From owner-svn-src-all@freebsd.org Sun Aug 4 01:18:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B788C091B; Sun, 4 Aug 2019 01:18:51 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461NMb0Nz3z3wYd; Sun, 4 Aug 2019 01:18:51 +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 CBD7B23A72; Sun, 4 Aug 2019 01:18:50 +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 x741Iowd041462; Sun, 4 Aug 2019 01:18:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x741Io7e041461; Sun, 4 Aug 2019 01:18:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908040118.x741Io7e041461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 4 Aug 2019 01:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350565 - in stable/12: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12: contrib/binutils/binutils/doc gnu/usr.bin/binutils/objdump X-SVN-Commit-Revision: 350565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 01:18:51 -0000 Author: emaste Date: Sun Aug 4 01:18:50 2019 New Revision: 350565 URL: https://svnweb.freebsd.org/changeset/base/350565 Log: objdump: update deprecation notice MFC r350503: objdump: move deprecation notice to indended spot r335217 added a deprecation notice to the source file for the objdump man page, and r335219 added it to the rendered objdump.1, but in the wrong spot. MFC r350505: objdump: be explicit that GNU objdump that will be removed We may install llvm-objdump as objdump (see review D18307) or just provide no /usr/bin/objdump, but either way GNU objdump won't be installed in the future. Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/binutils/binutils/doc/binutils.texi stable/12/gnu/usr.bin/binutils/objdump/objdump.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/binutils/binutils/doc/binutils.texi ============================================================================== --- stable/12/contrib/binutils/binutils/doc/binutils.texi Sat Aug 3 22:41:29 2019 (r350564) +++ stable/12/contrib/binutils/binutils/doc/binutils.texi Sun Aug 4 01:18:50 2019 (r350565) @@ -1624,8 +1624,8 @@ program to compile and work. specify archives, @command{objdump} shows information on each of the member object files. -@command{objdump} will be removed from a future version of the -FreeBSD base system. Users who require @command{objdump} are advised +GNU @command{objdump} will be removed from a future version of the +FreeBSD base system. Users who require GNU @command{objdump} are advised to install the binutils port or package. @c man end Modified: stable/12/gnu/usr.bin/binutils/objdump/objdump.1 ============================================================================== --- stable/12/gnu/usr.bin/binutils/objdump/objdump.1 Sat Aug 3 22:41:29 2019 (r350564) +++ stable/12/gnu/usr.bin/binutils/objdump/objdump.1 Sun Aug 4 01:18:50 2019 (r350565) @@ -179,13 +179,13 @@ information is mostly useful to programmers who are wo compilation tools, as opposed to programmers who just want their program to compile and work. .PP -\&\fBobjdump\fR will be removed from a future version of the -FreeBSD base system. Users who require \&\fBobjdump\fR are advised -to install the binutils port or package. -.PP \&\fIobjfile\fR... are the object files to be examined. When you specify archives, \fBobjdump\fR shows information on each of the member object files. +.PP +GNU \&\fBobjdump\fR will be removed from a future version of the +FreeBSD base system. Users who require GNU \&\fBobjdump\fR are advised +to install the binutils port or package. .SH "OPTIONS" .IX Header "OPTIONS" The long and short forms of options, shown here as alternatives, are From owner-svn-src-all@freebsd.org Sun Aug 4 04:51:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA616C4D7F; Sun, 4 Aug 2019 04:51:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461T505Qx7z46Wh; Sun, 4 Aug 2019 04:51:32 +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 9DB37261BE; Sun, 4 Aug 2019 04:51:32 +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 x744pWV2070494; Sun, 4 Aug 2019 04:51:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x744pWTN070493; Sun, 4 Aug 2019 04:51:32 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908040451.x744pWTN070493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 4 Aug 2019 04:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350566 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 350566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 04:51:32 -0000 Author: delphij Date: Sun Aug 4 04:51:32 2019 New Revision: 350566 URL: https://svnweb.freebsd.org/changeset/base/350566 Log: There is no need to explicitly add zlib, we already have it in sys/conf/files. Modified: head/share/man/man4/mxge.4 Modified: head/share/man/man4/mxge.4 ============================================================================== --- head/share/man/man4/mxge.4 Sun Aug 4 01:18:50 2019 (r350565) +++ head/share/man/man4/mxge.4 Sun Aug 4 04:51:32 2019 (r350566) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 2, 2019 +.Dd February 13, 2008 .Dt MXGE 4 .Os .Sh NAME @@ -43,7 +43,6 @@ place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device firmware" -.Cd "device zlib" .Cd "device mxge" .Ed .Pp From owner-svn-src-all@freebsd.org Sun Aug 4 12:47:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46D1FA9308; Sun, 4 Aug 2019 12:47:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461gfM195jz4Tv2; Sun, 4 Aug 2019 12:47:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A7E43964; Sun, 4 Aug 2019 12:47:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x74Clc6s057287; Sun, 4 Aug 2019 12:47:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74ClcGO057283; Sun, 4 Aug 2019 12:47:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908041247.x74ClcGO057283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 4 Aug 2019 12:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350568 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 12:47:39 -0000 Author: cy Date: Sun Aug 4 12:47:38 2019 New Revision: 350568 URL: https://svnweb.freebsd.org/changeset/base/350568 Log: Resolve ipfilter kld unload issues related to VNET jails. When the ipfilter kld is loaded, used within VNET jail, and unloaded, then subsequent loading, use, and unloading of another packet filters will cause the subsequently loaded netpfil kld's to panic. The scenario is as follows: cd /usr/tests/sys/netpfil/common kldunload ipl kldunload pfsync kldunload ipfw kyua test pass_block kldload ipl kyua test pass_block kldunload ipl kldload pfsync kyua test pass_block kldunload pfsync -- page fault panic occurs here -- Reported by: "Ahsan Barkati" via kp@ Discussed with: kp@ Tested by: kp@ MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Aug 4 12:47:35 2019 (r350567) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Aug 4 12:47:38 2019 (r350568) @@ -100,7 +100,10 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { # include # include -static eventhandler_tag ipf_arrivetag, ipf_departtag; +VNET_DEFINE_STATIC(eventhandler_tag, ipf_arrivetag); +VNET_DEFINE_STATIC(eventhandler_tag, ipf_departtag); +#define V_ipf_arrivetag VNET(ipf_arrivetag) +#define V_ipf_departtag VNET(ipf_departtag) #if 0 /* * Disable the "cloner" event handler; we are getting interface @@ -110,7 +113,8 @@ static eventhandler_tag ipf_arrivetag, ipf_departtag; * If it turns out to be needed, well need a dedicated event handler * for it to deal with the ifc and the correct vnet. */ -static eventhandler_tag ipf_clonetag; +VNET_DEFINE_STATIC(eventhandler_tag, ipf_clonetag); +#define V_ipf_clonetag VNET(ipf_clonetag) #endif static void ipf_ifevent(void *arg, struct ifnet *ifp); @@ -1383,14 +1387,14 @@ int ipf_pfil_hook(void) { void ipf_event_reg(void) { - ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ + V_ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); - ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ + V_ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); #if 0 - ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ + V_ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ NULL, EVENTHANDLER_PRI_ANY); #endif } @@ -1398,15 +1402,15 @@ ipf_event_reg(void) void ipf_event_dereg(void) { - if (ipf_arrivetag != NULL) { - EVENTHANDLER_DEREGISTER(ifnet_arrival_event, ipf_arrivetag); + if (V_ipf_arrivetag != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, V_ipf_arrivetag); } - if (ipf_departtag != NULL) { - EVENTHANDLER_DEREGISTER(ifnet_departure_event, ipf_departtag); + if (V_ipf_departtag != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, V_ipf_departtag); } #if 0 - if (ipf_clonetag != NULL) { - EVENTHANDLER_DEREGISTER(if_clone_event, ipf_clonetag); + if (V_ipf_clonetag != NULL) { + EVENTHANDLER_DEREGISTER(if_clone_event, V_ipf_clonetag); } #endif } Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sun Aug 4 12:47:35 2019 (r350567) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sun Aug 4 12:47:38 2019 (r350568) @@ -283,6 +283,10 @@ vnet_ipf_uninit(void) V_ipfmain.ipf_running = -2; ipf_destroy_all(&V_ipfmain); + if (!IS_DEFAULT_VNET(curvnet)) { + ipf_event_dereg(); + (void)ipf_pfil_unhook(); + } } } VNET_SYSUNINIT(vnet_ipf_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, From owner-svn-src-all@freebsd.org Sun Aug 4 12:47:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8339A92F5; Sun, 4 Aug 2019 12:47:35 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461gfH5s0Nz4Ttr; Sun, 4 Aug 2019 12:47:35 +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 A70623963; Sun, 4 Aug 2019 12:47:35 +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 x74ClZnJ057238; Sun, 4 Aug 2019 12:47:35 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74ClZIa057237; Sun, 4 Aug 2019 12:47:35 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908041247.x74ClZIa057237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 4 Aug 2019 12:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350567 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 12:47:36 -0000 Author: cy Date: Sun Aug 4 12:47:35 2019 New Revision: 350567 URL: https://svnweb.freebsd.org/changeset/base/350567 Log: Returning an uninitialized error is a bad thing. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sun Aug 4 04:51:32 2019 (r350566) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sun Aug 4 12:47:35 2019 (r350567) @@ -310,7 +310,7 @@ ipf_modunload() printf("%s unloaded\n", ipfilter_version); - return error; + return (0); } From owner-svn-src-all@freebsd.org Sun Aug 4 19:25:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0704BAFEAD; Sun, 4 Aug 2019 19:25:24 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461rTH62F1z3JZ6; Sun, 4 Aug 2019 19:25:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD5A78254; Sun, 4 Aug 2019 19:25:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x74JPN5r096057; Sun, 4 Aug 2019 19:25:23 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74JPNYU096056; Sun, 4 Aug 2019 19:25:23 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908041925.x74JPNYU096056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Aug 2019 19:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350569 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 350569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 19:25:24 -0000 Author: jhibbits Date: Sun Aug 4 19:25:23 2019 New Revision: 350569 URL: https://svnweb.freebsd.org/changeset/base/350569 Log: powerpc: Enable the BUS_DMA_NOCACHE flag handling The flag handling was committed commented out 7 years ago. It works, and is needed for LinuxKPI-based DRM drivers. Also mark a local as potentially unusable, as it's only really used when KTR is enabled. Submitted by: mmacy Modified: head/sys/powerpc/powerpc/busdma_machdep.c Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Sun Aug 4 12:47:38 2019 (r350568) +++ head/sys/powerpc/powerpc/busdma_machdep.c Sun Aug 4 19:25:23 2019 (r350569) @@ -350,7 +350,7 @@ bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain) int bus_dma_tag_destroy(bus_dma_tag_t dmat) { - bus_dma_tag_t dmat_copy; + bus_dma_tag_t dmat_copy __unused; int error; error = 0; @@ -515,11 +515,9 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int if (flags & BUS_DMA_ZERO) mflags |= M_ZERO; -#ifdef NOTYET if (flags & BUS_DMA_NOCACHE) attr = VM_MEMATTR_UNCACHEABLE; else -#endif attr = VM_MEMATTR_DEFAULT; /* From owner-svn-src-all@freebsd.org Sun Aug 4 19:28:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08E66B0008; Sun, 4 Aug 2019 19:28:13 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461rXY07jjz3JnV; Sun, 4 Aug 2019 19:28:13 +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 D73298264; Sun, 4 Aug 2019 19:28:12 +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 x74JSCrY096264; Sun, 4 Aug 2019 19:28:12 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74JSBab096255; Sun, 4 Aug 2019 19:28:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908041928.x74JSBab096255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Aug 2019 19:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350570 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src dev/ofw dev/pci kern sys X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src dev/ofw dev/pci kern sys X-SVN-Commit-Revision: 350570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 19:28:13 -0000 Author: jhibbits Date: Sun Aug 4 19:28:10 2019 New Revision: 350570 URL: https://svnweb.freebsd.org/changeset/base/350570 Log: Add necessary bits for Linux KPI to work correctly on powerpc PowerPC, and possibly other architectures, use different address ranges for PCI space vs physical address space, which is only mapped at resource activation time, when the BAR gets written. The DRM kernel modules do not activate the rman resources, soas not to waste KVA, instead only mapping parts of the PCI memory at a time. This introduces a BUS_TRANSLATE_RESOURCE() method, implemented in the Open Firmware/FDT PCI driver, to perform this necessary translation without activating the resource. In addition to system KPI changes, LinuxKPI is updated to handle a big-endian host, by adding proper endian swaps to the I/O functions. Submitted by: mmacy Reported by: hselasky Differential Revision: https://reviews.freebsd.org/D21096 Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h head/sys/compat/linuxkpi/common/include/linux/io.h head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c head/sys/dev/ofw/ofwpci.c head/sys/dev/pci/vga_pci.c head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Aug 4 19:28:10 2019 (r350570) @@ -56,6 +56,7 @@ #define __GFP_IO 0 #define __GFP_NO_KSWAPD 0 +#define __GFP_KSWAPD_RECLAIM 0 #define __GFP_WAIT M_WAITOK #define __GFP_DMA32 (1U << 24) /* LinuxKPI only */ #define __GFP_BITS_SHIFT 25 Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Sun Aug 4 19:28:10 2019 (r350570) @@ -42,6 +42,32 @@ * XXX This is all x86 specific. It should be bus space access. */ + +/* rmb and wmb are declared in machine/atomic.h, so should be included first. */ +#ifndef __io_br +#define __io_br() __compiler_membar() +#endif + +#ifndef __io_ar +#ifdef rmb +#define __io_ar() rmb() +#else +#define __io_ar() __compiler_membar() +#endif +#endif + +#ifndef __io_bw +#ifdef wmb +#define __io_bw() wmb() +#else +#define __io_bw() __compiler_membar() +#endif +#endif + +#ifndef __io_aw +#define __io_aw() __compiler_membar() +#endif + /* Access MMIO registers atomically without barriers and byte swapping. */ static inline uint8_t @@ -112,9 +138,9 @@ readb(const volatile void *addr) { uint8_t v; - __compiler_membar(); + __io_br(); v = *(const volatile uint8_t *)addr; - __compiler_membar(); + __io_ar(); return (v); } #define readb(addr) readb(addr) @@ -123,9 +149,9 @@ readb(const volatile void *addr) static inline void writeb(uint8_t v, volatile void *addr) { - __compiler_membar(); + __io_bw(); *(volatile uint8_t *)addr = v; - __compiler_membar(); + __io_aw(); } #define writeb(v, addr) writeb(v, addr) @@ -135,9 +161,9 @@ readw(const volatile void *addr) { uint16_t v; - __compiler_membar(); - v = *(const volatile uint16_t *)addr; - __compiler_membar(); + __io_br(); + v = le16toh(__raw_readw(addr)); + __io_ar(); return (v); } #define readw(addr) readw(addr) @@ -146,9 +172,9 @@ readw(const volatile void *addr) static inline void writew(uint16_t v, volatile void *addr) { - __compiler_membar(); - *(volatile uint16_t *)addr = v; - __compiler_membar(); + __io_bw(); + __raw_writew(htole16(v), addr); + __io_aw(); } #define writew(v, addr) writew(v, addr) @@ -158,9 +184,9 @@ readl(const volatile void *addr) { uint32_t v; - __compiler_membar(); - v = *(const volatile uint32_t *)addr; - __compiler_membar(); + __io_br(); + v = le32toh(__raw_readl(addr)); + __io_ar(); return (v); } #define readl(addr) readl(addr) @@ -169,9 +195,9 @@ readl(const volatile void *addr) static inline void writel(uint32_t v, volatile void *addr) { - __compiler_membar(); - *(volatile uint32_t *)addr = v; - __compiler_membar(); + __io_bw(); + __raw_writel(htole32(v), addr); + __io_aw(); } #define writel(v, addr) writel(v, addr) @@ -183,9 +209,9 @@ readq(const volatile void *addr) { uint64_t v; - __compiler_membar(); - v = *(const volatile uint64_t *)addr; - __compiler_membar(); + __io_br(); + v = le64toh(__raw_readq(addr)); + __io_ar(); return (v); } #define readq(addr) readq(addr) @@ -193,9 +219,9 @@ readq(const volatile void *addr) static inline void writeq(uint64_t v, volatile void *addr) { - __compiler_membar(); - *(volatile uint64_t *)addr = v; - __compiler_membar(); + __io_bw(); + __raw_writeq(htole64(v), addr); + __io_aw(); } #define writeq(v, addr) writeq(v, addr) #endif @@ -206,7 +232,7 @@ writeq(uint64_t v, volatile void *addr) static inline uint8_t readb_relaxed(const volatile void *addr) { - return (*(const volatile uint8_t *)addr); + return (__raw_readb(addr)); } #define readb_relaxed(addr) readb_relaxed(addr) @@ -214,7 +240,7 @@ readb_relaxed(const volatile void *addr) static inline void writeb_relaxed(uint8_t v, volatile void *addr) { - *(volatile uint8_t *)addr = v; + __raw_writeb(v, addr); } #define writeb_relaxed(v, addr) writeb_relaxed(v, addr) @@ -222,7 +248,7 @@ writeb_relaxed(uint8_t v, volatile void *addr) static inline uint16_t readw_relaxed(const volatile void *addr) { - return (*(const volatile uint16_t *)addr); + return (le16toh(__raw_readw(addr))); } #define readw_relaxed(addr) readw_relaxed(addr) @@ -230,7 +256,7 @@ readw_relaxed(const volatile void *addr) static inline void writew_relaxed(uint16_t v, volatile void *addr) { - *(volatile uint16_t *)addr = v; + __raw_writew(htole16(v), addr); } #define writew_relaxed(v, addr) writew_relaxed(v, addr) @@ -238,7 +264,7 @@ writew_relaxed(uint16_t v, volatile void *addr) static inline uint32_t readl_relaxed(const volatile void *addr) { - return (*(const volatile uint32_t *)addr); + return (le32toh(__raw_readl(addr))); } #define readl_relaxed(addr) readl_relaxed(addr) @@ -246,7 +272,7 @@ readl_relaxed(const volatile void *addr) static inline void writel_relaxed(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = v; + __raw_writel(htole32(v), addr); } #define writel_relaxed(v, addr) writel_relaxed(v, addr) @@ -256,14 +282,14 @@ writel_relaxed(uint32_t v, volatile void *addr) static inline uint64_t readq_relaxed(const volatile void *addr) { - return (*(const volatile uint64_t *)addr); + return (le64toh(__raw_readq(addr))); } #define readq_relaxed(addr) readq_relaxed(addr) static inline void writeq_relaxed(uint64_t v, volatile void *addr) { - *(volatile uint64_t *)addr = v; + __raw_writeq(htole64(v), addr); } #define writeq_relaxed(v, addr) writeq_relaxed(v, addr) #endif @@ -290,7 +316,13 @@ ioread16(const volatile void *addr) static inline uint16_t ioread16be(const volatile void *addr) { - return (bswap16(readw(addr))); + uint16_t v; + + __io_br(); + v = (be16toh(__raw_readw(addr))); + __io_ar(); + + return (v); } #define ioread16be(addr) ioread16be(addr) @@ -306,7 +338,13 @@ ioread32(const volatile void *addr) static inline uint32_t ioread32be(const volatile void *addr) { - return (bswap32(readl(addr))); + uint32_t v; + + __io_br(); + v = (be32toh(__raw_readl(addr))); + __io_ar(); + + return (v); } #define ioread32be(addr) ioread32be(addr) @@ -338,7 +376,9 @@ iowrite32(uint32_t v, volatile void *addr) static inline void iowrite32be(uint32_t v, volatile void *addr) { - writel(bswap32(v), addr); + __io_bw(); + __raw_writel(htobe32(v), addr); + __io_aw(); } #define iowrite32be(v, addr) iowrite32be(v, addr) Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Sun Aug 4 19:28:10 2019 (r350570) @@ -205,6 +205,7 @@ struct pci_driver { struct pci_bus { struct pci_dev *self; + int domain; int number; }; @@ -270,26 +271,6 @@ linux_pci_find_irq_dev(unsigned int irq) return (found); } -static inline unsigned long -pci_resource_start(struct pci_dev *pdev, int bar) -{ - struct resource_list_entry *rle; - - if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) - return (0); - return rle->start; -} - -static inline unsigned long -pci_resource_len(struct pci_dev *pdev, int bar) -{ - struct resource_list_entry *rle; - - if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) - return (0); - return rle->count; -} - static inline int pci_resource_type(struct pci_dev *pdev, int bar) { @@ -447,6 +428,9 @@ pci_disable_msix(struct pci_dev *pdev) pdev->dev.msix_max = 0; } +unsigned long pci_resource_start(struct pci_dev *pdev, int bar); +unsigned long pci_resource_len(struct pci_dev *pdev, int bar); + static inline bus_addr_t pci_bus_address(struct pci_dev *pdev, int bar) { @@ -633,7 +617,7 @@ static inline void pci_disable_sriov(struct pci_dev *d /* XXX This should not be necessary. */ #define pcix_set_mmrbc(d, v) 0 #define pcix_get_max_mmrbc(d) 0 -#define pcie_set_readrq(d, v) 0 +#define pcie_set_readrq(d, v) pci_set_max_read_req(&(d)->dev, (v)) #define PCI_DMA_BIDIRECTIONAL 0 #define PCI_DMA_TODEVICE 1 Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Sun Aug 4 19:28:10 2019 (r350570) @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -209,7 +209,6 @@ linux_pci_attach(device_t dev) struct pci_driver *pdrv; const struct pci_device_id *id; device_t parent; - devclass_t devclass; int error; linux_set_current(curthread); @@ -218,7 +217,6 @@ linux_pci_attach(device_t dev) pdev = device_get_softc(dev); parent = device_get_parent(dev); - devclass = device_get_devclass(parent); if (pdrv->isdrm) { dinfo = device_get_ivars(parent); device_set_ivars(dev, dinfo); @@ -254,6 +252,7 @@ linux_pci_attach(device_t dev) pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK | M_ZERO); pbus->self = pdev; pbus->number = pci_get_bus(dev); + pbus->domain = pci_get_domain(dev); pdev->bus = pbus; spin_lock(&pci_lock); @@ -386,6 +385,36 @@ linux_pci_register_driver(struct pci_driver *pdrv) return (-ENXIO); pdrv->isdrm = false; return (_linux_pci_register_driver(pdrv, dc)); +} + +unsigned long +pci_resource_start(struct pci_dev *pdev, int bar) +{ + struct resource_list_entry *rle; + unsigned long newstart; + device_t dev; + + if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) + return (0); + dev = pci_find_dbsf(pdev->bus->domain, pdev->bus->number, + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); + MPASS(dev != NULL); + if (BUS_TRANSLATE_RESOURCE(dev, rle->type, rle->start, &newstart)) { + device_printf(pdev->dev.bsddev, "translate of %#lx failed\n", + rle->start); + return (0); + } + return (newstart); +} + +unsigned long +pci_resource_len(struct pci_dev *pdev, int bar) +{ + struct resource_list_entry *rle; + + if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) + return (0); + return (rle->count); } int Modified: head/sys/dev/ofw/ofwpci.c ============================================================================== --- head/sys/dev/ofw/ofwpci.c Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/dev/ofw/ofwpci.c Sun Aug 4 19:28:10 2019 (r350570) @@ -76,6 +76,8 @@ static int ofw_pci_deactivate_resource(device_t, devic struct resource *); static int ofw_pci_adjust_resource(device_t, device_t, int, struct resource *, rman_res_t, rman_res_t); +static int ofw_pci_translate_resource(device_t bus, int type, + rman_res_t start, rman_res_t *newstart); #ifdef __powerpc__ static bus_space_tag_t ofw_pci_bus_get_bus_tag(device_t, device_t); @@ -116,6 +118,7 @@ static device_method_t ofw_pci_methods[] = { DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), + DEVMETHOD(bus_translate_resource, ofw_pci_translate_resource), #ifdef __powerpc__ DEVMETHOD(bus_get_bus_tag, ofw_pci_bus_get_bus_tag), #endif @@ -476,6 +479,45 @@ ofw_pci_release_resource(device_t bus, device_t child, return (error); } return (rman_release_resource(res)); +} + +static int +ofw_pci_translate_resource(device_t bus, int type, rman_res_t start, + rman_res_t *newstart) +{ + struct ofw_pci_softc *sc; + struct ofw_pci_range *rp; + int space; + + sc = device_get_softc(bus); + + /* + * Map this through the ranges list + */ + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { + if (start < rp->pci || start >= rp->pci + rp->size) + continue; + + switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { + case OFW_PCI_PHYS_HI_SPACE_IO: + space = SYS_RES_IOPORT; + break; + case OFW_PCI_PHYS_HI_SPACE_MEM32: + case OFW_PCI_PHYS_HI_SPACE_MEM64: + space = SYS_RES_MEMORY; + break; + default: + space = -1; + } + + if (type == space) { + start += (rp->host - rp->pci); + break; + } + } + *newstart = start; + return (0); } static int Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/dev/pci/vga_pci.c Sun Aug 4 19:28:10 2019 (r350570) @@ -142,11 +142,35 @@ vga_pci_is_boot_display(device_t dev) return (1); } +static void +vga_pci_reset(device_t dev) +{ + int ps; + /* + * FLR is unsupported on GPUs so attempt a power-management reset by cycling + * the device in/out of D3 state. + * PCI spec says we can only go into D3 state from D0 state. + * Transition from D[12] into D0 before going to D3 state. + */ + ps = pci_get_powerstate(dev); + if (ps != PCI_POWERSTATE_D0 && ps != PCI_POWERSTATE_D3) + pci_set_powerstate(dev, PCI_POWERSTATE_D0); + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D3) + pci_set_powerstate(dev, PCI_POWERSTATE_D3); + pci_set_powerstate(dev, ps); +} + + void * vga_pci_map_bios(device_t dev, size_t *size) { - int rid; + struct vga_resource *vr; struct resource *res; + device_t pcib; + uint32_t rom_addr; + uint16_t config; + volatile char *bios; + int i, rid, found; #if defined(__amd64__) || defined(__i386__) if (vga_pci_is_boot_display(dev)) { @@ -164,21 +188,96 @@ vga_pci_map_bios(device_t dev, size_t *size) } #endif - rid = PCIR_BIOS; + pcib = device_get_parent(device_get_parent(dev)); + if (device_get_devclass(device_get_parent(pcib)) == + devclass_find("pci")) { + /* + * The parent bridge is a PCI-to-PCI bridge: check the + * value of the "VGA Enable" bit. + */ + config = pci_read_config(pcib, PCIR_BRIDGECTL_1, 2); + if ((config & PCIB_BCR_VGA_ENABLE) == 0) { + config |= PCIB_BCR_VGA_ENABLE; + pci_write_config(pcib, PCIR_BRIDGECTL_1, config, 2); + } + } + + switch(pci_read_config(dev, PCIR_HDRTYPE, 1)) { + case PCIM_HDRTYPE_BRIDGE: + rid = PCIR_BIOS_1; + break; + case PCIM_HDRTYPE_CARDBUS: + rid = 0; + break; + default: + rid = PCIR_BIOS; + break; + } + if (rid == 0) + return (NULL); res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0, ~0, 1, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "vga_pci_alloc_resource failed\n"); return (NULL); } + bios = rman_get_virtual(res); + *size = rman_get_size(res); + for (found = i = 0; i < hz; i++) { + found = (bios[0] == 0x55 && bios[1] == 0xaa); + if (found) + break; + pause("vgabios", 1); + } + if (found) + return (__DEVOLATILE(void *, bios)); + if (bootverbose) + device_printf(dev, "initial ROM mapping failed -- resetting\n"); + /* + * Enable ROM decode + */ + vga_pci_reset(dev); + rom_addr = pci_read_config(dev, rid, 4); + rom_addr &= 0x7ff; + rom_addr |= rman_get_start(res) | 0x1; + pci_write_config(dev, rid, rom_addr, 4); + vr = lookup_res(device_get_softc(dev), rid); + vga_pci_release_resource(dev, NULL, SYS_RES_MEMORY, rid, + vr->vr_res); + + /* + * re-allocate + */ + res = vga_pci_alloc_resource(dev, NULL, SYS_RES_MEMORY, &rid, 0, + ~0, 1, RF_ACTIVE); + if (res == NULL) { + device_printf(dev, "vga_pci_alloc_resource failed\n"); + return (NULL); + } + bios = rman_get_virtual(res); *size = rman_get_size(res); - return (rman_get_virtual(res)); + for (found = i = 0; i < 3*hz; i++) { + found = (bios[0] == 0x55 && bios[1] == 0xaa); + if (found) + break; + pause("vgabios", 1); + } + if (found) + return (__DEVOLATILE(void *, bios)); + device_printf(dev, "ROM mapping failed\n"); + vr = lookup_res(device_get_softc(dev), rid); + vga_pci_release_resource(dev, NULL, SYS_RES_MEMORY, rid, + vr->vr_res); + return (NULL); } void vga_pci_unmap_bios(device_t dev, void *bios) { struct vga_resource *vr; + int rid; if (bios == NULL) { return; @@ -192,16 +291,28 @@ vga_pci_unmap_bios(device_t dev, void *bios) return; } #endif - + switch(pci_read_config(dev, PCIR_HDRTYPE, 1)) { + case PCIM_HDRTYPE_BRIDGE: + rid = PCIR_BIOS_1; + break; + case PCIM_HDRTYPE_CARDBUS: + rid = 0; + break; + default: + rid = PCIR_BIOS; + break; + } + if (rid == 0) + return; /* * Look up the PCIR_BIOS resource in our softc. It should match * the address we returned previously. */ - vr = lookup_res(device_get_softc(dev), PCIR_BIOS); + vr = lookup_res(device_get_softc(dev), rid); KASSERT(vr->vr_res != NULL, ("vga_pci_unmap_bios: bios not mapped")); KASSERT(rman_get_virtual(vr->vr_res) == bios, ("vga_pci_unmap_bios: mismatch")); - vga_pci_release_resource(dev, NULL, SYS_RES_MEMORY, PCIR_BIOS, + vga_pci_release_resource(dev, NULL, SYS_RES_MEMORY, rid, vr->vr_res); } Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/kern/bus_if.m Sun Aug 4 19:28:10 2019 (r350570) @@ -76,6 +76,18 @@ CODE { { return (0); } + + static int + null_translate_resource(device_t bus, int type, rman_res_t start, + rman_res_t *newstart) + { + if (device_get_parent(bus) != NULL) + return (BUS_TRANSLATE_RESOURCE(device_get_parent(bus), + type, start, newstart)); + + *newstart = start; + return (0); + } }; /** @@ -405,6 +417,23 @@ METHOD int adjust_resource { rman_res_t _start; rman_res_t _end; }; + + +/** + * @brief translate a resource value + * + * + * @param _dev the device associated with the resource + * @param _type the type of resource + * @param _start the starting address of the resource range + * @param _newstart the new starting address of the resource range + */ +METHOD int translate_resource { + device_t _dev; + int _type; + rman_res_t _start; + rman_res_t *_newstart; +} DEFAULT null_translate_resource; /** * @brief Release a resource Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/kern/subr_bus.c Sun Aug 4 19:28:10 2019 (r350570) @@ -3971,7 +3971,6 @@ bus_helper_reset_prepare(device_t dev, int flags) return (0); } - /** * @brief Helper function for implementing BUS_PRINT_CHILD(). * Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sun Aug 4 19:25:23 2019 (r350569) +++ head/sys/sys/bus.h Sun Aug 4 19:28:10 2019 (r350570) @@ -434,6 +434,8 @@ struct resource * bus_generic_alloc_resource(device_t bus, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); +int bus_generic_translate_resource(device_t dev, int type, rman_res_t start, + rman_res_t *newstart); int bus_generic_attach(device_t dev); int bus_generic_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu); From owner-svn-src-all@freebsd.org Sun Aug 4 19:47:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66C63B055B; Sun, 4 Aug 2019 19:47:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461ryH21PCz3KZ9; Sun, 4 Aug 2019 19:47:03 +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 2282485F3; Sun, 4 Aug 2019 19:47:03 +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 x74Jl2V8008692; Sun, 4 Aug 2019 19:47:02 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74Jl20R008691; Sun, 4 Aug 2019 19:47:02 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908041947.x74Jl20R008691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Aug 2019 19:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350571 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 350571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 19:47:03 -0000 Author: jhibbits Date: Sun Aug 4 19:47:02 2019 New Revision: 350571 URL: https://svnweb.freebsd.org/changeset/base/350571 Log: Fix the build after r350570. Signed char cannot compare to values above 0x7f. Use unsigned instead. Modified: head/sys/dev/pci/vga_pci.c Modified: head/sys/dev/pci/vga_pci.c ============================================================================== --- head/sys/dev/pci/vga_pci.c Sun Aug 4 19:28:10 2019 (r350570) +++ head/sys/dev/pci/vga_pci.c Sun Aug 4 19:47:02 2019 (r350571) @@ -169,7 +169,7 @@ vga_pci_map_bios(device_t dev, size_t *size) device_t pcib; uint32_t rom_addr; uint16_t config; - volatile char *bios; + volatile unsigned char *bios; int i, rid, found; #if defined(__amd64__) || defined(__i386__) From owner-svn-src-all@freebsd.org Sun Aug 4 19:55:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 922DAB077D; Sun, 4 Aug 2019 19:55:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461s8J3Lj3z3L0K; Sun, 4 Aug 2019 19:55:44 +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 54C6687D3; Sun, 4 Aug 2019 19:55:44 +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 x74Jtirq014409; Sun, 4 Aug 2019 19:55:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74Jti2j014408; Sun, 4 Aug 2019 19:55:44 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908041955.x74Jti2j014408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Aug 2019 19:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350572 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 350572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 19:55:44 -0000 Author: jhibbits Date: Sun Aug 4 19:55:43 2019 New Revision: 350572 URL: https://svnweb.freebsd.org/changeset/base/350572 Log: Fix 32-bit build post-r350570 The error message prints a rman_res_t, which is an uintmax_t. Explicitly cast, just for future-proofing, and use the correct format. Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Sun Aug 4 19:47:02 2019 (r350571) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Sun Aug 4 19:55:43 2019 (r350572) @@ -400,8 +400,8 @@ pci_resource_start(struct pci_dev *pdev, int bar) PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); MPASS(dev != NULL); if (BUS_TRANSLATE_RESOURCE(dev, rle->type, rle->start, &newstart)) { - device_printf(pdev->dev.bsddev, "translate of %#lx failed\n", - rle->start); + device_printf(pdev->dev.bsddev, "translate of %#jx failed\n", + (uintmax_t)rle->start); return (0); } return (newstart); From owner-svn-src-all@freebsd.org Sun Aug 4 20:00:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EF78B084C; Sun, 4 Aug 2019 20:00:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461sG03lckz3L8p; Sun, 4 Aug 2019 20:00:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 629D587E1; Sun, 4 Aug 2019 20:00:40 +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 x74K0erG014744; Sun, 4 Aug 2019 20:00:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74K0efw014743; Sun, 4 Aug 2019 20:00:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908042000.x74K0efw014743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Aug 2019 20:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350573 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 350573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 20:00:40 -0000 Author: jhibbits Date: Sun Aug 4 20:00:39 2019 New Revision: 350573 URL: https://svnweb.freebsd.org/changeset/base/350573 Log: Fix 32-bit build again, post r350570. Missed this part with my testing as well. Pass the right type to BUS_TRANSLATE_RESOURCE(). Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Sun Aug 4 19:55:43 2019 (r350572) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Sun Aug 4 20:00:39 2019 (r350573) @@ -391,7 +391,7 @@ unsigned long pci_resource_start(struct pci_dev *pdev, int bar) { struct resource_list_entry *rle; - unsigned long newstart; + rman_res_t newstart; device_t dev; if ((rle = linux_pci_get_bar(pdev, bar)) == NULL) From owner-svn-src-all@freebsd.org Sun Aug 4 20:40:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8796DB1339; Sun, 4 Aug 2019 20:40:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461t8J35mnz3MYq; Sun, 4 Aug 2019 20:40:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C1428F0C; Sun, 4 Aug 2019 20:40:48 +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 x74KemMw038239; Sun, 4 Aug 2019 20:40:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74Kelnw038060; Sun, 4 Aug 2019 20:40:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908042040.x74Kelnw038060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 4 Aug 2019 20:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350574 - in stable/12: contrib/binutils/gas/doc gnu/usr.bin/binutils/as X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12: contrib/binutils/gas/doc gnu/usr.bin/binutils/as X-SVN-Commit-Revision: 350574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 20:40:48 -0000 Author: emaste Date: Sun Aug 4 20:40:47 2019 New Revision: 350574 URL: https://svnweb.freebsd.org/changeset/base/350574 Log: MFC r350518: as: add deprecation notice to the man page In the future FreeBSD will ship without GNU binutils 2.17.50. Add a note advising users who require GNU as to install the binutils port or package. Note that on armv7, arm64, amd64, i386 we currently ship only two binutils tools (as and objdump). A deprecation notice was added to objdump's man page some time ago. PR: 233611 Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/binutils/gas/doc/as.texinfo stable/12/gnu/usr.bin/binutils/as/as.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/binutils/gas/doc/as.texinfo ============================================================================== --- stable/12/contrib/binutils/gas/doc/as.texinfo Sun Aug 4 20:00:39 2019 (r350573) +++ stable/12/contrib/binutils/gas/doc/as.texinfo Sun Aug 4 20:40:47 2019 (r350574) @@ -1295,6 +1295,9 @@ computer-readable series of instructions. Different v @section The GNU Assembler @c man begin DESCRIPTION +@sc{gnu} @command{as} will be removed from a future version of the +FreeBSD base system. Users who require +@sc{gnu} @command{as} are advised to install the binutils port or package. @sc{gnu} @command{as} is really a family of assemblers. @ifclear GENERIC Modified: stable/12/gnu/usr.bin/binutils/as/as.1 ============================================================================== --- stable/12/gnu/usr.bin/binutils/as/as.1 Sun Aug 4 20:00:39 2019 (r350573) +++ stable/12/gnu/usr.bin/binutils/as/as.1 Sun Aug 4 20:40:47 2019 (r350574) @@ -293,6 +293,10 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-\-alte [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" +\&\s-1GNU\s0 \fBas\fR will be removed from a future version of the +FreeBSD base system. Users who require +\&\s-1GNU\s0 \fBas\fR are advised to install the binutils port or package. +.PP \&\s-1GNU\s0 \fBas\fR is really a family of assemblers. If you use (or have used) the \s-1GNU\s0 assembler on one architecture, you should find a fairly similar environment when you use it on another From owner-svn-src-all@freebsd.org Sun Aug 4 21:43:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB535B3308; Sun, 4 Aug 2019 21:43:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461vXl4zCsz3RJ3; Sun, 4 Aug 2019 21:43:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C62D9C84; Sun, 4 Aug 2019 21:43:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x74LhZm9080306; Sun, 4 Aug 2019 21:43:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x74LhZvJ080304; Sun, 4 Aug 2019 21:43:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908042143.x74LhZvJ080304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 4 Aug 2019 21:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350575 - in head/libexec/rtld-elf: amd64 i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/libexec/rtld-elf: amd64 i386 X-SVN-Commit-Revision: 350575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2019 21:43:35 -0000 Author: kib Date: Sun Aug 4 21:43:34 2019 New Revision: 350575 URL: https://svnweb.freebsd.org/changeset/base/350575 Log: rtld-elf: Remove x86 elf_rtld.x linker scripts. First, amd64 version of the script cannot work at least due to the wrong architecture specification. Second, kernel can activate shared objects for long time, due to PIE support. It seems the intent was to allow ld-elf.so.1 to be build and used as an executable. Since we have direct exec mode implemented for dso ld-elf.so.1, the non-functional and commented out scripts can be finally removed. Sponsored by: The FreeBSD Foundation MFC after: 1 week Deleted: head/libexec/rtld-elf/amd64/elf_rtld.x head/libexec/rtld-elf/i386/elf_rtld.x Modified: head/libexec/rtld-elf/amd64/Makefile.inc head/libexec/rtld-elf/i386/Makefile.inc Modified: head/libexec/rtld-elf/amd64/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/amd64/Makefile.inc Sun Aug 4 20:40:47 2019 (r350574) +++ head/libexec/rtld-elf/amd64/Makefile.inc Sun Aug 4 21:43:34 2019 (r350575) @@ -1,6 +1,3 @@ # $FreeBSD$ CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -# Uncomment this to build the dynamic linker as an executable instead -# of a shared library: -#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x Modified: head/libexec/rtld-elf/i386/Makefile.inc ============================================================================== --- head/libexec/rtld-elf/i386/Makefile.inc Sun Aug 4 20:40:47 2019 (r350574) +++ head/libexec/rtld-elf/i386/Makefile.inc Sun Aug 4 21:43:34 2019 (r350575) @@ -1,6 +1,3 @@ # $FreeBSD$ CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -# Uncomment this to build the dynamic linker as an executable instead -# of a shared library: -#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x From owner-svn-src-all@freebsd.org Mon Aug 5 00:08:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8378B584D; Mon, 5 Aug 2019 00:08:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461ylt4TY2z42TZ; Mon, 5 Aug 2019 00:08:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 772A9B577; Mon, 5 Aug 2019 00:08:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7508Qc3063402; Mon, 5 Aug 2019 00:08:26 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7508Q0M063401; Mon, 5 Aug 2019 00:08:26 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201908050008.x7508Q0M063401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Aug 2019 00:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350576 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 350576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 00:08:26 -0000 Author: kevans Date: Mon Aug 5 00:08:25 2019 New Revision: 350576 URL: https://svnweb.freebsd.org/changeset/base/350576 Log: ipfw: fix jail option after r348215 r348215 changed jail_getid(3) to validate passed-in jids as active jails (as the function is documented to return -1 if the jail does not exist). This broke the jail option (in some cases?) as the jail historically hasn't needed to exist at the time of rule parsing; jids will get stored and later applied. Fix this caller to attempt to parse *av as a number first and just use it as-is to match historical behavior. jail_getid(3) must still be used in order for name arguments to work, but it's strictly a fallback in case we weren't given a number. Reported and tested by: Ari Suutari Reviewed by: ae MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D21128 Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Aug 4 21:43:34 2019 (r350575) +++ head/sbin/ipfw/ipfw2.c Mon Aug 5 00:08:25 2019 (r350576) @@ -4674,12 +4674,27 @@ read_options: case TOK_JAIL: NEED1("jail requires argument"); { + char *end; int jid; cmd->opcode = O_JAIL; - jid = jail_getid(*av); - if (jid < 0) - errx(EX_DATAERR, "%s", jail_errmsg); + /* + * If av is a number, then we'll just pass it as-is. If + * it's a name, try to resolve that to a jid. + * + * We save the jail_getid(3) call for a fallback because + * it entails an unconditional trip to the kernel to + * either validate a jid or resolve a name to a jid. + * This specific token doesn't currently require a + * jid to be an active jail, so we save a transition + * by simply using a number that we're given. + */ + jid = strtoul(*av, &end, 10); + if (*end != '\0') { + jid = jail_getid(*av); + if (jid < 0) + errx(EX_DATAERR, "%s", jail_errmsg); + } cmd32->d[0] = (uint32_t)jid; cmd->len |= F_INSN_SIZE(ipfw_insn_u32); av++; From owner-svn-src-all@freebsd.org Mon Aug 5 00:32:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 985D0B5E95; Mon, 5 Aug 2019 00:32:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461zJB3F17z43RH; Mon, 5 Aug 2019 00:32:58 +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 50B46BAA7; Mon, 5 Aug 2019 00:32:58 +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 x750WwJN080602; Mon, 5 Aug 2019 00:32:58 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x750WwOg080601; Mon, 5 Aug 2019 00:32:58 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908050032.x750WwOg080601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 5 Aug 2019 00:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350577 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 00:32:58 -0000 Author: cy Date: Mon Aug 5 00:32:57 2019 New Revision: 350577 URL: https://svnweb.freebsd.org/changeset/base/350577 Log: MFC r350548: #include whitespace adjustments. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Mon Aug 5 00:08:25 2019 (r350576) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Mon Aug 5 00:32:57 2019 (r350577) @@ -28,24 +28,24 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -# include -# include +#include +#include #include #include # include #if defined(__FreeBSD_version) #include #endif -# include -# include -# include +#include +#include +#include #include -# include -# include +#include +#include #include -# include -# include +#include +#include #include #include #include @@ -75,7 +75,7 @@ static const char rcsid[] = "@(#)$Id$"; #include "netinet/ip_scan.h" #endif #include "netinet/ip_pool.h" -# include +#include #include #ifdef CSUM_DATA_VALID #include From owner-svn-src-all@freebsd.org Mon Aug 5 00:32:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3568B5E9C; Mon, 5 Aug 2019 00:32:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461zJB5m35z43RJ; Mon, 5 Aug 2019 00:32:58 +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 A59D1BAA8; Mon, 5 Aug 2019 00:32:58 +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 x750Wwc2080608; Mon, 5 Aug 2019 00:32:58 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x750Ww8r080607; Mon, 5 Aug 2019 00:32:58 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908050032.x750Ww8r080607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 5 Aug 2019 00:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350577 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 00:32:59 -0000 Author: cy Date: Mon Aug 5 00:32:57 2019 New Revision: 350577 URL: https://svnweb.freebsd.org/changeset/base/350577 Log: MFC r350548: #include whitespace adjustments. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Mon Aug 5 00:08:25 2019 (r350576) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Mon Aug 5 00:32:57 2019 (r350577) @@ -28,24 +28,24 @@ static const char rcsid[] = "@(#)$Id$"; #include #include #include -# include -# include +#include +#include #include #include # include #if defined(__FreeBSD_version) #include #endif -# include -# include -# include +#include +#include +#include #include -# include -# include +#include +#include #include -# include -# include +#include +#include #include #include #include @@ -75,7 +75,7 @@ static const char rcsid[] = "@(#)$Id$"; #include "netinet/ip_scan.h" #endif #include "netinet/ip_pool.h" -# include +#include #include #ifdef CSUM_DATA_VALID #include From owner-svn-src-all@freebsd.org Mon Aug 5 01:37:19 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2313AB6EFB; Mon, 5 Aug 2019 01:37:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4620kQ6wzzz45T2; Mon, 5 Aug 2019 01:37:18 +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 B58B3C6E6; Mon, 5 Aug 2019 01:37:18 +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 x751bIuH016435; Mon, 5 Aug 2019 01:37:18 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x751bII0016433; Mon, 5 Aug 2019 01:37:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908050137.x751bII0016433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 5 Aug 2019 01:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350578 - in head/sys/powerpc: ofw powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: ofw powerpc X-SVN-Commit-Revision: 350578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 01:37:19 -0000 Author: jhibbits Date: Mon Aug 5 01:37:18 2019 New Revision: 350578 URL: https://svnweb.freebsd.org/changeset/base/350578 Log: powerpc: Get 32-bit AIM building with secure-PLT The last few changes needed before 32-bit AIM builds with secure-PLT with base GCC. Because ofwcall32.S and swtch32.S were branching to the GOT it could not use secure PLT. Modified: head/sys/powerpc/ofw/ofwcall32.S head/sys/powerpc/powerpc/swtch32.S Modified: head/sys/powerpc/ofw/ofwcall32.S ============================================================================== --- head/sys/powerpc/ofw/ofwcall32.S Mon Aug 5 00:32:57 2019 (r350577) +++ head/sys/powerpc/ofw/ofwcall32.S Mon Aug 5 01:37:18 2019 (r350578) @@ -67,8 +67,11 @@ ASENTRY(ofwcall) mfmsr %r6 /* GOT pointer in r7 */ - bl _GLOBAL_OFFSET_TABLE_@local-4 + bl 1f +1: mflr %r7 + addis %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@ha + addi %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@l /* read client interface handler */ lwz %r4,openfirmware_entry@got(%r7) @@ -129,8 +132,11 @@ ASENTRY(rtascall) stw %r0,4(%r1) /* GOT pointer in r7 */ - bl _GLOBAL_OFFSET_TABLE_@local-4 + bl 1f +1: mflr %r7 + addis %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@ha + addi %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@l /* Record the old MSR to real-mode-accessible area */ mfmsr %r0 @@ -152,8 +158,11 @@ ASENTRY(rtascall) bctrl /* GOT pointer in r7 */ - bl _GLOBAL_OFFSET_TABLE_@local-4 + bl 1f +1: mflr %r7 + addis %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@ha + addi %r7,%r7,(_GLOBAL_OFFSET_TABLE_-1b)@l /* Now set the MSR back */ lwz %r6,rtas_regsave@got(%r7) Modified: head/sys/powerpc/powerpc/swtch32.S ============================================================================== --- head/sys/powerpc/powerpc/swtch32.S Mon Aug 5 00:32:57 2019 (r350577) +++ head/sys/powerpc/powerpc/swtch32.S Mon Aug 5 01:37:18 2019 (r350578) @@ -124,8 +124,11 @@ ENTRY(cpu_switch) cpu_switchin: #if defined(SMP) && defined(SCHED_ULE) /* Wait for the new thread to become unblocked */ - bl _GLOBAL_OFFSET_TABLE_@local-4 + bl 1f +1: mflr %r6 + addis %r6,%r6,(_GLOBAL_OFFSET_TABLE_-1b)@ha + addi %r6,%r6,(_GLOBAL_OFFSET_TABLE_-1b)@l lwz %r6,blocked_lock@got(%r6) blocked_loop: lwz %r7,TD_LOCK(%r2) From owner-svn-src-all@freebsd.org Mon Aug 5 02:44:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68DF3B7F9F; Mon, 5 Aug 2019 02:44:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4622CT28Gqz47wJ; Mon, 5 Aug 2019 02:44:05 +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 2B66CD34D; Mon, 5 Aug 2019 02:44:05 +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 x752i5ak057132; Mon, 5 Aug 2019 02:44:05 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x752i5tG057131; Mon, 5 Aug 2019 02:44:05 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201908050244.x752i5tG057131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 5 Aug 2019 02:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350579 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 350579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 02:44:05 -0000 Author: alc Date: Mon Aug 5 02:44:04 2019 New Revision: 350579 URL: https://svnweb.freebsd.org/changeset/base/350579 Log: Enable superpage promotion within the kernel pmap. Reviewed by: markj X-MFC after: r350004 Differential Revision: https://reviews.freebsd.org/D21149 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Aug 5 01:37:18 2019 (r350578) +++ head/sys/arm64/arm64/pmap.c Mon Aug 5 02:44:04 2019 (r350579) @@ -3425,8 +3425,7 @@ validate: } #if VM_NRESERVLEVEL > 0 - if (pmap != pmap_kernel() && - (mpte == NULL || mpte->wire_count == NL3PG) && + if ((mpte == NULL || mpte->wire_count == NL3PG) && pmap_ps_enabled(pmap) && (m->flags & PG_FICTITIOUS) == 0 && vm_reserv_level_iffullpop(m) == 0) { From owner-svn-src-all@freebsd.org Mon Aug 5 06:01:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E7B6BA9B6; Mon, 5 Aug 2019 06:01:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4626bG1pQHz4Gb0; Mon, 5 Aug 2019 06:01:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20681F76C; Mon, 5 Aug 2019 06:01:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7561Upp071944; Mon, 5 Aug 2019 06:01:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7561T26071943; Mon, 5 Aug 2019 06:01:29 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908050601.x7561T26071943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 5 Aug 2019 06:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350581 - head X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 06:01:30 -0000 Author: delphij Date: Mon Aug 5 06:01:29 2019 New Revision: 350581 URL: https://svnweb.freebsd.org/changeset/base/350581 Log: Remove obsolete header file. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Aug 5 02:52:57 2019 (r350580) +++ head/ObsoleteFiles.inc Mon Aug 5 06:01:29 2019 (r350581) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20190729: gzip'ed a.out support removed +OLD_FILES+=usr/include/sys/inflate.h # 20190722: cap_random(3) removed OLD_FILES+=lib/casper/libcap_random.so.1 OLD_FILES+=usr/include/casper/cap_random.h From owner-svn-src-all@freebsd.org Mon Aug 5 07:49:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38C86BC97B; Mon, 5 Aug 2019 07:49:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4628zM6cmXz4LfN; Mon, 5 Aug 2019 07:49:03 +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 C048D1897A; Mon, 5 Aug 2019 07:49:03 +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 x757n319036668; Mon, 5 Aug 2019 07:49:03 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x757n2Wf036664; Mon, 5 Aug 2019 07:49:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201908050749.x757n2Wf036664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 5 Aug 2019 07:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350582 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 350582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 07:49:04 -0000 Author: ae Date: Mon Aug 5 07:49:02 2019 New Revision: 350582 URL: https://svnweb.freebsd.org/changeset/base/350582 Log: MFC r350417: Add ipfw_get_action() function to get the pointer to action opcode. ACTION_PTR() returns pointer to the start of rule action section, but rule can keep several rule modifiers like O_LOG, O_TAG and O_ALTQ, and only then real action opcode is stored. ipfw_get_action() function inspects the rule action section, skips all modifiers and returns action opcode. Use this function in ipfw_reset_eaction() and flush_nat_ptrs(). Modified: stable/12/sys/netpfil/ipfw/ip_fw_eaction.c stable/12/sys/netpfil/ipfw/ip_fw_nat.c stable/12/sys/netpfil/ipfw/ip_fw_private.h stable/12/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw_eaction.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_eaction.c Mon Aug 5 06:01:29 2019 (r350581) +++ stable/12/sys/netpfil/ipfw/ip_fw_eaction.c Mon Aug 5 07:49:02 2019 (r350582) @@ -377,33 +377,30 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_f uint16_t eaction_id, uint16_t default_id, uint16_t instance_id) { ipfw_insn *cmd, *icmd; - int l, cmdlen; + int l; IPFW_UH_WLOCK_ASSERT(ch); IPFW_WLOCK_ASSERT(ch); - cmd = ACTION_PTR(rule); - l = rule->cmd_len - rule->act_ofs; - while (l > 0) { - cmdlen = F_LEN(cmd); - l -= cmdlen; - if (cmd->opcode == O_EXTERNAL_ACTION || l <= 0) - break; - cmd += cmdlen; - } /* * Return if there is not O_EXTERNAL_ACTION or its id is * different. */ + cmd = ipfw_get_action(rule); if (cmd->opcode != O_EXTERNAL_ACTION || cmd->arg1 != eaction_id) return (0); /* * If instance_id is specified, we need to truncate the * rule length. Check if there is O_EXTERNAL_INSTANCE opcode. + * + * NOTE: F_LEN(cmd) must be 1 for O_EXTERNAL_ACTION opcode, + * and rule length should be enough to keep O_EXTERNAL_INSTANCE + * opcode, thus we do check for l > 1. */ - if (instance_id != 0 && l > 0) { - MPASS(cmdlen == 1); + l = rule->cmd + rule->cmd_len - cmd; + if (instance_id != 0 && l > 1) { + MPASS(F_LEN(cmd) == 1); icmd = cmd + 1; if (icmd->opcode != O_EXTERNAL_INSTANCE || icmd->arg1 != instance_id) @@ -415,8 +412,9 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_f * opcode. */ EACTION_DEBUG("truncate rule %d: len %u -> %u", - rule->rulenum, rule->cmd_len, rule->cmd_len - l); - rule->cmd_len -= l; + rule->rulenum, rule->cmd_len, + rule->cmd_len - F_LEN(icmd)); + rule->cmd_len -= F_LEN(icmd); MPASS(((uint32_t *)icmd - (uint32_t *)rule->cmd) == rule->cmd_len); } Modified: stable/12/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_nat.c Mon Aug 5 06:01:29 2019 (r350581) +++ stable/12/sys/netpfil/ipfw/ip_fw_nat.c Mon Aug 5 07:49:02 2019 (r350582) @@ -141,13 +141,12 @@ ifaddr_change(void *arg __unused, struct ifnet *ifp) static void flush_nat_ptrs(struct ip_fw_chain *chain, const int ix) { - int i; ipfw_insn_nat *cmd; + int i; IPFW_WLOCK_ASSERT(chain); for (i = 0; i < chain->n_rules; i++) { - cmd = (ipfw_insn_nat *)ACTION_PTR(chain->map[i]); - /* XXX skip log and the like ? */ + cmd = (ipfw_insn_nat *)ipfw_get_action(chain->map[i]); if (cmd->o.opcode == O_NAT && cmd->nat != NULL && (ix < 0 || cmd->nat->id == ix)) cmd->nat = NULL; Modified: stable/12/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_private.h Mon Aug 5 06:01:29 2019 (r350581) +++ stable/12/sys/netpfil/ipfw/ip_fw_private.h Mon Aug 5 07:49:02 2019 (r350582) @@ -676,6 +676,7 @@ struct ip_fw *ipfw_alloc_rule(struct ip_fw_chain *chai void ipfw_free_rule(struct ip_fw *rule); int ipfw_match_range(struct ip_fw *rule, ipfw_range_tlv *rt); int ipfw_mark_object_kidx(uint32_t *bmask, uint16_t etlv, uint16_t kidx); +ipfw_insn *ipfw_get_action(struct ip_fw *); typedef int (sopt_handler_f)(struct ip_fw_chain *ch, ip_fw3_opheader *op3, struct sockopt_data *sd); Modified: stable/12/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Aug 5 06:01:29 2019 (r350581) +++ stable/12/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Aug 5 07:49:02 2019 (r350582) @@ -1219,6 +1219,35 @@ move_range(struct ip_fw_chain *chain, ipfw_range_tlv * } /* + * Returns pointer to action instruction, skips all possible rule + * modifiers like O_LOG, O_TAG, O_ALTQ. + */ +ipfw_insn * +ipfw_get_action(struct ip_fw *rule) +{ + ipfw_insn *cmd; + int l, cmdlen; + + cmd = ACTION_PTR(rule); + l = rule->cmd_len - rule->act_ofs; + while (l > 0) { + switch (cmd->opcode) { + case O_ALTQ: + case O_LOG: + case O_TAG: + break; + default: + return (cmd); + } + cmdlen = F_LEN(cmd); + l -= cmdlen; + cmd += cmdlen; + } + panic("%s: rule (%p) has not action opcode", __func__, rule); + return (NULL); +} + +/* * Clear counters for a specific rule. * Normally run under IPFW_UH_RLOCK, but these are idempotent ops * so we only care that rules do not disappear. From owner-svn-src-all@freebsd.org Mon Aug 5 07:50:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C71DBC9C3; Mon, 5 Aug 2019 07:50:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46290y2CFjz4LmD; Mon, 5 Aug 2019 07:50:26 +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 2EAE71897E; Mon, 5 Aug 2019 07:50:26 +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 x757oQwj036824; Mon, 5 Aug 2019 07:50:26 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x757oPVo036820; Mon, 5 Aug 2019 07:50:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201908050750.x757oPVo036820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 5 Aug 2019 07:50: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: r350583 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 350583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 07:50:26 -0000 Author: ae Date: Mon Aug 5 07:50:25 2019 New Revision: 350583 URL: https://svnweb.freebsd.org/changeset/base/350583 Log: MFC r350417: Add ipfw_get_action() function to get the pointer to action opcode. ACTION_PTR() returns pointer to the start of rule action section, but rule can keep several rule modifiers like O_LOG, O_TAG and O_ALTQ, and only then real action opcode is stored. ipfw_get_action() function inspects the rule action section, skips all modifiers and returns action opcode. Use this function in ipfw_reset_eaction() and flush_nat_ptrs(). Modified: stable/11/sys/netpfil/ipfw/ip_fw_eaction.c stable/11/sys/netpfil/ipfw/ip_fw_nat.c stable/11/sys/netpfil/ipfw/ip_fw_private.h stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw_eaction.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_eaction.c Mon Aug 5 07:49:02 2019 (r350582) +++ stable/11/sys/netpfil/ipfw/ip_fw_eaction.c Mon Aug 5 07:50:25 2019 (r350583) @@ -377,33 +377,30 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_f uint16_t eaction_id, uint16_t default_id, uint16_t instance_id) { ipfw_insn *cmd, *icmd; - int l, cmdlen; + int l; IPFW_UH_WLOCK_ASSERT(ch); IPFW_WLOCK_ASSERT(ch); - cmd = ACTION_PTR(rule); - l = rule->cmd_len - rule->act_ofs; - while (l > 0) { - cmdlen = F_LEN(cmd); - l -= cmdlen; - if (cmd->opcode == O_EXTERNAL_ACTION || l <= 0) - break; - cmd += cmdlen; - } /* * Return if there is not O_EXTERNAL_ACTION or its id is * different. */ + cmd = ipfw_get_action(rule); if (cmd->opcode != O_EXTERNAL_ACTION || cmd->arg1 != eaction_id) return (0); /* * If instance_id is specified, we need to truncate the * rule length. Check if there is O_EXTERNAL_INSTANCE opcode. + * + * NOTE: F_LEN(cmd) must be 1 for O_EXTERNAL_ACTION opcode, + * and rule length should be enough to keep O_EXTERNAL_INSTANCE + * opcode, thus we do check for l > 1. */ - if (instance_id != 0 && l > 0) { - MPASS(cmdlen == 1); + l = rule->cmd + rule->cmd_len - cmd; + if (instance_id != 0 && l > 1) { + MPASS(F_LEN(cmd) == 1); icmd = cmd + 1; if (icmd->opcode != O_EXTERNAL_INSTANCE || icmd->arg1 != instance_id) @@ -415,8 +412,9 @@ ipfw_reset_eaction(struct ip_fw_chain *ch, struct ip_f * opcode. */ EACTION_DEBUG("truncate rule %d: len %u -> %u", - rule->rulenum, rule->cmd_len, rule->cmd_len - l); - rule->cmd_len -= l; + rule->rulenum, rule->cmd_len, + rule->cmd_len - F_LEN(icmd)); + rule->cmd_len -= F_LEN(icmd); MPASS(((uint32_t *)icmd - (uint32_t *)rule->cmd) == rule->cmd_len); } Modified: stable/11/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_nat.c Mon Aug 5 07:49:02 2019 (r350582) +++ stable/11/sys/netpfil/ipfw/ip_fw_nat.c Mon Aug 5 07:50:25 2019 (r350583) @@ -139,13 +139,12 @@ ifaddr_change(void *arg __unused, struct ifnet *ifp) static void flush_nat_ptrs(struct ip_fw_chain *chain, const int ix) { - int i; ipfw_insn_nat *cmd; + int i; IPFW_WLOCK_ASSERT(chain); for (i = 0; i < chain->n_rules; i++) { - cmd = (ipfw_insn_nat *)ACTION_PTR(chain->map[i]); - /* XXX skip log and the like ? */ + cmd = (ipfw_insn_nat *)ipfw_get_action(chain->map[i]); if (cmd->o.opcode == O_NAT && cmd->nat != NULL && (ix < 0 || cmd->nat->id == ix)) cmd->nat = NULL; Modified: stable/11/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_private.h Mon Aug 5 07:49:02 2019 (r350582) +++ stable/11/sys/netpfil/ipfw/ip_fw_private.h Mon Aug 5 07:50:25 2019 (r350583) @@ -674,6 +674,7 @@ struct ip_fw *ipfw_alloc_rule(struct ip_fw_chain *chai void ipfw_free_rule(struct ip_fw *rule); int ipfw_match_range(struct ip_fw *rule, ipfw_range_tlv *rt); int ipfw_mark_object_kidx(uint32_t *bmask, uint16_t etlv, uint16_t kidx); +ipfw_insn *ipfw_get_action(struct ip_fw *); typedef int (sopt_handler_f)(struct ip_fw_chain *ch, ip_fw3_opheader *op3, struct sockopt_data *sd); Modified: stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Aug 5 07:49:02 2019 (r350582) +++ stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Aug 5 07:50:25 2019 (r350583) @@ -1217,6 +1217,35 @@ move_range(struct ip_fw_chain *chain, ipfw_range_tlv * } /* + * Returns pointer to action instruction, skips all possible rule + * modifiers like O_LOG, O_TAG, O_ALTQ. + */ +ipfw_insn * +ipfw_get_action(struct ip_fw *rule) +{ + ipfw_insn *cmd; + int l, cmdlen; + + cmd = ACTION_PTR(rule); + l = rule->cmd_len - rule->act_ofs; + while (l > 0) { + switch (cmd->opcode) { + case O_ALTQ: + case O_LOG: + case O_TAG: + break; + default: + return (cmd); + } + cmdlen = F_LEN(cmd); + l -= cmdlen; + cmd += cmdlen; + } + panic("%s: rule (%p) has not action opcode", __func__, rule); + return (NULL); +} + +/* * Clear counters for a specific rule. * Normally run under IPFW_UH_RLOCK, but these are idempotent ops * so we only care that rules do not disappear. From owner-svn-src-all@freebsd.org Mon Aug 5 09:49:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95676BF3EB; Mon, 5 Aug 2019 09:49:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462CfF3RJtz4Rs8; Mon, 5 Aug 2019 09:49:25 +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 5789719F0A; Mon, 5 Aug 2019 09:49:25 +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 x759nPrr008660; Mon, 5 Aug 2019 09:49:25 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x759nP0j008659; Mon, 5 Aug 2019 09:49:25 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201908050949.x759nP0j008659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 5 Aug 2019 09:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350584 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 350584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 09:49:25 -0000 Author: bz Date: Mon Aug 5 09:49:24 2019 New Revision: 350584 URL: https://svnweb.freebsd.org/changeset/base/350584 Log: frag6.c: re-order functions within file Re-order functions within the file in preparation for an upcoming code simplification. No functional changes. MFC after: 3 months Sponsored by: Netflix Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Aug 5 07:50:25 2019 (r350583) +++ head/sys/netinet6/frag6.c Mon Aug 5 09:49:24 2019 (r350584) @@ -183,46 +183,78 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGBUCKETSIZE, /* - * Initialise reassembly queue and fragment identifier. + * Remove the IPv6 fragmentation header from the mbuf. */ -static void -frag6_change(void *tag) +int +ip6_deletefraghdr(struct mbuf *m, int offset, int wait) { - VNET_ITERATOR_DECL(vnet_iter); + struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct mbuf *t; - 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(); + /* Delete frag6 header. */ + if (m->m_len >= offset + sizeof(struct ip6_frag)) { + /* This is the only possible case with !PULLDOWN_TEST. */ + bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), + offset); + m->m_data += sizeof(struct ip6_frag); + m->m_len -= sizeof(struct ip6_frag); + } else { + /* This comes with no copy if the boundary is on cluster. */ + if ((t = m_split(m, offset, wait)) == NULL) + return (ENOMEM); + m_adj(t, sizeof(struct ip6_frag)); + m_cat(m, t); } - VNET_LIST_RUNLOCK_NOSLEEP(); + + m->m_flags |= M_FRAGMENTED; + return (0); } -void -frag6_init(void) +/* + * Free a fragment reassembly header and all + * associated datagrams. + */ +static void +frag6_freef(struct ip6q *q6, uint32_t bucket) { - struct ip6q *q6; - int i; + struct ip6asfrag *af6, *down6; - 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; + IP6Q_LOCK_ASSERT(bucket); - ip6_maxfrags = IP6_MAXFRAGS; - EVENTHANDLER_REGISTER(nmbclusters_change, - frag6_change, NULL, EVENTHANDLER_PRI_ANY); + 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, bucket); + + /* + * Return ICMP time exceeded error for the 1st fragment. + * Just free other fragments. + */ + if (af6->ip6af_off == 0) { + struct ip6_hdr *ip6; + + /* adjust pointer */ + ip6 = mtod(m, struct ip6_hdr *); + + /* restore source and destination addresses */ + ip6->ip6_src = q6->ip6q_src; + ip6->ip6_dst = q6->ip6q_dst; + + icmp6_error(m, ICMP6_TIME_EXCEEDED, + ICMP6_TIME_EXCEED_REASSEMBLY, 0); + } else + m_freem(m); + free(af6, M_FRAG6); + } + frag6_remque(q6, bucket); + atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); +#ifdef MAC + mac_ip6q_destroy(q6); +#endif + free(q6, M_FRAG6); + atomic_subtract_int(&V_frag6_nfragpackets, 1); } /* @@ -716,110 +748,6 @@ insert: } /* - * Free a fragment reassembly header and all - * associated datagrams. - */ -static void -frag6_freef(struct ip6q *q6, uint32_t bucket) -{ - struct ip6asfrag *af6, *down6; - - 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, bucket); - - /* - * Return ICMP time exceeded error for the 1st fragment. - * Just free other fragments. - */ - if (af6->ip6af_off == 0) { - struct ip6_hdr *ip6; - - /* adjust pointer */ - ip6 = mtod(m, struct ip6_hdr *); - - /* restore source and destination addresses */ - ip6->ip6_src = q6->ip6q_src; - ip6->ip6_dst = q6->ip6q_dst; - - icmp6_error(m, ICMP6_TIME_EXCEEDED, - ICMP6_TIME_EXCEED_REASSEMBLY, 0); - } else - m_freem(m); - free(af6, M_FRAG6); - } - frag6_remque(q6, bucket); - atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); -#ifdef MAC - mac_ip6q_destroy(q6); -#endif - free(q6, M_FRAG6); - atomic_subtract_int(&V_frag6_nfragpackets, 1); -} - -/* - * Put an ip fragment on a reassembly chain. - * Like insque, but pointers in middle of structure. - */ -static void -frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6, - uint32_t bucket __unused) -{ - - IP6Q_LOCK_ASSERT(bucket); - - af6->ip6af_up = up6; - af6->ip6af_down = up6->ip6af_down; - up6->ip6af_down->ip6af_up = af6; - up6->ip6af_down = af6; -} - -/* - * To frag6_enq as remque is to insque. - */ -static void -frag6_deq(struct ip6asfrag *af6, uint32_t bucket __unused) -{ - - IP6Q_LOCK_ASSERT(bucket); - - af6->ip6af_up->ip6af_down = af6->ip6af_down; - af6->ip6af_down->ip6af_up = af6->ip6af_up; -} - -static void -frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket) -{ - - 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; - old->ip6q_next->ip6q_prev= new; - old->ip6q_next = new; - V_ip6q[bucket].count++; -} - -static void -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--; -} - -/* * IPv6 reassembling timer processing; * if a timer expires on a reassembly * queue, discard it. @@ -900,7 +828,50 @@ frag6_slowtimo(void) VNET_LIST_RUNLOCK_NOSLEEP(); } +static void +frag6_change(void *tag) +{ + VNET_ITERATOR_DECL(vnet_iter); + + 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(); +} + /* + * Initialise reassembly queue and fragment identifier. + */ +void +frag6_init(void) +{ + struct ip6q *q6; + int i; + + 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); +} + +/* * Drain off all datagram fragments. */ void @@ -929,27 +900,59 @@ frag6_drain(void) VNET_LIST_RUNLOCK_NOSLEEP(); } -int -ip6_deletefraghdr(struct mbuf *m, int offset, int wait) +/* + * Put an ip fragment on a reassembly chain. + * Like insque, but pointers in middle of structure. + */ +static void +frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6, + uint32_t bucket __unused) { - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); - struct mbuf *t; - /* Delete frag6 header. */ - if (m->m_len >= offset + sizeof(struct ip6_frag)) { - /* This is the only possible case with !PULLDOWN_TEST. */ - bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), - offset); - m->m_data += sizeof(struct ip6_frag); - m->m_len -= sizeof(struct ip6_frag); - } else { - /* This comes with no copy if the boundary is on cluster. */ - if ((t = m_split(m, offset, wait)) == NULL) - return (ENOMEM); - m_adj(t, sizeof(struct ip6_frag)); - m_cat(m, t); - } + IP6Q_LOCK_ASSERT(bucket); - m->m_flags |= M_FRAGMENTED; - return (0); + af6->ip6af_up = up6; + af6->ip6af_down = up6->ip6af_down; + up6->ip6af_down->ip6af_up = af6; + up6->ip6af_down = af6; +} + +/* + * To frag6_enq as remque is to insque. + */ +static void +frag6_deq(struct ip6asfrag *af6, uint32_t bucket __unused) +{ + + IP6Q_LOCK_ASSERT(bucket); + + af6->ip6af_up->ip6af_down = af6->ip6af_down; + af6->ip6af_down->ip6af_up = af6->ip6af_up; +} + +static void +frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket) +{ + + 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; + old->ip6q_next->ip6q_prev= new; + old->ip6q_next = new; + V_ip6q[bucket].count++; +} + +static void +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--; } From owner-svn-src-all@freebsd.org Mon Aug 5 11:01:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF940C07A0; Mon, 5 Aug 2019 11:01:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462FF466jHz4W7g; Mon, 5 Aug 2019 11:01:12 +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 B40C31ACC5; Mon, 5 Aug 2019 11:01:12 +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 x75B1CkN053955; Mon, 5 Aug 2019 11:01:12 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75B1CUL053954; Mon, 5 Aug 2019 11:01:12 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201908051101.x75B1CUL053954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 5 Aug 2019 11:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350585 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 350585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 11:01:13 -0000 Author: bz Date: Mon Aug 5 11:01:12 2019 New Revision: 350585 URL: https://svnweb.freebsd.org/changeset/base/350585 Log: frag6.c: rename ip6q[] to ipq6b[] and consistently use "bucket" The hash buckets array is called ip6q. The data structure ip6q is a description of different object, the one the array holds these days (since r337776). To clear some of this confusion, rename the array to ip6qb. When iterating over all buckets or addressing them directly, we use at least the variables i, hash, and bucket. To keep the terminology consistent use the variable name "bucket" and always make it an uint32_t and not sometimes an int. No functional behaviour changes intended. MFC after: 3 months Sponsored by: Netflix Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Aug 5 09:49:24 2019 (r350584) +++ head/sys/netinet6/frag6.c Mon Aug 5 11:01:12 2019 (r350585) @@ -107,16 +107,16 @@ VNET_DEFINE_STATIC(int, ip6_maxfragsperpacket); #define V_ip6_maxfragsperpacket VNET(ip6_maxfragsperpacket) /* Per-VNET reassembly queue buckets. */ -VNET_DEFINE_STATIC(struct ip6qbucket, ip6q[IP6REASS_NHASH]); -VNET_DEFINE_STATIC(uint32_t, ip6q_hashseed); -#define V_ip6q VNET(ip6q) -#define V_ip6q_hashseed VNET(ip6q_hashseed) +VNET_DEFINE_STATIC(struct ip6qbucket, ip6qb[IP6REASS_NHASH]); +VNET_DEFINE_STATIC(uint32_t, ip6qb_hashseed); +#define V_ip6qb VNET(ip6qb) +#define V_ip6qb_hashseed VNET(ip6qb_hashseed) -#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) +#define IP6QB_LOCK(_b) mtx_lock(&V_ip6qb[(_b)].lock) +#define IP6QB_TRYLOCK(_b) mtx_trylock(&V_ip6qb[(_b)].lock) +#define IP6QB_LOCK_ASSERT(_b) mtx_assert(&V_ip6qb[(_b)].lock, MA_OWNED) +#define IP6QB_UNLOCK(_b) mtx_unlock(&V_ip6qb[(_b)].lock) +#define IP6QB_HEAD(_b) (&V_ip6qb[(_b)].ip6q) /* * By default, limit the number of IP6 fragments across all reassembly @@ -219,7 +219,7 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) { struct ip6asfrag *af6, *down6; - IP6Q_LOCK_ASSERT(bucket); + IP6QB_LOCK_ASSERT(bucket); for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = down6) { @@ -303,7 +303,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) int fragoff, frgpartlen; /* must be larger than u_int16_t */ uint32_t hashkey[(sizeof(struct in6_addr) * 2 + sizeof(ip6f->ip6f_ident)) / sizeof(uint32_t)]; - uint32_t hash, *hashkeyp; + uint32_t bucket, *hashkeyp; struct ifnet *dstifp; u_int8_t ecn, ecn0; #ifdef RSS @@ -384,10 +384,10 @@ frag6_input(struct mbuf **mp, int *offp, int proto) 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); + bucket = jenkins_hash32(hashkey, nitems(hashkey), V_ip6qb_hashseed); + bucket &= IP6REASS_HMASK; + head = IP6QB_HEAD(bucket); + IP6QB_LOCK(bucket); /* * Enforce upper bound on number of fragments. @@ -424,7 +424,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) */ if (V_ip6_maxfragpackets < 0) ; - else if (V_ip6q[hash].count >= V_ip6_maxfragbucketsize || + else if (V_ip6qb[bucket].count >= V_ip6_maxfragbucketsize || atomic_load_int(&V_frag6_nfragpackets) >= (u_int)V_ip6_maxfragpackets) goto dropfrag; @@ -440,7 +440,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } mac_ip6q_create(m, q6); #endif - frag6_insque_head(q6, head, hash); + frag6_insque_head(q6, head, bucket); /* ip6q_nxt will be filled afterwards, from 1st fragment */ q6->ip6q_down = q6->ip6q_up = (struct ip6asfrag *)q6; @@ -480,14 +480,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(hash); + IP6QB_UNLOCK(bucket); 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(hash); + IP6QB_UNLOCK(bucket); return (IPPROTO_DONE); } /* @@ -506,7 +506,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) int erroff = af6->ip6af_offset; /* dequeue the fragment. */ - frag6_deq(af6, hash); + frag6_deq(af6, bucket); free(af6, M_FRAG6); /* adjust pointer. */ @@ -609,7 +609,7 @@ insert: * Move to front of packet queue, as we are * the most recently active fragmented packet. */ - frag6_enq(ip6af, af6->ip6af_up, hash); + frag6_enq(ip6af, af6->ip6af_up, bucket); atomic_add_int(&frag6_nfrags, 1); q6->ip6q_nfrag++; next = 0; @@ -618,9 +618,9 @@ insert: if (af6->ip6af_off != next) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); - frag6_freef(q6, hash); + frag6_freef(q6, bucket); } - IP6Q_UNLOCK(hash); + IP6QB_UNLOCK(bucket); return IPPROTO_DONE; } next += af6->ip6af_frglen; @@ -628,9 +628,9 @@ insert: if (af6->ip6af_up->ip6af_mff) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); - frag6_freef(q6, hash); + frag6_freef(q6, bucket); } - IP6Q_UNLOCK(hash); + IP6QB_UNLOCK(bucket); return IPPROTO_DONE; } @@ -640,7 +640,7 @@ insert: ip6af = q6->ip6q_down; t = m = IP6_REASS_MBUF(ip6af); af6 = ip6af->ip6af_down; - frag6_deq(ip6af, hash); + frag6_deq(ip6af, bucket); while (af6 != (struct ip6asfrag *)q6) { m->m_pkthdr.csum_flags &= IP6_REASS_MBUF(af6)->m_pkthdr.csum_flags; @@ -648,7 +648,7 @@ insert: IP6_REASS_MBUF(af6)->m_pkthdr.csum_data; af6dwn = af6->ip6af_down; - frag6_deq(af6, hash); + frag6_deq(af6, bucket); while (t->m_next) t = t->m_next; m_adj(IP6_REASS_MBUF(af6), af6->ip6af_offset); @@ -672,7 +672,7 @@ insert: nxt = q6->ip6q_nxt; if (ip6_deletefraghdr(m, offset, M_NOWAIT) != 0) { - frag6_remque(q6, hash); + frag6_remque(q6, bucket); atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_destroy(q6); @@ -689,7 +689,7 @@ insert: m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), (caddr_t)&nxt); - frag6_remque(q6, hash); + frag6_remque(q6, bucket); atomic_subtract_int(&frag6_nfrags, q6->ip6q_nfrag); #ifdef MAC mac_ip6q_reassemble(q6, m); @@ -718,7 +718,7 @@ insert: m_tag_prepend(m, mtag); #endif - IP6Q_UNLOCK(hash); + IP6QB_UNLOCK(bucket); IP6STAT_INC(ip6s_reassembled); in6_ifstat_inc(dstifp, ifs6_reass_ok); @@ -740,7 +740,7 @@ insert: return nxt; dropfrag: - IP6Q_UNLOCK(hash); + IP6QB_UNLOCK(bucket); in6_ifstat_inc(dstifp, ifs6_reass_fail); IP6STAT_INC(ip6s_fragdropped); m_freem(m); @@ -757,21 +757,21 @@ frag6_slowtimo(void) { VNET_ITERATOR_DECL(vnet_iter); struct ip6q *head, *q6; - int i; + uint32_t bucket; VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - for (i = 0; i < IP6REASS_NHASH; i++) { - IP6Q_LOCK(i); - head = IP6Q_HEAD(i); + for (bucket = 0; bucket < IP6REASS_NHASH; bucket++) { + IP6QB_LOCK(bucket); + head = IP6QB_HEAD(bucket); q6 = head->ip6q_next; if (q6 == NULL) { /* * XXXJTL: This should never happen. This * should turn into an assertion. */ - IP6Q_UNLOCK(i); + IP6QB_UNLOCK(bucket); continue; } while (q6 != head) { @@ -781,7 +781,7 @@ frag6_slowtimo(void) IP6STAT_ADD(ip6s_fragtimeout, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(q6->ip6q_prev, i); + frag6_freef(q6->ip6q_prev, bucket); } } /* @@ -795,33 +795,33 @@ frag6_slowtimo(void) */ while ((V_ip6_maxfragpackets == 0 || (V_ip6_maxfragpackets > 0 && - V_ip6q[i].count > V_ip6_maxfragbucketsize)) && + V_ip6qb[bucket].count > V_ip6_maxfragbucketsize)) && head->ip6q_prev != head) { IP6STAT_ADD(ip6s_fragoverflow, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_prev, i); + frag6_freef(head->ip6q_prev, bucket); } - IP6Q_UNLOCK(i); + IP6QB_UNLOCK(bucket); } /* * If we are still over the maximum number of fragmented * packets, drain off enough to get down to the new limit. */ - i = 0; + bucket = 0; while (V_ip6_maxfragpackets >= 0 && atomic_load_int(&V_frag6_nfragpackets) > (u_int)V_ip6_maxfragpackets) { - IP6Q_LOCK(i); - head = IP6Q_HEAD(i); + IP6QB_LOCK(bucket); + head = IP6QB_HEAD(bucket); if (head->ip6q_prev != head) { IP6STAT_ADD(ip6s_fragoverflow, q6->ip6q_prev->ip6q_nfrag); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_prev, i); + frag6_freef(head->ip6q_prev, bucket); } - IP6Q_UNLOCK(i); - i = (i + 1) % IP6REASS_NHASH; + IP6QB_UNLOCK(bucket); + bucket = (bucket + 1) % IP6REASS_NHASH; } CURVNET_RESTORE(); } @@ -851,17 +851,17 @@ void frag6_init(void) { struct ip6q *q6; - int i; + uint32_t bucket; V_ip6_maxfragpackets = IP6_MAXFRAGPACKETS; frag6_set_bucketsize(); - for (i = 0; i < IP6REASS_NHASH; i++) { - q6 = IP6Q_HEAD(i); + for (bucket = 0; bucket < IP6REASS_NHASH; bucket++) { + q6 = IP6QB_HEAD(bucket); q6->ip6q_next = q6->ip6q_prev = q6; - mtx_init(&V_ip6q[i].lock, "ip6qlock", NULL, MTX_DEF); - V_ip6q[i].count = 0; + mtx_init(&V_ip6qb[bucket].lock, "ip6qlock", NULL, MTX_DEF); + V_ip6qb[bucket].count = 0; } - V_ip6q_hashseed = arc4random(); + V_ip6qb_hashseed = arc4random(); V_ip6_maxfragsperpacket = 64; if (!IS_DEFAULT_VNET(curvnet)) return; @@ -879,21 +879,21 @@ frag6_drain(void) { VNET_ITERATOR_DECL(vnet_iter); struct ip6q *head; - int i; + uint32_t bucket; VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - for (i = 0; i < IP6REASS_NHASH; i++) { - if (IP6Q_TRYLOCK(i) == 0) + for (bucket = 0; bucket < IP6REASS_NHASH; bucket++) { + if (IP6QB_TRYLOCK(bucket) == 0) continue; - head = IP6Q_HEAD(i); + head = IP6QB_HEAD(bucket); while (head->ip6q_next != head) { IP6STAT_INC(ip6s_fragdropped); /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */ - frag6_freef(head->ip6q_next, i); + frag6_freef(head->ip6q_next, bucket); } - IP6Q_UNLOCK(i); + IP6QB_UNLOCK(bucket); } CURVNET_RESTORE(); } @@ -909,7 +909,7 @@ frag6_enq(struct ip6asfrag *af6, struct ip6asfrag *up6 uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(bucket); + IP6QB_LOCK_ASSERT(bucket); af6->ip6af_up = up6; af6->ip6af_down = up6->ip6af_down; @@ -924,7 +924,7 @@ static void frag6_deq(struct ip6asfrag *af6, uint32_t bucket __unused) { - IP6Q_LOCK_ASSERT(bucket); + IP6QB_LOCK_ASSERT(bucket); af6->ip6af_up->ip6af_down = af6->ip6af_down; af6->ip6af_down->ip6af_up = af6->ip6af_up; @@ -934,8 +934,8 @@ static void frag6_insque_head(struct ip6q *new, struct ip6q *old, uint32_t bucket) { - IP6Q_LOCK_ASSERT(bucket); - KASSERT(IP6Q_HEAD(bucket) == old, + IP6QB_LOCK_ASSERT(bucket); + KASSERT(IP6QB_HEAD(bucket) == old, ("%s: attempt to insert at head of wrong bucket" " (bucket=%u, old=%p)", __func__, bucket, old)); @@ -943,16 +943,16 @@ 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++; + V_ip6qb[bucket].count++; } static void frag6_remque(struct ip6q *p6, uint32_t bucket) { - IP6Q_LOCK_ASSERT(bucket); + IP6QB_LOCK_ASSERT(bucket); p6->ip6q_prev->ip6q_next = p6->ip6q_next; p6->ip6q_next->ip6q_prev = p6->ip6q_prev; - V_ip6q[bucket].count--; + V_ip6qb[bucket].count--; } From owner-svn-src-all@freebsd.org Mon Aug 5 11:47:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27737C133D; Mon, 5 Aug 2019 11:47:36 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462GGc0GYsz4YD3; Mon, 5 Aug 2019 11:47:36 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E07C01B48C; Mon, 5 Aug 2019 11:47:35 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75BlZGa080876; Mon, 5 Aug 2019 11:47:35 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75BlY1U080870; Mon, 5 Aug 2019 11:47:34 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201908051147.x75BlY1U080870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Mon, 5 Aug 2019 11:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350586 - in head: etc/mtree tests/sys/netpfil tests/sys/netpfil/common X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: in head: etc/mtree tests/sys/netpfil tests/sys/netpfil/common X-SVN-Commit-Revision: 350586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 11:47:36 -0000 Author: thj Date: Mon Aug 5 11:47:34 2019 New Revision: 350586 URL: https://svnweb.freebsd.org/changeset/base/350586 Log: Add common firewall test suite Add a common test suite for the firewalls included in the base system. The test suite allows common test infrastructure to test pf, ipfw and ipf firewalls from test files containing the setup for all three firewalls. Add the pass block test for pf, ipfw and ipf. The pass block test checks the allow/deny functionality of the firewalls tested. Submitted by: Ahsan Barkati Sponsored by: Google, Inc. (GSoC 2019) Reviewed by: kp Approved by: bz (co-mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21065 Added: head/tests/sys/netpfil/common/ head/tests/sys/netpfil/common/Makefile (contents, props changed) head/tests/sys/netpfil/common/pass_block.sh (contents, props changed) head/tests/sys/netpfil/common/runner.subr (contents, props changed) head/tests/sys/netpfil/common/utils.subr (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/tests/sys/netpfil/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Aug 5 11:01:12 2019 (r350585) +++ head/etc/mtree/BSD.tests.dist Mon Aug 5 11:47:34 2019 (r350586) @@ -793,6 +793,8 @@ netmap .. netpfil + common + .. pf ioctl .. Modified: head/tests/sys/netpfil/Makefile ============================================================================== --- head/tests/sys/netpfil/Makefile Mon Aug 5 11:01:12 2019 (r350585) +++ head/tests/sys/netpfil/Makefile Mon Aug 5 11:47:34 2019 (r350586) @@ -5,7 +5,8 @@ TESTSDIR= ${TESTSBASE}/sys/netpfil .if ${MK_PF} != "no" -TESTS_SUBDIRS+= pf +TESTS_SUBDIRS+= pf \ + common .endif .include Added: head/tests/sys/netpfil/common/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/common/Makefile Mon Aug 5 11:47:34 2019 (r350586) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/netpfil/common + + +ATF_TESTS_SH+= pass_block \ + +${PACKAGE}FILES+= utils.subr \ + runner.subr + +.include Added: head/tests/sys/netpfil/common/pass_block.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/common/pass_block.sh Mon Aug 5 11:47:34 2019 (r350586) @@ -0,0 +1,129 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# 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$ +# + +. $(atf_get_srcdir)/utils.subr +. $(atf_get_srcdir)/runner.subr + +v4_head() +{ + atf_set require.user root +} + +v4_body() +{ + firewall=$1 + firewall_init $firewall + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + vnet_mkjail iron ${epair}b + jexec iron ifconfig ${epair}b 192.0.2.2/24 up + + # Block All + firewall_config "iron" ${firewall} \ + "pf" \ + "block in" \ + "ipfw" \ + "ipfw -q add 100 deny all from any to any" \ + "ipf" \ + "block in all" + + atf_check -s exit:2 -o ignore ping -c 1 -t 1 192.0.2.2 + + # Pass All + firewall_config "iron" ${firewall} \ + "pf" \ + "pass in" \ + "ipfw" \ + "ipfw -q add 100 allow all from any to any" \ + "ipf" \ + "pass in all" + + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 +} + +v4_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +v6_head() +{ + atf_set require.user root +} + +v6_body() +{ + firewall=$1 + firewall_init $firewall + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 fd7a:803f:cc4b::1/64 up no_dad + + vnet_mkjail iron ${epair}b + jexec iron ifconfig ${epair}b inet6 fd7a:803f:cc4b::2/64 up no_dad + + # Block All + firewall_config "iron" ${firewall} \ + "pf" \ + "block in" \ + "ipfw" \ + "ipfw -q add 100 deny all from any to any" \ + "ipf" \ + "block in all" + + atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 fd7a:803f:cc4b::2 + + # Pass All + firewall_config "iron" ${firewall} \ + "pf" \ + "pass in" \ + "ipfw" \ + "ipfw -q add 100 allow all from any to any" \ + "ipf" \ + "pass in all" + + atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 fd7a:803f:cc4b::2 +} + +v6_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +setup_tests "v4" \ + "pf" \ + "ipfw" \ + "ipf" \ + "v6" \ + "pf" \ + "ipfw" \ + "ipf" \ No newline at end of file Added: head/tests/sys/netpfil/common/runner.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/common/runner.subr Mon Aug 5 11:47:34 2019 (r350586) @@ -0,0 +1,67 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# 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$ +# + +. $(atf_get_srcdir)/utils.subr + +setup_tests() +{ + tests="" + while [ $# -gt 0 ]; do + if [ $(is_firewall $1) -eq 1 ]; then + fw=$1 + shift + if [ -z "${testcase}" ]; then + echo "no testcase passed to setup_test" + return + fi + atf_test_case "${fw}_${testcase}" "cleanup" + eval "${fw}_${testcase}_head(){ ${testcase}_head; }" + eval "${fw}_${testcase}_body(){ ${testcase}_body $fw; }" + eval "${fw}_${testcase}_cleanup(){ ${testcase}_cleanup $fw; }" + tests="$tests ${fw}_${testcase}" + else + testcase=$1 + shift + fi + done + init_testcases "$tests" +} + + +init_testcases() +{ + args="$@" + atf_init_test_cases() + { + for testcase in $args; + do + atf_add_test_case "$testcase" + done + } +} \ No newline at end of file Added: head/tests/sys/netpfil/common/utils.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/common/utils.subr Mon Aug 5 11:47:34 2019 (r350586) @@ -0,0 +1,113 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# 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$ +# + +. $(atf_get_srcdir)/../../common/vnet.subr + +firewall_config() +{ + jname=$1 + shift + fw=$1 + shift + + while [ $# -gt 0 ]; do + if [ $(is_firewall $fw) -eq 1 ]; then + current_fw="$1" + shift + filename=${current_fw}.rule + cwd=$(pwd) + if [ -f ${current_fw}.rule ]; then + rm ${current_fw}.rule + fi + fi + rule=$1 + echo $rule >> $filename + shift + done + + if [ ${fw} == "ipfw" ]; then + jexec ${jname} ipfw -q -f flush + jexec ${jname} /bin/sh $cwd/ipfw.rule + elif [ ${fw} == "pf" ]; then + jexec ${jname} pfctl -e + jexec ${jname} pfctl -F all + jexec ${jname} pfctl -f $cwd/pf.rule + elif [ ${fw} == "ipf" ]; then + jexec ${jname} ipf -E + jexec ${jname} ipf -Fa -f $cwd/ipf.rule + elif [ ${fw} == "ipfnat" ]; then + jexec ${jname} service ipfilter start + jexec ${jname} ipnat -CF -f $cwd/ipfnat.rule + else + atf_fail "$fw is not a valid firewall to configure" + fi +} + +firewall_cleanup() +{ + firewall=$1 + echo "Cleaning $firewall" + vnet_cleanup +} + +firewall_init() +{ + firewall=$1 + vnet_init + + if [ ${firewall} == "ipfw" ]; then + if ! kldstat -q -m ipfw; then + atf_skip "This test requires ipfw" + fi + elif [ ${firewall} == "pf" ]; then + if [ ! -c /dev/pf ]; then + atf_skip "This test requires pf" + fi + elif [ ${firewall} == "ipf" ]; then + if ! kldstat -q -m ipfilter; then + atf_skip "This test requires ipf" + fi + elif [ ${firewall} == "ipfnat" ]; then + if ! kldstat -q -m ipfw_nat; then + atf_skip "This test requires ipfw_nat" + fi + else + atf_fail "$fw is not a valid firewall to initialize" + fi + +} + +is_firewall() +{ + if [ "$1" = "pf" -o "$1" = "ipfw" -o "$1" = "ipf" -o "$1" = "ipfnat" ]; then + echo 1 + else + echo 0 + fi +} \ No newline at end of file From owner-svn-src-all@freebsd.org Mon Aug 5 13:22:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 585F5C3806; Mon, 5 Aug 2019 13:22:03 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462JMb1l2Lz4f2V; Mon, 5 Aug 2019 13:22:03 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D78C1C607; Mon, 5 Aug 2019 13:22:03 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75DM2Aw035636; Mon, 5 Aug 2019 13:22:02 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75DM2Ua035635; Mon, 5 Aug 2019 13:22:02 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201908051322.x75DM2Ua035635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 5 Aug 2019 13:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350587 - head/libexec/rtld-elf/powerpc64 X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/libexec/rtld-elf/powerpc64 X-SVN-Commit-Revision: 350587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 13:22:03 -0000 Author: luporl Date: Mon Aug 5 13:22:02 2019 New Revision: 350587 URL: https://svnweb.freebsd.org/changeset/base/350587 Log: [PPC64] Fix rtld direct exec mode Instead of restoring the saved values of argc, argv and envp, these must be loaded from the stack that _rtld() modifies. This fixes rtld direct exec mode. E.g.: /libexec/ld-elf.so.1 /bin/ls Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21131 Modified: head/libexec/rtld-elf/powerpc64/rtld_start.S Modified: head/libexec/rtld-elf/powerpc64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_start.S Mon Aug 5 11:47:34 2019 (r350586) +++ head/libexec/rtld-elf/powerpc64/rtld_start.S Mon Aug 5 13:22:02 2019 (r350587) @@ -38,9 +38,12 @@ _ENTRY(_rtld_start) stdu %r1,-144(%r1) /* 16-byte aligned stack for reg saves + exit_proc & obj _rtld args + backchain & lrsave stack frame */ - std %r3,96(%r1) /* argc */ + + /* Save and restore only initial argv, because _rtld will modify + * argv and envp if invoked explicitly, making it necessary to + * load the (possibly) adjusted values from the stack. + */ std %r4,104(%r1) /* argv */ - std %r5,112(%r1) /* envp */ /* std %r6,120(%r1) *//* obj (always 0) */ /* std %r7,128(%r1) *//* cleanup (always 0) */ std %r8,136(%r1) /* ps_strings */ @@ -94,9 +97,14 @@ _ENTRY(_rtld_start) /* * Restore args, with new obj/exit proc */ - ld %r3,96(%r1) /* argc */ - ld %r4,104(%r1) /* argv */ - ld %r5,112(%r1) /* envp */ + ld %r4,104(%r1) /* argv */ + ld %r3,-8(%r4) /* argc */ + + /* envp = argv + argc + 1 */ + addi %r5,%r3,1 + sldi %r5,%r5,3 /* x8 */ + add %r5,%r4,%r5 + ld %r6,120(%r1) /* obj */ ld %r7,128(%r1) /* exit proc */ ld %r8,136(%r1) /* ps_strings */ From owner-svn-src-all@freebsd.org Mon Aug 5 13:22:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE442C380C; Mon, 5 Aug 2019 13:22: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462JMr49nXz4f7Q; Mon, 5 Aug 2019 13:22: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 711721C61B; Mon, 5 Aug 2019 13:22: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 x75DMGm2036410; Mon, 5 Aug 2019 13:22:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75DMF1v036404; Mon, 5 Aug 2019 13:22:15 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908051322.x75DMF1v036404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 5 Aug 2019 13:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350588 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 350588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 13:22:16 -0000 Author: tuexen Date: Mon Aug 5 13:22:15 2019 New Revision: 350588 URL: https://svnweb.freebsd.org/changeset/base/350588 Log: Improve consistency. No functional change. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_usrreq.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Mon Aug 5 13:22:02 2019 (r350587) +++ head/sys/netinet/sctp_asconf.c Mon Aug 5 13:22:15 2019 (r350588) @@ -1957,7 +1957,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *inp, struct sc /* invalid if we are a v6 only endpoint */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && - SCTP_IPV6_V6ONLY(&inp->ip_inp.inp)) + SCTP_IPV6_V6ONLY(inp)) return; sin = &ifa->address.sin; @@ -2030,9 +2030,8 @@ sctp_asconf_iterator_ep(struct sctp_inpcb *inp, void * case AF_INET: { /* invalid if we are a v6 only endpoint */ - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && - SCTP_IPV6_V6ONLY(&inp->ip_inp.inp)) { + SCTP_IPV6_V6ONLY(inp)) { cnt_invalid++; if (asc->cnt == cnt_invalid) return (1); @@ -2147,7 +2146,7 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, stru /* invalid if we are a v6 only endpoint */ if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && - SCTP_IPV6_V6ONLY(&inp->ip_inp.inp)) + SCTP_IPV6_V6ONLY(inp)) continue; sin = &ifa->address.sin; @@ -2164,7 +2163,7 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, stru continue; } if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && - SCTP_IPV6_V6ONLY(&inp->ip_inp.inp)) { + SCTP_IPV6_V6ONLY(inp)) { cnt_invalid++; if (asc->cnt == cnt_invalid) return; Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Mon Aug 5 13:22:02 2019 (r350587) +++ head/sys/netinet/sctp_os_bsd.h Mon Aug 5 13:22:15 2019 (r350588) @@ -365,10 +365,10 @@ typedef struct callout sctp_os_timer_t; */ /* get the v6 hop limit */ -#define SCTP_GET_HLIM(inp, ro) in6_selecthlim((struct inpcb *)&inp->ip_inp.inp, (ro ? (ro->ro_rt ? (ro->ro_rt->rt_ifp) : (NULL)) : (NULL))); +#define SCTP_GET_HLIM(inp, ro) in6_selecthlim(&inp->ip_inp.inp, (ro ? (ro->ro_rt ? (ro->ro_rt->rt_ifp) : (NULL)) : (NULL))); /* is the endpoint v6only? */ -#define SCTP_IPV6_V6ONLY(inp) (((struct inpcb *)inp)->inp_flags & IN6P_IPV6_V6ONLY) +#define SCTP_IPV6_V6ONLY(sctp_inpcb) ((sctp_inpcb)->ip_inp.inp.inp_flags & IN6P_IPV6_V6ONLY) /* is the socket non-blocking? */ #define SCTP_SO_IS_NBIO(so) ((so)->so_state & SS_NBIO) #define SCTP_SET_SO_NBIO(so) ((so)->so_state |= SS_NBIO) Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Aug 5 13:22:02 2019 (r350587) +++ head/sys/netinet/sctp_pcb.c Mon Aug 5 13:22:15 2019 (r350588) @@ -2845,7 +2845,7 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *ad struct sockaddr_in *sin; /* IPV6_V6ONLY socket? */ - if (SCTP_IPV6_V6ONLY(ip_inp)) { + if (SCTP_IPV6_V6ONLY(inp)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); return (EINVAL); } @@ -3643,8 +3643,9 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, #ifdef INET6 - if (ip_pcb->inp_vflag & INP_IPV6) - ip6_freepcbopts(((struct inpcb *)inp)->in6p_outputopts); + if (ip_pcb->inp_vflag & INP_IPV6) { + ip6_freepcbopts(ip_pcb->in6p_outputopts); + } #endif /* INET6 */ ip_pcb->inp_vflag = 0; /* free up authentication fields */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Mon Aug 5 13:22:02 2019 (r350587) +++ head/sys/netinet/sctp_usrreq.c Mon Aug 5 13:22:15 2019 (r350588) @@ -1412,7 +1412,6 @@ sctp_do_connect_x(struct socket *so, struct sctp_inpcb } if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && (num_v4 > 0)) { - if (SCTP_IPV6_V6ONLY(inp)) { /* * if IPV6_V6ONLY flag, ignore connections destined @@ -6931,14 +6930,14 @@ sctp_connect(struct socket *so, struct sockaddr *addr, #ifdef INET case AF_INET: { - struct sockaddr_in *sinp; + struct sockaddr_in *sin; if (addr->sa_len != sizeof(struct sockaddr_in)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } - sinp = (struct sockaddr_in *)addr; - if (p != NULL && (error = prison_remote_ip4(p->td_ucred, &sinp->sin_addr)) != 0) { + sin = (struct sockaddr_in *)addr; + if (p != NULL && (error = prison_remote_ip4(p->td_ucred, &sin->sin_addr)) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); return (error); } Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Mon Aug 5 13:22:02 2019 (r350587) +++ head/sys/netinet6/sctp6_usrreq.c Mon Aug 5 13:22:15 2019 (r350588) @@ -592,7 +592,7 @@ sctp6_bind(struct socket *so, struct sockaddr *addr, s } inp->ip_inp.inp.inp_vflag &= ~INP_IPV4; inp->ip_inp.inp.inp_vflag |= INP_IPV6; - if ((addr != NULL) && (SCTP_IPV6_V6ONLY(&inp->ip_inp.inp) == 0)) { + if ((addr != NULL) && (SCTP_IPV6_V6ONLY(inp) == 0)) { switch (addr->sa_family) { #ifdef INET case AF_INET: From owner-svn-src-all@freebsd.org Mon Aug 5 13:28:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 993C8C39C4; Mon, 5 Aug 2019 13:28:22 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462JVt3Chlz4fjF; Mon, 5 Aug 2019 13:28:22 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5030B1C666; Mon, 5 Aug 2019 13:28:22 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75DSMjC041697; Mon, 5 Aug 2019 13:28:22 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75DSMDW041696; Mon, 5 Aug 2019 13:28:22 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201908051328.x75DSMDW041696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 5 Aug 2019 13:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350589 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 350589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 13:28:22 -0000 Author: luporl Date: Mon Aug 5 13:28:21 2019 New Revision: 350589 URL: https://svnweb.freebsd.org/changeset/base/350589 Log: [PPC64] Don't mark ld.bfd as obsolete PowerPC64 still needs ld.bfd for 32-bit binaries/libraries. This will be needed when ELFv2 becomes default, but there is no harm in committing it already. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D21136 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Mon Aug 5 13:22:15 2019 (r350588) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Mon Aug 5 13:28:21 2019 (r350589) @@ -437,7 +437,8 @@ OLD_FILES+=usr/share/man/man7/ldint.7.gz OLD_FILES+=usr/share/man/man7/binutils.7.gz .endif .endif -.if !defined(WITH_PORT_BASE_BINUTILS) +# powerpc64 still needs ld.bfd for 32-bit binaries/libraries +.if !defined(WITH_PORT_BASE_BINUTILS) && ${TARGET_ARCH} != "powerpc64" .if ${MK_BINUTILS} == no || ${MK_LLD_IS_LD} == yes OLD_FILES+=usr/bin/ld.bfd .endif From owner-svn-src-all@freebsd.org Mon Aug 5 15:24:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A196C5CC5; Mon, 5 Aug 2019 15:24:06 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462M4Q1YG2z3JDB; Mon, 5 Aug 2019 15:24:06 +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 F25C21DC08; Mon, 5 Aug 2019 15:24:05 +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 x75FO5aX013653; Mon, 5 Aug 2019 15:24:05 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75FO53o013652; Mon, 5 Aug 2019 15:24:05 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201908051524.x75FO53o013652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 5 Aug 2019 15:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350590 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 350590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 15:24:06 -0000 Author: kp Date: Mon Aug 5 15:24:05 2019 New Revision: 350590 URL: https://svnweb.freebsd.org/changeset/base/350590 Log: MFC r350416: riscv: Fix copyin/copyout r343275 introduced a performance optimisation to the copyin/copyout routines by attempting to copy word-per-word rather than byte-per-byte where possible. This optimisation failed to account for cases where the buffer is longer than XLEN_BYTES, but due to misalignment does not not allow for any word-sized copies. E.g. a 9 byte buffer (with XLEN_BYTES == 8) which is misaligned by 2 bytes. The code nevertheless did a single full-word copy, which meant we copied too much data. This potentially clobbered other data. This is most easily demonstrated by a simple `sysctl -a`. Fix it by not assuming that we'll always have at least one full-word copy to do, but instead checking the remaining length first. Sponsored by: Axiado Modified: stable/12/sys/riscv/riscv/copyinout.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/copyinout.S ============================================================================== --- stable/12/sys/riscv/riscv/copyinout.S Mon Aug 5 13:28:21 2019 (r350589) +++ stable/12/sys/riscv/riscv/copyinout.S Mon Aug 5 15:24:05 2019 (r350590) @@ -65,7 +65,7 @@ END(copyio_fault) ENTER_USER_ACCESS(a7) li t2, XLEN_BYTES - blt a2, t2, 3f /* Byte-copy if len < XLEN_BYTES */ + blt a2, t2, 4f /* Byte-copy if len < XLEN_BYTES */ /* * Compare lower bits of src and dest. @@ -73,7 +73,7 @@ END(copyio_fault) */ andi t0, a0, (XLEN_BYTES-1) /* Low bits of src */ andi t1, a1, (XLEN_BYTES-1) /* Low bits of dest */ - bne t0, t1, 3f /* Misaligned. Go to byte copy */ + bne t0, t1, 4f /* Misaligned. Go to byte copy */ beqz t0, 2f /* Already word-aligned, skip ahead */ /* Byte copy until the first word-aligned address */ @@ -84,6 +84,7 @@ END(copyio_fault) addi a2, a2, -1 /* len-- */ andi t0, a0, (XLEN_BYTES-1) bnez t0, 1b + j 3f /* Copy words */ 2: ld a4, 0(a0) /* Load word from src */ @@ -91,20 +92,20 @@ END(copyio_fault) sd a4, 0(a1) /* Store word in dest */ addi a1, a1, XLEN_BYTES addi a2, a2, -XLEN_BYTES /* len -= XLEN_BYTES */ - bgeu a2, t2, 2b /* Again if len >= XLEN_BYTES */ +3: bgeu a2, t2, 2b /* Again if len >= XLEN_BYTES */ /* Check if we're finished */ - beqz a2, 4f + beqz a2, 5f /* Copy any remaining bytes */ -3: lb a4, 0(a0) /* Load byte from src */ +4: lb a4, 0(a0) /* Load byte from src */ addi a0, a0, 1 sb a4, 0(a1) /* Store byte in dest */ addi a1, a1, 1 addi a2, a2, -1 /* len-- */ - bnez a2, 3b + bnez a2, 4b -4: EXIT_USER_ACCESS(a7) +5: EXIT_USER_ACCESS(a7) SET_FAULT_HANDLER(x0, a7) /* Clear the handler */ .endm From owner-svn-src-all@freebsd.org Mon Aug 5 15:56:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D93D0C665E; Mon, 5 Aug 2019 15:56:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Mp568GXz3LRh; Mon, 5 Aug 2019 15:56:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 962DF1E160; Mon, 5 Aug 2019 15:56:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75Fuj1K032279; Mon, 5 Aug 2019 15:56:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75FuiIX032274; Mon, 5 Aug 2019 15:56:44 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201908051556.x75FuiIX032274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 5 Aug 2019 15:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350591 - in head: share/man/man4 sys/conf sys/dev/iicbus sys/modules/i2c sys/modules/i2c/ads111x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/iicbus sys/modules/i2c sys/modules/i2c/ads111x X-SVN-Commit-Revision: 350591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 15:56:45 -0000 Author: ian Date: Mon Aug 5 15:56:44 2019 New Revision: 350591 URL: https://svnweb.freebsd.org/changeset/base/350591 Log: Add a driver for Texas Instruments ADS101x/ADS111x i2c ADC chips. Instances of the device can be configured using hints or FDT data. Interfaces to reconfigure the chip and extract voltage measurements from it are available via sysctl(8). Added: head/share/man/man4/ads111x.4 (contents, props changed) head/sys/dev/iicbus/ads111x.c (contents, props changed) head/sys/modules/i2c/ads111x/ head/sys/modules/i2c/ads111x/Makefile (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/modules/i2c/Makefile Added: head/share/man/man4/ads111x.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/ads111x.4 Mon Aug 5 15:56:44 2019 (r350591) @@ -0,0 +1,240 @@ +.\" +.\" Copyright (c) 2019 Ian Lepore +.\" +.\" 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$ +.\" +.Dd August 5, 2019 +.Dt ADS1115 4 +.Os +.Sh NAME +.Nm ads1115 +.Nd driver for ADS101x and ADS111x i2c analog to digital converters +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ads1115" +.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 +ads1115_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the ADS101x/ADS111x family of analog +to digital converter (ADC) devices. +The supported devices are all similar to each other, varying in +features such as resolution and number of input channels. +The devices offer a number of configuration options which can be +set via hints, FDT data, and +.Xr sysctl 8 . +.Pp +.Xr Sysctl 8 +provides access to the voltage measurements made by the device. +Each time the +.Va dev.ads1115...voltage +variable is accessed for a given channel, the driver switches the +chip's internal mux to choose the right input pins for that channel, +directs it to make a single measurement, and returns the measured value +in microvolts. +The amount of time required to make the measurement is a function +of the sampling rate configured for the device. +While device is directed to make a single measurement, it still averages +the input values for the same amount of time as it would to emit one +sample if it were in continuous mode. +For example, if the sample rate were configured as 125 samples per +second, a single measurement would require 8 milliseconds. +.Pp +For devices that support multiple input pins, the device datasheet +describes mux settings to control how those pins are interpeted when +making either single-ended or differential measurements. +There are eight possible ways to combine the inputs from the four pins. +The +.Nm +driver models that by creating a separate output channel for each of +the eight combinations. +To make a measurement on a given pin or pair of pins, you simply access +the voltage variable for the channel number that corresponds the mux +setting number (0 through 7) shown in the datasheet. +When the driver is configured with hints or FDT data, it creates +sysctl variables for just the channels specified in the config data. +When there is no channel config data, it creates all eight possible +channels so that you can access whichever one(s) you need. +.Pp +For devices that include an +.Va alert +output pin, the +.Nm +driver does not directly support the pin in terms of sensing or +acting on changes in the pin state. +However, you may connect the pin to a gpio input or fan controller +or other external device, and use the driver's sysctl variables to +configure behavior and threshold values for the pin. +The driver avoids perturbing your settings as it does other +manipulations to the config register. +.Sh SYSCTL VARIABLES +Sysctl variables are used to access the voltage measurements, and to +change the configuration of the channels. +All writeable variables may also be set as +.Xr loader 8 +tunables. +Channel numbers in these sysctl variables range from 0 through 7. +.Bl -tag -width indent +.It Va dev.ads1115..config +Provides access to the configuration register bits that control the +alert pin configuration. +Other bits which are controlled by the driver are masked out, and +cannot be viewed or changed using this variable. +.It Va dev.ads1115..lo_thresh +Sets the low threshold for activating the alert pin. +.It Va dev.ads1115..hi_thresh +Sets the high threshold for activating the alert pin. +.It Va dev.ads1115...rate_index +Sets the sample rate for the channel. +The device datasheet documents eight available sample rates, chosen +by setting a value of 0 through 7 into the corresponding control +register bits. +This variable sets the value used for those bits when making a +measurement on the given channel. +.Pp +Because measurements are always made in single-shot mode, think of +this variable as controlling the averaging time for a single sample; +the time to make a measurement is 1 / samplerate. +.It Va dev.ads1115...gain_index +Sets the programmable gain amplifier for the channel on devices +which have an internal amplifier. +The device datasheet documents eight available gain values, chosen +by setting a value of 0 through 7 into the corresponding control +register bits. +This variable sets the value used for those bits when making a +measurement on the given channel. +.It Va dev.ads1115...voltage +Reading this variable causes the device to make a measurement on +the corresponding input pin(s) and return the voltage in microvolts. +.Pp +Note that this variable does not appear when you list multiple +sysctl variables -- you must access it specifically by name, because +accessing it triggers device I/O. +.El +.Sh HARDWARE +The +.Nm +driver provides support for the following devices: +.Pp +.Bl -column -compact -offset indent "XXXXXXXX" "XXXXXXXX" +.It ADS1013 Ta ADS1113 +.It ADS1014 Ta ADS1114 +.It ADS1015 Ta ADS1115 +.El +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, the +.Nm +device is defined as a slave device subnode +of the i2c bus controller node. +All properties documented in the +.Va ads1115.txt +bindings document can be used with the +.Nm +device. +.Pp +The following properties are required in the +.Nm +device subnode: +.Bl -tag -width indent +.It Va compatible +One of the following: +.Bl -column -compact -offset indent ".Dq ti,ads1013" ".Dq ti,ads1113" +.It Dq ti,ads1013 Ta Dq ti,ads1113 +.It Dq ti,ads1014 Ta Dq ti,ads1114 +.It Dq ti,ads1015 Ta Dq ti,ads1115 +.El +.It Va reg +I2c slave address of device. +.El +.Pp +Specific channels can be configured by adding child nodes to the +.Nm +node, as described in the standard ads1115.txt bindings document. +If no channels are configured, sysctl variables will be created +for all possible channels supported by the device type, otherwise +only the specified channels are created. +.Ss Example including channel configuration +.Bd -unfilled -offset indent +adc@48 { + compatible = "ti,ads1115"; + reg = <0x48>; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + + channel@6 { + reg = <6>; + ti,gain = <3>; + ti,datarate = <4>; + }; + channel@7 { + reg = <7>; + ti,gain = <1>; + ti,datarate = <7>; + }; +}; +.Ed +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, such as +.Li MIPS , +these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.ads1115..at +The iicbus instance the +.Nm +instance is attached to. +.It Va hint.ads1115...gain_index +The amplifier gain, as described above for the sysctl variable +.Va dev.ads1115...gain_index . +.It Va hint.ads1115...rate_index +The sample rate, as described above for the sysctl variable +.Va dev.ads1115...rate_index . +.El +.Pp +If no channels are configured, sysctl variables will be created +for all possible channels supported by the device type, otherwise +only the specified channels are created. +.Sh SEE ALSO +.Xr fdt 4 , +.Xr sysctl 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 13.0 . Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Aug 5 15:24:05 2019 (r350590) +++ head/sys/conf/NOTES Mon Aug 5 15:56:44 2019 (r350591) @@ -2422,6 +2422,7 @@ device iicoc # OpenCores I2C controller support # I2C peripheral devices # device ad7418 # Analog Devices temp and voltage sensor +device ads111x # Texas Instruments ADS101x and ADS111x ADCs device ds1307 # Dallas DS1307 RTC and compatible device ds13rtc # All Dallas/Maxim ds13xx chips device ds1672 # Dallas DS1672 RTC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Aug 5 15:24:05 2019 (r350590) +++ head/sys/conf/files Mon Aug 5 15:56:44 2019 (r350591) @@ -1761,6 +1761,7 @@ dev/ida/ida.c optional ida dev/ida/ida_disk.c optional ida dev/ida/ida_pci.c optional ida pci dev/iicbus/ad7418.c optional ad7418 +dev/iicbus/ads111x.c optional ads111x dev/iicbus/ds1307.c optional ds1307 dev/iicbus/ds13rtc.c optional ds13rtc | ds133x | ds1374 dev/iicbus/ds1672.c optional ds1672 Added: head/sys/dev/iicbus/ads111x.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/ads111x.c Mon Aug 5 15:56:44 2019 (r350591) @@ -0,0 +1,582 @@ +/*- + * Copyright (c) 2019 Ian Lepore. + * + * 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. + */ + +/* + * Driver for Texas Instruments ADS101x and ADS111x family i2c ADC chips. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#endif + +#include +#include + +#include "iicbus_if.h" + +/* + * Chip registers, bit definitions, shifting and masking values. + */ +#define ADS111x_CONV 0 /* Reg 0: Latest sample (ro) */ + +#define ADS111x_CONF 1 /* Reg 1: Config (rw) */ +#define ADS111x_CONF_OS_SHIFT 15 /* Operational state */ +#define ADS111x_CONF_MUX_SHIFT 12 /* Input mux setting */ +#define ADS111x_CONF_GAIN_SHIFT 9 /* Programmable gain amp */ +#define ADS111x_CONF_MODE_SHIFT 8 /* Operational mode */ +#define ADS111x_CONF_RATE_SHIFT 5 /* Sample rate */ + +#define ADS111x_LOTHRESH 2 /* Compare lo threshold (rw) */ + +#define ADS111x_HITHRESH 3 /* Compare hi threshold (rw) */ + +/* + * On config write, the operational-state bit starts a measurement, on read it + * indicates when the measurement process is complete/idle. + */ +#define ADS111x_CONF_MEASURE (1u << ADS111x_CONF_OS_SHIFT) +#define ADS111x_CONF_IDLE (1u << ADS111x_CONF_OS_SHIFT) + +/* + * The default values for config items that are not per-channel. Mostly, this + * turns off the comparator on chips that have that feature, because this driver + * doesn't support it directly. However, the user is allowed to enable the + * comparator and we'll leave it alone if they do. That allows them connect the + * alert pin to something and use the feature without any help from this driver. + */ +#define ADS111x_CONF_DEFAULT (1 << ADS111x_CONF_MODE_SHIFT) +#define ADS111x_CONF_USERMASK 0x001f + +/* + * Per-channel defaults. The chip only has one control register, and we load + * per-channel values into it every time we make a measurement on that channel. + * These are the default values for the control register from the datasheet, for + * values we maintain on a per-channel basis. + */ +#define DEFAULT_GAINIDX 2 +#define DEFAULT_RATEIDX 4 + +/* + * Full-scale ranges for each available amplifier setting, in microvolts. The + * ADS1x13 chips are fixed-range, the other chips contain a programmable gain + * amplifier, and the full scale range is based on the amplifier setting. + */ +static const u_int fixedranges[8] = { + 2048000, 2048000, 2048000, 2048000, 2048000, 2048000, 2048000, 2048000, +}; +static const u_int gainranges[8] = { + 6144000, 4096000, 2048000, 1024000, 512000, 256000, 256000, 256000, +}; + +/* The highest value for the ADS101x chip is 0x7ff0, for ADS111x it's 0x7fff. */ +#define ADS101x_RANGEDIV ((1 << 15) - 15) +#define ADS111x_RANGEDIV ((1 << 15) - 1) + +/* Samples per second; varies based on chip type. */ +static const u_int rates101x[8] = {128, 250, 490, 920, 1600, 2400, 3300, 3300}; +static const u_int rates111x[8] = { 8, 16, 32, 64, 128, 250, 475, 860}; + +struct ads111x_channel { + u_int gainidx; /* Amplifier (full-scale range) config index */ + u_int rateidx; /* Samples per second config index */ + bool configured; /* Channel has been configured */ +}; + +#define ADS111x_MAX_CHANNELS 8 + +struct ads111x_chipinfo { + const char *name; + const u_int *rangetab; + const u_int *ratetab; + u_int numchan; + int rangediv; +}; + +static struct ads111x_chipinfo ads111x_chip_infos[] = { + { "ADS1013", fixedranges, rates101x, 1, ADS101x_RANGEDIV }, + { "ADS1014", gainranges, rates101x, 1, ADS101x_RANGEDIV }, + { "ADS1015", gainranges, rates101x, 8, ADS101x_RANGEDIV }, + { "ADS1113", fixedranges, rates111x, 1, ADS111x_RANGEDIV }, + { "ADS1114", gainranges, rates111x, 1, ADS111x_RANGEDIV }, + { "ADS1115", gainranges, rates111x, 8, ADS111x_RANGEDIV }, +}; + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + {"ti,ads1013", (uintptr_t)&ads111x_chip_infos[0]}, + {"ti,ads1014", (uintptr_t)&ads111x_chip_infos[1]}, + {"ti,ads1015", (uintptr_t)&ads111x_chip_infos[2]}, + {"ti,ads1113", (uintptr_t)&ads111x_chip_infos[3]}, + {"ti,ads1114", (uintptr_t)&ads111x_chip_infos[4]}, + {"ti,ads1115", (uintptr_t)&ads111x_chip_infos[5]}, + {NULL, (uintptr_t)NULL}, +}; +IICBUS_FDT_PNP_INFO(compat_data); +#endif + +struct ads111x_softc { + device_t dev; + struct sx lock; + int addr; + int cfgword; + const struct ads111x_chipinfo + *chipinfo; + struct ads111x_channel + channels[ADS111x_MAX_CHANNELS]; +}; + +static int +ads111x_write_2(struct ads111x_softc *sc, int reg, int val) +{ + uint8_t data[2]; + + be16enc(data, val); + + return (iic2errno(iicdev_writeto(sc->dev, reg, data, 2, IIC_WAIT))); +} + +static int +ads111x_read_2(struct ads111x_softc *sc, int reg, int *val) +{ + int err; + uint8_t data[2]; + + err = iic2errno(iicdev_readfrom(sc->dev, reg, data, 2, IIC_WAIT)); + if (err == 0) + *val = (int16_t)be16dec(data); + + return (err); +} + +static int +ads111x_sample_voltage(struct ads111x_softc *sc, int channum, int *voltage) +{ + struct ads111x_channel *chan; + int err, cfgword, convword, rate, waitns; + int64_t fsrange; + + chan = &sc->channels[channum]; + + /* Ask the chip to do a one-shot measurement of the given channel. */ + cfgword = sc->cfgword | + (1 << ADS111x_CONF_OS_SHIFT) | + (channum << ADS111x_CONF_MUX_SHIFT) | + (chan->gainidx << ADS111x_CONF_GAIN_SHIFT) | + (chan->rateidx << ADS111x_CONF_RATE_SHIFT); + if ((err = ads111x_write_2(sc, ADS111x_CONF, cfgword)) != 0) + return (err); + + /* + * Calculate how long it will take to make the measurement at the + * current sampling rate (round up), and sleep at least that long. + */ + rate = sc->chipinfo->ratetab[chan->rateidx]; + waitns = (1000000000 + rate - 1) / rate; + err = pause_sbt("ads111x", nstosbt(waitns), 0, C_PREL(2)); + if (err != 0 && err != EWOULDBLOCK) + return (err); + +#if 0 + /* + * Sanity-check that the measurement is complete. Not enabled by + * default because checking wastes 200-800us just in moving the status + * command and result across the i2c bus, which could double the time it + * takes to get one measurement. Unlike most i2c slaves, this device + * does not auto-increment the register number on reads, so we can't + * read both status and measurement in one operation. + */ + if ((err = ads111x_read_2(sc, ADS111x_CONF, &cfgword)) != 0) + return (err); + if (!(cfgword & ADS111x_CONF_IDLE)) + return (EIO); +#endif + + /* Retrieve the sample and convert it to microvolts. */ + if ((err = ads111x_read_2(sc, ADS111x_CONV, &convword)) != 0) + return (err); + fsrange = sc->chipinfo->rangetab[chan->gainidx]; + *voltage = (int)((convword * fsrange ) / sc->chipinfo->rangediv); + + return (err); +} + +static int +ads111x_sysctl_gainidx(SYSCTL_HANDLER_ARGS) +{ + struct ads111x_softc *sc; + int chan, err, gainidx; + + sc = arg1; + chan = arg2; + + gainidx = sc->channels[chan].gainidx; + err = sysctl_handle_int(oidp, &gainidx, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + if (gainidx < 0 || gainidx > 7) + return (EINVAL); + sx_xlock(&sc->lock); + sc->channels[chan].gainidx = gainidx; + sx_xunlock(&sc->lock); + + return (err); +} + +static int +ads111x_sysctl_rateidx(SYSCTL_HANDLER_ARGS) +{ + struct ads111x_softc *sc; + int chan, err, rateidx; + + sc = arg1; + chan = arg2; + + rateidx = sc->channels[chan].rateidx; + err = sysctl_handle_int(oidp, &rateidx, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + if (rateidx < 0 || rateidx > 7) + return (EINVAL); + sx_xlock(&sc->lock); + sc->channels[chan].rateidx = rateidx; + sx_xunlock(&sc->lock); + + return (err); +} + +static int +ads111x_sysctl_voltage(SYSCTL_HANDLER_ARGS) +{ + struct ads111x_softc *sc; + int chan, err, voltage; + + sc = arg1; + chan = arg2; + + if (req->oldptr != NULL) { + sx_xlock(&sc->lock); + err = ads111x_sample_voltage(sc, chan, &voltage); + sx_xunlock(&sc->lock); + if (err != 0) { + device_printf(sc->dev, + "conversion read failed, error %d\n", err); + return (err); + } + } + err = sysctl_handle_int(oidp, &voltage, 0, req); + return (err); +} + +static int +ads111x_sysctl_config(SYSCTL_HANDLER_ARGS) +{ + struct ads111x_softc *sc; + int config, err; + + sc = arg1; + config = sc->cfgword & ADS111x_CONF_USERMASK; + err = sysctl_handle_int(oidp, &config, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + sx_xlock(&sc->lock); + sc->cfgword = config & ADS111x_CONF_USERMASK; + err = ads111x_write_2(sc, ADS111x_CONF, sc->cfgword); + sx_xunlock(&sc->lock); + + return (err); +} +static int +ads111x_sysctl_lothresh(SYSCTL_HANDLER_ARGS) +{ + struct ads111x_softc *sc; + int thresh, err; + + sc = arg1; + if ((err = ads111x_read_2(sc, ADS111x_LOTHRESH, &thresh)) != 0) + return (err); + err = sysctl_handle_int(oidp, &thresh, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + sx_xlock(&sc->lock); + err = ads111x_write_2(sc, ADS111x_CONF, thresh); + sx_xunlock(&sc->lock); + + return (err); +} + +static int +ads111x_sysctl_hithresh(SYSCTL_HANDLER_ARGS) +{ + struct ads111x_softc *sc; + int thresh, err; + + sc = arg1; + if ((err = ads111x_read_2(sc, ADS111x_HITHRESH, &thresh)) != 0) + return (err); + err = sysctl_handle_int(oidp, &thresh, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + sx_xlock(&sc->lock); + err = ads111x_write_2(sc, ADS111x_CONF, thresh); + sx_xunlock(&sc->lock); + + return (err); +} + +static void +ads111x_setup_channel(struct ads111x_softc *sc, int chan, int gainidx, int rateidx) +{ + struct ads111x_channel *c; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *chantree, *devtree; + char chanstr[4]; + + c = &sc->channels[chan]; + c->gainidx = gainidx; + c->rateidx = rateidx; + + /* + * If setting up the channel for the first time, create channel's + * sysctl entries. We might have already configured the channel if + * config data for it exists in both FDT and hints. + */ + + if (c->configured) + return; + + ctx = device_get_sysctl_ctx(sc->dev); + devtree = device_get_sysctl_tree(sc->dev); + snprintf(chanstr, sizeof(chanstr), "%d", chan); + chantree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(devtree), OID_AUTO, + chanstr, CTLFLAG_RD, NULL, "channel data"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(chantree), OID_AUTO, + "gain_index", CTLTYPE_INT | CTLFLAG_RWTUN, sc, chan, + ads111x_sysctl_gainidx, "I", "programmable gain amp setting, 0-7"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(chantree), OID_AUTO, + "rate_index", CTLTYPE_INT | CTLFLAG_RWTUN, sc, chan, + ads111x_sysctl_rateidx, "I", "sample rate setting, 0-7"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(chantree), OID_AUTO, + "voltage", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_SKIP, sc, chan, + ads111x_sysctl_voltage, "I", "sampled voltage in microvolts"); + + c->configured = true; +} + +static void +ads111x_add_channels(struct ads111x_softc *sc) +{ + const char *name; + uint32_t chan, gainidx, num_added, rateidx, unit; + bool found; + +#ifdef FDT + phandle_t child, node; + + /* Configure any channels that have FDT data. */ + num_added = 0; + node = ofw_bus_get_node(sc->dev); + for (child = OF_child(node); child != 0; child = OF_peer(child)) { + if (OF_getencprop(child, "reg", &chan, sizeof(chan)) == -1) + continue; + if (chan >= ADS111x_MAX_CHANNELS) + continue; + gainidx = DEFAULT_GAINIDX; + rateidx = DEFAULT_RATEIDX; + OF_getencprop(child, "ti,gain", &gainidx, sizeof(gainidx)); + OF_getencprop(child, "ti,datarate", &rateidx, sizeof(rateidx)); + ads111x_setup_channel(sc, chan, gainidx, rateidx); + ++num_added; + } +#else + num_added = 0; +#endif + + /* Configure any channels that have hint data. */ + name = device_get_name(sc->dev); + unit = device_get_unit(sc->dev); + for (chan = 0; chan < sc->chipinfo->numchan; ++chan) { + found = false; + gainidx = DEFAULT_GAINIDX; + rateidx = DEFAULT_RATEIDX; + if (resource_int_value(name, unit, "gain_index", &gainidx) == 0) + found = true; + if (resource_int_value(name, unit, "rate_index", &gainidx) == 0) + found = true; + if (found) { + ads111x_setup_channel(sc, chan, gainidx, rateidx); + ++num_added; + } + } + + /* If any channels were configured via FDT or hints, we're done. */ + if (num_added > 0) + return; + + /* + * No channel config; add all possible channels using default values, + * and let the user configure the ones they want on the fly via sysctl. + */ + for (chan = 0; chan < sc->chipinfo->numchan; ++chan) { + gainidx = DEFAULT_GAINIDX; + rateidx = DEFAULT_RATEIDX; + ads111x_setup_channel(sc, chan, gainidx, rateidx); + } +} + +static const struct ads111x_chipinfo * +ads111x_find_chipinfo(device_t dev) +{ + const struct ads111x_chipinfo *info; + const char *chiptype; + int i; + +#ifdef FDT + if (ofw_bus_status_okay(dev)) { + info = (struct ads111x_chipinfo*) + ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (info != NULL) + return (info); + } +#endif + + /* For hinted devices, we must be told the chip type. */ + chiptype = NULL; + resource_string_value(device_get_name(dev), device_get_unit(dev), + "type", &chiptype); + if (chiptype != NULL) { + for (i = 0; i < nitems(ads111x_chip_infos); ++i) { + info = &ads111x_chip_infos[i]; + if (strcasecmp(chiptype, info->name) == 0) + return (info); + } + } + return (NULL); +} + +static int +ads111x_probe(device_t dev) +{ + const struct ads111x_chipinfo *info; + + info = ads111x_find_chipinfo(dev); + if (info != NULL) { + device_set_desc(dev, info->name); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +ads111x_attach(device_t dev) +{ + struct ads111x_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->addr = iicbus_get_addr(dev); + sc->cfgword = ADS111x_CONF_DEFAULT; + + sc->chipinfo = ads111x_find_chipinfo(sc->dev); + if (sc->chipinfo == NULL) { + device_printf(dev, + "cannot get chipinfo (but it worked during probe)"); + return (ENXIO); + } + + /* Set the default chip config. */ + if ((err = ads111x_write_2(sc, ADS111x_CONF, sc->cfgword)) != 0) { + device_printf(dev, "cannot write chip config register\n"); + return (err); + } + + /* Add the sysctl handler to set the chip configuration register. */ + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "config", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, + ads111x_sysctl_config, "I", "configuration register word"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "lo_thresh", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, + ads111x_sysctl_lothresh, "I", "comparator low threshold"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "hi_thresh", CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, + ads111x_sysctl_hithresh, "I", "comparator high threshold"); + + /* Set up channels based on metadata or default config. */ + ads111x_add_channels(sc); + + sx_init(&sc->lock, "ads111x"); + + return (0); +} + +static int +ads111x_detach(device_t dev) +{ + struct ads111x_softc *sc; + + sc = device_get_softc(dev); + + sx_destroy(&sc->lock); + return (0); +} + +static device_method_t ads111x_methods[] = { + DEVMETHOD(device_probe, ads111x_probe), + DEVMETHOD(device_attach, ads111x_attach), + DEVMETHOD(device_detach, ads111x_detach), + + DEVMETHOD_END, +}; + +static driver_t ads111x_driver = { + "ads111x", + ads111x_methods, + sizeof(struct ads111x_softc), +}; +static devclass_t ads111x_devclass; + +DRIVER_MODULE(ads111x, iicbus, ads111x_driver, ads111x_devclass, NULL, NULL); +MODULE_VERSION(ads111x, 1); +MODULE_DEPEND(ads111x, iicbus, 1, 1, 1); Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Mon Aug 5 15:24:05 2019 (r350590) +++ head/sys/modules/i2c/Makefile Mon Aug 5 15:56:44 2019 (r350591) @@ -1,6 +1,7 @@ # $FreeBSD$ SUBDIR = \ + ads111x \ controllers \ cyapa \ ds1307 \ Added: head/sys/modules/i2c/ads111x/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/ads111x/Makefile Mon Aug 5 15:56:44 2019 (r350591) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus + +KMOD= ads111x +SRCS= ads111x.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + iicbus_if.h \ + ofw_bus_if.h \ + opt_platform.h \ + +.include From owner-svn-src-all@freebsd.org Mon Aug 5 16:36:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D7A6C74F8; Mon, 5 Aug 2019 16:36:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Ngf17Djz3PdS; Mon, 5 Aug 2019 16:36:14 +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 0939D1E8A5; Mon, 5 Aug 2019 16:36:14 +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 x75GaEFj056584; Mon, 5 Aug 2019 16:36:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75GaBQV056573; Mon, 5 Aug 2019 16:36:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051636.x75GaBQV056573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 16:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350592 - in stable/12: release/arm64 release/tools sys/arm/allwinner sys/conf sys/dev/extres/phy X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12: release/arm64 release/tools sys/arm/allwinner sys/conf sys/dev/extres/phy X-SVN-Commit-Revision: 350592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 16:36:14 -0000 Author: manu Date: Mon Aug 5 16:36:11 2019 New Revision: 350592 URL: https://svnweb.freebsd.org/changeset/base/350592 Log: MFC r340845-r340848, r340971, r340981, r342076 r340845: Derive PHY class to new one specialized for USB PHY functions. Submitted by: mmel r340846: aw_usbphy: Convert to usbphy subclass Instead of routing the phy when enabling it, do the configuration and routing in the phynode_usb_set_mode function. While here, if we don't have a vbus detection method, enable the phy if requested. r340847: a10_ehci: Always set the phy to host mode r340848: axp8xx: Rework the enable part and add the GPIOXLDO regulators r340971: aw_usbphy: Do not error if it's not phy 0 Only phy0 can switch between host/otg, do not error if we request host mode on phy != 0. X-MFC with: r340846 r340981: release: arm64: Add PINEBOOK config Add a configuration for PINEBOOK image. Pinebook is a arm64 laptop based on a Pine64 board. Since the usb trackpad need a quirk, add a common function for adding quirk for arm board. A default one is supplied as most board to not need quirks. Reviewed by: gjb Differential Revision: https://reviews.freebsd.org/D18337 r342076: arm64: allwinner: axp81x: Fix double invertion for FLDO1 This fix booting on A64 boards when disabling the unused regulators at boot. We did disable all the regulator handled by register 0x13 which of course contain mandatory regulators for the board to be up. Reported by: Mark Millard X-MFC-With: r340848 Added: stable/12/release/arm64/PINEBOOK.conf - copied unchanged from r340981, head/release/arm64/PINEBOOK.conf stable/12/sys/dev/extres/phy/phy_internal.h - copied unchanged from r340848, head/sys/dev/extres/phy/phy_internal.h stable/12/sys/dev/extres/phy/phy_usb.c - copied unchanged from r340848, head/sys/dev/extres/phy/phy_usb.c stable/12/sys/dev/extres/phy/phy_usb.h - copied unchanged from r340848, head/sys/dev/extres/phy/phy_usb.h stable/12/sys/dev/extres/phy/phynode_usb_if.m - copied unchanged from r340848, head/sys/dev/extres/phy/phynode_usb_if.m Modified: stable/12/release/tools/arm.subr stable/12/sys/arm/allwinner/a10_ehci.c stable/12/sys/arm/allwinner/aw_usbphy.c stable/12/sys/arm/allwinner/axp81x.c stable/12/sys/conf/files stable/12/sys/dev/extres/phy/phy.c Directory Properties: stable/12/ (props changed) Copied: stable/12/release/arm64/PINEBOOK.conf (from r340981, head/release/arm64/PINEBOOK.conf) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/release/arm64/PINEBOOK.conf Mon Aug 5 16:36:11 2019 (r350592, copy of r340981, head/release/arm64/PINEBOOK.conf) @@ -0,0 +1,42 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +EMBEDDED_TARGET_ARCH="aarch64" +EMBEDDED_TARGET="arm64" +EMBEDDEDBUILD=1 +EMBEDDEDPORTS="sysutils/u-boot-pinebook" +FAT_SIZE="54m -b 1m" +FAT_TYPE="16" +IMAGE_SIZE="2560M" +KERNEL="GENERIC" +MD_ARGS="-x 63 -y 255" +NODOC=1 +PART_SCHEME="MBR" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +export BOARDNAME="PINEBOOK" + +arm_install_uboot() { + UBOOT_DIR="/usr/local/share/u-boot/u-boot-pinebook" + UBOOT_FILES="u-boot-sunxi-with-spl.bin" + chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ + of=/dev/${mddev} bs=1k seek=8 conv=sync + + return 0 +} + +arm_do_quirk() { + echo '# Enable quirk for trackpad' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'usb_quirk_load=YES' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'ums_load=YES' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + echo 'hw.usb.quirk="0x258a 0x000c 0x0000 0xffff UQ_CFG_INDEX=1"' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf + # We want EFIFB but there is no node and so we cannot know + # which regulator is used for powering lcd/hdmi + echo 'hw.regulator.disable_unused=0' \ + >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf +} Modified: stable/12/release/tools/arm.subr ============================================================================== --- stable/12/release/tools/arm.subr Mon Aug 5 15:56:44 2019 (r350591) +++ stable/12/release/tools/arm.subr Mon Aug 5 16:36:11 2019 (r350592) @@ -174,6 +174,7 @@ arm_install_base() { arm64_setup_multicons arm_setup_fdt_overlays arm_setup_minimal_loader + arm_do_quirk echo '# Custom /etc/fstab for FreeBSD embedded images' \ > ${CHROOTDIR}/${DESTDIR}/etc/fstab @@ -237,4 +238,8 @@ arm_install_uboot() { # Override in the arm/KERNEL.conf file. return 0 +} + +arm_do_quirk() { + # Override in the arm{,64}/BOARD.conf file. } Modified: stable/12/sys/arm/allwinner/a10_ehci.c ============================================================================== --- stable/12/sys/arm/allwinner/a10_ehci.c Mon Aug 5 15:56:44 2019 (r350591) +++ stable/12/sys/arm/allwinner/a10_ehci.c Mon Aug 5 16:36:11 2019 (r350592) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #define EHCI_HC_DEVSTR "Allwinner Integrated USB 2.0 controller" @@ -242,6 +242,11 @@ a10_ehci_attach(device_t self) /* Enable USB PHY */ if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) { + err = phy_usb_set_mode(aw_sc->phy, PHY_USB_MODE_HOST); + if (err != 0) { + device_printf(self, "Could not set phy to host mode\n"); + goto error; + } err = phy_enable(aw_sc->phy); if (err != 0) { device_printf(self, "Could not enable phy\n"); Modified: stable/12/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_usbphy.c Mon Aug 5 15:56:44 2019 (r350591) +++ stable/12/sys/arm/allwinner/aw_usbphy.c Mon Aug 5 16:36:11 2019 (r350592) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include "phynode_if.h" @@ -139,17 +139,22 @@ struct awusbphy_softc { gpio_pin_t vbus_det_pin; int vbus_det_valid; struct aw_usbphy_conf *phy_conf; + int mode; }; /* Phy class and methods. */ static int awusbphy_phy_enable(struct phynode *phy, bool enable); -static phynode_method_t awusbphy_phynode_methods[] = { +static int awusbphy_get_mode(struct phynode *phy, int *mode); +static int awusbphy_set_mode(struct phynode *phy, int mode); +static phynode_usb_method_t awusbphy_phynode_methods[] = { PHYNODEMETHOD(phynode_enable, awusbphy_phy_enable), + PHYNODEMETHOD(phynode_usb_get_mode, awusbphy_get_mode), + PHYNODEMETHOD(phynode_usb_set_mode, awusbphy_set_mode), PHYNODEMETHOD_END }; DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_class, awusbphy_phynode_methods, - 0, phynode_class); + sizeof(struct phynode_usb_sc), phynode_usb_class); #define RD4(res, o) bus_read_4(res, (o)) #define WR4(res, o, v) bus_write_4(res, (o), (v)) @@ -165,6 +170,18 @@ DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_clas #define PMU_ULPI_BYPASS (1 << 0) #define PMU_UNK_H3 0x10 #define PMU_UNK_H3_CLR 0x2 +#define PHY_CSR 0x00 +#define ID_PULLUP_EN (1 << 17) +#define DPDM_PULLUP_EN (1 << 16) +#define FORCE_ID (0x3 << 14) +#define FORCE_ID_SHIFT 14 +#define FORCE_ID_LOW 2 +#define FORCE_VBUS_VALID (0x3 << 12) +#define FORCE_VBUS_VALID_SHIFT 12 +#define FORCE_VBUS_VALID_HIGH 3 +#define VBUS_CHANGE_DET (1 << 6) +#define ID_CHANGE_DET (1 << 5) +#define DPDM_CHANGE_DET (1 << 4) static void awusbphy_configure(device_t dev, int phyno) @@ -287,7 +304,7 @@ awusbphy_vbus_detect(device_t dev, int *val) return (0); } - *val = 1; + *val = 0; return (0); } @@ -315,30 +332,22 @@ awusbphy_phy_enable(struct phynode *phynode, bool enab if (reg == NULL) return (0); - if (enable) { + if (phy == 0) { /* If an external vbus is detected, do not enable phy 0 */ - if (phy == 0) { - error = awusbphy_vbus_detect(dev, &vbus_det); - if (error) - goto out; + error = awusbphy_vbus_detect(dev, &vbus_det); + if (error) + goto out; - /* Depending on the PHY we need to route OTG to OHCI/EHCI */ - if (sc->phy_conf->phy0_route == true) { - if (vbus_det == 0) - /* Host mode */ - CLR4(sc->phy_ctrl, OTG_PHY_CFG, - OTG_PHY_ROUTE_OTG); - else - /* Peripheral mode */ - SET4(sc->phy_ctrl, OTG_PHY_CFG, - OTG_PHY_ROUTE_OTG); - } - if (vbus_det == 1) - return (0); - } else - error = 0; - if (error == 0) - error = regulator_enable(reg); + if (vbus_det == 1) { + if (bootverbose) + device_printf(dev, "External VBUS detected, not enabling the regulator\n"); + + return (0); + } + } + if (enable) { + /* Depending on the PHY we need to route OTG to OHCI/EHCI */ + error = regulator_enable(reg); } else error = regulator_disable(reg); @@ -350,6 +359,73 @@ out: return (error); } + return (0); +} + +static int +awusbphy_get_mode(struct phynode *phynode, int *mode) +{ + struct awusbphy_softc *sc; + device_t dev; + + dev = phynode_get_device(phynode); + sc = device_get_softc(dev); + + *mode = sc->mode; + + return (0); +} + +static int +awusbphy_set_mode(struct phynode *phynode, int mode) +{ + device_t dev; + intptr_t phy; + struct awusbphy_softc *sc; + uint32_t val; + int error, vbus_det; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy != 0) { + if (mode != PHY_USB_MODE_HOST) + return (EINVAL); + return (0); + } + + switch (mode) { + case PHY_USB_MODE_HOST: + val = bus_read_4(sc->phy_ctrl, PHY_CSR); + val &= ~(VBUS_CHANGE_DET | ID_CHANGE_DET | DPDM_CHANGE_DET); + val |= (ID_PULLUP_EN | DPDM_PULLUP_EN); + val &= ~FORCE_ID; + val |= (FORCE_ID_LOW << FORCE_ID_SHIFT); + val &= ~FORCE_VBUS_VALID; + val |= (FORCE_VBUS_VALID_HIGH << FORCE_VBUS_VALID_SHIFT); + bus_write_4(sc->phy_ctrl, PHY_CSR, val); + if (sc->phy_conf->phy0_route == true) { + error = awusbphy_vbus_detect(dev, &vbus_det); + if (error) + goto out; + if (vbus_det == 0) + CLR4(sc->phy_ctrl, OTG_PHY_CFG, + OTG_PHY_ROUTE_OTG); + else + SET4(sc->phy_ctrl, OTG_PHY_CFG, + OTG_PHY_ROUTE_OTG); + } + break; + case PHY_USB_MODE_OTG: + /* TODO */ + break; + } + + sc->mode = mode; + + +out: return (0); } Modified: stable/12/sys/arm/allwinner/axp81x.c ============================================================================== --- stable/12/sys/arm/allwinner/axp81x.c Mon Aug 5 15:56:44 2019 (r350591) +++ stable/12/sys/arm/allwinner/axp81x.c Mon Aug 5 16:36:11 2019 (r350592) @@ -126,12 +126,16 @@ MALLOC_DEFINE(M_AXP8XX_REG, "AXP8xx regulator", "AXP8x #define AXP_IRQSTAT5 0x4c #define AXP_IRQSTAT5_POKSIRQ (1 << 4) #define AXP_GPIO0_CTRL 0x90 +#define AXP_GPIO0LDO_CTRL 0x91 #define AXP_GPIO1_CTRL 0x92 +#define AXP_GPIO1LDO_CTRL 0x93 #define AXP_GPIO_FUNC (0x7 << 0) #define AXP_GPIO_FUNC_SHIFT 0 #define AXP_GPIO_FUNC_DRVLO 0 #define AXP_GPIO_FUNC_DRVHI 1 #define AXP_GPIO_FUNC_INPUT 2 +#define AXP_GPIO_FUNC_LDO_ON 3 +#define AXP_GPIO_FUNC_LDO_OFF 4 #define AXP_GPIO_SIGBIT 0x94 #define AXP_GPIO_PD 0x97 @@ -166,6 +170,8 @@ struct axp8xx_regdef { char *supply_name; uint8_t enable_reg; uint8_t enable_mask; + uint8_t enable_value; + uint8_t disable_value; uint8_t voltage_reg; int voltage_min; int voltage_max; @@ -197,6 +203,8 @@ enum axp8xx_reg_id { AXP8XX_REG_ID_FLDO1, AXP8XX_REG_ID_FLDO2, AXP813_REG_ID_FLDO3, + AXP8XX_REG_ID_GPIO0_LDO, + AXP8XX_REG_ID_GPIO1_LDO, }; static struct axp8xx_regdef axp803_regdefs[] = { @@ -204,7 +212,8 @@ static struct axp8xx_regdef axp803_regdefs[] = { .id = AXP803_REG_ID_DC1SW, .name = "dc1sw", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DC1SW, + .enable_mask = (uint8_t) AXP_POWERCTL2_DC1SW, + .enable_value = AXP_POWERCTL2_DC1SW, }, }; @@ -213,7 +222,8 @@ static struct axp8xx_regdef axp813_regdefs[] = { .id = AXP813_REG_ID_DCDC7, .name = "dcdc7", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC7, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC7, + .enable_value = AXP_POWERCTL1_DCDC7, .voltage_reg = AXP_VOLTCTL_DCDC7, .voltage_min = 600, .voltage_max = 1520, @@ -229,7 +239,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC1, .name = "dcdc1", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC1, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC1, + .enable_value = AXP_POWERCTL1_DCDC1, .voltage_reg = AXP_VOLTCTL_DCDC1, .voltage_min = 1600, .voltage_max = 3400, @@ -240,7 +251,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC2, .name = "dcdc2", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC2, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC2, + .enable_value = AXP_POWERCTL1_DCDC2, .voltage_reg = AXP_VOLTCTL_DCDC2, .voltage_min = 500, .voltage_max = 1300, @@ -253,7 +265,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC3, .name = "dcdc3", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC3, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC3, + .enable_value = AXP_POWERCTL1_DCDC3, .voltage_reg = AXP_VOLTCTL_DCDC3, .voltage_min = 500, .voltage_max = 1300, @@ -266,7 +279,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC4, .name = "dcdc4", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC4, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC4, + .enable_value = AXP_POWERCTL1_DCDC4, .voltage_reg = AXP_VOLTCTL_DCDC4, .voltage_min = 500, .voltage_max = 1300, @@ -279,7 +293,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC5, .name = "dcdc5", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC5, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC5, + .enable_value = AXP_POWERCTL1_DCDC5, .voltage_reg = AXP_VOLTCTL_DCDC5, .voltage_min = 800, .voltage_max = 1840, @@ -292,7 +307,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DCDC6, .name = "dcdc6", .enable_reg = AXP_POWERCTL1, - .enable_mask = AXP_POWERCTL1_DCDC6, + .enable_mask = (uint8_t) AXP_POWERCTL1_DCDC6, + .enable_value = AXP_POWERCTL1_DCDC6, .voltage_reg = AXP_VOLTCTL_DCDC6, .voltage_min = 600, .voltage_max = 1520, @@ -305,7 +321,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO1, .name = "dldo1", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO1, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO1, + .enable_value = AXP_POWERCTL2_DLDO1, .voltage_reg = AXP_VOLTCTL_DLDO1, .voltage_min = 700, .voltage_max = 3300, @@ -316,7 +333,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO2, .name = "dldo2", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO2, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO2, + .enable_value = AXP_POWERCTL2_DLDO2, .voltage_reg = AXP_VOLTCTL_DLDO2, .voltage_min = 700, .voltage_max = 4200, @@ -329,7 +347,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO3, .name = "dldo3", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO3, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO3, + .enable_value = AXP_POWERCTL2_DLDO3, .voltage_reg = AXP_VOLTCTL_DLDO3, .voltage_min = 700, .voltage_max = 3300, @@ -340,7 +359,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_DLDO4, .name = "dldo4", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_DLDO4, + .enable_mask = (uint8_t) AXP_POWERCTL2_DLDO4, + .enable_value = AXP_POWERCTL2_DLDO4, .voltage_reg = AXP_VOLTCTL_DLDO4, .voltage_min = 700, .voltage_max = 3300, @@ -351,7 +371,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO1, .name = "aldo1", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO1, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO1, + .enable_value = AXP_POWERCTL3_ALDO1, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -361,7 +382,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO2, .name = "aldo2", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO2, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO2, + .enable_value = AXP_POWERCTL3_ALDO2, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -371,7 +393,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ALDO3, .name = "aldo3", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_ALDO3, + .enable_mask = (uint8_t) AXP_POWERCTL3_ALDO3, + .enable_value = AXP_POWERCTL3_ALDO3, .voltage_min = 700, .voltage_max = 3300, .voltage_step1 = 100, @@ -381,7 +404,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO1, .name = "eldo1", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO1, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO1, + .enable_value = AXP_POWERCTL2_ELDO1, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -391,7 +415,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO2, .name = "eldo2", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO2, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO2, + .enable_value = AXP_POWERCTL2_ELDO2, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -401,7 +426,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_ELDO3, .name = "eldo3", .enable_reg = AXP_POWERCTL2, - .enable_mask = AXP_POWERCTL2_ELDO3, + .enable_mask = (uint8_t) AXP_POWERCTL2_ELDO3, + .enable_value = AXP_POWERCTL2_ELDO3, .voltage_min = 700, .voltage_max = 1900, .voltage_step1 = 50, @@ -411,7 +437,8 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_FLDO1, .name = "fldo1", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_FLDO1, + .enable_mask = (uint8_t) AXP_POWERCTL3_FLDO1, + .enable_value = AXP_POWERCTL3_FLDO1, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, @@ -421,12 +448,39 @@ static struct axp8xx_regdef axp8xx_common_regdefs[] = .id = AXP8XX_REG_ID_FLDO2, .name = "fldo2", .enable_reg = AXP_POWERCTL3, - .enable_mask = AXP_POWERCTL3_FLDO2, + .enable_mask = (uint8_t) AXP_POWERCTL3_FLDO2, + .enable_value = AXP_POWERCTL3_FLDO2, .voltage_min = 700, .voltage_max = 1450, .voltage_step1 = 50, .voltage_nstep1 = 15, }, + { + .id = AXP8XX_REG_ID_GPIO0_LDO, + .name = "ldo-io0", + .enable_reg = AXP_GPIO0_CTRL, + .enable_mask = (uint8_t) AXP_GPIO_FUNC, + .enable_value = AXP_GPIO_FUNC_LDO_ON, + .disable_value = AXP_GPIO_FUNC_LDO_OFF, + .voltage_reg = AXP_GPIO0LDO_CTRL, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, + { + .id = AXP8XX_REG_ID_GPIO1_LDO, + .name = "ldo-io1", + .enable_reg = AXP_GPIO1_CTRL, + .enable_mask = (uint8_t) AXP_GPIO_FUNC, + .enable_value = AXP_GPIO_FUNC_LDO_ON, + .disable_value = AXP_GPIO_FUNC_LDO_OFF, + .voltage_reg = AXP_GPIO1LDO_CTRL, + .voltage_min = 700, + .voltage_max = 3300, + .voltage_step1 = 100, + .voltage_nstep1 = 26, + }, }; struct axp8xx_softc; @@ -520,10 +574,15 @@ axp8xx_regnode_enable(struct regnode *regnode, bool en sc->def->name); axp8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); + val &= ~sc->def->enable_mask; if (enable) - val |= sc->def->enable_mask; - else - val &= ~sc->def->enable_mask; + val |= sc->def->enable_value; + else { + if (sc->def->disable_value) + val |= sc->def->disable_value; + else + val &= ~sc->def->enable_value; + } axp8xx_write(sc->base_dev, sc->def->enable_reg, val); *udelay = 0; Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Mon Aug 5 15:56:44 2019 (r350591) +++ stable/12/sys/conf/files Mon Aug 5 16:36:11 2019 (r350592) @@ -1756,6 +1756,8 @@ dev/extres/clk/clk_mux.c optional ext_resources clk fd dev/extres/phy/phy.c optional ext_resources phy fdt dev/extres/phy/phydev_if.m optional ext_resources phy fdt dev/extres/phy/phynode_if.m optional ext_resources phy fdt +dev/extres/phy/phy_usb.c optional ext_resources phy fdt +dev/extres/phy/phynode_usb_if.m optional ext_resources phy fdt dev/extres/hwreset/hwreset.c optional ext_resources hwreset fdt dev/extres/hwreset/hwreset_if.m optional ext_resources hwreset fdt dev/extres/nvmem/nvmem.c optional ext_resources nvmem fdt Modified: stable/12/sys/dev/extres/phy/phy.c ============================================================================== --- stable/12/sys/dev/extres/phy/phy.c Mon Aug 5 15:56:44 2019 (r350591) +++ stable/12/sys/dev/extres/phy/phy.c Mon Aug 5 16:36:11 2019 (r350592) @@ -43,18 +43,12 @@ __FBSDID("$FreeBSD$"); #endif #include +#include #include "phydev_if.h" MALLOC_DEFINE(M_PHY, "phy", "Phy framework"); -/* Forward declarations. */ -struct phy; -struct phynode; - -typedef TAILQ_HEAD(phynode_list, phynode) phynode_list_t; -typedef TAILQ_HEAD(phy_list, phy) phy_list_t; - /* Default phy methods. */ static int phynode_method_init(struct phynode *phynode); static int phynode_method_enable(struct phynode *phynode, bool disable); @@ -73,52 +67,9 @@ static phynode_method_t phynode_methods[] = { }; DEFINE_CLASS_0(phynode, phynode_class, phynode_methods, 0); -/* - * Phy node - */ -struct phynode { - KOBJ_FIELDS; - - TAILQ_ENTRY(phynode) phylist_link; /* Global list entry */ - phy_list_t consumers_list; /* Consumers list */ - - - /* Details of this device. */ - const char *name; /* Globally unique name */ - - device_t pdev; /* Producer device_t */ - void *softc; /* Producer softc */ - intptr_t id; /* Per producer unique id */ -#ifdef FDT - phandle_t ofw_node; /* OFW node of phy */ -#endif - struct sx lock; /* Lock for this phy */ - int ref_cnt; /* Reference counter */ - int enable_cnt; /* Enabled counter */ -}; - -struct phy { - device_t cdev; /* consumer device*/ - struct phynode *phynode; - TAILQ_ENTRY(phy) link; /* Consumers list entry */ - - int enable_cnt; -}; - static phynode_list_t phynode_list = TAILQ_HEAD_INITIALIZER(phynode_list); -static struct sx phynode_topo_lock; SX_SYSINIT(phy_topology, &phynode_topo_lock, "Phy topology lock"); - -#define PHY_TOPO_SLOCK() sx_slock(&phynode_topo_lock) -#define PHY_TOPO_XLOCK() sx_xlock(&phynode_topo_lock) -#define PHY_TOPO_UNLOCK() sx_unlock(&phynode_topo_lock) -#define PHY_TOPO_ASSERT() sx_assert(&phynode_topo_lock, SA_LOCKED) -#define PHY_TOPO_XASSERT() sx_assert(&phynode_topo_lock, SA_XLOCKED) - -#define PHYNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) -#define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) -#define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) /* ---------------------------------------------------------------------------- * Copied: stable/12/sys/dev/extres/phy/phy_internal.h (from r340848, head/sys/dev/extres/phy/phy_internal.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/extres/phy/phy_internal.h Mon Aug 5 16:36:11 2019 (r350592, copy of r340848, head/sys/dev/extres/phy/phy_internal.h) @@ -0,0 +1,83 @@ +/*- + * Copyright 2018 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_EXTRES_PHY_INTERNAL_H +#define DEV_EXTRES_PHY_INTERNAL_H + +/* Forward declarations. */ +struct phy; +struct phynode; + +typedef TAILQ_HEAD(phynode_list, phynode) phynode_list_t; +typedef TAILQ_HEAD(phy_list, phy) phy_list_t; + +/* + * Phy node + */ +struct phynode { + KOBJ_FIELDS; + + TAILQ_ENTRY(phynode) phylist_link; /* Global list entry */ + phy_list_t consumers_list; /* Consumers list */ + + + /* Details of this device. */ + const char *name; /* Globally unique name */ + + device_t pdev; /* Producer device_t */ + void *softc; /* Producer softc */ + intptr_t id; /* Per producer unique id */ +#ifdef FDT + phandle_t ofw_node; /* OFW node of phy */ +#endif + struct sx lock; /* Lock for this phy */ + int ref_cnt; /* Reference counter */ + int enable_cnt; /* Enabled counter */ +}; + +struct phy { + device_t cdev; /* consumer device*/ + struct phynode *phynode; + TAILQ_ENTRY(phy) link; /* Consumers list entry */ + + int enable_cnt; +}; + + +#define PHY_TOPO_SLOCK() sx_slock(&phynode_topo_lock) +#define PHY_TOPO_XLOCK() sx_xlock(&phynode_topo_lock) +#define PHY_TOPO_UNLOCK() sx_unlock(&phynode_topo_lock) +#define PHY_TOPO_ASSERT() sx_assert(&phynode_topo_lock, SA_LOCKED) +#define PHY_TOPO_XASSERT() sx_assert(&phynode_topo_lock, SA_XLOCKED) + +#define PHYNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) +#define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) +#define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) + +struct sx phynode_topo_lock; + +#endif /* DEV_EXTRES_PHY_INTERNAL_H */ Copied: stable/12/sys/dev/extres/phy/phy_usb.c (from r340848, head/sys/dev/extres/phy/phy_usb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/extres/phy/phy_usb.c Mon Aug 5 16:36:11 2019 (r350592, copy of r340848, head/sys/dev/extres/phy/phy_usb.c) @@ -0,0 +1,149 @@ +/*- + * Copyright 2018 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + + +#include +#include + +#include "phydev_if.h" + +/* + * USB phy controller methods. + */ +static phynode_usb_method_t phynode_usb_methods[] = { + + PHYNODEUSBMETHOD_END +}; +DEFINE_CLASS_1(phynode_usb, phynode_usb_class, phynode_usb_methods, + 0, phynode_class); + +/* + * Create and initialize phy object, but do not register it. + */ +struct phynode * +phynode_usb_create(device_t pdev, phynode_class_t phynode_class, + struct phynode_usb_init_def *def) + +{ + struct phynode *phynode; + struct phynode_usb_sc *sc; + + phynode = phynode_create(pdev, phynode_class, &def->phynode_init_def); + if (phynode == NULL) + return (NULL); + sc = phynode_get_softc(phynode); + sc->std_param = def->std_param; + return (phynode); +} + +struct phynode +*phynode_usb_register(struct phynode *phynode) +{ + + return (phynode_register(phynode)); +} + +/* -------------------------------------------------------------------------- + * + * Real consumers executive + * + */ + +/* + * Set USB phy mode. (PHY_USB_MODE_*) + */ +int +phynode_usb_set_mode(struct phynode *phynode, int usb_mode) +{ + int rv; + + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + rv = PHYNODE_USB_SET_MODE(phynode, usb_mode); + PHYNODE_UNLOCK(phynode); + return (rv); +} + +/* + * Get USB phy mode. (PHY_USB_MODE_*) + */ +int +phynode_usb_get_mode(struct phynode *phynode, int *usb_mode) +{ + int rv; + + PHY_TOPO_ASSERT(); + + PHYNODE_XLOCK(phynode); + rv = PHYNODE_USB_GET_MODE(phynode, usb_mode); + PHYNODE_UNLOCK(phynode); + return (rv); +} + + /* -------------------------------------------------------------------------- + * + * USB phy consumers interface. + * + */ +int phy_usb_set_mode(phy_t phy, int usb_mode) +{ + int rv; + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_usb_set_mode(phynode, usb_mode); + PHY_TOPO_UNLOCK(); + return (rv); +} + +int phy_usb_get_mode(phy_t phy, int *usb_mode) +{ + int rv; + struct phynode *phynode; + + phynode = phy->phynode; + KASSERT(phynode->ref_cnt > 0, + ("Attempt to access unreferenced phy.\n")); + + PHY_TOPO_SLOCK(); + rv = phynode_usb_get_mode(phynode, usb_mode); + PHY_TOPO_UNLOCK(); + return (rv); +} Copied: stable/12/sys/dev/extres/phy/phy_usb.h (from r340848, head/sys/dev/extres/phy/phy_usb.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/extres/phy/phy_usb.h Mon Aug 5 16:36:11 2019 (r350592, copy of r340848, head/sys/dev/extres/phy/phy_usb.h) @@ -0,0 +1,85 @@ +/*- + * Copyright 2018 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _DEV_EXTRES_PHY_USB_H_ +#define _DEV_EXTRES_PHY_USB_H_ + +#include +#include "phynode_usb_if.h" + +#define PHY_USB_MODE_UNKNOWN 0 +#define PHY_USB_MODE_HOST 1 +#define PHY_USB_MODE_OTG 2 +#define PHY_USB_MODE_DEVICE 3 + +/* Standard USB phy parameters. */ +struct phynode_usb_std_param { + int usb_mode; +}; + +struct phynode_usb_sc { + struct phynode_usb_std_param std_param; +}; + +/* Initialization parameters. */ +struct phynode_usb_init_def { + struct phynode_init_def phynode_init_def; + struct phynode_usb_std_param std_param; /* Standard parameters */ +}; + + +/* + * Shorthands for constructing method tables. + */ +#define PHYNODEUSBMETHOD KOBJMETHOD +#define PHYNODEUSBMETHOD_END KOBJMETHOD_END +#define phynode_usb_method_t kobj_method_t +#define phynode_usb_class_t kobj_class_t +DECLARE_CLASS(phynode_usb_class); + +struct phynode *phynode_usb_create(device_t pdev, phynode_class_t phynode_class, + struct phynode_usb_init_def *def); +struct phynode *phynode_usb_register(struct phynode *phynode); + +#if 0 +/* XXX to be implemented */ +#ifdef FDT +int phynode_usb_parse_ofw_stdparam(device_t dev, phandle_t node, + struct phynode_usb_init_def *def); +#endif +#endif + +/* Phynode functions. */ +int phynode_usb_set_mode(struct phynode *phynode, int usb_mode); +int phynode_usb_get_mode(struct phynode *phynode, int *usb_mode); + +/* Consumer functions. */ +int phy_usb_set_mode(phy_t phy, int usb_mode); +int phy_usb_get_mode(phy_t phy, int *usb_mode); + +#endif /*_DEV_EXTRES_PHY_USB_H_*/ Copied: stable/12/sys/dev/extres/phy/phynode_usb_if.m (from r340848, head/sys/dev/extres/phy/phynode_usb_if.m) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/extres/phy/phynode_usb_if.m Mon Aug 5 16:36:11 2019 (r350592, copy of r340848, head/sys/dev/extres/phy/phynode_usb_if.m) @@ -0,0 +1,51 @@ +#- +# Copyright 2018 Michal Meloun +# 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$ +# + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 5 16:48:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94C32C78E6; Mon, 5 Aug 2019 16:48:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462NxZ3Svfz3QGj; Mon, 5 Aug 2019 16:48:18 +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 542AF1EA6F; Mon, 5 Aug 2019 16:48:18 +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 x75GmIox062613; Mon, 5 Aug 2019 16:48:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75GmGdd062605; Mon, 5 Aug 2019 16:48:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051648.x75GmGdd062605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 16:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350593 - in stable/12: release/arm64 sys/arm64/conf sys/dev/extres/clk sys/dev/extres/regulator sys/dts/arm64/overlays X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12: release/arm64 sys/arm64/conf sys/dev/extres/clk sys/dev/extres/regulator sys/dts/arm64/overlays X-SVN-Commit-Revision: 350593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 16:48:18 -0000 Author: manu Date: Mon Aug 5 16:48:16 2019 New Revision: 350593 URL: https://svnweb.freebsd.org/changeset/base/350593 Log: MFC r340987, r340989, r341254, r341269, r341333 r340987: arm64: Add evdev support to GENERIC r340989: regulator_fixed: Do not disable fixed regulator at probe If the regulator is unused it will be disabled by the regulator_shutdown sysinit. Tested on pinebook where the backlight is controlled by a fixed-regulator. The regulator doesn't have a regulator-boot-on param (I'm gonna upstream this) and so we disable it at probe. We later enable it but this cause the screen to go black. Linux doesn't disable regulator at boot (at least for fixed-regulator) so better match this to have the same UX. Differential Revision: https://reviews.freebsd.org/D17978 r341254: extres: clk: Fix clk_set_assigned ofw_bus_parse_xref_list_get_length doesn't returns the number of elements, fix this. While here when setting the clock to the assigned freqeuncy, allow the clock driver to round down or up the frequency as sometimes the exact frequency cannot be obtain. r341269: release: arm64: Add opp dtbo to PINE* boards r341333: arm64: allwinner: Add 792Mhz frequency to sun50i-a64-opp This is the frequency of the cpu on the Pinebook so add it to make cpufreq find the current setting. Note that this dtbo on the Pinebook doesn't work right now as u-boot dtb doesn't have symbols and so it fails to apply. Linux 4.20 have the dts and will be imported once taggued. X-MFC with: r341268 Modified: stable/12/release/arm64/PINE64-LTS.conf stable/12/release/arm64/PINE64.conf stable/12/release/arm64/PINEBOOK.conf stable/12/sys/arm64/conf/GENERIC stable/12/sys/dev/extres/clk/clk.c stable/12/sys/dev/extres/regulator/regulator_fixed.c stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Directory Properties: stable/12/ (props changed) Modified: stable/12/release/arm64/PINE64-LTS.conf ============================================================================== --- stable/12/release/arm64/PINE64-LTS.conf Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/release/arm64/PINE64-LTS.conf Mon Aug 5 16:48:16 2019 (r350593) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINE64-LTS" arm_install_uboot() { Modified: stable/12/release/arm64/PINE64.conf ============================================================================== --- stable/12/release/arm64/PINE64.conf Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/release/arm64/PINE64.conf Mon Aug 5 16:48:16 2019 (r350593) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINE64" arm_install_uboot() { Modified: stable/12/release/arm64/PINEBOOK.conf ============================================================================== --- stable/12/release/arm64/PINEBOOK.conf Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/release/arm64/PINEBOOK.conf Mon Aug 5 16:48:16 2019 (r350593) @@ -14,7 +14,7 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 PART_SCHEME="MBR" -FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer" +FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp" export BOARDNAME="PINEBOOK" arm_install_uboot() { Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/sys/arm64/conf/GENERIC Mon Aug 5 16:48:16 2019 (r350593) @@ -241,6 +241,11 @@ device kbdmux device vt_efifb +# EVDEV support +device evdev # input event device support +options EVDEV_SUPPORT # evdev support in legacy drivers +device uinput # install /dev/uinput cdev + # Pseudo devices. device crypto # core crypto support device loop # Network loopback Modified: stable/12/sys/dev/extres/clk/clk.c ============================================================================== --- stable/12/sys/dev/extres/clk/clk.c Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/sys/dev/extres/clk/clk.c Mon Aug 5 16:48:16 2019 (r350593) @@ -1297,7 +1297,7 @@ clk_set_assigned_rates(device_t dev, clk_t clk, uint32 { int rv; - rv = clk_set_freq(clk, freq, 0); + rv = clk_set_freq(clk, freq, CLK_SET_ROUND_DOWN | CLK_SET_ROUND_UP); if (rv != 0) { device_printf(dev, "Failed to set %s to a frequency of %u\n", clk_get_name(clk), freq); @@ -1330,9 +1330,9 @@ clk_set_assigned(device_t dev, phandle_t node) if (nrates <= 0) nrates = 0; - nparents = ofw_bus_parse_xref_list_get_length(node, - "assigned-clock-parents", "#clock-cells", &nparents); - + if (ofw_bus_parse_xref_list_get_length(node, + "assigned-clock-parents", "#clock-cells", &nparents) != 0) + nparents = -1; for (i = 0; i < nclocks; i++) { /* First get the clock we are supposed to modify */ rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks", Modified: stable/12/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- stable/12/sys/dev/extres/regulator/regulator_fixed.c Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/sys/dev/extres/regulator/regulator_fixed.c Mon Aug 5 16:48:16 2019 (r350593) @@ -145,7 +145,6 @@ regnode_fixed_init(struct regnode *regnode) struct regnode_fixed_sc *sc; struct gpiobus_pin *pin; uint32_t flags; - bool enable; int rv; sc = regnode_get_softc(regnode); @@ -158,14 +157,15 @@ regnode_fixed_init(struct regnode *regnode) flags = GPIO_PIN_OUTPUT; if (sc->gpio_open_drain) flags |= GPIO_PIN_OPENDRAIN; - enable = sc->param->boot_on || sc->param->always_on; - if (!sc->param->enable_active_high) - enable = !enable; - rv = GPIO_PIN_SET(pin->dev, pin->pin, enable); - if (rv != 0) { - device_printf(dev, "Cannot set GPIO pin: %d\n", pin->pin); - return (rv); + if (sc->param->boot_on || sc->param->always_on) { + rv = GPIO_PIN_SET(pin->dev, pin->pin, sc->param->enable_active_high); + if (rv != 0) { + device_printf(dev, "Cannot set GPIO pin: %d\n", + pin->pin); + return (rv); + } } + rv = GPIO_PIN_SETFLAGS(pin->dev, pin->pin, flags); if (rv != 0) { device_printf(dev, "Cannot configure GPIO pin: %d\n", pin->pin); Modified: stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso ============================================================================== --- stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Mon Aug 5 16:36:11 2019 (r350592) +++ stable/12/sys/dts/arm64/overlays/sun50i-a64-opp.dtso Mon Aug 5 16:48:16 2019 (r350593) @@ -15,6 +15,11 @@ opp-microvolt = <1040000>; clock-latency-ns = <244144>; /* 8 32k periods */ }; + opp-792000000 { + opp-hz = /bits/ 64 <792000000>; + opp-microvolt = <1100000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; opp-816000000 { opp-hz = /bits/ 64 <816000000>; opp-microvolt = <1100000>; From owner-svn-src-all@freebsd.org Mon Aug 5 16:56:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BBA1C7C32; Mon, 5 Aug 2019 16:56:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462P6m3fvxz3Qq5; Mon, 5 Aug 2019 16:56:16 +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 5EF661EC45; Mon, 5 Aug 2019 16:56:16 +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 x75GuGYO068446; Mon, 5 Aug 2019 16:56:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75GuBxx068422; Mon, 5 Aug 2019 16:56:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051656.x75GuBxx068422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 16:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350594 - in stable/12/sys: gnu/dts/arm gnu/dts/arm64/actions gnu/dts/arm64/allwinner gnu/dts/arm64/altera gnu/dts/arm64/amd gnu/dts/arm64/amlogic gnu/dts/arm64/arm gnu/dts/arm64/broadc... X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: gnu/dts/arm gnu/dts/arm64/actions gnu/dts/arm64/allwinner gnu/dts/arm64/altera gnu/dts/arm64/amd gnu/dts/arm64/amlogic gnu/dts/arm64/arm gnu/dts/arm64/broadcom gnu/dts/arm64/broadcom... X-SVN-Commit-Revision: 350594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 16:56:16 -0000 Author: manu Date: Mon Aug 5 16:56:11 2019 New Revision: 350594 URL: https://svnweb.freebsd.org/changeset/base/350594 Log: MFC r342936, r343873 r342936: Import DTS from Linux 4.20 r343873: arm64: dtb: allwinner: Add the new pine64-lts dtb file to the build X-MFC-With: r342936 Added: stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts stable/12/sys/gnu/dts/arm/am3517-evm-ui.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/am3517-evm-ui.dtsi stable/12/sys/gnu/dts/arm/armada-385-db-88f6820-amc.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/armada-385-db-88f6820-amc.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-arm-stardragon4800-rep2.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/aspeed-bmc-arm-stardragon4800-rep2.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts stable/12/sys/gnu/dts/arm/bcm2837-rpi-cm3-io3.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/bcm2837-rpi-cm3-io3.dts stable/12/sys/gnu/dts/arm/bcm2837-rpi-cm3.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/bcm2837-rpi-cm3.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-icore-1.5.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/imx6qdl-icore-1.5.dtsi stable/12/sys/gnu/dts/arm/imx6ul-ccimx6ulsbcpro.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/imx6ul-ccimx6ulsbcpro.dts stable/12/sys/gnu/dts/arm/imx6ulz-14x14-evk.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/imx6ulz-14x14-evk.dts stable/12/sys/gnu/dts/arm/imx6ulz.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/imx6ulz.dtsi stable/12/sys/gnu/dts/arm/meson8b-ec100.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/meson8b-ec100.dts stable/12/sys/gnu/dts/arm/omap3-gta04a5one.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/omap3-gta04a5one.dts stable/12/sys/gnu/dts/arm/rk3288-tinker-s.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/rk3288-tinker-s.dts stable/12/sys/gnu/dts/arm/rk3288-tinker.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/rk3288-tinker.dtsi stable/12/sys/gnu/dts/arm/socfpga_cyclone5_de0_nano_soc.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/socfpga_cyclone5_de0_nano_soc.dts stable/12/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus-v1.2.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus-v1.2.dts stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-zero-plus2.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/sun8i-h3-orangepi-zero-plus2.dts stable/12/sys/gnu/dts/arm/sunxi-bananapi-m2-plus-v1.2.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/sunxi-bananapi-m2-plus-v1.2.dtsi stable/12/sys/gnu/dts/arm/sunxi-bananapi-m2-plus.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/sunxi-bananapi-m2-plus.dtsi stable/12/sys/gnu/dts/arm/tegra20-colibri-eval-v3.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/tegra20-colibri-eval-v3.dts stable/12/sys/gnu/dts/arm/tegra30-apalis-v1.1-eval.dts - copied unchanged from r342936, head/sys/gnu/dts/arm/tegra30-apalis-v1.1-eval.dts stable/12/sys/gnu/dts/arm/tegra30-apalis-v1.1.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm/tegra30-apalis-v1.1.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-lts.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-lts.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-bananapi-m2-plus-v1.2.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/allwinner/sun50i-h5-bananapi-m2-plus-v1.2.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-bananapi-m2-plus.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/allwinner/sun50i-h5-bananapi-m2-plus.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-one-plus.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-one-plus.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-g12a-u200.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/amlogic/meson-g12a-u200.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-g12a.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/amlogic/meson-g12a.dtsi stable/12/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-cm3-io3.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-cm3-io3.dts stable/12/sys/gnu/dts/arm64/hisilicon/hi3670-hikey970.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/hisilicon/hi3670-hikey970.dts stable/12/sys/gnu/dts/arm64/hisilicon/hi3670.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/hisilicon/hi3670.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts stable/12/sys/gnu/dts/arm64/mediatek/mt7622-bananapi-bpi-r64.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/mediatek/mt7622-bananapi-bpi-r64.dts stable/12/sys/gnu/dts/arm64/qcom/msm8998-mtp.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/qcom/msm8998-mtp.dts stable/12/sys/gnu/dts/arm64/qcom/msm8998-mtp.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/qcom/msm8998-mtp.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8998.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/qcom/msm8998.dtsi stable/12/sys/gnu/dts/arm64/qcom/pmi8998.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/qcom/pmi8998.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb-kf.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb-kf.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb.dts stable/12/sys/gnu/dts/arm64/rockchip/px30-evb.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/rockchip/px30-evb.dts stable/12/sys/gnu/dts/arm64/rockchip/px30.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/rockchip/px30.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts - copied unchanged from r342936, head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts stable/12/sys/gnu/dts/arm64/synaptics/as370.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/synaptics/as370.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi - copied unchanged from r342936, head/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi stable/12/sys/gnu/dts/include/dt-bindings/clock/hi3670-clock.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/hi3670-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/jz4725b-cgu.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/jz4725b-cgu.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,camcc-sdm845.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/qcom,camcc-sdm845.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-qcs404.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-qcs404.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm660.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm660.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r7s9210-cpg-mssr.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/r7s9210-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7744-cpg-mssr.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/r8a7744-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a774a1-cpg-mssr.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/r8a774a1-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a774c0-cpg-mssr.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/r8a774c0-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/xlnx,zynqmp-clk.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/clock/xlnx,zynqmp-clk.h stable/12/sys/gnu/dts/include/dt-bindings/gpio/meson-g12a-gpio.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/gpio/meson-g12a-gpio.h stable/12/sys/gnu/dts/include/dt-bindings/mfd/at91-usart.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/mfd/at91-usart.h stable/12/sys/gnu/dts/include/dt-bindings/phy/phy-ocelot-serdes.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/phy/phy-ocelot-serdes.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-io-pad.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-io-pad.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/rzn1-pinctrl.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/pinctrl/rzn1-pinctrl.h stable/12/sys/gnu/dts/include/dt-bindings/power/owl-s900-powergate.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/power/owl-s900-powergate.h stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7744-sysc.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/power/r8a7744-sysc.h stable/12/sys/gnu/dts/include/dt-bindings/power/r8a774a1-sysc.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/power/r8a774a1-sysc.h stable/12/sys/gnu/dts/include/dt-bindings/power/r8a774c0-sysc.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/power/r8a774c0-sysc.h stable/12/sys/gnu/dts/include/dt-bindings/reset/actions,s700-reset.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/reset/actions,s700-reset.h stable/12/sys/gnu/dts/include/dt-bindings/reset/actions,s900-reset.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/reset/actions,s900-reset.h stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,sdm845-pdc.h - copied unchanged from r342936, head/sys/gnu/dts/include/dt-bindings/reset/qcom,sdm845-pdc.h Deleted: stable/12/sys/gnu/dts/arm/socfpga_cyclone5_de0_sockit.dts Modified: stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts stable/12/sys/gnu/dts/arm/am335x-evm.dts stable/12/sys/gnu/dts/arm/am335x-evmsk.dts stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi stable/12/sys/gnu/dts/arm/am335x-lxm.dts stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts stable/12/sys/gnu/dts/arm/am335x-nano.dts stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-pdu001.dts stable/12/sys/gnu/dts/arm/am335x-pepper.dts stable/12/sys/gnu/dts/arm/am335x-sancloud-bbe.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-shc.dts stable/12/sys/gnu/dts/arm/am3517-evm.dts stable/12/sys/gnu/dts/arm/am3517-som.dtsi stable/12/sys/gnu/dts/arm/am4372.dtsi stable/12/sys/gnu/dts/arm/am437x-cm-t43.dts stable/12/sys/gnu/dts/arm/am437x-gp-evm.dts stable/12/sys/gnu/dts/arm/am437x-idk-evm.dts stable/12/sys/gnu/dts/arm/am437x-sk-evm.dts stable/12/sys/gnu/dts/arm/am43x-epos-evm.dts stable/12/sys/gnu/dts/arm/am571x-idk.dts stable/12/sys/gnu/dts/arm/am572x-idk-common.dtsi stable/12/sys/gnu/dts/arm/am572x-idk.dts stable/12/sys/gnu/dts/arm/am57xx-cl-som-am57x.dts stable/12/sys/gnu/dts/arm/am57xx-idk-common.dtsi stable/12/sys/gnu/dts/arm/arm-realview-eb.dtsi stable/12/sys/gnu/dts/arm/arm-realview-pb1176.dts stable/12/sys/gnu/dts/arm/arm-realview-pb11mp.dts stable/12/sys/gnu/dts/arm/arm-realview-pbx.dtsi stable/12/sys/gnu/dts/arm/armada-388-clearfog.dtsi stable/12/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi stable/12/sys/gnu/dts/arm/armada-xp-98dx3336.dtsi stable/12/sys/gnu/dts/arm/armada-xp-98dx4251.dtsi stable/12/sys/gnu/dts/arm/armada-xp-db-dxbc2.dts stable/12/sys/gnu/dts/arm/armada-xp-db-xc3-24g4xg.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-quanta-q71l.dts stable/12/sys/gnu/dts/arm/aspeed-g4.dtsi stable/12/sys/gnu/dts/arm/aspeed-g5.dtsi stable/12/sys/gnu/dts/arm/at91-dvk_su60_somc.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91-dvk_su60_somc_lcm.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91-nattis-2-natte-2.dts stable/12/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts stable/12/sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts stable/12/sys/gnu/dts/arm/at91-sama5d2_xplained.dts stable/12/sys/gnu/dts/arm/at91-sama5d3_xplained.dts stable/12/sys/gnu/dts/arm/at91-sama5d4_xplained.dts stable/12/sys/gnu/dts/arm/at91-tse850-3.dts stable/12/sys/gnu/dts/arm/at91-vinco.dts stable/12/sys/gnu/dts/arm/at91sam9260ek.dts stable/12/sys/gnu/dts/arm/at91sam9261ek.dts stable/12/sys/gnu/dts/arm/at91sam9g20ek_common.dtsi stable/12/sys/gnu/dts/arm/at91sam9g45.dtsi stable/12/sys/gnu/dts/arm/at91sam9x5cm.dtsi stable/12/sys/gnu/dts/arm/bcm-hr2.dtsi stable/12/sys/gnu/dts/arm/bcm-nsp.dtsi stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-b-plus.dts stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts stable/12/sys/gnu/dts/arm/bcm283x-rpi-lan7515.dtsi stable/12/sys/gnu/dts/arm/bcm47081-tplink-archer-c5-v2.dts stable/12/sys/gnu/dts/arm/bcm4709-asus-rt-ac87u.dts stable/12/sys/gnu/dts/arm/bcm4709-tplink-archer-c9-v1.dts stable/12/sys/gnu/dts/arm/bcm5301x-nand-cs0.dtsi stable/12/sys/gnu/dts/arm/bcm5301x.dtsi stable/12/sys/gnu/dts/arm/bcm958625hr.dts stable/12/sys/gnu/dts/arm/da850-evm.dts stable/12/sys/gnu/dts/arm/da850-lego-ev3.dts stable/12/sys/gnu/dts/arm/dm8148-evm.dts stable/12/sys/gnu/dts/arm/dm8148-t410.dts stable/12/sys/gnu/dts/arm/dove-cubox.dts stable/12/sys/gnu/dts/arm/dove.dtsi stable/12/sys/gnu/dts/arm/dra62x-j5eco-evm.dts stable/12/sys/gnu/dts/arm/dra7-evm.dts stable/12/sys/gnu/dts/arm/dra7.dtsi stable/12/sys/gnu/dts/arm/dra71-evm.dts stable/12/sys/gnu/dts/arm/dra72-evm-revc.dts stable/12/sys/gnu/dts/arm/dra72-evm.dts stable/12/sys/gnu/dts/arm/dra76-evm.dts stable/12/sys/gnu/dts/arm/exynos3250-artik5.dtsi stable/12/sys/gnu/dts/arm/exynos4210-origen.dts stable/12/sys/gnu/dts/arm/exynos4210-trats.dts stable/12/sys/gnu/dts/arm/exynos4210-universal_c210.dts stable/12/sys/gnu/dts/arm/exynos4412-midas.dtsi stable/12/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi stable/12/sys/gnu/dts/arm/exynos5250-arndale.dts stable/12/sys/gnu/dts/arm/exynos5250-pinctrl.dtsi stable/12/sys/gnu/dts/arm/exynos5250-snow-rev5.dts stable/12/sys/gnu/dts/arm/exynos5250.dtsi stable/12/sys/gnu/dts/arm/exynos5410-odroidxu.dts stable/12/sys/gnu/dts/arm/exynos5420-peach-pit.dts stable/12/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3.dts stable/12/sys/gnu/dts/arm/exynos5800-peach-pi.dts stable/12/sys/gnu/dts/arm/gr-peach-audiocamerashield.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/hip04.dtsi stable/12/sys/gnu/dts/arm/imx1.dtsi stable/12/sys/gnu/dts/arm/imx23-evk.dts stable/12/sys/gnu/dts/arm/imx23-olinuxino.dts stable/12/sys/gnu/dts/arm/imx23-sansa.dts stable/12/sys/gnu/dts/arm/imx23-stmp378x_devb.dts stable/12/sys/gnu/dts/arm/imx23-xfi3.dts stable/12/sys/gnu/dts/arm/imx23.dtsi stable/12/sys/gnu/dts/arm/imx25.dtsi stable/12/sys/gnu/dts/arm/imx27.dtsi stable/12/sys/gnu/dts/arm/imx28-apf28dev.dts stable/12/sys/gnu/dts/arm/imx28-apx4devkit.dts stable/12/sys/gnu/dts/arm/imx28-cfa10036.dts stable/12/sys/gnu/dts/arm/imx28-duckbill-2-485.dts stable/12/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts stable/12/sys/gnu/dts/arm/imx28-duckbill-2-spi.dts stable/12/sys/gnu/dts/arm/imx28-duckbill-2.dts stable/12/sys/gnu/dts/arm/imx28-duckbill.dts stable/12/sys/gnu/dts/arm/imx28-evk.dts stable/12/sys/gnu/dts/arm/imx28-m28cu3.dts stable/12/sys/gnu/dts/arm/imx28-m28evk.dts stable/12/sys/gnu/dts/arm/imx28-sps1.dts stable/12/sys/gnu/dts/arm/imx28-ts4600.dts stable/12/sys/gnu/dts/arm/imx28.dtsi stable/12/sys/gnu/dts/arm/imx31.dtsi stable/12/sys/gnu/dts/arm/imx35.dtsi stable/12/sys/gnu/dts/arm/imx50.dtsi stable/12/sys/gnu/dts/arm/imx51-babbage.dts stable/12/sys/gnu/dts/arm/imx51-zii-rdu1.dts stable/12/sys/gnu/dts/arm/imx51-zii-scu2-mezz.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx51-zii-scu3-esb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx51.dtsi stable/12/sys/gnu/dts/arm/imx53-ppd.dts stable/12/sys/gnu/dts/arm/imx53.dtsi stable/12/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts stable/12/sys/gnu/dts/arm/imx6dl-icore-mipi.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx6dl-icore-rqs.dts stable/12/sys/gnu/dts/arm/imx6dl-icore.dts stable/12/sys/gnu/dts/arm/imx6dl-riotboard.dts stable/12/sys/gnu/dts/arm/imx6q-apalis-eval.dts stable/12/sys/gnu/dts/arm/imx6q-apalis-ixora-v1.1.dts stable/12/sys/gnu/dts/arm/imx6q-apalis-ixora.dts stable/12/sys/gnu/dts/arm/imx6q-icore-mipi.dts stable/12/sys/gnu/dts/arm/imx6q-icore-ofcap10.dts stable/12/sys/gnu/dts/arm/imx6q-icore-ofcap12.dts stable/12/sys/gnu/dts/arm/imx6q-icore-rqs.dts stable/12/sys/gnu/dts/arm/imx6q-icore.dts stable/12/sys/gnu/dts/arm/imx6q.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-apalis.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-icore-rqs.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-icore.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi stable/12/sys/gnu/dts/arm/imx6qdl.dtsi stable/12/sys/gnu/dts/arm/imx6sl.dtsi stable/12/sys/gnu/dts/arm/imx6sll.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6sx-sdb.dtsi stable/12/sys/gnu/dts/arm/imx6sx.dtsi stable/12/sys/gnu/dts/arm/imx6ul-geam.dts stable/12/sys/gnu/dts/arm/imx6ul-isiot-emmc.dts stable/12/sys/gnu/dts/arm/imx6ul-isiot-nand.dts stable/12/sys/gnu/dts/arm/imx6ul-isiot.dtsi stable/12/sys/gnu/dts/arm/imx6ul.dtsi stable/12/sys/gnu/dts/arm/imx6ull-14x14-evk.dts stable/12/sys/gnu/dts/arm/imx6ull-pinfunc.h stable/12/sys/gnu/dts/arm/imx6ull.dtsi stable/12/sys/gnu/dts/arm/imx7d-nitrogen7.dts stable/12/sys/gnu/dts/arm/imx7d-pico.dtsi stable/12/sys/gnu/dts/arm/imx7d-sdb.dts stable/12/sys/gnu/dts/arm/imx7d.dtsi stable/12/sys/gnu/dts/arm/imx7s-warp.dts stable/12/sys/gnu/dts/arm/imx7s.dtsi stable/12/sys/gnu/dts/arm/imx7ulp-pinfunc.h stable/12/sys/gnu/dts/arm/iwg20d-q7-common.dtsi stable/12/sys/gnu/dts/arm/keystone-k2g.dtsi stable/12/sys/gnu/dts/arm/logicpd-som-lv.dtsi stable/12/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit.dts stable/12/sys/gnu/dts/arm/lpc32xx.dtsi stable/12/sys/gnu/dts/arm/ls1021a-qds.dts stable/12/sys/gnu/dts/arm/ls1021a-twr.dts stable/12/sys/gnu/dts/arm/ls1021a.dtsi stable/12/sys/gnu/dts/arm/meson8.dtsi stable/12/sys/gnu/dts/arm/meson8b-odroidc1.dts stable/12/sys/gnu/dts/arm/meson8b.dtsi stable/12/sys/gnu/dts/arm/mt7623.dtsi stable/12/sys/gnu/dts/arm/omap2.dtsi stable/12/sys/gnu/dts/arm/omap2430.dtsi stable/12/sys/gnu/dts/arm/omap3-beagle-xm.dts stable/12/sys/gnu/dts/arm/omap3-beagle.dts stable/12/sys/gnu/dts/arm/omap3-gta04.dtsi stable/12/sys/gnu/dts/arm/omap3-gta04a3.dts stable/12/sys/gnu/dts/arm/omap3-gta04a4.dts stable/12/sys/gnu/dts/arm/omap3-gta04a5.dts stable/12/sys/gnu/dts/arm/omap3-n9.dts stable/12/sys/gnu/dts/arm/omap5-board-common.dtsi stable/12/sys/gnu/dts/arm/orion5x-linkstation.dtsi stable/12/sys/gnu/dts/arm/owl-s500-cubieboard6.dts stable/12/sys/gnu/dts/arm/owl-s500-guitar-bb-rev-b.dts stable/12/sys/gnu/dts/arm/owl-s500-guitar.dtsi stable/12/sys/gnu/dts/arm/owl-s500.dtsi stable/12/sys/gnu/dts/arm/pxa25x.dtsi stable/12/sys/gnu/dts/arm/pxa27x.dtsi stable/12/sys/gnu/dts/arm/pxa2xx.dtsi stable/12/sys/gnu/dts/arm/qcom-apq8064.dtsi stable/12/sys/gnu/dts/arm/qcom-ipq4019.dtsi stable/12/sys/gnu/dts/arm/qcom-ipq8064-ap148.dts stable/12/sys/gnu/dts/arm/qcom-ipq8064-v1.0.dtsi stable/12/sys/gnu/dts/arm/qcom-ipq8064.dtsi stable/12/sys/gnu/dts/arm/qcom-msm8974-lge-nexus5-hammerhead.dts stable/12/sys/gnu/dts/arm/qcom-msm8974.dtsi stable/12/sys/gnu/dts/arm/r8a7743-iwg20d-q7-dbcm-ca.dts stable/12/sys/gnu/dts/arm/r8a7743-iwg20d-q7.dts stable/12/sys/gnu/dts/arm/r8a77470-iwg23s-sbc.dts stable/12/sys/gnu/dts/arm/r8a77470.dtsi stable/12/sys/gnu/dts/arm/r8a7778-bockw.dts stable/12/sys/gnu/dts/arm/r8a7778.dtsi stable/12/sys/gnu/dts/arm/r8a7779-marzen.dts stable/12/sys/gnu/dts/arm/r8a7779.dtsi stable/12/sys/gnu/dts/arm/r8a7790-stout.dts stable/12/sys/gnu/dts/arm/r8a7790.dtsi stable/12/sys/gnu/dts/arm/r8a7791.dtsi stable/12/sys/gnu/dts/arm/r8a7792.dtsi stable/12/sys/gnu/dts/arm/r8a7793-gose.dts stable/12/sys/gnu/dts/arm/r8a7793.dtsi stable/12/sys/gnu/dts/arm/r8a7794-silk.dts stable/12/sys/gnu/dts/arm/r8a7794.dtsi stable/12/sys/gnu/dts/arm/r9a06g032.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/rk3036.dtsi stable/12/sys/gnu/dts/arm/rk3188-radxarock.dts stable/12/sys/gnu/dts/arm/rk3188.dtsi stable/12/sys/gnu/dts/arm/rk3288-tinker.dts stable/12/sys/gnu/dts/arm/rk3288-veyron.dtsi stable/12/sys/gnu/dts/arm/s5pv210.dtsi stable/12/sys/gnu/dts/arm/sama5d2.dtsi stable/12/sys/gnu/dts/arm/sama5d4.dtsi stable/12/sys/gnu/dts/arm/socfpga.dtsi stable/12/sys/gnu/dts/arm/socfpga_arria10.dtsi stable/12/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts stable/12/sys/gnu/dts/arm/ste-dbx5x0.dtsi stable/12/sys/gnu/dts/arm/ste-href-family-pinctrl.dtsi stable/12/sys/gnu/dts/arm/ste-href.dtsi stable/12/sys/gnu/dts/arm/ste-hrefprev60.dtsi stable/12/sys/gnu/dts/arm/ste-snowball.dts stable/12/sys/gnu/dts/arm/ste-u300.dts stable/12/sys/gnu/dts/arm/stih410-b2260.dts stable/12/sys/gnu/dts/arm/stihxxx-b2120.dtsi stable/12/sys/gnu/dts/arm/stm32429i-eval.dts stable/12/sys/gnu/dts/arm/stm32f429.dtsi stable/12/sys/gnu/dts/arm/stm32f469-disco.dts stable/12/sys/gnu/dts/arm/stm32f746-disco.dts stable/12/sys/gnu/dts/arm/stm32f769-disco.dts stable/12/sys/gnu/dts/arm/stm32h743.dtsi stable/12/sys/gnu/dts/arm/stm32mp157c-ev1.dts stable/12/sys/gnu/dts/arm/stm32mp157c.dtsi stable/12/sys/gnu/dts/arm/sun5i-reference-design-tablet.dtsi stable/12/sys/gnu/dts/arm/sun5i.dtsi stable/12/sys/gnu/dts/arm/sun7i-a20.dtsi stable/12/sys/gnu/dts/arm/sun8i-a33.dtsi stable/12/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts stable/12/sys/gnu/dts/arm/sun8i-a83t.dtsi stable/12/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts stable/12/sys/gnu/dts/arm/sun8i-h3.dtsi stable/12/sys/gnu/dts/arm/sun8i-r40-bananapi-m2-ultra.dts stable/12/sys/gnu/dts/arm/sun8i-r40.dtsi stable/12/sys/gnu/dts/arm/sun8i-reference-design-tablet.dtsi stable/12/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts stable/12/sys/gnu/dts/arm/sun9i-a80.dtsi stable/12/sys/gnu/dts/arm/sunxi-h3-h5.dtsi stable/12/sys/gnu/dts/arm/tegra124-apalis-eval.dts stable/12/sys/gnu/dts/arm/tegra124-apalis-v1.2-eval.dts stable/12/sys/gnu/dts/arm/tegra124-apalis-v1.2.dtsi stable/12/sys/gnu/dts/arm/tegra124-apalis.dtsi stable/12/sys/gnu/dts/arm/tegra20-colibri-iris.dts (contents, props changed) stable/12/sys/gnu/dts/arm/tegra20-colibri.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/tegra20-paz00.dts stable/12/sys/gnu/dts/arm/tegra20.dtsi stable/12/sys/gnu/dts/arm/tegra30-apalis-eval.dts stable/12/sys/gnu/dts/arm/tegra30-apalis.dtsi stable/12/sys/gnu/dts/arm/tegra30-colibri-eval-v3.dts stable/12/sys/gnu/dts/arm/tegra30-colibri.dtsi stable/12/sys/gnu/dts/arm/tegra30.dtsi stable/12/sys/gnu/dts/arm/uniphier-ld4-ref.dts stable/12/sys/gnu/dts/arm/uniphier-ld4.dtsi stable/12/sys/gnu/dts/arm/uniphier-ld6b-ref.dts stable/12/sys/gnu/dts/arm/uniphier-pinctrl.dtsi stable/12/sys/gnu/dts/arm/uniphier-pro4-ace.dts stable/12/sys/gnu/dts/arm/uniphier-pro4-ref.dts stable/12/sys/gnu/dts/arm/uniphier-pro4-sanji.dts stable/12/sys/gnu/dts/arm/uniphier-pro4.dtsi stable/12/sys/gnu/dts/arm/uniphier-pro5.dtsi stable/12/sys/gnu/dts/arm/uniphier-pxs2-gentil.dts stable/12/sys/gnu/dts/arm/uniphier-pxs2-vodka.dts stable/12/sys/gnu/dts/arm/uniphier-pxs2.dtsi stable/12/sys/gnu/dts/arm/uniphier-sld8-ref.dts stable/12/sys/gnu/dts/arm/uniphier-sld8.dtsi stable/12/sys/gnu/dts/arm/versatile-ab.dts stable/12/sys/gnu/dts/arm/vf500.dtsi stable/12/sys/gnu/dts/arm/vf610-twr.dts stable/12/sys/gnu/dts/arm/vf610-zii-cfu1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts stable/12/sys/gnu/dts/arm/vf610.dtsi stable/12/sys/gnu/dts/arm/vf610m4-colibri.dts stable/12/sys/gnu/dts/arm/vfxxx.dtsi stable/12/sys/gnu/dts/arm/zynq-zc702.dts stable/12/sys/gnu/dts/arm/zynq-zc770-xm010.dts stable/12/sys/gnu/dts/arm/zynq-zc770-xm013.dts stable/12/sys/gnu/dts/arm64/actions/s700-cubieboard7.dts stable/12/sys/gnu/dts/arm64/actions/s700.dtsi stable/12/sys/gnu/dts/arm64/actions/s900-bubblegum-96.dts stable/12/sys/gnu/dts/arm64/actions/s900.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-amarula-relic.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-bananapi-m64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-nanopi-a64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-orangepi-win.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pinebook.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine-baseboard.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-teres-i.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi stable/12/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi stable/12/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts stable/12/sys/gnu/dts/arm64/amd/amd-seattle-soc.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-axg-s400.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi stable/12/sys/gnu/dts/arm64/arm/juno-base.dtsi stable/12/sys/gnu/dts/arm64/arm/juno-cs-r1r2.dtsi stable/12/sys/gnu/dts/arm64/arm/juno.dts stable/12/sys/gnu/dts/arm64/broadcom/northstar2/ns2.dtsi stable/12/sys/gnu/dts/arm64/broadcom/stingray/bcm958742-base.dtsi stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray.dtsi stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tm2-common.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a-qds.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a-qds.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls208xa.dtsi stable/12/sys/gnu/dts/arm64/hisilicon/hi6220-coresight.dtsi stable/12/sys/gnu/dts/arm64/hisilicon/hi6220.dtsi stable/12/sys/gnu/dts/arm64/lg/lg1312.dtsi stable/12/sys/gnu/dts/arm64/lg/lg1313.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-372x.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-37xx.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap806-dual.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap806-quad.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap806.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-ap810-ap0-octa-core.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-common.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-cp110.dtsi stable/12/sys/gnu/dts/arm64/mediatek/mt2712e.dtsi stable/12/sys/gnu/dts/arm64/mediatek/mt7622-rfb1.dts stable/12/sys/gnu/dts/arm64/mediatek/mt7622.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra186.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra194.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra210.dtsi stable/12/sys/gnu/dts/arm64/qcom/apq8016-sbc.dtsi stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c.dts stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8916.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8996.dtsi stable/12/sys/gnu/dts/arm64/qcom/pm8916.dtsi stable/12/sys/gnu/dts/arm64/qcom/pm8994.dtsi stable/12/sys/gnu/dts/arm64/qcom/pm8998.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts stable/12/sys/gnu/dts/arm64/qcom/sdm845.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7795-h3ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-salvator-xs.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7796-m3ulcb.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7796-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7796.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77965-salvator-xs.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77965.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77970-v3msk.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77970.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77980-condor.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77980-v3hsk.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77980.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77990-ebisu.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77990.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77995-draak.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77995.dtsi stable/12/sys/gnu/dts/arm64/renesas/salvator-common.dtsi stable/12/sys/gnu/dts/arm64/renesas/ulcb-kf.dtsi stable/12/sys/gnu/dts/arm64/renesas/ulcb.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3328.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-firefly.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-puma-haikou.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-sapphire.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399.dtsi stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld11.dtsi stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld20-global.dts stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld20-ref.dts stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi stable/12/sys/gnu/dts/arm64/socionext/uniphier-pxs3-ref.dts stable/12/sys/gnu/dts/arm64/socionext/uniphier-pxs3.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am65.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am654-base-board.dts (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/am3.h stable/12/sys/gnu/dts/include/dt-bindings/clock/am4.h stable/12/sys/gnu/dts/include/dt-bindings/clock/at91.h stable/12/sys/gnu/dts/include/dt-bindings/clock/dra7.h stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos4.h stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5410.h stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5420.h stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5433.h stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos7-clk.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6sll-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6ul-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/maxim,max77686.h stable/12/sys/gnu/dts/include/dt-bindings/clock/maxim,max77802.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8996.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm845.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7743-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7745-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7790-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7791-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7792-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7793-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7793-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7794-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7794-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7795-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7796-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77970-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77995-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/renesas-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h stable/12/sys/gnu/dts/include/dt-bindings/clock/s3c2410.h stable/12/sys/gnu/dts/include/dt-bindings/clock/s3c2412.h stable/12/sys/gnu/dts/include/dt-bindings/clock/s3c2443.h stable/12/sys/gnu/dts/include/dt-bindings/clock/samsung,s2mps11.h stable/12/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/sun50i-a64-ccu.h stable/12/sys/gnu/dts/include/dt-bindings/iio/qcom,spmi-vadc.h stable/12/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h stable/12/sys/gnu/dts/include/dt-bindings/interrupt-controller/arm-gic.h stable/12/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq.h stable/12/sys/gnu/dts/include/dt-bindings/net/mscc-phy-vsc8531.h stable/12/sys/gnu/dts/include/dt-bindings/reset/imx7-reset.h stable/12/sys/gnu/dts/include/dt-bindings/thermal/thermal_exynos.h stable/12/sys/gnu/dts/include/dt-bindings/usb/pd.h stable/12/sys/modules/dtb/allwinner/Makefile Directory Properties: stable/12/ (props changed) stable/12/sys/gnu/dts/arm/armada-388-helios4.dts (props changed) stable/12/sys/gnu/dts/arm/at91-dvk_som60.dts (props changed) stable/12/sys/gnu/dts/arm/at91-gatwick.dts (props changed) stable/12/sys/gnu/dts/arm/at91-som60.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-wb45n.dts (props changed) stable/12/sys/gnu/dts/arm/at91-wb45n.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-wb50n.dts (props changed) stable/12/sys/gnu/dts/arm/at91-wb50n.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-cm1-io1.dts (props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-cm1.dtsi (props changed) stable/12/sys/gnu/dts/arm/gemini-sl93512r.dts (props changed) stable/12/sys/gnu/dts/arm/imx31-lite.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-kp-ddc.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-kp-hsc.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-kp.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6sll-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-ccimx6ulsbcexpress.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-ccimx6ulsom.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2g-netcp.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4-l4.dtsi (props changed) stable/12/sys/gnu/dts/arm/r9a06g032-rzn1d400-db.dts (props changed) stable/12/sys/gnu/dts/arm/s5pv210-aries.dtsi (props changed) stable/12/sys/gnu/dts/arm/s5pv210-fascinate4g.dts (props changed) stable/12/sys/gnu/dts/arm/s5pv210-galaxys.dts (props changed) stable/12/sys/gnu/dts/arm/vf610-zii-ssmb-spu3.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zturn.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-p241.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-p281.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-tx3-mini.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/bcm958802a802x.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray-board-base.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray-pcie.dtsi (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6797-x20-dev.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8005.dtsi (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-bob.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-chromebook.dtsi (props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am654.dtsi (props changed) stable/12/sys/gnu/dts/arm64/xilinx/avnet-ultra96-rev1.dts (props changed) Modified: stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi Mon Aug 5 16:56:11 2019 (r350594) @@ -379,7 +379,7 @@ }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "mii"; }; @@ -396,6 +396,10 @@ pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; }; &mmc1 { Modified: stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Mon Aug 5 16:56:11 2019 (r350594) @@ -7,6 +7,7 @@ */ #include +#include &ldo3_reg { regulator-min-microvolt = <1800000>; @@ -88,9 +89,11 @@ }; &i2c0 { - tda19988: tda19988 { + tda19988: tda19988@70 { compatible = "nxp,tda998x"; reg = <0x70>; + nxp,calib-gpios = <&gpio1 25 0>; + interrupts-extended = <&gpio1 25 IRQ_TYPE_LEVEL_LOW>; pinctrl-names = "default", "off"; pinctrl-0 = <&nxp_hdmi_bonelt_pins>; Modified: stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -140,10 +140,14 @@ pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "rmii"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -486,10 +486,14 @@ status = "okay"; pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "rgmii-txid"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-evm.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-evm.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -713,6 +713,7 @@ pinctrl-0 = <&cpsw_default>; pinctrl-1 = <&cpsw_sleep>; status = "okay"; + slaves = <1>; }; &davinci_mdio { @@ -720,15 +721,14 @@ pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; -}; -&cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; - phy-mode = "rgmii-txid"; + ethphy0: ethernet-phy@0 { + reg = <0>; + }; }; -&cpsw_emac1 { - phy_id = <&davinci_mdio>, <1>; +&cpsw_emac0 { + phy-handle = <ðphy0>; phy-mode = "rgmii-txid"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-evmsk.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-evmsk.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -639,16 +639,24 @@ pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; + + ethphy1: ethernet-phy@1 { + reg = <1>; + }; }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "rgmii-txid"; dual_emac_res_vlan = <1>; }; &cpsw_emac1 { - phy_id = <&davinci_mdio>, <1>; + phy-handle = <ðphy1>; phy-mode = "rgmii-txid"; dual_emac_res_vlan = <2>; }; Modified: stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi Mon Aug 5 16:56:11 2019 (r350594) @@ -102,15 +102,24 @@ &davinci_mdio { status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; + + ethphy1: ethernet-phy@1 { + reg = <1>; + }; }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "rmii"; + }; &cpsw_emac1 { - phy_id = <&davinci_mdio>, <1>; + phy-handle = <ðphy1>; phy-mode = "rmii"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-lxm.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-lxm.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-lxm.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -317,13 +317,13 @@ }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <5>; + phy-handle = <ðphy0>; phy-mode = "rmii"; dual_emac_res_vlan = <2>; }; &cpsw_emac1 { - phy_id = <&davinci_mdio>, <4>; + phy-handle = <ðphy1>; phy-mode = "rmii"; dual_emac_res_vlan = <3>; }; @@ -345,6 +345,14 @@ pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; + + ethphy0: ethernet-phy@5 { + reg = <5>; + }; + + ethphy1: ethernet-phy@4 { + reg = <4>; + }; }; &mmc1 { Copied: stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi (from r342936, head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Mon Aug 5 16:56:11 2019 (r350594, copy of r342936, head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi) @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 MOXA Inc. - https://www.moxa.com/ + * + * Authors: SZ Lin (林上智) + * Wes Huang (黃淵河) + * Fero JD Zhou (周俊達) + */ + +#include "am33xx.dtsi" + +/ { + vbat: vbat-regulator { + compatible = "regulator-fixed"; + }; + + /* Power supply provides a fixed 3.3V @3A */ + vmmcsd_fixed: vmmcsd-regulator { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + buttons: push_button { + compatible = "gpio-keys"; + }; +}; + +&am33xx_pinmux { + pinctrl-names = "default"; + + i2c0_pins: pinmux_i2c0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ + >; + }; + + push_button_pins: pinmux_push_button { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_hsync.gpio2_23 */ + >; + }; + + uart0_pins: pinmux_uart0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + >; + }; + + davinci_mdio_default: davinci_mdio_default { + pinctrl-single,pins = < + /* MDIO */ + AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ + AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + >; + }; + + mmc1_pins_default: pinmux_mmc1_pins { + pinctrl-single,pins = < + /* eMMC */ + AM33XX_IOPAD(0x800, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad12.mmc1_dat0 */ + AM33XX_IOPAD(0x804, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad13.mmc1_dat1 */ + AM33XX_IOPAD(0x808, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad14.mmc1_dat2 */ + AM33XX_IOPAD(0x80c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad15.mmc1_dat3 */ + AM33XX_IOPAD(0x810, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad8.mmc1_dat4 */ + AM33XX_IOPAD(0x814, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad9.mmc1_dat5 */ + AM33XX_IOPAD(0x818, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad10.mmc1_dat6 */ + AM33XX_IOPAD(0x81c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad11.mmc1_dat7 */ + AM33XX_IOPAD(0x884, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */ + AM33XX_IOPAD(0x880, PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */ + >; + }; + + spi0_pins: pinmux_spi0 { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_sclk.spi0_sclk */ + AM33XX_IOPAD(0x95c, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_cs0.spi0_cs0 */ + AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d0.spi0_d0 */ + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d1.spi0_d1 */ + >; + }; +}; + +&uart0 { + /* Console */ + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + + status = "okay"; + clock-frequency = <400000>; + + eeprom: eeprom@50 { + compatible = "atmel,24c16"; + pagesize = <16>; + reg = <0x50>; + }; + + rtc_wdt: rtc_wdt@68 { + compatible = "dallas,ds1374"; + reg = <0x68>; + }; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&cppi41dma { + status = "okay"; +}; + +/* Power */ +&vbat { + regulator-name = "vbat"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; +}; + +&mac { + pinctrl-names = "default"; + pinctrl-0 = <&cpsw_default>; + status = "okay"; +}; + +&davinci_mdio { + pinctrl-names = "default"; + pinctrl-0 = <&davinci_mdio_default>; + status = "okay"; +}; + +&cpsw_emac0 { + status = "okay"; +}; + +&cpsw_emac1 { + status = "okay"; +}; + +&phy_sel { + reg= <0x44e10650 0xf5>; + rmii-clock-ext; +}; + +&sham { + status = "okay"; +}; + +&aes { + status = "okay"; +}; + +&gpio0 { + ti,no-reset-on-init; +}; + +&mmc2 { + pinctrl-names = "default"; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <8>; + pinctrl-0 = <&mmc1_pins_default>; + ti,non-removable; + status = "okay"; +}; + +&buttons { + pinctrl-names = "default"; + pinctrl-0 = <&push_button_pins>; + #address-cells = <1>; + #size-cells = <0>; + + button@0 { + label = "push_button"; + linux,code = <0x100>; + gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; + }; +}; + +/* SPI Busses */ +&spi0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins>; + + m25p80@0 { + compatible = "mx25l6405d"; + spi-max-frequency = <40000000>; + + reg = <0>; + spi-cpol; + spi-cpha; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* reg : The partition's offset and size within the mtd bank. */ + partitions@0 { + label = "MLO"; + reg = <0x0 0x80000>; + }; + + partitions@1 { + label = "U-Boot"; + reg = <0x80000 0x100000>; + }; + + partitions@2 { + label = "U-Boot Env"; + reg = <0x180000 0x40000>; + }; + }; + }; +}; + +&spi1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pins>; + + tpm_spi_tis@0 { + compatible = "tcg,tpm_tis-spi"; + reg = <0>; + spi-max-frequency = <500000>; + }; +}; Copied: stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts (from r342936, head/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts Mon Aug 5 16:56:11 2019 (r350594, copy of r342936, head/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts) @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 MOXA Inc. - https://www.moxa.com/ + * + * Authors: SZ Lin (林上智) + * Wes Huang (黃淵河) + * Fero JD Zhou (周俊達) + */ + +/dts-v1/; + +#include "am335x-moxa-uc-2100-common.dtsi" + +/ { + model = "Moxa UC-2101"; + compatible = "moxa,uc-2101", "ti,am33xx"; + + leds { + compatible = "gpio-leds"; + led1 { + label = "UC2100:GREEN:USER"; + gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; +}; + +&am33xx_pinmux { + pinctrl-names = "default"; + + cpsw_default: cpsw_default { + pinctrl-single,pins = < + /* Slave 1 */ + AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_crs.rmii1_crs_dv */ + AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE1) /* mii1_rxerr.rmii1_rxerr */ + AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txen.rmii1_txen */ + AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd1.rmii1_txd1 */ + AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd0.rmii1_txd0 */ + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 */ + AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 */ + AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_refclk.rmii1_refclk */ + >; + }; + + spi1_pins: pinmux_spi1 { + pinctrl-single,pins = < + AM33XX_IOPAD(0x964, PIN_INPUT_PULLUP | MUX_MODE4) /* ecap0_in_pwm0_out.spi1_sclk */ + AM33XX_IOPAD(0x978, PIN_INPUT_PULLUP | MUX_MODE4) /* uart1_ctsn.spi1_cs0 */ + AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE4) /* uart0_ctsn.spi1_d0 */ + AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE4) /* uart0_rtsn.spi1_d1 */ + >; + }; +}; + +&davinci_mdio { + phy0: ethernet-phy@4 { + reg = <4>; + }; +}; + +&cpsw_emac0 { + status = "okay"; + phy-handle = <&phy0>; + phy-mode = "rmii"; +}; + +&cpsw_emac1 { + status = "disabled"; +}; Modified: stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -422,18 +422,26 @@ pinctrl-names = "default"; pinctrl-0 = <&davinci_mdio_default>; status = "okay"; + + ethphy0: ethernet-phy@4 { + reg = <4>; + }; + + ethphy1: ethernet-phy@5 { + reg = <5>; + }; }; &cpsw_emac0 { status = "okay"; - phy_id = <&davinci_mdio>, <4>; + phy-handle = <ðphy0>; phy-mode = "rmii"; dual_emac_res_vlan = <1>; }; &cpsw_emac1 { status = "okay"; - phy_id = <&davinci_mdio>, <5>; + phy-handle = <ðphy1>; phy-mode = "rmii"; dual_emac_res_vlan = <2>; }; Modified: stable/12/sys/gnu/dts/arm/am335x-nano.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-nano.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-nano.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -380,16 +380,24 @@ &davinci_mdio { status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; + + ethphy1: ethernet-phy@1 { + reg = <1>; + }; }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "mii"; dual_emac_res_vlan = <1>; }; &cpsw_emac1 { - phy_id = <&davinci_mdio>, <1>; + phy-handle = <ðphy1>; phy-mode = "mii"; dual_emac_res_vlan = <2>; }; Modified: stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -161,7 +161,7 @@ invensense,key = [4e cc 7e eb f6 1e 35 22 00 34 0d 65 32 e9 94 89];*/ }; - bmp280: pressure@78 { + bmp280: pressure@76 { compatible = "bosch,bmp280"; reg = <0x76>; }; @@ -424,7 +424,7 @@ }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <4>; + phy-handle = <ðphy0>; phy-mode = "rgmii-txid"; }; @@ -441,6 +441,10 @@ pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; + + ethphy0: ethernet-phy@4 { + reg = <4>; + }; }; &mmc1 { Modified: stable/12/sys/gnu/dts/arm/am335x-pdu001.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-pdu001.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-pdu001.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -373,7 +373,7 @@ ti,pindir-d0-out-d1-in; status = "okay"; - cfaf240320a032t { + display-controller@0 { compatible = "orisetech,otm3225a"; reg = <0>; spi-max-frequency = <1000000>; @@ -533,16 +533,24 @@ pinctrl-names = "default"; pinctrl-0 = <&davinci_mdio_default>; status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; + + ethphy1: ethernet-phy@1 { + reg = <1>; + }; }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "mii"; dual_emac_res_vlan = <1>; }; &cpsw_emac1 { - phy_id = <&davinci_mdio>, <1>; + phy-handle = <ðphy1>; phy-mode = "mii"; dual_emac_res_vlan = <2>; }; Modified: stable/12/sys/gnu/dts/arm/am335x-pepper.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-pepper.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-pepper.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -265,13 +265,13 @@ /* Ethernet */ &cpsw_emac0 { status = "okay"; - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "rgmii"; }; &cpsw_emac1 { status = "okay"; - phy_id = <&davinci_mdio>, <1>; + phy-handle = <ðphy1>; phy-mode = "rgmii"; }; @@ -279,6 +279,14 @@ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&mdio_pins>; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; + + ethphy1: ethernet-phy@1 { + reg = <1>; + }; }; &mac { Modified: stable/12/sys/gnu/dts/arm/am335x-sancloud-bbe.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-sancloud-bbe.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-sancloud-bbe.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -103,10 +103,14 @@ pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; phy-mode = "rgmii-txid"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-shc.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-shc.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am335x-shc.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -206,7 +206,6 @@ status = "okay"; slaves = <1>; cpsw_emac0: slave@4a100200 { - phy_id = <&davinci_mdio>, <0>; phy-mode = "mii"; phy-handle = <ðernetphy0>; }; Copied: stable/12/sys/gnu/dts/arm/am3517-evm-ui.dtsi (from r342936, head/sys/gnu/dts/arm/am3517-evm-ui.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am3517-evm-ui.dtsi Mon Aug 5 16:56:11 2019 (r350594, copy of r342936, head/sys/gnu/dts/arm/am3517-evm-ui.dtsi) @@ -0,0 +1,220 @@ +/* + * Copyright (C) 2018 Logic PD, Inc - http://www.logicpd.com/ + * + * 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. + */ + +#include + +/ { + codec1 { + compatible = "simple-audio-card"; + simple-audio-card,name = "tlv320aic23-hifi"; + + simple-audio-card,widgets = + "Microphone", "Mic In", + "Line", "Line In", + "Line", "Line Out"; + + simple-audio-card,routing = + "Line Out", "LOUT", + "Line Out", "ROUT", + "LLINEIN", "Line In", + "RLINEIN", "Line In", + "MICIN", "Mic In"; + + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&sound_master>; + simple-audio-card,frame-master = <&sound_master>; + + simple-audio-card,cpu { + sound-dai = <&mcbsp1>; + }; + + sound_master: simple-audio-card,codec { + sound-dai = <&tlv320aic23_1>; + system-clock-frequency = <12000000>; + }; + }; + + codec2 { + compatible = "simple-audio-card"; + simple-audio-card,name = "tlv320aic23-hifi"; + + simple-audio-card,widgets = + "Microphone", "Mic In", + "Line", "Line In", + "Line", "Line Out"; + + simple-audio-card,routing = + "Line Out", "LOUT", + "Line Out", "ROUT", + "LLINEIN", "Line In", + "RLINEIN", "Line In", + "MICIN", "Mic In"; + + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&sound_master2>; + simple-audio-card,frame-master = <&sound_master2>; + + simple-audio-card,cpu { + sound-dai = <&mcbsp2>; + }; + + sound_master2: simple-audio-card,codec { + sound-dai = <&tlv320aic23_2>; + system-clock-frequency = <12000000>; + }; + }; + + expander-keys { + compatible = "gpio-keys-polled"; + poll-interval = <100>; + + record { + label = "Record"; + /* linux,code = ; */ + gpios = <&tca6416_2 15 GPIO_ACTIVE_LOW>; + }; + + play { + label = "Play"; + linux,code = ; + gpios = <&tca6416_2 14 GPIO_ACTIVE_LOW>; + }; + + Stop { + label = "Stop"; + linux,code = ; + gpios = <&tca6416_2 13 GPIO_ACTIVE_LOW>; + }; + + fwd { + label = "FWD"; + linux,code = ; + gpios = <&tca6416_2 12 GPIO_ACTIVE_LOW>; + }; + + rwd { + label = "RWD"; + linux,code = ; + gpios = <&tca6416_2 11 GPIO_ACTIVE_LOW>; + }; + + shift { + label = "Shift"; + linux,code = ; + gpios = <&tca6416_2 10 GPIO_ACTIVE_LOW>; + }; + + Mode { + label = "Mode"; + linux,code = ; + gpios = <&tca6416_2 9 GPIO_ACTIVE_LOW>; + }; + + Menu { + label = "Menu"; + linux,code = ; + gpios = <&tca6416_2 8 GPIO_ACTIVE_LOW>; + }; + + Up { + label = "Up"; + linux,code = ; + gpios = <&tca6416_2 7 GPIO_ACTIVE_LOW>; + }; + + Down { + label = "Down"; + linux,code = ; + gpios = <&tca6416_2 6 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&i2c2 { + /* Audio codecs */ + tlv320aic23_1: codec@1a { + compatible = "ti,tlv320aic23"; + reg = <0x1a>; + #sound-dai-cells= <0>; + status = "okay"; + }; + + tlv320aic23_2: codec@1b { + compatible = "ti,tlv320aic23"; + reg = <0x1b>; + #sound-dai-cells= <0>; + status = "okay"; + }; +}; + +&i2c3 { + /* Audio codecs */ + tlv320aic23_3: codec@1a { + compatible = "ti,tlv320aic23"; + reg = <0x1a>; + #sound-dai-cells= <0>; + status = "okay"; + }; + + /* GPIO Expanders */ + tca6416_2: gpio@20 { + compatible = "ti,tca6416"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + vcc-supply = <&vdd_io_reg>; + }; + + tca6416_3: gpio@21 { + compatible = "ti,tca6416"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + vcc-supply = <&vdd_io_reg>; + }; + + /* TVP5146 Analog Video decoder input */ + tvp5146@5c { + compatible = "ti,tvp5146m2"; + reg = <0x5c>; + }; +}; + +&mcbsp1 { + status = "ok"; + #sound-dai-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&mcbsp1_pins>; +}; + +&mcbsp2 { + status = "ok"; + #sound-dai-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&mcbsp2_pins>; +}; + +&omap3_pmx_core { + mcbsp1_pins: pinmux_mcbsp1_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x2190, PIN_OUTPUT | MUX_MODE0) /* mcbsp1_dx.mcbsp1_dx */ + OMAP3_CORE1_IOPAD(0x2192, PIN_INPUT | MUX_MODE0) /* mcbsp1_dx.mcbsp1_dr */ + OMAP3_CORE1_IOPAD(0x2196, PIN_INPUT | MUX_MODE0) /* mcbsp_clks.mcbsp1_fsx */ + OMAP3_CORE1_IOPAD(0x2198, PIN_INPUT | MUX_MODE0) /* mcbsp1_clkx.mcbsp1_clkx */ + >; + }; + + mcbsp2_pins: pinmux_mcbsp2_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x213c, PIN_INPUT | MUX_MODE0) /* mcbsp2_fsx.mcbsp2_fsx */ + OMAP3_CORE1_IOPAD(0x213e, PIN_INPUT | MUX_MODE0) /* mcbsp2_clkx.mcbsp2_clkx */ + OMAP3_CORE1_IOPAD(0x2140, PIN_INPUT | MUX_MODE0) /* mcbsp2_dr.mcbsp2.dr */ + OMAP3_CORE1_IOPAD(0x2142, PIN_OUTPUT | MUX_MODE0) /* mcbsp2_dx.mcbsp2_dx */ + >; + }; +}; Modified: stable/12/sys/gnu/dts/arm/am3517-evm.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am3517-evm.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am3517-evm.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -9,6 +9,7 @@ #include "am3517.dtsi" #include "am3517-som.dtsi" +#include "am3517-evm-ui.dtsi" #include / { @@ -227,7 +228,7 @@ 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 */ + cd-gpios = <&gpio4 31 GPIO_ACTIVE_LOW>; /* gpio_127 */ }; &mmc3 { Modified: stable/12/sys/gnu/dts/arm/am3517-som.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am3517-som.dtsi Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am3517-som.dtsi Mon Aug 5 16:56:11 2019 (r350594) @@ -163,7 +163,7 @@ compatible = "ti,wl1271"; reg = <2>; interrupt-parent = <&gpio6>; - interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; /* gpio_170 */ + interrupts = <10 IRQ_TYPE_EDGE_RISING>; /* gpio_170 */ ref-clock-frequency = <26000000>; tcxo-clock-frequency = <26000000>; }; Modified: stable/12/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am4372.dtsi Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am4372.dtsi Mon Aug 5 16:56:11 2019 (r350594) @@ -1101,7 +1101,7 @@ }; }; - qspi: qspi@47900000 { + qspi: spi@47900000 { compatible = "ti,am4372-qspi"; reg = <0x47900000 0x100>, <0x30000000 0x4000000>; Modified: stable/12/sys/gnu/dts/arm/am437x-cm-t43.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am437x-cm-t43.dts Mon Aug 5 16:48:16 2019 (r350593) +++ stable/12/sys/gnu/dts/arm/am437x-cm-t43.dts Mon Aug 5 16:56:11 2019 (r350594) @@ -339,16 +339,24 @@ pinctrl-names = "default"; pinctrl-0 = <&davinci_mdio_default>; status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <0>; + }; + + ethphy1: ethernet-phy@1 { + reg = <1>; + }; }; &cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; + phy-handle = <ðphy0>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 5 17:01:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D644A803E; Mon, 5 Aug 2019 17:01:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462PDd1xf1z3wYm; Mon, 5 Aug 2019 17:01:21 +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 0690B1EC8A; Mon, 5 Aug 2019 17:01:21 +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 x75H1KHP070531; Mon, 5 Aug 2019 17:01:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75H1JKE070523; Mon, 5 Aug 2019 17:01:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051701.x75H1JKE070523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 17:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350595 - in stable/12: etc/mtree release/arm64 sys/arm/allwinner/clkng sys/conf sys/modules/dtb/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12: etc/mtree release/arm64 sys/arm/allwinner/clkng sys/conf sys/modules/dtb/allwinner X-SVN-Commit-Revision: 350595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 17:01:21 -0000 Author: manu Date: Mon Aug 5 17:01:19 2019 New Revision: 350595 URL: https://svnweb.freebsd.org/changeset/base/350595 Log: MFC r342924, r343749-r343750, r343874, r344893-r344895, r345711 r342924: dtb: allwinner: Add orangepi-pc to the build PR: 226011 Submitted by: Greg V r343749: release: arm64: rpi3: Install the RPI3B+ DTB file We should use the correct DTB file otherwise the firmware uses the RPI3B one. r343750: release: arm64: pine64-lts: Use the newly created u-boot-pine64-lts port In U-Boot 2019.01 there is now a config for this board, use it for the release image. r343874: mtree: Add dtb subdir to the mtree file makefs will fails otherwise Reported by: emaste r344893: arm: allwinner: Fix NM clock recalc If the NM clock is using a fractional divider the formula isn't the same. r344894: arm64: allwinner: Add CCU DE2 The Display Engine 2 have it's own Clock and Control Unit, add support for it. r344895: arm64: allwinner: a64: Add TCON clock The tcon clock need a mux table for it's parent, for now just list the parents twice. r345711: arm: allwinner: clk: Fix nm_recalc When comparing best frequencies use the absolute value. If we do not do that we end up choosing an always lower value than the best one if the exact freq cannot be met. Added: stable/12/sys/arm/allwinner/clkng/ccu_de2.c - copied unchanged from r344895, head/sys/arm/allwinner/clkng/ccu_de2.c Modified: stable/12/etc/mtree/BSD.root.dist stable/12/release/arm64/PINE64-LTS.conf stable/12/release/arm64/RPI3.conf stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c stable/12/sys/arm/allwinner/clkng/ccu_a64.c stable/12/sys/conf/files.arm64 stable/12/sys/modules/dtb/allwinner/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/etc/mtree/BSD.root.dist ============================================================================== --- stable/12/etc/mtree/BSD.root.dist Mon Aug 5 16:56:11 2019 (r350594) +++ stable/12/etc/mtree/BSD.root.dist Mon Aug 5 17:01:19 2019 (r350595) @@ -11,7 +11,11 @@ defaults .. dtb + allwinner tags=package=runtime + .. overlays tags=package=runtime + .. + rockchip tags=package=runtime .. .. firmware Modified: stable/12/release/arm64/PINE64-LTS.conf ============================================================================== --- stable/12/release/arm64/PINE64-LTS.conf Mon Aug 5 16:56:11 2019 (r350594) +++ stable/12/release/arm64/PINE64-LTS.conf Mon Aug 5 17:01:19 2019 (r350595) @@ -6,7 +6,7 @@ EMBEDDED_TARGET_ARCH="aarch64" EMBEDDED_TARGET="arm64" EMBEDDEDBUILD=1 -EMBEDDEDPORTS="sysutils/u-boot-sopine" +EMBEDDEDPORTS="sysutils/u-boot-pine64-lts" FAT_SIZE="54m -b 1m" FAT_TYPE="16" IMAGE_SIZE="3072M" @@ -18,7 +18,7 @@ FDT_OVERLAYS="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64 export BOARDNAME="PINE64-LTS" arm_install_uboot() { - UBOOT_DIR="/usr/local/share/u-boot/u-boot-sopine" + UBOOT_DIR="/usr/local/share/u-boot/u-boot-pine64-lts" UBOOT_FILES="u-boot-sunxi-with-spl.bin" chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \ of=/dev/${mddev} bs=1k seek=8 conv=sync Modified: stable/12/release/arm64/RPI3.conf ============================================================================== --- stable/12/release/arm64/RPI3.conf Mon Aug 5 16:56:11 2019 (r350594) +++ stable/12/release/arm64/RPI3.conf Mon Aug 5 17:01:19 2019 (r350595) @@ -4,7 +4,7 @@ # DTB_DIR="/usr/local/share/rpi-firmware" -DTB="bcm2710-rpi-3-b.dtb" +DTB="bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb" EMBEDDED_TARGET_ARCH="aarch64" EMBEDDED_TARGET="arm64" EMBEDDEDBUILD=1 Modified: stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c Mon Aug 5 16:56:11 2019 (r350594) +++ stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c Mon Aug 5 17:01:19 2019 (r350595) @@ -155,7 +155,7 @@ aw_clk_nm_find_best(struct aw_clk_nm_sc *sc, uint64_t for (m = min_m; m <= max_m; ) { for (n = min_m; n <= max_n; ) { cur = fparent / n / m; - if ((*fout - cur) < (*fout - best)) { + if (abs(*fout - cur) < abs(*fout - best)) { best = cur; *factor_n = n; *factor_m = m; @@ -300,7 +300,11 @@ aw_clk_nm_recalc(struct clknode *clk, uint64_t *freq) else prediv = 1; - *freq = *freq / prediv / n / m; + /* For FRAC NM the formula is freq_parent * n / m */ + if (sc->flags & AW_CLK_HAS_FRAC) + *freq = *freq * n / m; + else + *freq = *freq / prediv / n / m; } return (0); Modified: stable/12/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_a64.c Mon Aug 5 16:56:11 2019 (r350594) +++ stable/12/sys/arm/allwinner/clkng/ccu_a64.c Mon Aug 5 17:01:19 2019 (r350595) @@ -289,6 +289,15 @@ NM_CLK_WITH_FRAC(pll_video0_clk, AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ 24, 25); /* mode sel, freq sel */ +static const char *pll_video0_2x_parents[] = {"pll_video0"}; +FIXED_CLK(pll_video0_2x_clk, + CLK_PLL_VIDEO0_2X, /* id */ + "pll_video0-2x", /* name */ + pll_video0_2x_parents, /* parent */ + 0, /* freq */ + 2, /* mult */ + 1, /* div */ + 0); /* flags */ static const char *pll_ve_parents[] = {"osc24M"}; NM_CLK_WITH_FRAC(pll_ve_clk, @@ -631,6 +640,15 @@ NM_CLK(de_clk, AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ /* TCON0/1 Needs mux table */ +static const char *tcon1_parents[] = {"pll_video0", "pll_video0", "pll_video1"}; +NM_CLK(tcon1_clk, + CLK_TCON1, "tcon1", tcon1_parents, + 0x11C, + 0, 0, 1, AW_CLK_FACTOR_FIXED, + 0, 4, 0, 0, + 24, 2, + 31, + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); static const char *deinterlace_parents[] = {"pll_periph0", "pll_periph1"}; NM_CLK(deinterlace_clk, @@ -727,6 +745,7 @@ static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_NM, .clk.nm = &spdif_clk}, { .type = AW_CLK_NM, .clk.nm = &dram_clk}, { .type = AW_CLK_NM, .clk.nm = &de_clk}, + { .type = AW_CLK_NM, .clk.nm = &tcon1_clk}, { .type = AW_CLK_NM, .clk.nm = &deinterlace_clk}, { .type = AW_CLK_NM, .clk.nm = &csi_sclk_clk}, { .type = AW_CLK_NM, .clk.nm = &csi_mclk_clk}, @@ -750,6 +769,7 @@ static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_FIXED, .clk.fixed = &pll_audio_2x_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &pll_audio_4x_clk}, { .type = AW_CLK_FIXED, .clk.fixed = &pll_audio_8x_clk}, + { .type = AW_CLK_FIXED, .clk.fixed = &pll_video0_2x_clk}, }; static struct aw_clk_init a64_init_clks[] = { Copied: stable/12/sys/arm/allwinner/clkng/ccu_de2.c (from r344895, head/sys/arm/allwinner/clkng/ccu_de2.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/allwinner/clkng/ccu_de2.c Mon Aug 5 17:01:19 2019 (r350595, copy of r344895, head/sys/arm/allwinner/clkng/ccu_de2.c) @@ -0,0 +1,167 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "opt_soc.h" + +#include +#include +#include + +#include + +#include +#include + +/* Non exported clocks */ +#define CLK_MIXER0_DIV 3 +#define CLK_MIXER1_DIV 4 +#define CLK_WB_DIV 5 + +static struct aw_ccung_reset de2_ccu_resets[] = { + CCU_RESET(RST_MIXER0, 0x08, 0) + CCU_RESET(RST_MIXER1, 0x08, 1) + CCU_RESET(RST_WB, 0x08, 2) +}; + +static struct aw_ccung_gate de2_ccu_gates[] = { + CCU_GATE(CLK_BUS_MIXER0, "mixer0", "mixer0-div", 0x00, 0) + CCU_GATE(CLK_BUS_MIXER1, "mixer1", "mixer1-div", 0x00, 1) + CCU_GATE(CLK_BUS_WB, "wb", "wb-div", 0x00, 2) + + CCU_GATE(CLK_MIXER0, "bus-mixer0", "bus-de", 0x04, 0) + CCU_GATE(CLK_MIXER1, "bus-mixer1", "bus-de", 0x04, 1) + CCU_GATE(CLK_WB, "bus-wb", "bus-de", 0x04, 2) +}; + +static const char *div_parents[] = {"de"}; + +NM_CLK(mixer0_div_clk, + CLK_MIXER0_DIV, /* id */ + "mixer0-div", div_parents, /* names, parents */ + 0x0C, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* N factor (fake)*/ + 0, 4, 0, 0, /* M flags */ + 0, 0, /* mux */ + 0, /* gate */ + AW_CLK_SCALE_CHANGE); /* flags */ + +NM_CLK(mixer1_div_clk, + CLK_MIXER1_DIV, /* id */ + "mixer1-div", div_parents, /* names, parents */ + 0x0C, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* N factor (fake)*/ + 4, 4, 0, 0, /* M flags */ + 0, 0, /* mux */ + 0, /* gate */ + AW_CLK_SCALE_CHANGE); /* flags */ + +NM_CLK(wb_div_clk, + CLK_WB_DIV, /* id */ + "wb-div", div_parents, /* names, parents */ + 0x0C, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* N factor (fake)*/ + 8, 4, 0, 0, /* M flags */ + 0, 0, /* mux */ + 0, /* gate */ + AW_CLK_SCALE_CHANGE); /* flags */ + +static struct aw_ccung_clk de2_ccu_clks[] = { + { .type = AW_CLK_NM, .clk.nm = &mixer0_div_clk}, + { .type = AW_CLK_NM, .clk.nm = &mixer1_div_clk}, + { .type = AW_CLK_NM, .clk.nm = &wb_div_clk}, +}; + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun50i-a64-de2-clk", 1}, + {"allwinner,sun50i-h5-de2-clk", 1}, + {NULL, 0} +}; + +static int +ccu_de2_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner DE2 Clock Control Unit"); + return (BUS_PROBE_DEFAULT); +} + +static int +ccu_de2_attach(device_t dev) +{ + struct aw_ccung_softc *sc; + + sc = device_get_softc(dev); + + sc->resets = de2_ccu_resets; + sc->nresets = nitems(de2_ccu_resets); + sc->gates = de2_ccu_gates; + sc->ngates = nitems(de2_ccu_gates); + sc->clks = de2_ccu_clks; + sc->nclks = nitems(de2_ccu_clks); + + return (aw_ccung_attach(dev)); +} + +static device_method_t ccu_de2_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ccu_de2_probe), + DEVMETHOD(device_attach, ccu_de2_attach), + + DEVMETHOD_END +}; + +static devclass_t ccu_de2ng_devclass; + +DEFINE_CLASS_1(ccu_de2, ccu_de2_driver, ccu_de2_methods, + sizeof(struct aw_ccung_softc), aw_ccung_driver); + +EARLY_DRIVER_MODULE(ccu_de2, simplebus, ccu_de2_driver, + ccu_de2ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Mon Aug 5 16:56:11 2019 (r350594) +++ stable/12/sys/conf/files.arm64 Mon Aug 5 17:01:19 2019 (r350595) @@ -51,6 +51,7 @@ arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_cc arm/allwinner/clkng/ccu_a64.c optional soc_allwinner_a64 aw_ccu fdt arm/allwinner/clkng/ccu_h3.c optional soc_allwinner_h5 aw_ccu fdt arm/allwinner/clkng/ccu_sun8i_r.c optional aw_ccu fdt +arm/allwinner/clkng/ccu_de2.c optional aw_ccu fdt # Allwinner padconf files arm/allwinner/a64/a64_padconf.c optional soc_allwinner_a64 fdt Modified: stable/12/sys/modules/dtb/allwinner/Makefile ============================================================================== --- stable/12/sys/modules/dtb/allwinner/Makefile Mon Aug 5 16:56:11 2019 (r350594) +++ stable/12/sys/modules/dtb/allwinner/Makefile Mon Aug 5 17:01:19 2019 (r350595) @@ -20,6 +20,7 @@ DTS= \ sun8i-h3-nanopi-m1-plus.dts \ sun8i-h3-nanopi-neo.dts \ sun8i-h3-orangepi-one.dts \ + sun8i-h3-orangepi-pc.dts \ sun8i-h3-orangepi-plus2e.dts DTSO= sun8i-a83t-sid.dtso \ From owner-svn-src-all@freebsd.org Mon Aug 5 17:06:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78BAEA8300; Mon, 5 Aug 2019 17:06:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462PLP3Pq0z3wqH; Mon, 5 Aug 2019 17:06:21 +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 3E04B1EE11; Mon, 5 Aug 2019 17:06:21 +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 x75H6Le1074581; Mon, 5 Aug 2019 17:06:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75H6KBO074578; Mon, 5 Aug 2019 17:06:20 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051706.x75H6KBO074578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 17:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350596 - stable/12/sys/dev/iicbus/twsi X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 350596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 17:06:21 -0000 Author: manu Date: Mon Aug 5 17:06:20 2019 New Revision: 350596 URL: https://svnweb.freebsd.org/changeset/base/350596 Log: MFC r345948, r345951 r345948: twsi: Add interrupt mode Add the ability to use interrupts for i2c message. We still use polling for early boot i2c transfer (for PMIC for example) but as soon as interrupts are available use them. On Allwinner SoC >A20 is seems that polling mode is broken for some reason, this is now fixed by using interrupt mode. For Allwinner also fix the frequency calculation, the one in the code was for when the APB frequency is at 48Mhz while it is at 24Mhz on most (all?) Allwinner SoCs. We now support both cases. While here add more debug info when it's compiled in. Tested On: A20, H3, A64 r345951: twsi: Use config_intrhook_oneshot instead of config_intrhook_establish Suggested by: ian X-MFC-With: 345948 Modified: stable/12/sys/dev/iicbus/twsi/a10_twsi.c stable/12/sys/dev/iicbus/twsi/twsi.c stable/12/sys/dev/iicbus/twsi/twsi.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/a10_twsi.c Mon Aug 5 17:01:19 2019 (r350595) +++ stable/12/sys/dev/iicbus/twsi/a10_twsi.c Mon Aug 5 17:06:20 2019 (r350596) @@ -1,6 +1,5 @@ /*- - * Copyright (c) 2016 Emmanuel Vadot - * All rights reserved. + * Copyright (c) 2016-2019 Emmanuel Vadot * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -90,6 +89,7 @@ a10_twsi_attach(device_t dev) struct twsi_softc *sc; clk_t clk; hwreset_t rst; + uint64_t freq; int error; sc = device_get_softc(dev); @@ -124,10 +124,31 @@ a10_twsi_attach(device_t dev) sc->reg_soft_reset = TWI_SRST; /* Setup baud rate params */ - sc->baud_rate[IIC_SLOW].param = TWSI_BAUD_RATE_PARAM(11, 2); - sc->baud_rate[IIC_FAST].param = TWSI_BAUD_RATE_PARAM(11, 2); - sc->baud_rate[IIC_FASTEST].param = TWSI_BAUD_RATE_PARAM(2, 2); + clk_get_freq(clk, &freq); + switch (freq) { + /* + * Formula is + * F0 = FINT / 2 ^ CLK_N + * F1 = F0 / (CLK_M + 1) + * + * Doc says that the output freq is F1/10 but my logic analyzer says otherwise + */ + case 48000000: + sc->baud_rate[IIC_SLOW].param = TWSI_BAUD_RATE_PARAM(11, 1); + sc->baud_rate[IIC_FAST].param = TWSI_BAUD_RATE_PARAM(11, 1); + sc->baud_rate[IIC_FASTEST].param = TWSI_BAUD_RATE_PARAM(2, 1); + break; + case 24000000: + sc->baud_rate[IIC_SLOW].param = TWSI_BAUD_RATE_PARAM(5, 2); + sc->baud_rate[IIC_FAST].param = TWSI_BAUD_RATE_PARAM(5, 2); + sc->baud_rate[IIC_FASTEST].param = TWSI_BAUD_RATE_PARAM(2, 2); + break; + default: + device_printf(dev, "Non supported frequency\n"); + return (ENXIO); + } + sc->need_ack = true; return (twsi_attach(dev)); } @@ -154,8 +175,8 @@ DEFINE_CLASS_1(iichb, a10_twsi_driver, a10_twsi_method static devclass_t a10_twsi_devclass; EARLY_DRIVER_MODULE(a10_twsi, simplebus, a10_twsi_driver, a10_twsi_devclass, - 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); EARLY_DRIVER_MODULE(iicbus, a10_twsi, iicbus_driver, iicbus_devclass, - 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); MODULE_DEPEND(a10_twsi, iicbus, 1, 1, 1); SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.c Mon Aug 5 17:01:19 2019 (r350595) +++ stable/12/sys/dev/iicbus/twsi/twsi.c Mon Aug 5 17:06:20 2019 (r350596) @@ -31,7 +31,7 @@ /* * Driver for the TWSI (aka I2C, aka IIC) bus controller found on Marvell - * and Allwinner SoCs. Supports master operation only, and works in polling mode. + * and Allwinner SoCs. Supports master operation only. * * Calls to DELAY() are needed per Application Note AN-179 "TWSI Software * Guidelines for Discovery(TM), Horizon (TM) and Feroceon(TM) Devices". @@ -75,8 +75,11 @@ __FBSDID("$FreeBSD$"); #define TWSI_STATUS_START 0x08 #define TWSI_STATUS_RPTD_START 0x10 #define TWSI_STATUS_ADDR_W_ACK 0x18 +#define TWSI_STATUS_ADDR_W_NACK 0x20 #define TWSI_STATUS_DATA_WR_ACK 0x28 +#define TWSI_STATUS_DATA_WR_NACK 0x30 #define TWSI_STATUS_ADDR_R_ACK 0x40 +#define TWSI_STATUS_ADDR_R_NACK 0x48 #define TWSI_STATUS_DATA_RD_ACK 0x50 #define TWSI_STATUS_DATA_RD_NOACK 0x58 @@ -84,27 +87,32 @@ __FBSDID("$FreeBSD$"); #undef TWSI_DEBUG #ifdef TWSI_DEBUG -#define debugf(fmt, args...) do { printf("%s(): ", __func__); printf(fmt,##args); } while (0) +#define debugf(dev, fmt, args...) device_printf(dev, "%s: " fmt, __func__, ##args) #else -#define debugf(fmt, args...) +#define debugf(dev, fmt, args...) #endif static struct resource_spec res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE}, { -1, 0 } }; static __inline uint32_t TWSI_READ(struct twsi_softc *sc, bus_size_t off) { + uint32_t val; - return (bus_read_4(sc->res[0], off)); + val = bus_read_4(sc->res[0], off); + debugf(sc->dev, "read %x from %lx\n", val, off); + return (val); } static __inline void TWSI_WRITE(struct twsi_softc *sc, bus_size_t off, uint32_t val) { + debugf(sc->dev, "Writing %x to %lx\n", val, off); bus_write_4(sc->res[0], off, val); } @@ -114,8 +122,10 @@ twsi_control_clear(struct twsi_softc *sc, uint32_t mas uint32_t val; val = TWSI_READ(sc, sc->reg_control); + debugf(sc->dev, "read val=%x\n", val); val &= ~(TWSI_CONTROL_STOP | TWSI_CONTROL_START); val &= ~mask; + debugf(sc->dev, "write val=%x\n", val); TWSI_WRITE(sc, sc->reg_control, val); } @@ -125,8 +135,10 @@ twsi_control_set(struct twsi_softc *sc, uint32_t mask) uint32_t val; val = TWSI_READ(sc, sc->reg_control); + debugf(sc->dev, "read val=%x\n", val); val &= ~(TWSI_CONTROL_STOP | TWSI_CONTROL_START); val |= mask; + debugf(sc->dev, "write val=%x\n", val); TWSI_WRITE(sc, sc->reg_control, val); } @@ -151,11 +163,13 @@ twsi_poll_ctrl(struct twsi_softc *sc, int timeout, uin { timeout /= 10; + debugf(sc->dev, "Waiting for ctrl reg to match mask %x\n", mask); while (!(TWSI_READ(sc, sc->reg_control) & mask)) { DELAY(10); if (--timeout < 0) return (timeout); } + debugf(sc->dev, "done\n"); return (0); } @@ -179,10 +193,11 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, /* read IFLG to know if it should be cleared later; from NBSD */ iflg_set = TWSI_READ(sc, sc->reg_control) & TWSI_CONTROL_IFLG; + debugf(dev, "send start\n"); twsi_control_set(sc, TWSI_CONTROL_START); if (mask == TWSI_STATUS_RPTD_START && iflg_set) { - debugf("IFLG set, clearing\n"); + debugf(dev, "IFLG set, clearing (mask=%x)\n", mask); twsi_clear_iflg(sc); } @@ -193,14 +208,16 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, DELAY(1000); if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf("timeout sending %sSTART condition\n", + debugf(dev, "timeout sending %sSTART condition\n", mask == TWSI_STATUS_START ? "" : "repeated "); return (IIC_ETIMEOUT); } status = TWSI_READ(sc, sc->reg_status); + debugf(dev, "status=%x\n", status); + if (status != mask) { - debugf("wrong status (%02x) after sending %sSTART condition\n", + debugf(dev, "wrong status (%02x) after sending %sSTART condition\n", status, mask == TWSI_STATUS_START ? "" : "repeated "); return (IIC_ESTATUS); } @@ -210,15 +227,15 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, DELAY(1000); if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf("timeout sending slave address\n"); + debugf(dev, "timeout sending slave address (timeout=%d)\n", timeout); return (IIC_ETIMEOUT); } - + read_access = (slave & 0x1) ? 1 : 0; status = TWSI_READ(sc, sc->reg_status); if (status != (read_access ? TWSI_STATUS_ADDR_R_ACK : TWSI_STATUS_ADDR_W_ACK)) { - debugf("no ACK (status: %02x) after sending slave address\n", + debugf(dev, "no ACK (status: %02x) after sending slave address\n", status); return (IIC_ENOACK); } @@ -234,6 +251,7 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_ { struct twsi_softc *sc; uint32_t param; + /* uint32_t val; */ sc = device_get_softc(dev); @@ -241,17 +259,18 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_ case IIC_SLOW: case IIC_FAST: param = sc->baud_rate[speed].param; + debugf(dev, "Using IIC_FAST mode with speed param=%x\n", param); break; case IIC_FASTEST: case IIC_UNKNOWN: default: param = sc->baud_rate[IIC_FAST].param; + debugf(dev, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param); break; } mtx_lock(&sc->mutex); TWSI_WRITE(sc, sc->reg_soft_reset, 0x0); - DELAY(2000); TWSI_WRITE(sc, sc->reg_baud_rate, param); TWSI_WRITE(sc, sc->reg_control, TWSI_CONTROL_TWSIEN); DELAY(1000); @@ -267,6 +286,7 @@ twsi_stop(device_t dev) sc = device_get_softc(dev); + debugf(dev, "%s\n", __func__); mtx_lock(&sc->mutex); twsi_control_clear(sc, TWSI_CONTROL_ACK); twsi_control_set(sc, TWSI_CONTROL_STOP); @@ -288,6 +308,7 @@ twsi_repeated_start(device_t dev, u_char slave, int ti sc = device_get_softc(dev); + debugf(dev, "%s: slave=%x\n", __func__, slave); mtx_lock(&sc->mutex); rv = twsi_locked_start(dev, sc, TWSI_STATUS_RPTD_START, slave, timeout); @@ -311,6 +332,7 @@ twsi_start(device_t dev, u_char slave, int timeout) sc = device_get_softc(dev); + debugf(dev, "%s: slave=%x\n", __func__, slave); mtx_lock(&sc->mutex); rv = twsi_locked_start(dev, sc, TWSI_STATUS_START, slave, timeout); mtx_unlock(&sc->mutex); @@ -348,7 +370,7 @@ twsi_read(device_t dev, char *buf, int len, int *read, DELAY(1000); if (twsi_poll_ctrl(sc, delay, TWSI_CONTROL_IFLG)) { - debugf("timeout reading data\n"); + debugf(dev, "timeout reading data (delay=%d)\n", delay); rv = IIC_ETIMEOUT; goto out; } @@ -356,7 +378,7 @@ twsi_read(device_t dev, char *buf, int len, int *read, status = TWSI_READ(sc, sc->reg_status); if (status != (last_byte ? TWSI_STATUS_DATA_RD_NOACK : TWSI_STATUS_DATA_RD_ACK)) { - debugf("wrong status (%02x) while reading\n", status); + debugf(dev, "wrong status (%02x) while reading\n", status); rv = IIC_ESTATUS; goto out; } @@ -387,14 +409,14 @@ twsi_write(device_t dev, const char *buf, int len, int twsi_clear_iflg(sc); DELAY(1000); if (twsi_poll_ctrl(sc, timeout, TWSI_CONTROL_IFLG)) { - debugf("timeout writing data\n"); + debugf(dev, "timeout writing data (timeout=%d)\n", timeout); rv = IIC_ETIMEOUT; goto out; } status = TWSI_READ(sc, sc->reg_status); if (status != TWSI_STATUS_DATA_WR_ACK) { - debugf("wrong status (%02x) while writing\n", status); + debugf(dev, "wrong status (%02x) while writing\n", status); rv = IIC_ESTATUS; goto out; } @@ -406,6 +428,201 @@ out: return (rv); } +static int +twsi_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) +{ + struct twsi_softc *sc; + int i; + + sc = device_get_softc(dev); + + if (sc->have_intr == false) + return (iicbus_transfer_gen(dev, msgs, nmsgs)); + + sc->error = 0; + + sc->control_val = TWSI_CONTROL_TWSIEN | + TWSI_CONTROL_INTEN | TWSI_CONTROL_ACK; + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + debugf(dev, "transmitting %d messages\n", nmsgs); + debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); + for (i = 0; i < nmsgs && sc->error == 0; i++) { + sc->transfer = 1; + sc->msg = &msgs[i]; + debugf(dev, "msg[%d] flags: %x\n", i, msgs[i].flags); + debugf(dev, "msg[%d] len: %d\n", i, msgs[i].len); + + /* Send start and re-enable interrupts */ + sc->control_val = TWSI_CONTROL_TWSIEN | + TWSI_CONTROL_INTEN | TWSI_CONTROL_ACK; + if (sc->msg->len == 1) + sc->control_val &= ~TWSI_CONTROL_ACK; + TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); + while (sc->error == 0 && sc->transfer != 0) { + pause_sbt("twsi", SBT_1MS * 30, SBT_1MS, 0); + } + + debugf(dev, "Done with msg[%d]\n", i); + if (sc->error) { + debugf(sc->dev, "Error, aborting (%d)\n", sc->error); + TWSI_WRITE(sc, sc->reg_control, 0); + goto out; + } + } + + /* Disable module and interrupts */ + debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); + TWSI_WRITE(sc, sc->reg_control, 0); + debugf(sc->dev, "status=%x\n", TWSI_READ(sc, sc->reg_status)); + +out: + return (sc->error); +} + +static void +twsi_intr(void *arg) +{ + struct twsi_softc *sc; + uint32_t status; + int transfer_done = 0; + + sc = arg; + + debugf(sc->dev, "Got interrupt\n"); + + while (TWSI_READ(sc, sc->reg_control) & TWSI_CONTROL_IFLG) { + status = TWSI_READ(sc, sc->reg_status); + debugf(sc->dev, "status=%x\n", status); + + switch (status) { + case TWSI_STATUS_START: + case TWSI_STATUS_RPTD_START: + /* Transmit the address */ + debugf(sc->dev, "Send the address\n"); + + if (sc->msg->flags & IIC_M_RD) + TWSI_WRITE(sc, sc->reg_data, + sc->msg->slave | LSB); + else + TWSI_WRITE(sc, sc->reg_data, + sc->msg->slave & ~LSB); + + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; + + case TWSI_STATUS_ADDR_W_ACK: + debugf(sc->dev, "Ack received after transmitting the address\n"); + /* Directly send the first byte */ + sc->sent_bytes = 0; + debugf(sc->dev, "Sending byte 0 = %x\n", sc->msg->buf[0]); + TWSI_WRITE(sc, sc->reg_data, sc->msg->buf[0]); + + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; + + case TWSI_STATUS_ADDR_R_ACK: + sc->recv_bytes = 0; + + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; + + case TWSI_STATUS_ADDR_W_NACK: + case TWSI_STATUS_ADDR_R_NACK: + debugf(sc->dev, "No ack received after transmitting the address\n"); + sc->transfer = 0; + sc->error = ETIMEDOUT; + sc->control_val = 0; + wakeup(sc); + break; + + case TWSI_STATUS_DATA_WR_ACK: + debugf(sc->dev, "Ack received after transmitting data\n"); + if (sc->sent_bytes++ == (sc->msg->len - 1)) { + debugf(sc->dev, "Done sending all the bytes\n"); + /* Send stop, no interrupts on stop */ + if (!(sc->msg->flags & IIC_M_NOSTOP)) { + debugf(sc->dev, "Done TX data, send stop\n"); + TWSI_WRITE(sc, sc->reg_control, + sc->control_val | TWSI_CONTROL_STOP); + } else { + sc->control_val &= ~TWSI_CONTROL_INTEN; + TWSI_WRITE(sc, sc->reg_control, + sc->control_val); + } + transfer_done = 1; + } else { + debugf(sc->dev, "Sending byte %d = %x\n", + sc->sent_bytes, + sc->msg->buf[sc->sent_bytes]); + TWSI_WRITE(sc, sc->reg_data, + sc->msg->buf[sc->sent_bytes]); + TWSI_WRITE(sc, sc->reg_control, + sc->control_val); + } + + break; + case TWSI_STATUS_DATA_RD_ACK: + debugf(sc->dev, "Ack received after receiving data\n"); + debugf(sc->dev, "msg_len=%d recv_bytes=%d\n", sc->msg->len, sc->recv_bytes); + sc->msg->buf[sc->recv_bytes++] = TWSI_READ(sc, sc->reg_data); + + /* If we only have one byte left, disable ACK */ + if (sc->msg->len - sc->recv_bytes == 1) + sc->control_val &= ~TWSI_CONTROL_ACK; + TWSI_WRITE(sc, sc->reg_control, sc->control_val); + break; + + case TWSI_STATUS_DATA_RD_NOACK: + if (sc->msg->len - sc->recv_bytes == 1) { + sc->msg->buf[sc->recv_bytes++] = TWSI_READ(sc, sc->reg_data); + debugf(sc->dev, "Done RX data, send stop (2)\n"); + if (!(sc->msg->flags & IIC_M_NOSTOP)) + TWSI_WRITE(sc, sc->reg_control, + sc->control_val | TWSI_CONTROL_STOP); + } else { + debugf(sc->dev, "No ack when receiving data\n"); + sc->error = ENXIO; + sc->control_val = 0; + } + sc->transfer = 0; + transfer_done = 1; + break; + + default: + debugf(sc->dev, "status=%x hot handled\n", status); + sc->transfer = 0; + sc->error = ENXIO; + sc->control_val = 0; + wakeup(sc); + break; + } + + if (sc->need_ack) + TWSI_WRITE(sc, sc->reg_control, + sc->control_val | TWSI_CONTROL_IFLG); + } + + debugf(sc->dev, "Done with interrupts\n"); + if (transfer_done == 1) { + sc->transfer = 0; + wakeup(sc); + } +} + +static void +twsi_intr_start(void *pdev) +{ + struct twsi_softc *sc; + + sc = device_get_softc(pdev); + + if ((bus_setup_intr(pdev, sc->res[1], INTR_TYPE_MISC | INTR_MPSAFE, + NULL, twsi_intr, sc, &sc->intrhand))) + device_printf(pdev, "unable to register interrupt handler\n"); + + sc->have_intr = true; +} + int twsi_attach(device_t dev) { @@ -430,6 +647,8 @@ twsi_attach(device_t dev) } bus_generic_attach(dev); + config_intrhook_oneshot(twsi_intr_start, dev); + return (0); } @@ -448,6 +667,9 @@ twsi_detach(device_t dev) if ((rv = device_delete_child(dev, sc->iicbus)) != 0) return (rv); + if (sc->intrhand != NULL) + bus_teardown_intr(sc->dev, sc->res[1], sc->intrhand); + bus_release_resources(dev, res_spec, sc->res); mtx_destroy(&sc->mutex); @@ -477,7 +699,7 @@ static device_method_t twsi_methods[] = { DEVMETHOD(iicbus_write, twsi_write), DEVMETHOD(iicbus_read, twsi_read), DEVMETHOD(iicbus_reset, twsi_reset), - DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), + DEVMETHOD(iicbus_transfer, twsi_transfer), { 0, 0 } }; Modified: stable/12/sys/dev/iicbus/twsi/twsi.h ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.h Mon Aug 5 17:01:19 2019 (r350595) +++ stable/12/sys/dev/iicbus/twsi/twsi.h Mon Aug 5 17:06:20 2019 (r350596) @@ -43,9 +43,19 @@ struct twsi_baud_rate { struct twsi_softc { device_t dev; - struct resource *res[1]; /* SYS_RES_MEMORY */ + struct resource *res[2]; struct mtx mutex; device_t iicbus; + void * intrhand; + bool have_intr; + + struct iic_msg *msg; + uint16_t sent_bytes; + uint16_t recv_bytes; + int transfer; + int error; + uint32_t control_val; + bool need_ack; bus_size_t reg_data; bus_size_t reg_slave_addr; From owner-svn-src-all@freebsd.org Mon Aug 5 17:23:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4980BA89C8; Mon, 5 Aug 2019 17:23:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Pk71yf4z3xsw; Mon, 5 Aug 2019 17:23:27 +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 0783C1F191; Mon, 5 Aug 2019 17:23:27 +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 x75HNRgG086445; Mon, 5 Aug 2019 17:23:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75HNNVE086427; Mon, 5 Aug 2019 17:23:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051723.x75HNNVE086427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 17:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350597 - in stable/12/sys: arm/allwinner arm/allwinner/clkng gnu/dts/arm gnu/dts/arm64/allwinner gnu/dts/arm64/altera gnu/dts/arm64/amlogic gnu/dts/arm64/arm gnu/dts/arm64/exynos gnu/d... X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner arm/allwinner/clkng gnu/dts/arm gnu/dts/arm64/allwinner gnu/dts/arm64/altera gnu/dts/arm64/amlogic gnu/dts/arm64/arm gnu/dts/arm64/exynos gnu/dts/arm64/freescale gnu/dt... X-SVN-Commit-Revision: 350597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 17:23:27 -0000 Author: manu Date: Mon Aug 5 17:23:23 2019 New Revision: 350597 URL: https://svnweb.freebsd.org/changeset/base/350597 Log: MFC r346092, r346271-r346272 r346092: Import DTS files from Linux 5.0 r346271: aw_rtc: Register the clocks Since latest DTS update the rtc is supposed to register two clocks : - osc32k (the 32k oscillator on the board that the RTC uses directly and that other peripheral can use) - iosc (the internal oscillator of the RTC when available which frequency depend on the SoC revision) Since we need the RTC before the proper clock control unit (because it uses those clocks) attach it a BUS_PASS_BUS + MIDDLE and attach the clock control unit at BUS_PASS_BUS + LAST for the SoC that requires it. Tested On: A20, H3, A64 r346272: aw_syscon: Add a new compatible Since 5.0 DTS the syscon controller have a new compatible as it exports new subnodes, we currently only use it as a syscon provider so just add the new compatible. Tested On: H3 Added: stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/am33xx-l4.dtsi stable/12/sys/gnu/dts/arm/am437x-l4.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/am437x-l4.dtsi stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts stable/12/sys/gnu/dts/arm/bcm2836-rpi.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/bcm2836-rpi.dtsi stable/12/sys/gnu/dts/arm/bcm4708-linksys-ea6500-v2.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/bcm4708-linksys-ea6500-v2.dts stable/12/sys/gnu/dts/arm/dra7-l4.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/dra7-l4.dtsi stable/12/sys/gnu/dts/arm/facebook-bmc-flash-layout.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/facebook-bmc-flash-layout.dtsi stable/12/sys/gnu/dts/arm/imx6dl-emcon-avari.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/imx6dl-emcon-avari.dts stable/12/sys/gnu/dts/arm/imx6q-emcon-avari.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/imx6q-emcon-avari.dts stable/12/sys/gnu/dts/arm/imx6qdl-emcon-avari.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/imx6qdl-emcon-avari.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-emcon.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/imx6qdl-emcon.dtsi stable/12/sys/gnu/dts/arm/imx6ul-pico-pi.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/imx6ul-pico-pi.dts stable/12/sys/gnu/dts/arm/imx6ul-pico.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/imx6ul-pico.dtsi stable/12/sys/gnu/dts/arm/imx7d-pico-hobbit.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/imx7d-pico-hobbit.dts stable/12/sys/gnu/dts/arm/imx7d-sdb-reva.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/imx7d-sdb-reva.dts stable/12/sys/gnu/dts/arm/imx7ulp-evk.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/imx7ulp-evk.dts stable/12/sys/gnu/dts/arm/imx7ulp.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/imx7ulp.dtsi stable/12/sys/gnu/dts/arm/omap5-l4.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/omap5-l4.dtsi stable/12/sys/gnu/dts/arm/pxa300-raumfeld-common.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/pxa300-raumfeld-common.dtsi stable/12/sys/gnu/dts/arm/pxa300-raumfeld-connector.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/pxa300-raumfeld-connector.dts stable/12/sys/gnu/dts/arm/pxa300-raumfeld-controller.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/pxa300-raumfeld-controller.dts stable/12/sys/gnu/dts/arm/pxa300-raumfeld-speaker-l.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-l.dts stable/12/sys/gnu/dts/arm/pxa300-raumfeld-speaker-m.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-m.dts stable/12/sys/gnu/dts/arm/pxa300-raumfeld-speaker-one.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-one.dts stable/12/sys/gnu/dts/arm/pxa300-raumfeld-speaker-s.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/pxa300-raumfeld-speaker-s.dts stable/12/sys/gnu/dts/arm/pxa300-raumfeld-tuneable-clock.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/pxa300-raumfeld-tuneable-clock.dtsi stable/12/sys/gnu/dts/arm/r8a7744-iwg20d-q7-dbcm-ca.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/r8a7744-iwg20d-q7-dbcm-ca.dts stable/12/sys/gnu/dts/arm/r8a7744-iwg20d-q7.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/r8a7744-iwg20d-q7.dts stable/12/sys/gnu/dts/arm/r8a7744-iwg20m.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/r8a7744-iwg20m.dtsi stable/12/sys/gnu/dts/arm/r8a7744.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/r8a7744.dtsi stable/12/sys/gnu/dts/arm/rda8810pl-orangepi-2g-iot.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/rda8810pl-orangepi-2g-iot.dts stable/12/sys/gnu/dts/arm/rda8810pl-orangepi-i96.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/rda8810pl-orangepi-i96.dts stable/12/sys/gnu/dts/arm/rda8810pl.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/rda8810pl.dtsi stable/12/sys/gnu/dts/arm/rk3188-bqedison2qc.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/rk3188-bqedison2qc.dts stable/12/sys/gnu/dts/arm/sun8i-h3-mapleboard-mp130.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/sun8i-h3-mapleboard-mp130.dts stable/12/sys/gnu/dts/arm/sun8i-t3-cqa3t-bv3.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/sun8i-t3-cqa3t-bv3.dts stable/12/sys/gnu/dts/arm/suniv-f1c100s-licheepi-nano.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/suniv-f1c100s-licheepi-nano.dts stable/12/sys/gnu/dts/arm/suniv-f1c100s.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm/suniv-f1c100s.dtsi stable/12/sys/gnu/dts/arm/vf610-bk4.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/vf610-bk4.dts stable/12/sys/gnu/dts/arm/vf610-zii-scu4-aib.dts - copied unchanged from r346092, head/sys/gnu/dts/arm/vf610-zii-scu4-aib.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-lite2.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-lite2.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frwy.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frwy.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a-qds.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-qds.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a-rdb.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-qds.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-qds.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-rdb.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/fsl-lx2160a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi stable/12/sys/gnu/dts/arm64/freescale/imx8mq-evk.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/imx8mq-evk.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mq-pinfunc.h - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/imx8mq-pinfunc.h stable/12/sys/gnu/dts/arm64/freescale/imx8mq.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/freescale/imx8mq.dtsi stable/12/sys/gnu/dts/arm64/hisilicon/hikey970-pinctrl.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/hisilicon/hikey970-pinctrl.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-8040-mcbin-singleshot.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin-singleshot.dts stable/12/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8998-pins.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/qcom/msm8998-pins.dtsi stable/12/sys/gnu/dts/arm64/qcom/pms405.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/qcom/pms405.dtsi stable/12/sys/gnu/dts/arm64/qcom/qcs404-evb-1000.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/qcom/qcs404-evb-1000.dts stable/12/sys/gnu/dts/arm64/qcom/qcs404-evb-4000.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/qcom/qcs404-evb-4000.dts stable/12/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi stable/12/sys/gnu/dts/arm64/qcom/qcs404.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/qcom/qcs404.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet-inx.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet-inx.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet-kd.dts - copied unchanged from r346092, head/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet-kd.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet.dtsi - copied unchanged from r346092, head/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet.dtsi stable/12/sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8-clock.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/clock/imx8-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8mq-clock.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/clock/imx8mq-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/mt7629-clk.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/clock/mt7629-clk.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gpucc-sdm845.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/clock/qcom,gpucc-sdm845.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,lpass-sdm845.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/clock/qcom,lpass-sdm845.h stable/12/sys/gnu/dts/include/dt-bindings/clock/suniv-ccu-f1c100s.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/clock/suniv-ccu-f1c100s.h stable/12/sys/gnu/dts/include/dt-bindings/dma/dw-dmac.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/dma/dw-dmac.h stable/12/sys/gnu/dts/include/dt-bindings/firmware/ - copied from r346092, head/sys/gnu/dts/include/dt-bindings/firmware/ stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/k3.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/pinctrl/k3.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/mt6797-pinfunc.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/pinctrl/mt6797-pinfunc.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8qm.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8qm.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8qxp.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8qxp.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/r7s9210-pinctrl.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/pinctrl/r7s9210-pinctrl.h stable/12/sys/gnu/dts/include/dt-bindings/power/imx8mq-power.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/power/imx8mq-power.h stable/12/sys/gnu/dts/include/dt-bindings/power/rk3066-power.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/power/rk3066-power.h stable/12/sys/gnu/dts/include/dt-bindings/power/rk3188-power.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/power/rk3188-power.h stable/12/sys/gnu/dts/include/dt-bindings/regulator/active-semi,8945a-regulator.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/regulator/active-semi,8945a-regulator.h stable/12/sys/gnu/dts/include/dt-bindings/reset/suniv-ccu-f1c100s.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/reset/suniv-ccu-f1c100s.h stable/12/sys/gnu/dts/include/dt-bindings/thermal/tegra194-bpmp-thermal.h - copied unchanged from r346092, head/sys/gnu/dts/include/dt-bindings/thermal/tegra194-bpmp-thermal.h Deleted: stable/12/sys/gnu/dts/arm/qcom-apq8064-arrow-sd-600eval-pins.dtsi stable/12/sys/gnu/dts/arm/qcom-apq8064-arrow-sd-600eval.dts Modified: stable/12/sys/arm/allwinner/aw_rtc.c stable/12/sys/arm/allwinner/aw_syscon.c stable/12/sys/arm/allwinner/clkng/ccu_a31.c stable/12/sys/arm/allwinner/clkng/ccu_a64.c stable/12/sys/arm/allwinner/clkng/ccu_a83t.c stable/12/sys/arm/allwinner/clkng/ccu_h3.c stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi stable/12/sys/gnu/dts/arm/am335x-boneblue.dts stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts stable/12/sys/gnu/dts/arm/am335x-evm.dts stable/12/sys/gnu/dts/arm/am335x-evmsk.dts stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts stable/12/sys/gnu/dts/arm/am335x-pdu001.dts stable/12/sys/gnu/dts/arm/am335x-shc.dts stable/12/sys/gnu/dts/arm/am33xx-clocks.dtsi stable/12/sys/gnu/dts/arm/am33xx.dtsi stable/12/sys/gnu/dts/arm/am3517-evm.dts stable/12/sys/gnu/dts/arm/am4372.dtsi stable/12/sys/gnu/dts/arm/am437x-gp-evm.dts stable/12/sys/gnu/dts/arm/am43xx-clocks.dtsi stable/12/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi stable/12/sys/gnu/dts/arm/arm-realview-pbx.dtsi stable/12/sys/gnu/dts/arm/armada-xp-db.dts stable/12/sys/gnu/dts/arm/armada-xp-gp.dts stable/12/sys/gnu/dts/arm/armada-xp-lenovo-ix4-300d.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-arm-centriq2400-rep.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-intel-s2600wf.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-lanyang.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-portwell-neptune.dts stable/12/sys/gnu/dts/arm/at91-nattis-2-natte-2.dts stable/12/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts stable/12/sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts stable/12/sys/gnu/dts/arm/at91-sama5d2_xplained.dts stable/12/sys/gnu/dts/arm/at91-sama5d4ek.dts stable/12/sys/gnu/dts/arm/at91sam9260.dtsi stable/12/sys/gnu/dts/arm/at91sam9261.dtsi stable/12/sys/gnu/dts/arm/at91sam9263.dtsi stable/12/sys/gnu/dts/arm/at91sam9g15.dtsi stable/12/sys/gnu/dts/arm/at91sam9g20.dtsi stable/12/sys/gnu/dts/arm/at91sam9g25.dtsi stable/12/sys/gnu/dts/arm/at91sam9g25ek.dts stable/12/sys/gnu/dts/arm/at91sam9g35.dtsi stable/12/sys/gnu/dts/arm/at91sam9rl.dtsi stable/12/sys/gnu/dts/arm/at91sam9x25.dtsi stable/12/sys/gnu/dts/arm/at91sam9x35.dtsi stable/12/sys/gnu/dts/arm/at91sam9x5.dtsi stable/12/sys/gnu/dts/arm/at91sam9x5_can.dtsi stable/12/sys/gnu/dts/arm/at91sam9x5_isi.dtsi stable/12/sys/gnu/dts/arm/at91sam9x5_lcd.dtsi stable/12/sys/gnu/dts/arm/at91sam9x5_macb0.dtsi stable/12/sys/gnu/dts/arm/at91sam9x5_macb1.dtsi stable/12/sys/gnu/dts/arm/at91sam9x5_usart3.dtsi stable/12/sys/gnu/dts/arm/axp81x.dtsi stable/12/sys/gnu/dts/arm/bcm-nsp.dtsi stable/12/sys/gnu/dts/arm/bcm2835-rpi-zero-w.dts stable/12/sys/gnu/dts/arm/bcm2835-rpi-zero.dts stable/12/sys/gnu/dts/arm/bcm2835-rpi.dtsi stable/12/sys/gnu/dts/arm/bcm2836-rpi-2-b.dts stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-b-plus.dts stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts stable/12/sys/gnu/dts/arm/bcm2837-rpi-cm3.dtsi stable/12/sys/gnu/dts/arm/bcm47081.dtsi stable/12/sys/gnu/dts/arm/bcm4709.dtsi stable/12/sys/gnu/dts/arm/bcm47094.dtsi stable/12/sys/gnu/dts/arm/bcm47189-tenda-ac9.dts stable/12/sys/gnu/dts/arm/bcm5301x.dtsi stable/12/sys/gnu/dts/arm/bcm53573.dtsi stable/12/sys/gnu/dts/arm/bcm63138.dtsi stable/12/sys/gnu/dts/arm/bcm958522er.dts stable/12/sys/gnu/dts/arm/bcm958525er.dts stable/12/sys/gnu/dts/arm/bcm958525xmc.dts stable/12/sys/gnu/dts/arm/bcm958622hr.dts stable/12/sys/gnu/dts/arm/bcm958623hr.dts stable/12/sys/gnu/dts/arm/bcm958625hr.dts stable/12/sys/gnu/dts/arm/bcm958625k.dts stable/12/sys/gnu/dts/arm/bcm963138dvt.dts stable/12/sys/gnu/dts/arm/bcm988312hr.dts stable/12/sys/gnu/dts/arm/da850-evm.dts stable/12/sys/gnu/dts/arm/da850-lcdk.dts stable/12/sys/gnu/dts/arm/da850.dtsi stable/12/sys/gnu/dts/arm/dra7-evm-common.dtsi stable/12/sys/gnu/dts/arm/dra7.dtsi stable/12/sys/gnu/dts/arm/dra72-evm-common.dtsi stable/12/sys/gnu/dts/arm/dra72x.dtsi stable/12/sys/gnu/dts/arm/dra74x.dtsi stable/12/sys/gnu/dts/arm/dra76x.dtsi stable/12/sys/gnu/dts/arm/dra7xx-clocks.dtsi stable/12/sys/gnu/dts/arm/emev2.dtsi stable/12/sys/gnu/dts/arm/exynos3250-artik5.dtsi stable/12/sys/gnu/dts/arm/exynos3250-monk.dts stable/12/sys/gnu/dts/arm/exynos3250-rinato.dts stable/12/sys/gnu/dts/arm/exynos3250.dtsi stable/12/sys/gnu/dts/arm/exynos4210-trats.dts stable/12/sys/gnu/dts/arm/exynos4210.dtsi stable/12/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi stable/12/sys/gnu/dts/arm/exynos4412-midas.dtsi stable/12/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi stable/12/sys/gnu/dts/arm/exynos4412-odroidu3.dts stable/12/sys/gnu/dts/arm/exynos4412-prime.dtsi stable/12/sys/gnu/dts/arm/exynos4412.dtsi stable/12/sys/gnu/dts/arm/exynos5250-arndale.dts stable/12/sys/gnu/dts/arm/exynos5250.dtsi stable/12/sys/gnu/dts/arm/exynos5420-arndale-octa.dts stable/12/sys/gnu/dts/arm/exynos5420-pinctrl.dtsi stable/12/sys/gnu/dts/arm/exynos5420-smdk5420.dts stable/12/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi stable/12/sys/gnu/dts/arm/exynos5422-odroidhc1.dts stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi stable/12/sys/gnu/dts/arm/exynos5422-odroidxu4.dts stable/12/sys/gnu/dts/arm/gemini-dlink-dir-685.dts stable/12/sys/gnu/dts/arm/gemini-dlink-dns-313.dts stable/12/sys/gnu/dts/arm/gemini-nas4220b.dts stable/12/sys/gnu/dts/arm/gemini-rut1xx.dts stable/12/sys/gnu/dts/arm/gemini-sl93512r.dts stable/12/sys/gnu/dts/arm/gemini-sq201.dts stable/12/sys/gnu/dts/arm/gemini-wbd111.dts stable/12/sys/gnu/dts/arm/gemini-wbd222.dts stable/12/sys/gnu/dts/arm/gemini.dtsi stable/12/sys/gnu/dts/arm/imx1-ads.dts stable/12/sys/gnu/dts/arm/imx1-apf9328.dts stable/12/sys/gnu/dts/arm/imx1.dtsi stable/12/sys/gnu/dts/arm/imx23-evk.dts stable/12/sys/gnu/dts/arm/imx23-olinuxino.dts stable/12/sys/gnu/dts/arm/imx23-sansa.dts stable/12/sys/gnu/dts/arm/imx23-stmp378x_devb.dts stable/12/sys/gnu/dts/arm/imx23-xfi3.dts stable/12/sys/gnu/dts/arm/imx23.dtsi stable/12/sys/gnu/dts/arm/imx25-eukrea-cpuimx25.dtsi stable/12/sys/gnu/dts/arm/imx25-karo-tx25.dts stable/12/sys/gnu/dts/arm/imx25-pdk.dts stable/12/sys/gnu/dts/arm/imx25.dtsi stable/12/sys/gnu/dts/arm/imx27-apf27.dts stable/12/sys/gnu/dts/arm/imx27-eukrea-cpuimx27.dtsi stable/12/sys/gnu/dts/arm/imx27-pdk.dts stable/12/sys/gnu/dts/arm/imx27-phytec-phycard-s-som.dtsi stable/12/sys/gnu/dts/arm/imx27-phytec-phycore-som.dtsi stable/12/sys/gnu/dts/arm/imx27.dtsi stable/12/sys/gnu/dts/arm/imx28-apf28.dts stable/12/sys/gnu/dts/arm/imx28-apx4devkit.dts stable/12/sys/gnu/dts/arm/imx28-cfa10036.dts stable/12/sys/gnu/dts/arm/imx28-duckbill-2-485.dts stable/12/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts stable/12/sys/gnu/dts/arm/imx28-duckbill-2-spi.dts stable/12/sys/gnu/dts/arm/imx28-duckbill-2.dts stable/12/sys/gnu/dts/arm/imx28-duckbill.dts stable/12/sys/gnu/dts/arm/imx28-eukrea-mbmx283lc.dts stable/12/sys/gnu/dts/arm/imx28-eukrea-mbmx287lc.dts stable/12/sys/gnu/dts/arm/imx28-evk.dts stable/12/sys/gnu/dts/arm/imx28-m28.dtsi stable/12/sys/gnu/dts/arm/imx28-m28cu3.dts stable/12/sys/gnu/dts/arm/imx28-m28evk.dts stable/12/sys/gnu/dts/arm/imx28-sps1.dts stable/12/sys/gnu/dts/arm/imx28-ts4600.dts stable/12/sys/gnu/dts/arm/imx28-tx28.dts stable/12/sys/gnu/dts/arm/imx28.dtsi stable/12/sys/gnu/dts/arm/imx31-bug.dts stable/12/sys/gnu/dts/arm/imx31-lite.dts stable/12/sys/gnu/dts/arm/imx31.dtsi stable/12/sys/gnu/dts/arm/imx35-eukrea-cpuimx35.dtsi stable/12/sys/gnu/dts/arm/imx35-pdk.dts stable/12/sys/gnu/dts/arm/imx35.dtsi stable/12/sys/gnu/dts/arm/imx50-evk.dts stable/12/sys/gnu/dts/arm/imx50.dtsi stable/12/sys/gnu/dts/arm/imx51-apf51.dts stable/12/sys/gnu/dts/arm/imx51-babbage.dts stable/12/sys/gnu/dts/arm/imx51-digi-connectcore-som.dtsi stable/12/sys/gnu/dts/arm/imx51-eukrea-cpuimx51.dtsi stable/12/sys/gnu/dts/arm/imx51-ts4800.dts stable/12/sys/gnu/dts/arm/imx51-zii-rdu1.dts stable/12/sys/gnu/dts/arm/imx51-zii-scu2-mezz.dts stable/12/sys/gnu/dts/arm/imx51-zii-scu3-esb.dts stable/12/sys/gnu/dts/arm/imx51.dtsi stable/12/sys/gnu/dts/arm/imx53-ard.dts stable/12/sys/gnu/dts/arm/imx53-cx9020.dts stable/12/sys/gnu/dts/arm/imx53-m53.dtsi stable/12/sys/gnu/dts/arm/imx53-qsb-common.dtsi stable/12/sys/gnu/dts/arm/imx53-smd.dts stable/12/sys/gnu/dts/arm/imx53-tqma53.dtsi stable/12/sys/gnu/dts/arm/imx53-tx53.dtsi stable/12/sys/gnu/dts/arm/imx53-usbarmory.dts stable/12/sys/gnu/dts/arm/imx53-voipac-dmm-668.dtsi stable/12/sys/gnu/dts/arm/imx53.dtsi stable/12/sys/gnu/dts/arm/imx6dl-apf6dev.dts stable/12/sys/gnu/dts/arm/imx6dl-aristainetos2_4.dts stable/12/sys/gnu/dts/arm/imx6dl-aristainetos2_7.dts stable/12/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts stable/12/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts stable/12/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts stable/12/sys/gnu/dts/arm/imx6dl-dfi-fs700-m60.dts stable/12/sys/gnu/dts/arm/imx6dl-mamoj.dts stable/12/sys/gnu/dts/arm/imx6dl-phytec-pfla02.dtsi stable/12/sys/gnu/dts/arm/imx6dl-rex-basic.dts stable/12/sys/gnu/dts/arm/imx6dl-riotboard.dts stable/12/sys/gnu/dts/arm/imx6dl-ts4900.dts stable/12/sys/gnu/dts/arm/imx6dl-ts7970.dts stable/12/sys/gnu/dts/arm/imx6dl-wandboard-revb1.dts stable/12/sys/gnu/dts/arm/imx6dl-wandboard-revd1.dts stable/12/sys/gnu/dts/arm/imx6dl-wandboard.dts stable/12/sys/gnu/dts/arm/imx6dl.dtsi stable/12/sys/gnu/dts/arm/imx6q-apf6dev.dts stable/12/sys/gnu/dts/arm/imx6q-arm2.dts stable/12/sys/gnu/dts/arm/imx6q-b450v3.dts stable/12/sys/gnu/dts/arm/imx6q-b650v3.dts stable/12/sys/gnu/dts/arm/imx6q-b850v3.dts stable/12/sys/gnu/dts/arm/imx6q-ba16.dtsi stable/12/sys/gnu/dts/arm/imx6q-bx50v3.dtsi stable/12/sys/gnu/dts/arm/imx6q-cm-fx6.dts stable/12/sys/gnu/dts/arm/imx6q-dfi-fs700-m60.dts stable/12/sys/gnu/dts/arm/imx6q-dhcom-som.dtsi stable/12/sys/gnu/dts/arm/imx6q-display5.dtsi stable/12/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts stable/12/sys/gnu/dts/arm/imx6q-evi.dts stable/12/sys/gnu/dts/arm/imx6q-gk802.dts stable/12/sys/gnu/dts/arm/imx6q-gw5400-a.dts stable/12/sys/gnu/dts/arm/imx6q-h100.dts stable/12/sys/gnu/dts/arm/imx6q-kp-tpc.dts stable/12/sys/gnu/dts/arm/imx6q-marsboard.dts stable/12/sys/gnu/dts/arm/imx6q-mccmon6.dts stable/12/sys/gnu/dts/arm/imx6q-novena.dts stable/12/sys/gnu/dts/arm/imx6q-phytec-pfla02.dtsi stable/12/sys/gnu/dts/arm/imx6q-pistachio.dts stable/12/sys/gnu/dts/arm/imx6q-rex-pro.dts stable/12/sys/gnu/dts/arm/imx6q-sbc6x.dts stable/12/sys/gnu/dts/arm/imx6q-tbs2910.dts stable/12/sys/gnu/dts/arm/imx6q-ts4900.dts stable/12/sys/gnu/dts/arm/imx6q-ts7970.dts stable/12/sys/gnu/dts/arm/imx6q-wandboard-revb1.dts stable/12/sys/gnu/dts/arm/imx6q-wandboard-revd1.dts stable/12/sys/gnu/dts/arm/imx6q-wandboard.dts stable/12/sys/gnu/dts/arm/imx6q-zii-rdu2.dts stable/12/sys/gnu/dts/arm/imx6q.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-apalis.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-cubox-i.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw51xx.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw52xx.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw553x.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw560x.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw5903.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-hummingboard2.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-icore-rqs.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-icore.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-nit6xlite.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-nitrogen6_som2.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-phytec-pfla02.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-tx6.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-udoo.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-var-dart.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-wandboard-revb1.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-wandboard-revc1.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-wandboard-revd1.dtsi stable/12/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi stable/12/sys/gnu/dts/arm/imx6qdl.dtsi stable/12/sys/gnu/dts/arm/imx6qp-wandboard-revd1.dts stable/12/sys/gnu/dts/arm/imx6qp-zii-rdu2.dts stable/12/sys/gnu/dts/arm/imx6sl-evk.dts stable/12/sys/gnu/dts/arm/imx6sl-warp.dts stable/12/sys/gnu/dts/arm/imx6sl.dtsi stable/12/sys/gnu/dts/arm/imx6sll-evk.dts stable/12/sys/gnu/dts/arm/imx6sll.dtsi stable/12/sys/gnu/dts/arm/imx6sx-nitrogen6sx.dts stable/12/sys/gnu/dts/arm/imx6sx-sabreauto.dts stable/12/sys/gnu/dts/arm/imx6sx-sdb-reva.dts stable/12/sys/gnu/dts/arm/imx6sx-sdb-sai.dts stable/12/sys/gnu/dts/arm/imx6sx-sdb.dts stable/12/sys/gnu/dts/arm/imx6sx-sdb.dtsi stable/12/sys/gnu/dts/arm/imx6sx-softing-vining-2000.dts stable/12/sys/gnu/dts/arm/imx6sx-udoo-neo-basic.dts stable/12/sys/gnu/dts/arm/imx6sx-udoo-neo-extended.dts stable/12/sys/gnu/dts/arm/imx6sx-udoo-neo-full.dts stable/12/sys/gnu/dts/arm/imx6sx.dtsi stable/12/sys/gnu/dts/arm/imx6ul-14x14-evk.dtsi stable/12/sys/gnu/dts/arm/imx6ul-ccimx6ulsbcpro.dts stable/12/sys/gnu/dts/arm/imx6ul-ccimx6ulsom.dtsi stable/12/sys/gnu/dts/arm/imx6ul-geam.dts stable/12/sys/gnu/dts/arm/imx6ul-isiot.dtsi stable/12/sys/gnu/dts/arm/imx6ul-litesom.dtsi stable/12/sys/gnu/dts/arm/imx6ul-opos6ul.dtsi stable/12/sys/gnu/dts/arm/imx6ul-pico-hobbit.dts stable/12/sys/gnu/dts/arm/imx6ul-tx6ul.dtsi stable/12/sys/gnu/dts/arm/imx6ul.dtsi stable/12/sys/gnu/dts/arm/imx6ull-14x14-evk.dts stable/12/sys/gnu/dts/arm/imx6ull-colibri-nonwifi.dtsi stable/12/sys/gnu/dts/arm/imx6ull-colibri-wifi.dtsi stable/12/sys/gnu/dts/arm/imx6ull.dtsi stable/12/sys/gnu/dts/arm/imx6ulz-14x14-evk.dts stable/12/sys/gnu/dts/arm/imx6ulz.dtsi stable/12/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts stable/12/sys/gnu/dts/arm/imx7d-colibri-emmc.dtsi stable/12/sys/gnu/dts/arm/imx7d-colibri.dtsi stable/12/sys/gnu/dts/arm/imx7d-nitrogen7.dts stable/12/sys/gnu/dts/arm/imx7d-pico-pi.dts stable/12/sys/gnu/dts/arm/imx7d-pico.dtsi stable/12/sys/gnu/dts/arm/imx7d-sdb.dts stable/12/sys/gnu/dts/arm/imx7d.dtsi stable/12/sys/gnu/dts/arm/imx7s-colibri.dtsi stable/12/sys/gnu/dts/arm/imx7s-warp.dts stable/12/sys/gnu/dts/arm/imx7s.dtsi stable/12/sys/gnu/dts/arm/iwg20d-q7-common.dtsi stable/12/sys/gnu/dts/arm/kirkwood-dnskw.dtsi stable/12/sys/gnu/dts/arm/ls1021a-moxa-uc-8410a.dts stable/12/sys/gnu/dts/arm/ls1021a.dtsi stable/12/sys/gnu/dts/arm/meson.dtsi stable/12/sys/gnu/dts/arm/meson6-atv1200.dts stable/12/sys/gnu/dts/arm/meson6.dtsi stable/12/sys/gnu/dts/arm/meson8-minix-neo-x8.dts stable/12/sys/gnu/dts/arm/meson8.dtsi stable/12/sys/gnu/dts/arm/meson8b-ec100.dts stable/12/sys/gnu/dts/arm/meson8b-mxq.dts stable/12/sys/gnu/dts/arm/meson8b-odroidc1.dts stable/12/sys/gnu/dts/arm/meson8b.dtsi stable/12/sys/gnu/dts/arm/meson8m2-mxiii-plus.dts stable/12/sys/gnu/dts/arm/meson8m2.dtsi stable/12/sys/gnu/dts/arm/mmp2.dtsi stable/12/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi stable/12/sys/gnu/dts/arm/mt7623.dtsi stable/12/sys/gnu/dts/arm/omap3-gta04.dtsi stable/12/sys/gnu/dts/arm/omap3-n900.dts stable/12/sys/gnu/dts/arm/omap3-n950-n9.dtsi stable/12/sys/gnu/dts/arm/omap4-droid4-xt894.dts stable/12/sys/gnu/dts/arm/omap4-l4.dtsi stable/12/sys/gnu/dts/arm/omap4-sdp.dts stable/12/sys/gnu/dts/arm/omap5-board-common.dtsi stable/12/sys/gnu/dts/arm/omap5-cm-t54.dts stable/12/sys/gnu/dts/arm/omap5.dtsi stable/12/sys/gnu/dts/arm/pxa27x.dtsi stable/12/sys/gnu/dts/arm/pxa2xx.dtsi stable/12/sys/gnu/dts/arm/pxa3xx.dtsi stable/12/sys/gnu/dts/arm/qcom-apq8084.dtsi stable/12/sys/gnu/dts/arm/qcom-msm8974-lge-nexus5-hammerhead.dts stable/12/sys/gnu/dts/arm/qcom-msm8974.dtsi stable/12/sys/gnu/dts/arm/r8a7740.dtsi stable/12/sys/gnu/dts/arm/r8a7743-iwg20m.dtsi stable/12/sys/gnu/dts/arm/r8a7743.dtsi stable/12/sys/gnu/dts/arm/r8a77470-iwg23s-sbc.dts stable/12/sys/gnu/dts/arm/r8a77470.dtsi stable/12/sys/gnu/dts/arm/r8a7790-lager.dts stable/12/sys/gnu/dts/arm/r8a7791-koelsch.dts stable/12/sys/gnu/dts/arm/r8a7791-porter.dts stable/12/sys/gnu/dts/arm/r9a06g032.dtsi stable/12/sys/gnu/dts/arm/rk3066a.dtsi stable/12/sys/gnu/dts/arm/rk3188-px3-evb.dts stable/12/sys/gnu/dts/arm/rk3188-radxarock.dts stable/12/sys/gnu/dts/arm/rk3188.dtsi stable/12/sys/gnu/dts/arm/rk322x.dtsi stable/12/sys/gnu/dts/arm/rk3288-rock2-som.dtsi stable/12/sys/gnu/dts/arm/rk3288-veyron-mickey.dts stable/12/sys/gnu/dts/arm/rk3288.dtsi stable/12/sys/gnu/dts/arm/rk3xxx.dtsi stable/12/sys/gnu/dts/arm/rv1108.dtsi stable/12/sys/gnu/dts/arm/s5pv210.dtsi stable/12/sys/gnu/dts/arm/sama5d2.dtsi stable/12/sys/gnu/dts/arm/sama5d4.dtsi stable/12/sys/gnu/dts/arm/sh73a0.dtsi stable/12/sys/gnu/dts/arm/socfpga.dtsi stable/12/sys/gnu/dts/arm/socfpga_arria10.dtsi stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk.dtsi stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk_nand.dts stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk_qspi.dts stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk_sdmmc.dts stable/12/sys/gnu/dts/arm/socfpga_arria5.dtsi stable/12/sys/gnu/dts/arm/socfpga_arria5_socdk.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5.dtsi stable/12/sys/gnu/dts/arm/socfpga_cyclone5_de0_nano_soc.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5_mcv.dtsi stable/12/sys/gnu/dts/arm/socfpga_cyclone5_mcvevk.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5_socdk.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5_sockit.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5_sodia.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts stable/12/sys/gnu/dts/arm/socfpga_vt.dts stable/12/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts stable/12/sys/gnu/dts/arm/sun4i-a10-pcduino.dts stable/12/sys/gnu/dts/arm/sun4i-a10.dtsi stable/12/sys/gnu/dts/arm/sun5i-a10s-auxtek-t003.dts stable/12/sys/gnu/dts/arm/sun5i-a10s-auxtek-t004.dts stable/12/sys/gnu/dts/arm/sun5i-a10s-mk802.dts stable/12/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts stable/12/sys/gnu/dts/arm/sun5i-a10s-r7-tv-dongle.dts stable/12/sys/gnu/dts/arm/sun5i-a10s-wobo-i5.dts stable/12/sys/gnu/dts/arm/sun5i-a10s.dtsi stable/12/sys/gnu/dts/arm/sun5i-a13-empire-electronix-d709.dts stable/12/sys/gnu/dts/arm/sun5i-a13-hsg-h702.dts stable/12/sys/gnu/dts/arm/sun5i-a13-licheepi-one.dts stable/12/sys/gnu/dts/arm/sun5i-a13-olinuxino-micro.dts stable/12/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts stable/12/sys/gnu/dts/arm/sun5i-a13-utoo-p66.dts stable/12/sys/gnu/dts/arm/sun5i-a13.dtsi stable/12/sys/gnu/dts/arm/sun5i-gr8-chip-pro.dts stable/12/sys/gnu/dts/arm/sun5i-gr8-evb.dts stable/12/sys/gnu/dts/arm/sun5i-gr8.dtsi stable/12/sys/gnu/dts/arm/sun5i-r8-chip.dts stable/12/sys/gnu/dts/arm/sun5i-reference-design-tablet.dtsi stable/12/sys/gnu/dts/arm/sun5i.dtsi stable/12/sys/gnu/dts/arm/sun6i-a31-app4-evb1.dts stable/12/sys/gnu/dts/arm/sun6i-a31-colombus.dts stable/12/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts stable/12/sys/gnu/dts/arm/sun6i-a31-i7.dts stable/12/sys/gnu/dts/arm/sun6i-a31-m9.dts stable/12/sys/gnu/dts/arm/sun6i-a31-mele-a1000g-quad.dts stable/12/sys/gnu/dts/arm/sun6i-a31.dtsi stable/12/sys/gnu/dts/arm/sun6i-a31s-colorfly-e708-q1.dts stable/12/sys/gnu/dts/arm/sun6i-a31s-cs908.dts stable/12/sys/gnu/dts/arm/sun6i-a31s-inet-q972.dts stable/12/sys/gnu/dts/arm/sun6i-a31s-primo81.dts stable/12/sys/gnu/dts/arm/sun6i-a31s-sina31s-core.dtsi stable/12/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts stable/12/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts stable/12/sys/gnu/dts/arm/sun6i-a31s-yones-toptech-bs1078-v2.dts stable/12/sys/gnu/dts/arm/sun6i-reference-design-tablet.dtsi stable/12/sys/gnu/dts/arm/sun7i-a20-bananapi-m1-plus.dts stable/12/sys/gnu/dts/arm/sun7i-a20-bananapi.dts stable/12/sys/gnu/dts/arm/sun7i-a20-bananapro.dts stable/12/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts stable/12/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts stable/12/sys/gnu/dts/arm/sun7i-a20-hummingbird.dts stable/12/sys/gnu/dts/arm/sun7i-a20-i12-tvbox.dts stable/12/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts stable/12/sys/gnu/dts/arm/sun7i-a20-itead-ibox.dts stable/12/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts stable/12/sys/gnu/dts/arm/sun7i-a20-m3.dts stable/12/sys/gnu/dts/arm/sun7i-a20-mk808c.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb-emmc.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb-emmc.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2-emmc.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro-emmc.dts stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts stable/12/sys/gnu/dts/arm/sun7i-a20-orangepi-mini.dts stable/12/sys/gnu/dts/arm/sun7i-a20-orangepi.dts stable/12/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts stable/12/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts stable/12/sys/gnu/dts/arm/sun7i-a20-wexler-tab7200.dts stable/12/sys/gnu/dts/arm/sun7i-a20-wits-pro-a20-dkt.dts stable/12/sys/gnu/dts/arm/sun7i-a20.dtsi stable/12/sys/gnu/dts/arm/sun8i-a23-a33.dtsi stable/12/sys/gnu/dts/arm/sun8i-a23-evb.dts stable/12/sys/gnu/dts/arm/sun8i-a23-gt90h-v4.dts stable/12/sys/gnu/dts/arm/sun8i-a23-polaroid-mid2407pxe03.dts stable/12/sys/gnu/dts/arm/sun8i-a23-polaroid-mid2809pxe04.dts stable/12/sys/gnu/dts/arm/sun8i-a23.dtsi stable/12/sys/gnu/dts/arm/sun8i-a33-ga10h-v1.1.dts stable/12/sys/gnu/dts/arm/sun8i-a33-inet-d978-rev2.dts stable/12/sys/gnu/dts/arm/sun8i-a33-olinuxino.dts stable/12/sys/gnu/dts/arm/sun8i-a33-sinlinx-sina33.dts stable/12/sys/gnu/dts/arm/sun8i-a33.dtsi stable/12/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts stable/12/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts stable/12/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts stable/12/sys/gnu/dts/arm/sun8i-a83t.dtsi stable/12/sys/gnu/dts/arm/sun8i-h3-beelink-x2.dts stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts stable/12/sys/gnu/dts/arm/sun8i-h3.dtsi stable/12/sys/gnu/dts/arm/sun8i-q8-common.dtsi stable/12/sys/gnu/dts/arm/sun8i-r16-bananapi-m2m.dts stable/12/sys/gnu/dts/arm/sun8i-r16-nintendo-nes-classic.dts stable/12/sys/gnu/dts/arm/sun8i-r16-parrot.dts stable/12/sys/gnu/dts/arm/sun8i-r40.dtsi stable/12/sys/gnu/dts/arm/sun8i-reference-design-tablet.dtsi stable/12/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero-dock.dts stable/12/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero.dts stable/12/sys/gnu/dts/arm/sun8i-v3s.dtsi stable/12/sys/gnu/dts/arm/sunxi-h3-h5.dtsi stable/12/sys/gnu/dts/arm/sunxi-itead-core-common.dtsi stable/12/sys/gnu/dts/arm/sunxi-reference-design-tablet.dtsi stable/12/sys/gnu/dts/arm/tegra124-nyan.dtsi stable/12/sys/gnu/dts/arm/tegra124.dtsi stable/12/sys/gnu/dts/arm/tegra20.dtsi stable/12/sys/gnu/dts/arm/uniphier-ld4.dtsi stable/12/sys/gnu/dts/arm/uniphier-pro4.dtsi stable/12/sys/gnu/dts/arm/uniphier-pxs2.dtsi stable/12/sys/gnu/dts/arm/uniphier-sld8.dtsi stable/12/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi stable/12/sys/gnu/dts/arm/vexpress-v2m.dtsi stable/12/sys/gnu/dts/arm/vexpress-v2p-ca15-tc1.dts stable/12/sys/gnu/dts/arm/vexpress-v2p-ca15_a7.dts stable/12/sys/gnu/dts/arm/vexpress-v2p-ca5s.dts stable/12/sys/gnu/dts/arm/vexpress-v2p-ca9.dts stable/12/sys/gnu/dts/arm/vf500-colibri.dtsi stable/12/sys/gnu/dts/arm/vf500.dtsi stable/12/sys/gnu/dts/arm/vf610-colibri.dtsi stable/12/sys/gnu/dts/arm/vf610-cosmic.dts stable/12/sys/gnu/dts/arm/vf610-twr.dts stable/12/sys/gnu/dts/arm/vf610-zii-cfu1.dts stable/12/sys/gnu/dts/arm/vf610-zii-dev.dtsi stable/12/sys/gnu/dts/arm/vf610-zii-ssmb-spu3.dts stable/12/sys/gnu/dts/arm/vf610m4-colibri.dts stable/12/sys/gnu/dts/arm/vf610m4.dtsi stable/12/sys/gnu/dts/arm/zynq-7000.dtsi stable/12/sys/gnu/dts/arm64/allwinner/axp803.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-bananapi-m64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-orangepi-win.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pinebook.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine-baseboard.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5.dtsi stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-one-plus.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi stable/12/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-axg-s400.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gx-p23x-q20x.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-p20x.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-p230.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-nexbox-a1.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-rbox-pro.dts stable/12/sys/gnu/dts/arm64/arm/rtsm_ve-aemv8a.dts stable/12/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard.dtsi stable/12/sys/gnu/dts/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts stable/12/sys/gnu/dts/arm64/arm/vexpress-v2m-rs1.dtsi stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tm2-common.dtsi stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tmu.dtsi stable/12/sys/gnu/dts/arm64/exynos/exynos5433.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a-qds.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a-qds.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a-rdb.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1088a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls2088a.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls208xa-qds.dtsi stable/12/sys/gnu/dts/arm64/freescale/fsl-ls208xa.dtsi stable/12/sys/gnu/dts/arm64/hisilicon/hi3660-hikey960.dts stable/12/sys/gnu/dts/arm64/hisilicon/hi3660.dtsi stable/12/sys/gnu/dts/arm64/hisilicon/hi3670-hikey970.dts stable/12/sys/gnu/dts/arm64/hisilicon/hi3670.dtsi stable/12/sys/gnu/dts/arm64/hisilicon/hi3798cv200-poplar.dts stable/12/sys/gnu/dts/arm64/hisilicon/hi6220-hikey.dts stable/12/sys/gnu/dts/arm64/hisilicon/hi6220.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dts stable/12/sys/gnu/dts/arm64/marvell/armada-37xx.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts stable/12/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dts stable/12/sys/gnu/dts/arm64/marvell/armada-ap806.dtsi stable/12/sys/gnu/dts/arm64/mediatek/mt7622.dtsi stable/12/sys/gnu/dts/arm64/mediatek/mt8173.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra186-p2771-0000.dts stable/12/sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra186.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra194-p2972-0000.dts stable/12/sys/gnu/dts/arm64/nvidia/tegra194.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi stable/12/sys/gnu/dts/arm64/nvidia/tegra210.dtsi stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8916-pins.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8916.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8996-pins.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8996.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8998-mtp.dtsi stable/12/sys/gnu/dts/arm64/qcom/msm8998.dtsi stable/12/sys/gnu/dts/arm64/qcom/pm8998.dtsi stable/12/sys/gnu/dts/arm64/qcom/sdm845.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7795-salvator-x.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795-salvator-xs.dts stable/12/sys/gnu/dts/arm64/renesas/r8a7795.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a7796.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77965.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77970.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77980.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77990-ebisu.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77990.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a77995-draak.dts stable/12/sys/gnu/dts/arm64/renesas/r8a77995.dtsi stable/12/sys/gnu/dts/arm64/renesas/salvator-common.dtsi stable/12/sys/gnu/dts/arm64/renesas/ulcb.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3328.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3368.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-bob.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-chromebook.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-kevin.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-sapphire-excavator.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-sapphire.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399.dtsi stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi stable/12/sys/gnu/dts/arm64/sprd/sc9836.dtsi stable/12/sys/gnu/dts/arm64/sprd/sc9860.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am65.dtsi stable/12/sys/gnu/dts/arm64/ti/k3-am654-base-board.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-clk.dtsi stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu100-revC.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu106-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu111-revA.dts stable/12/sys/gnu/dts/arm64/xilinx/zynqmp.dtsi stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm2835-aux.h stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm2835.h stable/12/sys/gnu/dts/include/dt-bindings/clock/gxbb-clkc.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm845.h stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmcc.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7795-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7796-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77995-cpg-mssr.h stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3328-cru.h stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-de2.h stable/12/sys/gnu/dts/include/dt-bindings/gpio/tegra186-gpio.h stable/12/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h stable/12/sys/gnu/dts/include/dt-bindings/mailbox/tegra186-hsp.h stable/12/sys/gnu/dts/include/dt-bindings/media/xilinx-vip.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/bcm2835.h stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77970-sysc.h stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77980-sysc.h stable/12/sys/gnu/dts/include/dt-bindings/power/raspberrypi-power.h stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-axg-reset.h stable/12/sys/gnu/dts/include/dt-bindings/reset/sun8i-de2.h stable/12/sys/gnu/dts/include/dt-bindings/sound/qcom,q6afe.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_rtc.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_rtc.c Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/arm/allwinner/aw_rtc.c Mon Aug 5 17:23:23 2019 (r350597) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2019 Emmanuel Vadot * Copyright (c) 2016 Vladimir Belian * All rights reserved. * @@ -43,6 +44,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include "clock_if.h" @@ -62,7 +65,7 @@ __FBSDID("$FreeBSD$"); #define LOSC_MAGIC 0x16aa0000 #define LOSC_BUSY_MASK 0x00000380 -#define IS_SUN7I (sc->type == A20_RTC) +#define IS_SUN7I (sc->conf->is_a20 == true) #define YEAR_MIN (IS_SUN7I ? 1970 : 2010) #define YEAR_MAX (IS_SUN7I ? 2100 : 2073) @@ -92,27 +95,68 @@ __FBSDID("$FreeBSD$"); #define RTC_READ(sc, reg) bus_read_4((sc)->res, (reg)) #define RTC_WRITE(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) -#define IS_LEAP_YEAR(y) \ - (((y) % 400) == 0 || (((y) % 100) != 0 && ((y) % 4) == 0)) +#define IS_LEAP_YEAR(y) (((y) % 400) == 0 || (((y) % 100) != 0 && ((y) % 4) == 0)) -#define A10_RTC 1 -#define A20_RTC 2 -#define A31_RTC 3 +struct aw_rtc_conf { + uint64_t iosc_freq; + bus_size_t rtc_date; + bus_size_t rtc_time; + bus_size_t rtc_losc_sta; + bool is_a20; +}; +struct aw_rtc_conf a10_conf = { + .rtc_date = A10_RTC_DATE_REG, + .rtc_time = A10_RTC_TIME_REG, + .rtc_losc_sta = LOSC_CTRL_REG, +}; + +struct aw_rtc_conf a20_conf = { + .rtc_date = A10_RTC_DATE_REG, + .rtc_time = A10_RTC_TIME_REG, + .rtc_losc_sta = LOSC_CTRL_REG, + .is_a20 = true, +}; + +struct aw_rtc_conf a31_conf = { + .iosc_freq = 650000, /* between 600 and 700 Khz */ + .rtc_date = A31_RTC_DATE_REG, + .rtc_time = A31_RTC_TIME_REG, + .rtc_losc_sta = A31_LOSC_AUTO_SWT_STA, +}; + +struct aw_rtc_conf h3_conf = { + .iosc_freq = 16000000, + .rtc_date = A31_RTC_DATE_REG, + .rtc_time = A31_RTC_TIME_REG, + .rtc_losc_sta = A31_LOSC_AUTO_SWT_STA, +}; + static struct ofw_compat_data compat_data[] = { - { "allwinner,sun4i-a10-rtc", A10_RTC }, - { "allwinner,sun7i-a20-rtc", A20_RTC }, - { "allwinner,sun6i-a31-rtc", A31_RTC }, + { "allwinner,sun4i-a10-rtc", (uintptr_t) &a10_conf }, + { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, + { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, + { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf }, { NULL, 0 } }; struct aw_rtc_softc { struct resource *res; + struct aw_rtc_conf *conf; int type; - bus_size_t rtc_date; - bus_size_t rtc_time; }; +static struct clk_fixed_def aw_rtc_osc32k = { + .clkdef.id = 0, + .freq = 32768, +}; + +static struct clk_fixed_def aw_rtc_iosc = { + .clkdef.id = 2, +}; + +static void aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev); + static int aw_rtc_probe(device_t dev); static int aw_rtc_attach(device_t dev); static int aw_rtc_detach(device_t dev); @@ -140,9 +184,8 @@ static driver_t aw_rtc_driver = { static devclass_t aw_rtc_devclass; EARLY_DRIVER_MODULE(aw_rtc, simplebus, aw_rtc_driver, aw_rtc_devclass, 0, 0, - BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); - static int aw_rtc_probe(device_t dev) { @@ -161,7 +204,6 @@ static int aw_rtc_attach(device_t dev) { struct aw_rtc_softc *sc = device_get_softc(dev); - bus_size_t rtc_losc_sta; uint32_t val; int rid = 0; @@ -171,20 +213,7 @@ aw_rtc_attach(device_t dev) return (ENXIO); } - sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - switch (sc->type) { - case A10_RTC: - case A20_RTC: - sc->rtc_date = A10_RTC_DATE_REG; - sc->rtc_time = A10_RTC_TIME_REG; - rtc_losc_sta = LOSC_CTRL_REG; - break; - case A31_RTC: - sc->rtc_date = A31_RTC_DATE_REG; - sc->rtc_time = A31_RTC_TIME_REG; - rtc_losc_sta = A31_LOSC_AUTO_SWT_STA; - break; - } + sc->conf = (struct aw_rtc_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; val = RTC_READ(sc, LOSC_CTRL_REG); val |= LOSC_AUTO_SW_EN; val |= LOSC_MAGIC | LOSC_GSM | LOSC_OSC_SRC; @@ -193,13 +222,15 @@ aw_rtc_attach(device_t dev) DELAY(100); if (bootverbose) { - val = RTC_READ(sc, rtc_losc_sta); + val = RTC_READ(sc, sc->conf->rtc_losc_sta); if ((val & LOSC_OSC_SRC) == 0) device_printf(dev, "Using internal oscillator\n"); else device_printf(dev, "Using external oscillator\n"); } + aw_rtc_install_clocks(sc, dev); + clock_register(dev, RTC_RES_US); return (0); @@ -212,6 +243,41 @@ aw_rtc_detach(device_t dev) return (EBUSY); } +static void +aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev) { + struct clkdom *clkdom; + const char **clknames; + phandle_t node; + int nclocks; + + node = ofw_bus_get_node(dev); + nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames); + /* No clocks to export */ + if (nclocks <= 0) + return; + + if (nclocks != 3) { + device_printf(dev, "Having only %d clocks instead of 3, aborting\n", nclocks); + return; + } + + clkdom = clkdom_create(dev); + + aw_rtc_osc32k.clkdef.name = clknames[0]; + if (clknode_fixed_register(clkdom, &aw_rtc_osc32k) != 0) + device_printf(dev, "Cannot register osc32k clock\n"); + + aw_rtc_iosc.clkdef.name = clknames[2]; + aw_rtc_iosc.freq = sc->conf->iosc_freq; + if (clknode_fixed_register(clkdom, &aw_rtc_iosc) != 0) + device_printf(dev, "Cannot register iosc clock\n"); + + clkdom_finit(clkdom); + + if (bootverbose) + clkdom_dump(clkdom); +} + static int aw_rtc_gettime(device_t dev, struct timespec *ts) { @@ -219,11 +285,11 @@ aw_rtc_gettime(device_t dev, struct timespec *ts) struct clocktime ct; uint32_t rdate, rtime; - rdate = RTC_READ(sc, sc->rtc_date); - rtime = RTC_READ(sc, sc->rtc_time); + rdate = RTC_READ(sc, sc->conf->rtc_date); + rtime = RTC_READ(sc, sc->conf->rtc_time); if ((rtime & TIME_MASK) == 0) - rdate = RTC_READ(sc, sc->rtc_date); + rdate = RTC_READ(sc, sc->conf->rtc_date); ct.sec = GET_SEC_VALUE(rtime); ct.min = GET_MIN_VALUE(rtime); @@ -265,7 +331,7 @@ aw_rtc_settime(device_t dev, struct timespec *ts) DELAY(1); } /* reset time register to avoid unexpected date increment */ - RTC_WRITE(sc, sc->rtc_time, 0); + RTC_WRITE(sc, sc->conf->rtc_time, 0); rdate = SET_DAY_VALUE(ct.day) | SET_MON_VALUE(ct.mon) | SET_YEAR_VALUE(ct.year - YEAR_OFFSET) | @@ -281,7 +347,7 @@ aw_rtc_settime(device_t dev, struct timespec *ts) } DELAY(1); } - RTC_WRITE(sc, sc->rtc_date, rdate); + RTC_WRITE(sc, sc->conf->rtc_date, rdate); for (clk = 0; RTC_READ(sc, LOSC_CTRL_REG) & LOSC_BUSY_MASK; clk++) { if (clk > RTC_TIMEOUT) { @@ -290,7 +356,7 @@ aw_rtc_settime(device_t dev, struct timespec *ts) } DELAY(1); } - RTC_WRITE(sc, sc->rtc_time, rtime); + RTC_WRITE(sc, sc->conf->rtc_time, rtime); DELAY(RTC_TIMEOUT); Modified: stable/12/sys/arm/allwinner/aw_syscon.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_syscon.c Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/arm/allwinner/aw_syscon.c Mon Aug 5 17:23:23 2019 (r350597) @@ -52,6 +52,7 @@ static struct ofw_compat_data compat_data[] = { {"allwinner,sun50i-a64-system-control", 1}, {"allwinner,sun8i-a83t-system-controller", 1}, {"allwinner,sun8i-h3-system-controller", 1}, + {"allwinner,sun8i-h3-system-control", 1}, {NULL, 0} }; Modified: stable/12/sys/arm/allwinner/clkng/ccu_a31.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_a31.c Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/arm/allwinner/clkng/ccu_a31.c Mon Aug 5 17:23:23 2019 (r350597) @@ -973,4 +973,4 @@ DEFINE_CLASS_1(ccu_a31ng, ccu_a31ng_driver, ccu_a31ng_ sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a31ng, simplebus, ccu_a31ng_driver, - ccu_a31ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_a31ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); Modified: stable/12/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_a64.c Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/arm/allwinner/clkng/ccu_a64.c Mon Aug 5 17:23:23 2019 (r350597) @@ -825,4 +825,4 @@ DEFINE_CLASS_1(ccu_a64ng, ccu_a64ng_driver, ccu_a64ng_ sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a64ng, simplebus, ccu_a64ng_driver, - ccu_a64ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_a64ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); Modified: stable/12/sys/arm/allwinner/clkng/ccu_a83t.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_a83t.c Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/arm/allwinner/clkng/ccu_a83t.c Mon Aug 5 17:23:23 2019 (r350597) @@ -786,4 +786,4 @@ DEFINE_CLASS_1(ccu_a83tng, ccu_a83tng_driver, ccu_a83t sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a83tng, simplebus, ccu_a83tng_driver, - ccu_a83tng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_a83tng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); Modified: stable/12/sys/arm/allwinner/clkng/ccu_h3.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_h3.c Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/arm/allwinner/clkng/ccu_h3.c Mon Aug 5 17:23:23 2019 (r350597) @@ -787,4 +787,4 @@ DEFINE_CLASS_1(ccu_h3ng, ccu_h3ng_driver, ccu_h3ng_met sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_h3ng, simplebus, ccu_h3ng_driver, - ccu_h3ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_h3ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); Modified: stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi Mon Aug 5 17:23:23 2019 (r350597) @@ -419,6 +419,6 @@ }; &rtc { - clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-boneblue.dts Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am335x-boneblue.dts Mon Aug 5 17:23:23 2019 (r350597) @@ -515,7 +515,7 @@ &rtc { system-power-controller; - clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts Mon Aug 5 17:23:23 2019 (r350597) @@ -393,7 +393,7 @@ status = "okay"; &epwmss0 { status = "okay"; - ecap0: ecap@48300100 { + ecap0: ecap@100 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ecap0_pins>; Modified: stable/12/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-evm.dts Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am335x-evm.dts Mon Aug 5 17:23:23 2019 (r350597) @@ -519,7 +519,7 @@ &epwmss0 { status = "okay"; - ecap0: ecap@48300100 { + ecap0: ecap@100 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ecap0_pins>; @@ -729,7 +729,7 @@ &cpsw_emac0 { phy-handle = <ðphy0>; - phy-mode = "rgmii-txid"; + phy-mode = "rgmii-id"; }; &tscadc { @@ -797,6 +797,6 @@ }; &rtc { - clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-evmsk.dts Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am335x-evmsk.dts Mon Aug 5 17:23:23 2019 (r350597) @@ -540,7 +540,7 @@ &epwmss2 { status = "okay"; - ecap2: ecap@48304100 { + ecap2: ecap@100 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ecap2_pins>; @@ -651,13 +651,13 @@ &cpsw_emac0 { phy-handle = <ðphy0>; - phy-mode = "rgmii-txid"; + phy-mode = "rgmii-id"; dual_emac_res_vlan = <1>; }; &cpsw_emac1 { phy-handle = <ðphy1>; - phy-mode = "rgmii-txid"; + phy-mode = "rgmii-id"; dual_emac_res_vlan = <2>; }; @@ -738,6 +738,6 @@ }; &rtc { - clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts Mon Aug 5 17:23:23 2019 (r350597) @@ -456,6 +456,6 @@ }; &rtc { - clocks = <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; clock-names = "ext-clk", "int-clk"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-pdu001.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-pdu001.dts Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am335x-pdu001.dts Mon Aug 5 17:23:23 2019 (r350597) @@ -585,7 +585,7 @@ bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; - cd-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + cd-gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; }; &sham { Modified: stable/12/sys/gnu/dts/arm/am335x-shc.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-shc.dts Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am335x-shc.dts Mon Aug 5 17:23:23 2019 (r350597) @@ -138,7 +138,7 @@ &epwmss1 { status = "okay"; - ehrpwm1: pwm@48302200 { + ehrpwm1: pwm@200 { pinctrl-names = "default"; pinctrl-0 = <&ehrpwm1_pins>; status = "okay"; @@ -205,7 +205,7 @@ pinctrl-1 = <&cpsw_sleep>; status = "okay"; slaves = <1>; - cpsw_emac0: slave@4a100200 { + cpsw_emac0: slave@200 { phy-mode = "mii"; phy-handle = <ðernetphy0>; }; @@ -215,7 +215,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; bus-width = <0x4>; - cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; cd-inverted; max-frequency = <26000000>; vmmc-supply = <&vmmcsd_fixed>; Modified: stable/12/sys/gnu/dts/arm/am33xx-clocks.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am33xx-clocks.dtsi Mon Aug 5 17:06:20 2019 (r350596) +++ stable/12/sys/gnu/dts/arm/am33xx-clocks.dtsi Mon Aug 5 17:23:23 2019 (r350597) @@ -334,49 +334,49 @@ timer1_fck: timer1_fck@528 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>, <&tclkin_ck>, <&clk_rc32k_ck>, <&clk_32768_ck>; + clocks = <&sys_clkin_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>, <&tclkin_ck>, <&clk_rc32k_ck>, <&clk_32768_ck>; reg = <0x0528>; }; timer2_fck: timer2_fck@508 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; reg = <0x0508>; }; timer3_fck: timer3_fck@50c { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; reg = <0x050c>; }; timer4_fck: timer4_fck@510 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; reg = <0x0510>; }; timer5_fck: timer5_fck@518 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; reg = <0x0518>; }; timer6_fck: timer6_fck@51c { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; reg = <0x051c>; }; timer7_fck: timer7_fck@504 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&tclkin_ck>, <&sys_clkin_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; reg = <0x0504>; }; @@ -407,7 +407,7 @@ wdt1_fck: wdt1_fck@538 { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&clk_rc32k_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&clk_rc32k_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; reg = <0x0538>; }; @@ -477,7 +477,7 @@ gpio0_dbclk_mux_ck: gpio0_dbclk_mux_ck@53c { #clock-cells = <0>; compatible = "ti,mux-clock"; - clocks = <&clk_rc32k_ck>, <&clk_32768_ck>, <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>; + clocks = <&clk_rc32k_ck>, <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; reg = <0x053c>; }; @@ -539,86 +539,140 @@ }; &prcm { - l4_per_cm: l4_per_cm@0 { + per_cm: per-cm@0 { compatible = "ti,omap4-cm"; - reg = <0x0 0x200>; + reg = <0x0 0x400>; #address-cells = <1>; #size-cells = <1>; - ranges = <0 0x0 0x200>; + ranges = <0 0x0 0x400>; - l4_per_clkctrl: clk@14 { + l4ls_clkctrl: l4ls-clkctrl@38 { compatible = "ti,clkctrl"; - reg = <0x14 0x13c>; + reg = <0x38 0x2c>, <0x6c 0x28>, <0xac 0xc>, <0xc0 0x1c>, <0xec 0xc>, <0x10c 0x8>, <0x130 0x4>; #clock-cells = <2>; }; + + l3s_clkctrl: l3s-clkctrl@1c { + compatible = "ti,clkctrl"; + reg = <0x1c 0x4>, <0x30 0x8>, <0x68 0x4>, <0xf8 0x4>; + #clock-cells = <2>; + }; + + l3_clkctrl: l3-clkctrl@24 { + compatible = "ti,clkctrl"; + reg = <0x24 0xc>, <0x94 0x10>, <0xbc 0x4>, <0xdc 0x8>, <0xfc 0x8>; + #clock-cells = <2>; + }; + + l4hs_clkctrl: l4hs-clkctrl@120 { + compatible = "ti,clkctrl"; + reg = <0x120 0x4>; + #clock-cells = <2>; + }; + + pruss_ocp_clkctrl: pruss-ocp-clkctrl@e8 { + compatible = "ti,clkctrl"; + reg = <0xe8 0x4>; + #clock-cells = <2>; + }; + + cpsw_125mhz_clkctrl: cpsw-125mhz-clkctrl@0 { + compatible = "ti,clkctrl"; + reg = <0x0 0x18>; + #clock-cells = <2>; + }; + + lcdc_clkctrl: lcdc-clkctrl@18 { + compatible = "ti,clkctrl"; + reg = <0x18 0x4>; + #clock-cells = <2>; + }; + + clk_24mhz_clkctrl: clk-24mhz-clkctrl@14c { + compatible = "ti,clkctrl"; + reg = <0x14c 0x4>; + #clock-cells = <2>; + }; }; - l4_wkup_cm: l4_wkup_cm@400 { + wkup_cm: wkup-cm@400 { compatible = "ti,omap4-cm"; reg = <0x400 0x100>; #address-cells = <1>; #size-cells = <1>; ranges = <0 0x400 0x100>; - l4_wkup_clkctrl: clk@4 { + l4_wkup_clkctrl: l4-wkup-clkctrl@0 { compatible = "ti,clkctrl"; - reg = <0x4 0xd4>; + reg = <0x0 0x10>, <0xb4 0x24>; #clock-cells = <2>; }; + + l3_aon_clkctrl: l3-aon-clkctrl@14 { + compatible = "ti,clkctrl"; + reg = <0x14 0x4>; + #clock-cells = <2>; + }; + + l4_wkup_aon_clkctrl: l4-wkup-aon-clkctrl@b0 { + compatible = "ti,clkctrl"; + reg = <0xb0 0x4>; + #clock-cells = <2>; + }; }; - mpu_cm: mpu_cm@600 { + mpu_cm: mpu-cm@600 { compatible = "ti,omap4-cm"; reg = <0x600 0x100>; #address-cells = <1>; #size-cells = <1>; ranges = <0 0x600 0x100>; - mpu_clkctrl: clk@4 { + mpu_clkctrl: mpu-clkctrl@0 { compatible = "ti,clkctrl"; - reg = <0x4 0x4>; + reg = <0x0 0x8>; #clock-cells = <2>; }; }; - l4_rtc_cm: l4_rtc_cm@800 { + l4_rtc_cm: l4-rtc-cm@800 { compatible = "ti,omap4-cm"; reg = <0x800 0x100>; #address-cells = <1>; #size-cells = <1>; ranges = <0 0x800 0x100>; - l4_rtc_clkctrl: clk@0 { + l4_rtc_clkctrl: l4-rtc-clkctrl@0 { compatible = "ti,clkctrl"; reg = <0x0 0x4>; #clock-cells = <2>; }; }; - gfx_l3_cm: gfx_l3_cm@900 { + gfx_l3_cm: gfx-l3-cm@900 { compatible = "ti,omap4-cm"; reg = <0x900 0x100>; #address-cells = <1>; #size-cells = <1>; ranges = <0 0x900 0x100>; - gfx_l3_clkctrl: clk@4 { + gfx_l3_clkctrl: gfx-l3-clkctrl@0 { compatible = "ti,clkctrl"; - reg = <0x4 0x4>; + reg = <0x0 0x8>; #clock-cells = <2>; }; }; - l4_cefuse_cm: l4_cefuse_cm@a00 { + l4_cefuse_cm: l4-cefuse-cm@a00 { compatible = "ti,omap4-cm"; reg = <0xa00 0x100>; #address-cells = <1>; #size-cells = <1>; ranges = <0 0xa00 0x100>; - l4_cefuse_clkctrl: clk@20 { + l4_cefuse_clkctrl: l4-cefuse-clkctrl@0 { compatible = "ti,clkctrl"; - reg = <0x20 0x4>; + reg = <0x0 0x24>; #clock-cells = <2>; }; }; Copied: stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi (from r346092, head/sys/gnu/dts/arm/am33xx-l4.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi Mon Aug 5 17:23:23 2019 (r350597, copy of r346092, head/sys/gnu/dts/arm/am33xx-l4.dtsi) @@ -0,0 +1,2132 @@ +&l4_wkup { /* 0x44c00000 */ + compatible = "ti,am33xx-l4-wkup", "simple-bus"; + reg = <0x44c00000 0x800>, + <0x44c00800 0x800>, + <0x44c01000 0x400>, + <0x44c01400 0x400>; + reg-names = "ap", "la", "ia0", "ia1"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x00000000 0x44c00000 0x100000>, /* segment 0 */ + <0x00100000 0x44d00000 0x100000>, /* segment 1 */ + <0x00200000 0x44e00000 0x100000>; /* segment 2 */ + + segment@0 { /* 0x44c00000 */ + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x00000000 0x00000000 0x000800>, /* ap 0 */ + <0x00000800 0x00000800 0x000800>, /* ap 1 */ + <0x00001000 0x00001000 0x000400>, /* ap 2 */ + <0x00001400 0x00001400 0x000400>; /* ap 3 */ + }; + + segment@100000 { /* 0x44d00000 */ + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x00000000 0x00100000 0x004000>, /* ap 4 */ + <0x00004000 0x00104000 0x001000>, /* ap 5 */ + <0x00080000 0x00180000 0x002000>, /* ap 6 */ + <0x00082000 0x00182000 0x001000>; /* ap 7 */ + + target-module@0 { /* 0x44d00000, ap 4 28.0 */ + compatible = "ti,sysc-omap4", "ti,sysc"; + reg = <0x0 0x4>; + reg-names = "rev"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x4000>; + status = "disabled"; + }; + + target-module@80000 { /* 0x44d80000, ap 6 10.0 */ + compatible = "ti,sysc"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x80000 0x2000>; + }; + }; + + segment@200000 { /* 0x44e00000 */ + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x00000000 0x00200000 0x002000>, /* ap 8 */ + <0x00002000 0x00202000 0x001000>, /* ap 9 */ + <0x00003000 0x00203000 0x001000>, /* ap 10 */ + <0x00004000 0x00204000 0x001000>, /* ap 11 */ + <0x00005000 0x00205000 0x001000>, /* ap 12 */ + <0x00006000 0x00206000 0x001000>, /* ap 13 */ + <0x00007000 0x00207000 0x001000>, /* ap 14 */ + <0x00008000 0x00208000 0x001000>, /* ap 15 */ + <0x00009000 0x00209000 0x001000>, /* ap 16 */ + <0x0000a000 0x0020a000 0x001000>, /* ap 17 */ + <0x0000b000 0x0020b000 0x001000>, /* ap 18 */ + <0x0000c000 0x0020c000 0x001000>, /* ap 19 */ + <0x0000d000 0x0020d000 0x001000>, /* ap 20 */ + <0x0000f000 0x0020f000 0x001000>, /* ap 21 */ + <0x00010000 0x00210000 0x010000>, /* ap 22 */ + <0x00020000 0x00220000 0x010000>, /* ap 23 */ + <0x00030000 0x00230000 0x001000>, /* ap 24 */ + <0x00031000 0x00231000 0x001000>, /* ap 25 */ + <0x00032000 0x00232000 0x001000>, /* ap 26 */ + <0x00033000 0x00233000 0x001000>, /* ap 27 */ + <0x00034000 0x00234000 0x001000>, /* ap 28 */ + <0x00035000 0x00235000 0x001000>, /* ap 29 */ + <0x00036000 0x00236000 0x001000>, /* ap 30 */ + <0x00037000 0x00237000 0x001000>, /* ap 31 */ + <0x00038000 0x00238000 0x001000>, /* ap 32 */ + <0x00039000 0x00239000 0x001000>, /* ap 33 */ + <0x0003a000 0x0023a000 0x001000>, /* ap 34 */ + <0x0003e000 0x0023e000 0x001000>, /* ap 35 */ + <0x0003f000 0x0023f000 0x001000>, /* ap 36 */ + <0x0000e000 0x0020e000 0x001000>, /* ap 37 */ + <0x00040000 0x00240000 0x040000>, /* ap 38 */ + <0x00080000 0x00280000 0x001000>; /* ap 39 */ + + target-module@0 { /* 0x44e00000, ap 8 58.0 */ + compatible = "ti,sysc-omap4", "ti,sysc"; + reg = <0 0x4>; + reg-names = "rev"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x2000>; + + prcm: prcm@0 { + compatible = "ti,am3-prcm", "simple-bus"; + reg = <0 0x2000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0x2000>; + + prcm_clocks: clocks { + #address-cells = <1>; + #size-cells = <0>; + }; + + prcm_clockdomains: clockdomains { + }; + }; + }; + + target-module@3000 { /* 0x44e03000, ap 10 0a.0 */ + compatible = "ti,sysc"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x3000 0x1000>; + }; + + target-module@5000 { /* 0x44e05000, ap 12 30.0 */ + compatible = "ti,sysc"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x5000 0x1000>; + }; + + target-module@7000 { /* 0x44e07000, ap 14 20.0 */ + compatible = "ti,sysc-omap2", "ti,sysc"; + ti,hwmods = "gpio1"; + reg = <0x7000 0x4>, + <0x7010 0x4>, + <0x7114 0x4>; + reg-names = "rev", "sysc", "syss"; + ti,sysc-mask = <(SYSC_OMAP2_ENAWAKEUP | + SYSC_OMAP2_SOFTRESET | + SYSC_OMAP2_AUTOIDLE)>; + ti,sysc-sidle = , + , + , + ; + ti,syss-mask = <1>; + /* Domains (P, C): wkup_pwrdm, l4_wkup_clkdm */ + clocks = <&l4_wkup_clkctrl AM3_L4_WKUP_GPIO1_CLKCTRL 0>, + <&l4_wkup_clkctrl AM3_L4_WKUP_GPIO1_CLKCTRL 18>; + clock-names = "fck", "dbclk"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x7000 0x1000>; + + gpio0: gpio@0 { + compatible = "ti,omap4-gpio"; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x0 0x1000>; + interrupts = <96>; + }; + }; + + target-module@9000 { /* 0x44e09000, ap 16 04.0 */ + compatible = "ti,sysc-omap2", "ti,sysc"; + ti,hwmods = "uart1"; + reg = <0x9050 0x4>, + <0x9054 0x4>, + <0x9058 0x4>; + reg-names = "rev", "sysc", "syss"; + ti,sysc-mask = <(SYSC_OMAP2_ENAWAKEUP | + SYSC_OMAP2_SOFTRESET | + SYSC_OMAP2_AUTOIDLE)>; + ti,sysc-sidle = , + , + , + ; + /* Domains (P, C): wkup_pwrdm, l4_wkup_clkdm */ + clocks = <&l4_wkup_clkctrl AM3_L4_WKUP_UART1_CLKCTRL 0>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x9000 0x1000>; + + uart0: serial@0 { + compatible = "ti,am3352-uart", "ti,omap3-uart"; + clock-frequency = <48000000>; + reg = <0x0 0x2000>; + interrupts = <72>; + status = "disabled"; + dmas = <&edma 26 0>, <&edma 27 0>; + dma-names = "tx", "rx"; + }; + }; + + target-module@b000 { /* 0x44e0b000, ap 18 48.0 */ + compatible = "ti,sysc-omap2", "ti,sysc"; + ti,hwmods = "i2c1"; + reg = <0xb000 0x8>, + <0xb010 0x8>, + <0xb090 0x8>; + reg-names = "rev", "sysc", "syss"; + ti,sysc-mask = <(SYSC_OMAP2_CLOCKACTIVITY | + SYSC_OMAP2_ENAWAKEUP | + SYSC_OMAP2_SOFTRESET | + SYSC_OMAP2_AUTOIDLE)>; + ti,sysc-sidle = , + , + , + ; + ti,syss-mask = <1>; + /* Domains (P, C): wkup_pwrdm, l4_wkup_clkdm */ + clocks = <&l4_wkup_clkctrl AM3_L4_WKUP_I2C1_CLKCTRL 0>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0xb000 0x1000>; + + i2c0: i2c@0 { + compatible = "ti,omap4-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0 0x1000>; + interrupts = <70>; + status = "disabled"; + }; + }; + + target-module@d000 { /* 0x44e0d000, ap 20 38.0 */ + compatible = "ti,sysc-omap4", "ti,sysc"; + ti,hwmods = "adc_tsc"; + reg = <0xd000 0x4>, + <0xd010 0x4>; + reg-names = "rev", "sysc"; + ti,sysc-sidle = , + , + , + ; + /* Domains (P, C): wkup_pwrdm, l4_wkup_clkdm */ + clocks = <&l4_wkup_clkctrl AM3_L4_WKUP_ADC_TSC_CLKCTRL 0>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x00000000 0x0000d000 0x00001000>, + <0x00001000 0x0000e000 0x00001000>; + + tscadc: tscadc@0 { + compatible = "ti,am3359-tscadc"; + reg = <0x0 0x1000>; + interrupts = <16>; + status = "disabled"; + dmas = <&edma 53 0>, <&edma 57 0>; + dma-names = "fifo0", "fifo1"; + + tsc { + compatible = "ti,am3359-tsc"; + }; + am335x_adc: adc { + #io-channel-cells = <1>; + compatible = "ti,am3359-adc"; + }; + }; + }; + + target-module@10000 { /* 0x44e10000, ap 22 0c.0 */ + compatible = "ti,sysc-omap4", "ti,sysc"; + reg = <0x10000 0x4>; + reg-names = "rev"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x00000000 0x00010000 0x00010000>, + <0x00010000 0x00020000 0x00010000>; + + scm: scm@0 { + compatible = "ti,am3-scm", "simple-bus"; + reg = <0x0 0x2000>; + #address-cells = <1>; + #size-cells = <1>; + #pinctrl-cells = <1>; + ranges = <0 0 0x2000>; + + phy_sel: cpsw-phy-sel@650 { + compatible = "ti,am3352-cpsw-phy-sel"; + reg= <0x650 0x4>; + reg-names = "gmii-sel"; + }; + + am33xx_pinmux: pinmux@800 { + compatible = "pinctrl-single"; + reg = <0x800 0x238>; + #address-cells = <1>; + #size-cells = <0>; + #pinctrl-cells = <1>; + pinctrl-single,register-width = <32>; + pinctrl-single,function-mask = <0x7f>; + }; + + scm_conf: scm_conf@0 { + compatible = "syscon", "simple-bus"; + reg = <0x0 0x800>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0x800>; + + scm_clocks: clocks { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + wkup_m3_ipc: wkup_m3_ipc@1324 { + compatible = "ti,am3352-wkup-m3-ipc"; + reg = <0x1324 0x24>; + interrupts = <78>; + ti,rproc = <&wkup_m3>; + mboxes = <&mailbox &mbox_wkupm3>; + }; + + edma_xbar: dma-router@f90 { + compatible = "ti,am335x-edma-crossbar"; + reg = <0xf90 0x40>; + #dma-cells = <3>; + dma-requests = <32>; + dma-masters = <&edma>; + }; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 5 17:32:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13383A8D50; Mon, 5 Aug 2019 17:32:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462PwK6qYzz3yS9; Mon, 5 Aug 2019 17:32:17 +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 CDA4F1F34E; Mon, 5 Aug 2019 17:32:17 +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 x75HWH83091415; Mon, 5 Aug 2019 17:32:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75HWH0J091412; Mon, 5 Aug 2019 17:32:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051732.x75HWH0J091412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 17:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350598 - in stable/12/sys/arm/allwinner: . clk X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys/arm/allwinner: . clk X-SVN-Commit-Revision: 350598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 17:32:18 -0000 Author: manu Date: Mon Aug 5 17:32:16 2019 New Revision: 350598 URL: https://svnweb.freebsd.org/changeset/base/350598 Log: MFC r346293: allwinner: clk: Garbage collect old clock implementation The old clocks are disconneted from the build since r337344. Remove all those pseudo drivers. The only one remaining is for gmac (the ethernet controller) so move it to sys/arm/allwinner. While here remove a83t support from gmacclk as it is unneeded since r326114. Added: stable/12/sys/arm/allwinner/aw_gmacclk.c - copied unchanged from r346293, head/sys/arm/allwinner/aw_gmacclk.c Deleted: stable/12/sys/arm/allwinner/clk/ Modified: stable/12/sys/arm/allwinner/aw_ccu.c stable/12/sys/arm/allwinner/files.allwinner Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_ccu.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_ccu.c Mon Aug 5 17:23:23 2019 (r350597) +++ stable/12/sys/arm/allwinner/aw_ccu.c Mon Aug 5 17:32:16 2019 (r350598) @@ -53,38 +53,18 @@ __FBSDID("$FreeBSD$"); #define CCU_BASE 0x01c20000 #define CCU_SIZE 0x400 -#define PRCM_BASE 0x01f01400 -#define PRCM_SIZE 0x200 - -#define SYSCTRL_BASE 0x01c00000 -#define SYSCTRL_SIZE 0x34 - struct aw_ccu_softc { struct simplebus_softc sc; bus_space_tag_t bst; - bus_space_handle_t ccu_bsh; - bus_space_handle_t prcm_bsh; - bus_space_handle_t sysctrl_bsh; + bus_space_handle_t bsh; struct mtx mtx; int flags; }; -#define CLOCK_CCU (1 << 0) -#define CLOCK_PRCM (1 << 1) -#define CLOCK_SYSCTRL (1 << 2) - static struct ofw_compat_data compat_data[] = { - { "allwinner,sun4i-a10", CLOCK_CCU }, - { "allwinner,sun5i-a13", CLOCK_CCU }, - { "allwinner,sun7i-a20", CLOCK_CCU }, - { "allwinner,sun6i-a31", CLOCK_CCU }, - { "allwinner,sun6i-a31s", CLOCK_CCU }, - { "allwinner,sun50i-a64", CLOCK_CCU }, - { "allwinner,sun50i-h5", CLOCK_CCU }, - { "allwinner,sun8i-a33", CLOCK_CCU }, - { "allwinner,sun8i-a83t", CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL }, - { "allwinner,sun8i-h2-plus", CLOCK_CCU|CLOCK_PRCM }, - { "allwinner,sun8i-h3", CLOCK_CCU|CLOCK_PRCM }, + { "allwinner,sun7i-a20", 1 }, + { "allwinner,sun6i-a31", 1 }, + { "allwinner,sun6i-a31s", 1 }, { NULL, 0 } }; @@ -92,24 +72,11 @@ static int aw_ccu_check_addr(struct aw_ccu_softc *sc, bus_addr_t addr, bus_space_handle_t *pbsh, bus_size_t *poff) { - if (addr >= CCU_BASE && addr < (CCU_BASE + CCU_SIZE) && - (sc->flags & CLOCK_CCU) != 0) { + if (addr >= CCU_BASE && addr < (CCU_BASE + CCU_SIZE)) { *poff = addr - CCU_BASE; - *pbsh = sc->ccu_bsh; + *pbsh = sc->bsh; return (0); } - if (addr >= PRCM_BASE && addr < (PRCM_BASE + PRCM_SIZE) && - (sc->flags & CLOCK_PRCM) != 0) { - *poff = addr - PRCM_BASE; - *pbsh = sc->prcm_bsh; - return (0); - } - if (addr >= SYSCTRL_BASE && addr < (SYSCTRL_BASE + SYSCTRL_SIZE) && - (sc->flags & CLOCK_SYSCTRL) != 0) { - *poff = addr - SYSCTRL_BASE; - *pbsh = sc->sysctrl_bsh; - return (0); - } return (EINVAL); } @@ -241,29 +208,11 @@ aw_ccu_attach(device_t dev) * properties. */ sc->bst = bus_get_bus_tag(dev); - if (sc->flags & CLOCK_CCU) { - error = bus_space_map(sc->bst, CCU_BASE, CCU_SIZE, 0, - &sc->ccu_bsh); - if (error != 0) { - device_printf(dev, "couldn't map CCU: %d\n", error); - return (error); - } - } - if (sc->flags & CLOCK_PRCM) { - error = bus_space_map(sc->bst, PRCM_BASE, PRCM_SIZE, 0, - &sc->prcm_bsh); - if (error != 0) { - device_printf(dev, "couldn't map PRCM: %d\n", error); - return (error); - } - } - if (sc->flags & CLOCK_SYSCTRL) { - error = bus_space_map(sc->bst, SYSCTRL_BASE, SYSCTRL_SIZE, 0, - &sc->sysctrl_bsh); - if (error != 0) { - device_printf(dev, "couldn't map SYSCTRL: %d\n", error); - return (error); - } + error = bus_space_map(sc->bst, CCU_BASE, CCU_SIZE, 0, + &sc->bsh); + if (error != 0) { + device_printf(dev, "couldn't map CCU: %d\n", error); + return (error); } mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); Copied: stable/12/sys/arm/allwinner/aw_gmacclk.c (from r346293, head/sys/arm/allwinner/aw_gmacclk.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/allwinner/aw_gmacclk.c Mon Aug 5 17:32:16 2019 (r350598, copy of r346293, head/sys/arm/allwinner/aw_gmacclk.c) @@ -0,0 +1,280 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * 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$ + */ + +/* + * Allwinner GMAC clock + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "clkdev_if.h" + +#define GMAC_CLK_PIT (0x1 << 2) +#define GMAC_CLK_PIT_SHIFT 2 +#define GMAC_CLK_PIT_MII 0 +#define GMAC_CLK_PIT_RGMII 1 +#define GMAC_CLK_SRC (0x3 << 0) +#define GMAC_CLK_SRC_SHIFT 0 +#define GMAC_CLK_SRC_MII 0 +#define GMAC_CLK_SRC_EXT_RGMII 1 +#define GMAC_CLK_SRC_RGMII 2 + +#define EMAC_TXC_DIV_CFG (1 << 15) +#define EMAC_TXC_DIV_CFG_SHIFT 15 +#define EMAC_TXC_DIV_CFG_125MHZ 0 +#define EMAC_TXC_DIV_CFG_25MHZ 1 +#define EMAC_PHY_SELECT (1 << 16) +#define EMAC_PHY_SELECT_SHIFT 16 +#define EMAC_PHY_SELECT_INT 0 +#define EMAC_PHY_SELECT_EXT 1 +#define EMAC_ETXDC (0x7 << 10) +#define EMAC_ETXDC_SHIFT 10 +#define EMAC_ERXDC (0x1f << 5) +#define EMAC_ERXDC_SHIFT 5 + +#define CLK_IDX_MII 0 +#define CLK_IDX_RGMII 1 +#define CLK_IDX_COUNT 2 + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun7i-a20-gmac-clk", 1 }, + { NULL, 0 } +}; + +struct aw_gmacclk_sc { + device_t clkdev; + bus_addr_t reg; + + int rx_delay; + int tx_delay; +}; + +#define GMACCLK_READ(sc, val) CLKDEV_READ_4((sc)->clkdev, (sc)->reg, (val)) +#define GMACCLK_WRITE(sc, val) CLKDEV_WRITE_4((sc)->clkdev, (sc)->reg, (val)) +#define DEVICE_LOCK(sc) CLKDEV_DEVICE_LOCK((sc)->clkdev) +#define DEVICE_UNLOCK(sc) CLKDEV_DEVICE_UNLOCK((sc)->clkdev) + +static int +aw_gmacclk_init(struct clknode *clk, device_t dev) +{ + struct aw_gmacclk_sc *sc; + uint32_t val, index; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(sc); + GMACCLK_READ(sc, &val); + DEVICE_UNLOCK(sc); + + switch ((val & GMAC_CLK_SRC) >> GMAC_CLK_SRC_SHIFT) { + case GMAC_CLK_SRC_MII: + index = CLK_IDX_MII; + break; + case GMAC_CLK_SRC_RGMII: + index = CLK_IDX_RGMII; + break; + default: + return (ENXIO); + } + + clknode_init_parent_idx(clk, index); + return (0); +} + +static int +aw_gmacclk_set_mux(struct clknode *clk, int index) +{ + struct aw_gmacclk_sc *sc; + uint32_t val, clk_src, pit, txc_div; + int error; + + sc = clknode_get_softc(clk); + error = 0; + + switch (index) { + case CLK_IDX_MII: + clk_src = GMAC_CLK_SRC_MII; + pit = GMAC_CLK_PIT_MII; + txc_div = EMAC_TXC_DIV_CFG_25MHZ; + break; + case CLK_IDX_RGMII: + clk_src = GMAC_CLK_SRC_RGMII; + pit = GMAC_CLK_PIT_RGMII; + txc_div = EMAC_TXC_DIV_CFG_125MHZ; + break; + default: + return (ENXIO); + } + + DEVICE_LOCK(sc); + GMACCLK_READ(sc, &val); + val &= ~(GMAC_CLK_SRC | GMAC_CLK_PIT); + val |= (clk_src << GMAC_CLK_SRC_SHIFT); + val |= (pit << GMAC_CLK_PIT_SHIFT); + GMACCLK_WRITE(sc, val); + DEVICE_UNLOCK(sc); + + return (0); +} + +static clknode_method_t aw_gmacclk_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, aw_gmacclk_init), + CLKNODEMETHOD(clknode_set_mux, aw_gmacclk_set_mux), + CLKNODEMETHOD_END +}; +DEFINE_CLASS_1(aw_gmacclk_clknode, aw_gmacclk_clknode_class, + aw_gmacclk_clknode_methods, sizeof(struct aw_gmacclk_sc), clknode_class); + +static int +aw_gmacclk_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner GMAC Clock"); + return (BUS_PROBE_DEFAULT); +} + +static int +aw_gmacclk_attach(device_t dev) +{ + struct clknode_init_def def; + struct aw_gmacclk_sc *sc; + struct clkdom *clkdom; + struct clknode *clk; + clk_t clk_parent; + bus_addr_t paddr; + bus_size_t psize; + phandle_t node; + int error, ncells, i; + + node = ofw_bus_get_node(dev); + + if (ofw_reg_to_paddr(node, 0, &paddr, &psize, NULL) != 0) { + device_printf(dev, "cannot parse 'reg' property\n"); + return (ENXIO); + } + + error = ofw_bus_parse_xref_list_get_length(node, "clocks", + "#clock-cells", &ncells); + if (error != 0 || ncells != CLK_IDX_COUNT) { + device_printf(dev, "couldn't find parent clocks\n"); + return (ENXIO); + } + + clkdom = clkdom_create(dev); + + memset(&def, 0, sizeof(def)); + error = clk_parse_ofw_clk_name(dev, node, &def.name); + if (error != 0) { + device_printf(dev, "cannot parse clock name\n"); + error = ENXIO; + goto fail; + } + def.id = 1; + def.parent_names = malloc(sizeof(char *) * ncells, M_OFWPROP, M_WAITOK); + for (i = 0; i < ncells; i++) { + error = clk_get_by_ofw_index(dev, 0, i, &clk_parent); + if (error != 0) { + device_printf(dev, "cannot get clock %d\n", error); + goto fail; + } + def.parent_names[i] = clk_get_name(clk_parent); + clk_release(clk_parent); + } + def.parent_cnt = ncells; + + clk = clknode_create(clkdom, &aw_gmacclk_clknode_class, &def); + if (clk == NULL) { + device_printf(dev, "cannot create clknode\n"); + error = ENXIO; + goto fail; + } + + sc = clknode_get_softc(clk); + sc->reg = paddr; + sc->clkdev = device_get_parent(dev); + sc->tx_delay = sc->rx_delay = -1; + OF_getencprop(node, "tx-delay", &sc->tx_delay, sizeof(sc->tx_delay)); + OF_getencprop(node, "rx-delay", &sc->rx_delay, sizeof(sc->rx_delay)); + + clknode_register(clkdom, clk); + + if (clkdom_finit(clkdom) != 0) { + device_printf(dev, "cannot finalize clkdom initialization\n"); + error = ENXIO; + goto fail; + } + + if (bootverbose) + clkdom_dump(clkdom); + + return (0); + +fail: + return (error); +} + +static device_method_t aw_gmacclk_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, aw_gmacclk_probe), + DEVMETHOD(device_attach, aw_gmacclk_attach), + + DEVMETHOD_END +}; + +static driver_t aw_gmacclk_driver = { + "aw_gmacclk", + aw_gmacclk_methods, + 0 +}; + +static devclass_t aw_gmacclk_devclass; + +EARLY_DRIVER_MODULE(aw_gmacclk, simplebus, aw_gmacclk_driver, + aw_gmacclk_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: stable/12/sys/arm/allwinner/files.allwinner ============================================================================== --- stable/12/sys/arm/allwinner/files.allwinner Mon Aug 5 17:23:23 2019 (r350597) +++ stable/12/sys/arm/allwinner/files.allwinner Mon Aug 5 17:32:16 2019 (r350598) @@ -34,7 +34,7 @@ arm/allwinner/aw_cir.c optional aw_cir evdev arm/allwinner/aw_reset.c standard arm/allwinner/aw_ccu.c standard -arm/allwinner/clk/aw_gmacclk.c standard +arm/allwinner/aw_gmacclk.c standard arm/allwinner/clkng/aw_ccung.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard From owner-svn-src-all@freebsd.org Mon Aug 5 17:36:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98ACFA8E8C; Mon, 5 Aug 2019 17:36:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Q0f389xz3yfD; Mon, 5 Aug 2019 17:36:02 +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 2FF061F367; Mon, 5 Aug 2019 17:36:02 +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 x75Ha2SZ092382; Mon, 5 Aug 2019 17:36:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75Ha1a4092377; Mon, 5 Aug 2019 17:36:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908051736.x75Ha1a4092377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 5 Aug 2019 17:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350599 - in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sbin/nvmecontrol sys/dev/nvme X-SVN-Commit-Revision: 350599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 17:36:02 -0000 Author: mav Date: Mon Aug 5 17:36:00 2019 New Revision: 350599 URL: https://svnweb.freebsd.org/changeset/base/350599 Log: Add `nvmecontrol resv` to handle NVMe reservations. NVMe reservations are quite alike to SCSI persistent reservations and can be used in clustered setups with shared multiport storage. MFC after: 10 days Relnotes: yes Sponsored by: iXsystems, Inc. Added: head/sbin/nvmecontrol/resv.c (contents, props changed) Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/nvmecontrol.8 head/sbin/nvmecontrol/sanitize.c head/sys/dev/nvme/nvme.h Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Mon Aug 5 17:32:16 2019 (r350598) +++ head/sbin/nvmecontrol/Makefile Mon Aug 5 17:36:00 2019 (r350599) @@ -4,7 +4,7 @@ PACKAGE=runtime PROG= nvmecontrol SRCS= comnd.c nvmecontrol.c SRCS+= devlist.c firmware.c format.c identify.c logpage.c ns.c nsid.c -SRCS+= perftest.c power.c reset.c sanitize.c +SRCS+= perftest.c power.c reset.c resv.c sanitize.c #SRCS+= passthru.c SRCS+= identify_ext.c nvme_util.c nc_util.c MAN= nvmecontrol.8 Modified: head/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.8 Mon Aug 5 17:32:16 2019 (r350598) +++ head/sbin/nvmecontrol/nvmecontrol.8 Mon Aug 5 17:36:00 2019 (r350599) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2019 +.Dd August 5, 2019 .Dt NVMECONTROL 8 .Os .Sh NAME @@ -121,6 +121,33 @@ .Aq device id .Aq namespace id .Nm +.Ic resv acquire +.Aq Fl c Ar crkey +.Op Fl p Ar prkey +.Aq Fl t Ar rtype +.Aq Fl a Ar racqa +.Aq namespace id +.Nm +.Ic resv register +.Op Fl c Ar crkey +.Aq Fl k Ar nrkey +.Aq Fl r Ar rrega +.Op Fl i Ar iekey +.Op Fl p Ar cptpl +.Aq namespace id +.Nm +.Ic resv release +.Aq Fl c Ar crkey +.Aq Fl t Ar rtype +.Aq Fl a Ar rrela +.Aq namespace id +.Nm +.Ic resv report +.Op Fl e +.Op Fl v +.Op Fl x +.Aq namespace id +.Nm .Ic firmware .Op Fl s Ar slot .Op Fl f Ar path_to_firmware @@ -140,9 +167,9 @@ .Ic sanitize .Aq Fl a Ar sanact .Op Fl c Ar owpass +.Op Fl d .Op Fl p Ar ovrpat .Op Fl r -.Op Fl D .Op Fl I .Op Fl U .Aq device id @@ -223,6 +250,96 @@ will set Retain Asynchronous Event. Various namespace management commands. If namespace management is supported by device, allow list, create and delete namespaces, list, attach and detach controllers to namespaces. +.Ss resv acquire +Acquire or preempt namespace reservation, using specified parameters: +.Bl -tag -width 6n +.It Fl a +Acquire action: +.Bl -tag -compact -width 6n +.It Dv 0 +Acquire +.It Dv 1 +Preempt +.It Dv 2 +Preempt and abort +.El +.It Fl c +Current reservation key. +.It Fl p +Preempt reservation key. +.It Fl t +Reservation type: +.Bl -tag -compact -width 6n +.It Dv 1 +Write Exclusive +.It Dv 2 +Exclusive Access +.It Dv 3 +Write Exclusive - Registrants Only +.It Dv 4 +Exclusive Access - Registrants Only +.It Dv 5 +Write Exclusive - All Registrants +.It Dv 6 +Exclusive Access - All Registrants +.El +.El +.Ss resv register +Register, unregister or replace reservation key, using specified parameters: +.Bl -tag -width 6n +.It Fl c +Current reservation key. +.It Fl k +New reservation key. +.It Fl r +Register action: +.Bl -tag -compact -width 6n +.It Dv 0 +Register +.It Dv 1 +Unregister +.It Dv 2 +Replace +.El +.It Fl i +Ignore Existing Key +.It Fl p +Change Persist Through Power Loss State: +.Bl -tag -compact -width 6n +.It Dv 0 +No change to PTPL state +.It Dv 2 +Set PTPL state to ‘0’. +Reservations are released and registrants are cleared on a power on. +.It Dv 3 +Set PTPL state to ‘1’. +Reservations and registrants persist across a power loss. +.El +.El +.Ss resv release +Release or clear reservation, using specified parameters: +.Bl -tag -width 6n +.It Fl c +Current reservation key. +.It Fl t +Reservation type. +.It Fl a +Release action: +.Bl -tag -compact -width 6n +.It Dv 0 +Release +.It Dv 1 +Clean +.El +.El +.Ss resv report +Print reservation status, using specified parameters: +.Bl -tag -width 6n +.It Fl x +Print reservation status in hex. +.It Fl e +Use Extended Data Structure. +.El .Ss format Format either specified namespace, or all namespaces of specified controller, using specified parameters: @@ -281,7 +398,7 @@ The number of passes when performing an operation. Valid values are between 1 and 16. The default is 1. -.It Fl D +.It Fl d No Deallocate After Sanitize. .It Fl I When performing an Added: head/sbin/nvmecontrol/resv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/nvmecontrol/resv.c Mon Aug 5 17:36:00 2019 (r350599) @@ -0,0 +1,442 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2019 Alexander Motin + * + * 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, + * without modification, immediately at the beginning of the file. + * 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 "nvmecontrol.h" + +/* Tables for command line parsing */ + +static cmd_fn_t resv; +static cmd_fn_t resvacquire; +static cmd_fn_t resvregister; +static cmd_fn_t resvrelease; +static cmd_fn_t resvreport; + +#define NONE 0xffffffffu +#define NONE64 0xffffffffffffffffull +#define OPT(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc } +#define OPT_END { NULL, 0, arg_none, NULL, NULL } + +static struct cmd resv_cmd = { + .name = "resv", + .fn = resv, + .descr = "Reservation commands", + .ctx_size = 0, + .opts = NULL, + .args = NULL, +}; + +CMD_COMMAND(resv_cmd); + +static struct acquire_options { + uint64_t crkey; + uint64_t prkey; + uint8_t rtype; + uint8_t racqa; + const char *dev; +} acquire_opt = { + .crkey = 0, + .prkey = 0, + .rtype = 0, + .racqa = 0, + .dev = NULL, +}; + +static const struct opts acquire_opts[] = { + OPT("crkey", 'c', arg_uint64, acquire_opt, crkey, + "Current Reservation Key"), + OPT("prkey", 'p', arg_uint64, acquire_opt, prkey, + "Preempt Reservation Key"), + OPT("rtype", 't', arg_uint8, acquire_opt, rtype, + "Reservation Type"), + OPT("racqa", 'a', arg_uint8, acquire_opt, racqa, + "Acquire Action (0=acq, 1=pre, 2=pre+ab)"), + { NULL, 0, arg_none, NULL, NULL } +}; + +static const struct args acquire_args[] = { + { arg_string, &acquire_opt.dev, "namespace-id" }, + { arg_none, NULL, NULL }, +}; + +static struct cmd acquire_cmd = { + .name = "acquire", + .fn = resvacquire, + .descr = "Acquire/preempt reservation", + .ctx_size = sizeof(acquire_opt), + .opts = acquire_opts, + .args = acquire_args, +}; + +CMD_SUBCOMMAND(resv_cmd, acquire_cmd); + +static struct register_options { + uint64_t crkey; + uint64_t nrkey; + uint8_t rrega; + bool iekey; + uint8_t cptpl; + const char *dev; +} register_opt = { + .crkey = 0, + .nrkey = 0, + .rrega = 0, + .iekey = false, + .cptpl = 0, + .dev = NULL, +}; + +static const struct opts register_opts[] = { + OPT("crkey", 'c', arg_uint64, register_opt, crkey, + "Current Reservation Key"), + OPT("nrkey", 'k', arg_uint64, register_opt, nrkey, + "New Reservation Key"), + OPT("rrega", 'r', arg_uint8, register_opt, rrega, + "Register Action (0=reg, 1=unreg, 2=replace)"), + OPT("iekey", 'i', arg_none, register_opt, iekey, + "Ignore Existing Key"), + OPT("cptpl", 'p', arg_uint8, register_opt, cptpl, + "Change Persist Through Power Loss State"), + { NULL, 0, arg_none, NULL, NULL } +}; + +static const struct args register_args[] = { + { arg_string, ®ister_opt.dev, "namespace-id" }, + { arg_none, NULL, NULL }, +}; + +static struct cmd register_cmd = { + .name = "register", + .fn = resvregister, + .descr = "Register/unregister reservation", + .ctx_size = sizeof(register_opt), + .opts = register_opts, + .args = register_args, +}; + +CMD_SUBCOMMAND(resv_cmd, register_cmd); + +static struct release_options { + uint64_t crkey; + uint8_t rtype; + uint8_t rrela; + const char *dev; +} release_opt = { + .crkey = 0, + .rtype = 0, + .rrela = 0, + .dev = NULL, +}; + +static const struct opts release_opts[] = { + OPT("crkey", 'c', arg_uint64, release_opt, crkey, + "Current Reservation Key"), + OPT("rtype", 't', arg_uint8, release_opt, rtype, + "Reservation Type"), + OPT("rrela", 'a', arg_uint8, release_opt, rrela, + "Release Action (0=release, 1=clear)"), + { NULL, 0, arg_none, NULL, NULL } +}; + +static const struct args release_args[] = { + { arg_string, &release_opt.dev, "namespace-id" }, + { arg_none, NULL, NULL }, +}; + +static struct cmd release_cmd = { + .name = "release", + .fn = resvrelease, + .descr = "Release/clear reservation", + .ctx_size = sizeof(release_opt), + .opts = release_opts, + .args = release_args, +}; + +CMD_SUBCOMMAND(resv_cmd, release_cmd); + +static struct report_options { + bool hex; + bool verbose; + bool eds; + const char *dev; +} report_opt = { + .hex = false, + .verbose = false, + .eds = false, + .dev = NULL, +}; + +static const struct opts report_opts[] = { + OPT("hex", 'x', arg_none, report_opt, hex, + "Print reservation status in hex"), + OPT("verbose", 'v', arg_none, report_opt, verbose, + "More verbosity"), + OPT("eds", 'e', arg_none, report_opt, eds, + "Extended Data Structure"), + { NULL, 0, arg_none, NULL, NULL } +}; + +static const struct args report_args[] = { + { arg_string, &report_opt.dev, "namespace-id" }, + { arg_none, NULL, NULL }, +}; + +static struct cmd report_cmd = { + .name = "report", + .fn = resvreport, + .descr = "Print reservation status", + .ctx_size = sizeof(report_opt), + .opts = report_opts, + .args = report_args, +}; + +CMD_SUBCOMMAND(resv_cmd, report_cmd); + +/* handles NVME_OPC_RESERVATION_* NVM commands */ + +static void +resvacquire(const struct cmd *f, int argc, char *argv[]) +{ + struct nvme_pt_command pt; + uint64_t data[2]; + int fd; + uint32_t nsid; + + if (arg_parse(argc, argv, f)) + return; + open_dev(acquire_opt.dev, &fd, 1, 1); + get_nsid(fd, NULL, &nsid); + if (nsid == 0) { + fprintf(stderr, "This command require namespace-id\n"); + arg_help(argc, argv, f); + } + + data[0] = htole64(acquire_opt.crkey); + data[1] = htole64(acquire_opt.prkey); + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_RESERVATION_ACQUIRE; + pt.cmd.cdw10 = htole32((acquire_opt.racqa & 7) | + (acquire_opt.rtype << 8)); + pt.buf = &data; + pt.len = sizeof(data); + pt.is_read = 0; + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "acquire request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "acquire request returned error"); + + close(fd); + exit(0); +} + +static void +resvregister(const struct cmd *f, int argc, char *argv[]) +{ + struct nvme_pt_command pt; + uint64_t data[2]; + int fd; + uint32_t nsid; + + if (arg_parse(argc, argv, f)) + return; + open_dev(register_opt.dev, &fd, 1, 1); + get_nsid(fd, NULL, &nsid); + if (nsid == 0) { + fprintf(stderr, "This command require namespace-id\n"); + arg_help(argc, argv, f); + } + + data[0] = htole64(register_opt.crkey); + data[1] = htole64(register_opt.nrkey); + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_RESERVATION_REGISTER; + pt.cmd.cdw10 = htole32((register_opt.rrega & 7) | + (register_opt.iekey << 3) | (register_opt.cptpl << 30)); + pt.buf = &data; + pt.len = sizeof(data); + pt.is_read = 0; + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "register request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "register request returned error"); + + close(fd); + exit(0); +} + +static void +resvrelease(const struct cmd *f, int argc, char *argv[]) +{ + struct nvme_pt_command pt; + uint64_t data[1]; + int fd; + uint32_t nsid; + + if (arg_parse(argc, argv, f)) + return; + open_dev(release_opt.dev, &fd, 1, 1); + get_nsid(fd, NULL, &nsid); + if (nsid == 0) { + fprintf(stderr, "This command require namespace-id\n"); + arg_help(argc, argv, f); + } + + data[0] = htole64(release_opt.crkey); + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_RESERVATION_RELEASE; + pt.cmd.cdw10 = htole32((release_opt.rrela & 7) | + (release_opt.rtype << 8)); + pt.buf = &data; + pt.len = sizeof(data); + pt.is_read = 0; + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "release request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "release request returned error"); + + close(fd); + exit(0); +} + +static void +resvreport(const struct cmd *f, int argc, char *argv[]) +{ + struct nvme_pt_command pt; + struct nvme_resv_status *s; + struct nvme_resv_status_ext *e; + uint8_t data[4096]; + int fd; + u_int i, n; + uint32_t nsid; + + if (arg_parse(argc, argv, f)) + return; + open_dev(report_opt.dev, &fd, 1, 1); + get_nsid(fd, NULL, &nsid); + if (nsid == 0) { + fprintf(stderr, "This command require namespace-id\n"); + arg_help(argc, argv, f); + } + + bzero(data, sizeof(data)); + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = NVME_OPC_RESERVATION_REPORT; + pt.cmd.cdw10 = htole32(sizeof(data) / 4 - 1); + pt.cmd.cdw11 = htole32(report_opt.eds); /* EDS */ + pt.buf = &data; + pt.len = sizeof(data); + pt.is_read = 1; + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "report request failed"); + + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "report request returned error"); + + close(fd); + + if (report_opt.eds) + nvme_resv_status_ext_swapbytes((void *)data, sizeof(data)); + else + nvme_resv_status_swapbytes((void *)data, sizeof(data)); + + if (report_opt.hex) { + i = sizeof(data); + if (!report_opt.verbose) { + for (; i > 64; i--) { + if (data[i - 1] != 0) + break; + } + } + print_hex(&data, i); + exit(0); + } + + s = (struct nvme_resv_status *)data; + n = (s->regctl[1] << 8) | s->regctl[0]; + printf("Generation: %u\n", s->gen); + printf("Reservation Type: %u\n", s->rtype); + printf("Number of Registered Controllers: %u\n", n); + printf("Persist Through Power Loss State: %u\n", s->ptpls); + if (report_opt.eds) { + e = (struct nvme_resv_status_ext *)data; + n = MIN(n, (sizeof(data) - sizeof(e)) / sizeof(e->ctrlr[0])); + for (i = 0; i < n; i++) { + printf("Controller ID: 0x%04x\n", + e->ctrlr[i].ctrlr_id); + printf(" Reservation Status: %u\n", + e->ctrlr[i].rcsts); + printf(" Reservation Key: 0x%08jx\n", + e->ctrlr[i].rkey); + printf(" Host Identifier: 0x%08jx%08jx\n", + e->ctrlr[i].hostid[0], e->ctrlr[i].hostid[1]); + } + } else { + n = MIN(n, (sizeof(data) - sizeof(s)) / sizeof(s->ctrlr[0])); + for (i = 0; i < n; i++) { + printf("Controller ID: 0x%04x\n", + s->ctrlr[i].ctrlr_id); + printf(" Reservation Status: %u\n", + s->ctrlr[i].rcsts); + printf(" Host Identifier: 0x%08jx\n", + s->ctrlr[i].hostid); + printf(" Reservation Key: 0x%08jx\n", + s->ctrlr[i].rkey); + } + } + exit(0); +} + +static void +resv(const struct cmd *nf __unused, int argc, char *argv[]) +{ + + cmd_dispatch(argc, argv, &resv_cmd); +} Modified: head/sbin/nvmecontrol/sanitize.c ============================================================================== --- head/sbin/nvmecontrol/sanitize.c Mon Aug 5 17:32:16 2019 (r350598) +++ head/sbin/nvmecontrol/sanitize.c Mon Aug 5 17:36:00 2019 (r350599) @@ -71,7 +71,7 @@ static const struct opts sanitize_opts[] = { #define OPT(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc } OPT("ause", 'U', arg_none, opt, ause, "Allow Unrestricted Sanitize Exit"), - OPT("ndas", 'D', arg_none, opt, ndas, + OPT("ndas", 'd', arg_none, opt, ndas, "No Deallocate After Sanitize"), OPT("oipbp", 'I', arg_none, opt, oipbp, "Overwrite Invert Pattern Between Passes"), Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Mon Aug 5 17:32:16 2019 (r350598) +++ head/sys/dev/nvme/nvme.h Mon Aug 5 17:36:00 2019 (r350599) @@ -1401,6 +1401,56 @@ struct intel_log_temp_stats _Static_assert(sizeof(struct intel_log_temp_stats) == 13 * 8, "bad size for intel_log_temp_stats"); +struct nvme_resv_reg_ctrlr +{ + uint16_t ctrlr_id; /* Controller ID */ + uint8_t rcsts; /* Reservation Status */ + uint8_t reserved3[5]; + uint64_t hostid; /* Host Identifier */ + uint64_t rkey; /* Reservation Key */ +} __packed __aligned(4); + +_Static_assert(sizeof(struct nvme_resv_reg_ctrlr) == 24, "bad size for nvme_resv_reg_ctrlr"); + +struct nvme_resv_reg_ctrlr_ext +{ + uint16_t ctrlr_id; /* Controller ID */ + uint8_t rcsts; /* Reservation Status */ + uint8_t reserved3[5]; + uint64_t rkey; /* Reservation Key */ + uint64_t hostid[2]; /* Host Identifier */ + uint8_t reserved32[32]; +} __packed __aligned(4); + +_Static_assert(sizeof(struct nvme_resv_reg_ctrlr_ext) == 64, "bad size for nvme_resv_reg_ctrlr_ext"); + +struct nvme_resv_status +{ + uint32_t gen; /* Generation */ + uint8_t rtype; /* Reservation Type */ + uint8_t regctl[2]; /* Number of Registered Controllers */ + uint8_t reserved7[2]; + uint8_t ptpls; /* Persist Through Power Loss State */ + uint8_t reserved10[14]; + struct nvme_resv_reg_ctrlr ctrlr[0]; +} __packed __aligned(4); + +_Static_assert(sizeof(struct nvme_resv_status) == 24, "bad size for nvme_resv_status"); + +struct nvme_resv_status_ext +{ + uint32_t gen; /* Generation */ + uint8_t rtype; /* Reservation Type */ + uint8_t regctl[2]; /* Number of Registered Controllers */ + uint8_t reserved7[2]; + uint8_t ptpls; /* Persist Through Power Loss State */ + uint8_t reserved10[14]; + uint8_t reserved24[40]; + struct nvme_resv_reg_ctrlr_ext ctrlr[0]; +} __packed __aligned(4); + +_Static_assert(sizeof(struct nvme_resv_status_ext) == 64, "bad size for nvme_resv_status_ext"); + #define NVME_TEST_MAX_THREADS 128 struct nvme_io_test { @@ -1859,6 +1909,36 @@ void intel_log_temp_stats_swapbytes(struct intel_log_t s->max_oper_temp = le64toh(s->max_oper_temp); s->min_oper_temp = le64toh(s->min_oper_temp); s->est_offset = le64toh(s->est_offset); +} + +static inline +void nvme_resv_status_swapbytes(struct nvme_resv_status *s, size_t size) +{ + u_int i, n; + + s->gen = le32toh(s->gen); + n = (s->regctl[1] << 8) | s->regctl[0]; + n = MIN(n, (size - sizeof(s)) / sizeof(s->ctrlr[0])); + for (i = 0; i < n; i++) { + s->ctrlr[i].ctrlr_id = le16toh(s->ctrlr[i].ctrlr_id); + s->ctrlr[i].hostid = le64toh(s->ctrlr[i].hostid); + s->ctrlr[i].rkey = le64toh(s->ctrlr[i].rkey); + } +} + +static inline +void nvme_resv_status_ext_swapbytes(struct nvme_resv_status_ext *s, size_t size) +{ + u_int i, n; + + s->gen = le32toh(s->gen); + n = (s->regctl[1] << 8) | s->regctl[0]; + n = MIN(n, (size - sizeof(s)) / sizeof(s->ctrlr[0])); + for (i = 0; i < n; i++) { + s->ctrlr[i].ctrlr_id = le16toh(s->ctrlr[i].ctrlr_id); + s->ctrlr[i].rkey = le64toh(s->ctrlr[i].rkey); + nvme_le128toh((void *)s->ctrlr[i].hostid); + } } #endif /* __NVME_H__ */ From owner-svn-src-all@freebsd.org Mon Aug 5 17:43:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC8B5A90FC; Mon, 5 Aug 2019 17:43:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Q9Y6gVXz403R; Mon, 5 Aug 2019 17:43:45 +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 C66931F520; Mon, 5 Aug 2019 17:43:45 +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 x75HhjPh098119; Mon, 5 Aug 2019 17:43:45 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75HhjS9098115; Mon, 5 Aug 2019 17:43:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051743.x75HhjS9098115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 17:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350600 - in stable/12/sys: arm/mv arm64/conf conf dev/fdt dev/iicbus/twsi dev/sdhci X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/mv arm64/conf conf dev/fdt dev/iicbus/twsi dev/sdhci X-SVN-Commit-Revision: 350600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 17:43:46 -0000 Author: manu Date: Mon Aug 5 17:43:44 2019 New Revision: 350600 URL: https://svnweb.freebsd.org/changeset/base/350600 Log: MFC r342008, r342010-r342020 r342008: fdt: Add support for simple-mfd bus Quoting the binding Documentation : "These devices comprise a nexus for heterogeneous hardware blocks containing more than one non-unique yet varying hardware functionality." Reviewed by: loos Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D17751 r342010: arm64: Add new SoC type MARVELL_8K Sponsored by: Rubicon Communications, LLC ("Netgate") r342011: arm64: mvebu_pinctrl: Add driver for Marvell Pinmux Controller Add a driver compatible with Marvell mvebu-pinctrl and add ap806-pinctrl support. Sponsored by: Rubicon Communications, LCC ("Netgate") r342012: arm64: marvell: Add driver for Marvell Ap806 System Controller The first two clocks are for the clusters and their frequencies can be found reading a register. Then a fixed 1200Mhz clock is present and two fixed clocks, 'mss' which is 1200 / 6 and 'sdio' which is 1200 / 3. Sponsored by: Rubicon Communications, LLC ("Netgate") r342013: arm64: mv_gpio: Add Marvell 8K support While here put the interrupts setup in it's own function Sponsored by: Rubicon Communications, LCC ("Netgate") r342014: arm64: marvell: Add cp110 clock controller support The cp110 clock controller controls the clocks and gate of the CP110 hardware block. Every clock/gate are implemented except the NAND clock. Sponsored by: Rubicon Communications, LLC ("Netgate") r342015: twsi: Clean up marvell part and add support for Marvell 7k/8k Sponsored by: Rubicon Communications, LLC ("Netgate") r342016: arm64: Add mv_cp110_icu and mv_cp110_gicp icu is a interrupt concentrator in the CP110 block and gicp is a gic extension to allow interrupts in the CP block to be turned into GIC SPI interrupts Sponsored by: Rubicon Communications, LLC ("Netgate") r342017: sdhci_xenon: Add Marvell 8k compatible string Sponsored by: Rubicon Communications, LLC ("Netgate") r342018: mv_gpio: Since it's also an interrupt controller, attach sooner Sponsored by: Rubicon Communications, LLC ("Netgate") r342019: arm64: mv_cp110_icu: Fix build r342020: mv_thermal: Add thermal driver for AP806 and CP110 thermal sensor Sponsored by: Rubicon Communications, LLC ("Netgate") Added: stable/12/sys/arm/mv/mv_ap806_clock.c - copied unchanged from r342020, head/sys/arm/mv/mv_ap806_clock.c stable/12/sys/arm/mv/mv_ap806_gicp.c - copied unchanged from r342020, head/sys/arm/mv/mv_ap806_gicp.c stable/12/sys/arm/mv/mv_cp110_clock.c - copied unchanged from r342020, head/sys/arm/mv/mv_cp110_clock.c stable/12/sys/arm/mv/mv_cp110_clock.h - copied unchanged from r342020, head/sys/arm/mv/mv_cp110_clock.h stable/12/sys/arm/mv/mv_cp110_icu.c - copied unchanged from r342020, head/sys/arm/mv/mv_cp110_icu.c stable/12/sys/arm/mv/mv_thermal.c - copied unchanged from r342020, head/sys/arm/mv/mv_thermal.c stable/12/sys/arm/mv/mvebu_pinctrl.c - copied unchanged from r342020, head/sys/arm/mv/mvebu_pinctrl.c stable/12/sys/dev/fdt/simple_mfd.c - copied unchanged from r342008, head/sys/dev/fdt/simple_mfd.c Modified: stable/12/sys/arm/mv/gpio.c stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files stable/12/sys/conf/files.arm64 stable/12/sys/conf/options.arm64 stable/12/sys/dev/fdt/simplebus.c stable/12/sys/dev/fdt/simplebus.h stable/12/sys/dev/iicbus/twsi/mv_twsi.c stable/12/sys/dev/iicbus/twsi/twsi.h stable/12/sys/dev/sdhci/sdhci_xenon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/mv/gpio.c ============================================================================== --- stable/12/sys/arm/mv/gpio.c Mon Aug 5 17:36:00 2019 (r350599) +++ stable/12/sys/arm/mv/gpio.c Mon Aug 5 17:43:44 2019 (r350600) @@ -60,6 +60,10 @@ __FBSDID("$FreeBSD$"); #include "gpio_if.h" +#ifdef __aarch64__ +#include "opt_soc.h" +#endif + #define GPIO_MAX_INTR_COUNT 8 #define GPIO_PINS_PER_REG 32 #define GPIO_GENERIC_CAP (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ @@ -74,6 +78,7 @@ __FBSDID("$FreeBSD$"); #define DEBOUNCE_CHECK_TICKS ((hz / 1000) * DEBOUNCE_CHECK_MS) struct mv_gpio_softc { + device_t dev; device_t sc_busdev; struct resource * mem_res; int mem_rid; @@ -83,6 +88,7 @@ struct mv_gpio_softc { void *ih_cookie[GPIO_MAX_INTR_COUNT]; bus_space_tag_t bst; bus_space_handle_t bsh; + uint32_t offset; struct mtx mutex; uint8_t pin_num; /* number of GPIO pins */ uint8_t irq_num; /* number of real IRQs occupied by GPIO controller */ @@ -187,11 +193,15 @@ static driver_t mv_gpio_driver = { static devclass_t mv_gpio_devclass; -DRIVER_MODULE(mv_gpio, simplebus, mv_gpio_driver, mv_gpio_devclass, 0, 0); +EARLY_DRIVER_MODULE(mv_gpio, simplebus, mv_gpio_driver, mv_gpio_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -struct ofw_compat_data gpio_controllers[] = { - { "mrvl,gpio", (uintptr_t)true }, - { "marvell,orion-gpio", (uintptr_t)true }, +struct ofw_compat_data compat_data[] = { + { "mrvl,gpio", 1 }, + { "marvell,orion-gpio", 1 }, +#ifdef SOC_MARVELL_8K + { "marvell,armada-8k-gpio", 1 }, +#endif { NULL, 0 } }; @@ -201,7 +211,7 @@ mv_gpio_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_search_compatible(dev, gpio_controllers)->ocd_data == 0) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Marvell Integrated GPIO Controller"); @@ -209,61 +219,75 @@ mv_gpio_probe(device_t dev) } static int -mv_gpio_attach(device_t dev) +mv_gpio_setup_interrupts(struct mv_gpio_softc *sc, phandle_t node) { - int i, size; - struct mv_gpio_softc *sc; - pcell_t pincnt = 0; - pcell_t irq_cells = 0; phandle_t iparent; + pcell_t irq_cells; + int i, size; - sc = (struct mv_gpio_softc *)device_get_softc(dev); - if (sc == NULL) - return (ENXIO); - - if (OF_getencprop(ofw_bus_get_node(dev), "pin-count", &pincnt, - sizeof(pcell_t)) >= 0 || - OF_getencprop(ofw_bus_get_node(dev), "ngpios", &pincnt, - sizeof(pcell_t)) >= 0) { - sc->pin_num = MIN(pincnt, MV_GPIO_MAX_NPINS); - if (bootverbose) - device_printf(dev, "%d pins available\n", sc->pin_num); - } else { - device_printf(dev, "ERROR: no pin-count or ngpios entry found!\n"); - return (ENXIO); - } - - /* Assign generic capabilities to every gpio pin */ - for(i = 0; i < sc->pin_num; i++) - sc->gpio_setup[i].gp_caps = GPIO_GENERIC_CAP; - /* Find root interrupt controller */ - iparent = ofw_bus_find_iparent(ofw_bus_get_node(dev)); + iparent = ofw_bus_find_iparent(node); if (iparent == 0) { - device_printf(dev, "No interrupt-parrent found. " + device_printf(sc->dev, "No interrupt-parrent found. " "Error in DTB\n"); return (ENXIO); } else { /* While at parent - store interrupt cells prop */ if (OF_searchencprop(OF_node_from_xref(iparent), "#interrupt-cells", &irq_cells, sizeof(irq_cells)) == -1) { - device_printf(dev, "DTB: Missing #interrupt-cells " + device_printf(sc->dev, "DTB: Missing #interrupt-cells " "property in interrupt parent node\n"); return (ENXIO); } } - size = OF_getproplen(ofw_bus_get_node(dev), "interrupts"); + size = OF_getproplen(node, "interrupts"); if (size != -1) { size = size / sizeof(pcell_t); size = size / irq_cells; sc->irq_num = size; - device_printf(dev, "%d IRQs available\n", sc->irq_num); + device_printf(sc->dev, "%d IRQs available\n", sc->irq_num); } else { - device_printf(dev, "ERROR: no interrupts entry found!\n"); + device_printf(sc->dev, "ERROR: no interrupts entry found!\n"); return (ENXIO); } + for (i = 0; i < sc->irq_num; i++) { + sc->irq_rid[i] = i; + sc->irq_res[i] = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, + &sc->irq_rid[i], RF_ACTIVE); + if (!sc->irq_res[i]) { + mtx_destroy(&sc->mutex); + device_printf(sc->dev, + "could not allocate gpio%d interrupt\n", i+1); + return (ENXIO); + } + } + + device_printf(sc->dev, "Disable interrupts (offset = %x + EDGE(0x18)\n", sc->offset); + /* Disable all interrupts */ + bus_space_write_4(sc->bst, sc->bsh, sc->offset + GPIO_INT_EDGE_MASK, 0); + device_printf(sc->dev, "Disable interrupts (offset = %x + LEV(0x1C))\n", sc->offset); + bus_space_write_4(sc->bst, sc->bsh, sc->offset + GPIO_INT_LEV_MASK, 0); + + for (i = 0; i < sc->irq_num; i++) { + device_printf(sc->dev, "Setup intr %d\n", i); + if (bus_setup_intr(sc->dev, sc->irq_res[i], + INTR_TYPE_MISC, + (driver_filter_t *)mv_gpio_intr, NULL, + sc, &sc->ih_cookie[i]) != 0) { + mtx_destroy(&sc->mutex); + bus_release_resource(sc->dev, SYS_RES_IRQ, + sc->irq_rid[i], sc->irq_res[i]); + device_printf(sc->dev, "could not set up intr %d\n", i); + return (ENXIO); + } + } + + /* Clear interrupt status. */ + device_printf(sc->dev, "Clear int status (offset = %x)\n", sc->offset); + bus_space_write_4(sc->bst, sc->bsh, sc->offset + GPIO_INT_CAUSE, 0); + sc->debounce_callouts = (struct callout **)malloc(sc->pin_num * sizeof(struct callout *), M_DEVBUF, M_WAITOK | M_ZERO); if (sc->debounce_callouts == NULL) @@ -274,11 +298,46 @@ mv_gpio_attach(device_t dev) if (sc->debounce_counters == NULL) return (ENOMEM); + return (0); +} + +static int +mv_gpio_attach(device_t dev) +{ + int i, rv; + struct mv_gpio_softc *sc; + phandle_t node; + pcell_t pincnt = 0; + + sc = (struct mv_gpio_softc *)device_get_softc(dev); + if (sc == NULL) + return (ENXIO); + + node = ofw_bus_get_node(dev); + sc->dev = dev; + + if (OF_getencprop(node, "pin-count", &pincnt, sizeof(pcell_t)) >= 0 || + OF_getencprop(node, "ngpios", &pincnt, sizeof(pcell_t)) >= 0) { + sc->pin_num = MIN(pincnt, MV_GPIO_MAX_NPINS); + if (bootverbose) + device_printf(dev, "%d pins available\n", sc->pin_num); + } else { + device_printf(dev, "ERROR: no pin-count or ngpios entry found!\n"); + return (ENXIO); + } + + if (OF_getencprop(node, "offset", &sc->offset, sizeof(sc->offset)) == -1) + sc->offset = 0; + + /* Assign generic capabilities to every gpio pin */ + for(i = 0; i < sc->pin_num; i++) + sc->gpio_setup[i].gp_caps = GPIO_GENERIC_CAP; + mtx_init(&sc->mutex, device_get_nameunit(dev), NULL, MTX_SPIN); sc->mem_rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, - RF_ACTIVE); + RF_ACTIVE | RF_SHAREABLE ); if (!sc->mem_res) { mtx_destroy(&sc->mutex); @@ -289,38 +348,10 @@ mv_gpio_attach(device_t dev) sc->bst = rman_get_bustag(sc->mem_res); sc->bsh = rman_get_bushandle(sc->mem_res); - for (i = 0; i < sc->irq_num; i++) { - sc->irq_rid[i] = i; - sc->irq_res[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->irq_rid[i], RF_ACTIVE); - if (!sc->irq_res[i]) { - mtx_destroy(&sc->mutex); - device_printf(dev, - "could not allocate gpio%d interrupt\n", i+1); - return (ENXIO); - } - } + rv = mv_gpio_setup_interrupts(sc, node); + if (rv != 0) + return (rv); - /* Disable all interrupts */ - bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_EDGE_MASK, 0); - bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_LEV_MASK, 0); - - for (i = 0; i < sc->irq_num; i++) { - if (bus_setup_intr(dev, sc->irq_res[i], - INTR_TYPE_MISC, - (driver_filter_t *)mv_gpio_intr, NULL, - sc, &sc->ih_cookie[i]) != 0) { - mtx_destroy(&sc->mutex); - bus_release_resource(dev, SYS_RES_IRQ, - sc->irq_rid[i], sc->irq_res[i]); - device_printf(dev, "could not set up intr %d\n", i); - return (ENXIO); - } - } - - /* Clear interrupt status. */ - bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_CAUSE, 0); - sc->sc_busdev = gpiobus_attach_bus(dev); if (sc->sc_busdev == NULL) { mtx_destroy(&sc->mutex); @@ -540,6 +571,8 @@ mv_gpio_configure(device_t dev, uint32_t pin, uint32_t return (EINVAL); if (mask & MV_GPIO_IN_DEBOUNCE) { + if (sc->irq_num == 0) + return (EINVAL); error = mv_gpio_debounce_prepare(dev, pin); if (error != 0) return (error); @@ -845,7 +878,7 @@ mv_gpio_reg_read(device_t dev, uint32_t reg) struct mv_gpio_softc *sc; sc = (struct mv_gpio_softc *)device_get_softc(dev); - return (bus_space_read_4(sc->bst, sc->bsh, reg)); + return (bus_space_read_4(sc->bst, sc->bsh, sc->offset + reg)); } static void @@ -854,7 +887,7 @@ mv_gpio_reg_write(device_t dev, uint32_t reg, uint32_t struct mv_gpio_softc *sc; sc = (struct mv_gpio_softc *)device_get_softc(dev); - bus_space_write_4(sc->bst, sc->bsh, reg, val); + bus_space_write_4(sc->bst, sc->bsh, sc->offset + reg, val); } static void Copied: stable/12/sys/arm/mv/mv_ap806_clock.c (from r342020, head/sys/arm/mv/mv_ap806_clock.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/mv/mv_ap806_clock.c Mon Aug 5 17:43:44 2019 (r350600, copy of r342020, head/sys/arm/mv/mv_ap806_clock.c) @@ -0,0 +1,210 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Rubicon Communications, LLC (Netgate) + * + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include + +static struct clk_fixed_def ap806_clk_cluster_0 = { + .clkdef.id = 0, + .clkdef.name = "ap806-cpu-cluster-0", + .freq = 0, +}; + +static struct clk_fixed_def ap806_clk_cluster_1 = { + .clkdef.id = 1, + .clkdef.name = "ap806-cpu-cluster-1", + .freq = 0, +}; + +static struct clk_fixed_def ap806_clk_fixed = { + .clkdef.id = 2, + .clkdef.name = "ap806-fixed", + .freq = 1200000000, +}; + +/* Thoses are the only exported clocks AFAICT */ + +static const char *mss_parents[] = {"ap806-fixed"}; +static struct clk_fixed_def ap806_clk_mss = { + .clkdef.id = 3, + .clkdef.name = "ap806-mss", + .clkdef.parent_names = mss_parents, + .clkdef.parent_cnt = 1, + .mult = 1, + .div = 6, +}; + +static const char *sdio_parents[] = {"ap806-fixed"}; +static struct clk_fixed_def ap806_clk_sdio = { + .clkdef.id = 4, + .clkdef.name = "ap806-sdio", + .clkdef.parent_names = sdio_parents, + .clkdef.parent_cnt = 1, + .mult = 1, + .div = 3, +}; + +struct mv_ap806_clock_softc { + struct simplebus_softc simplebus_sc; + device_t dev; + struct resource *res; +}; + +static struct resource_spec mv_ap806_clock_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + +static struct ofw_compat_data compat_data[] = { + {"marvell,ap806-clock", 1}, + {NULL, 0} +}; + +#define RD4(sc, reg) bus_read_4((sc)->res, (reg)) +#define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) + +static int +mv_ap806_clock_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Marvell AP806 Clock Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +mv_ap806_clock_attach(device_t dev) +{ + struct mv_ap806_clock_softc *sc; + struct clkdom *clkdom; + uint64_t clock_freq; + uint32_t reg; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, mv_ap806_clock_res_spec, &sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + /* + * We might miss some combinations + * Those are the only possible ones on the mcbin + */ + reg = RD4(sc, 0x400); + switch (reg & 0x1f) { + case 0x0: + case 0x1: + clock_freq = 2000000000; + break; + case 0x6: + clock_freq = 1800000000; + break; + case 0xd: + clock_freq = 1600000000; + break; + case 0x14: + clock_freq = 1333000000; + break; + default: + device_printf(dev, "Cannot guess clock freq with reg %x\n", reg & 0x1f); + return (ENXIO); + break; + }; + + ap806_clk_cluster_0.freq = clock_freq; + ap806_clk_cluster_1.freq = clock_freq; + clkdom = clkdom_create(dev); + + clknode_fixed_register(clkdom, &ap806_clk_cluster_0); + clknode_fixed_register(clkdom, &ap806_clk_cluster_1); + clknode_fixed_register(clkdom, &ap806_clk_fixed); + clknode_fixed_register(clkdom, &ap806_clk_mss); + clknode_fixed_register(clkdom, &ap806_clk_sdio); + + clkdom_finit(clkdom); + + if (bootverbose) + clkdom_dump(clkdom); + return (0); +} + +static int +mv_ap806_clock_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t mv_ap806_clock_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mv_ap806_clock_probe), + DEVMETHOD(device_attach, mv_ap806_clock_attach), + DEVMETHOD(device_detach, mv_ap806_clock_detach), + + DEVMETHOD_END +}; + +static devclass_t mv_ap806_clock_devclass; + +static driver_t mv_ap806_clock_driver = { + "mv_ap806_clock", + mv_ap806_clock_methods, + sizeof(struct mv_ap806_clock_softc), +}; + +EARLY_DRIVER_MODULE(mv_ap806_clock, simplebus, mv_ap806_clock_driver, + mv_ap806_clock_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_LATE); Copied: stable/12/sys/arm/mv/mv_ap806_gicp.c (from r342020, head/sys/arm/mv/mv_ap806_gicp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/mv/mv_ap806_gicp.c Mon Aug 5 17:43:44 2019 (r350600, copy of r342020, head/sys/arm/mv/mv_ap806_gicp.c) @@ -0,0 +1,289 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Rubicon Communications, LLC (Netgate) + * + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include "pic_if.h" + +#define MV_AP806_GICP_MAX_NIRQS 207 + +struct mv_ap806_gicp_softc { + device_t dev; + device_t parent; + struct resource *res; + + ssize_t spi_ranges_cnt; + uint32_t *spi_ranges; +}; + +static struct ofw_compat_data compat_data[] = { + {"marvell,ap806-gicp", 1}, + {NULL, 0} +}; + +#define RD4(sc, reg) bus_read_4((sc)->res, (reg)) +#define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) + +static int +mv_ap806_gicp_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Marvell GICP"); + return (BUS_PROBE_DEFAULT); +} + +static int +mv_ap806_gicp_attach(device_t dev) +{ + struct mv_ap806_gicp_softc *sc; + phandle_t node, xref, intr_parent; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + /* Look for our parent */ + if ((intr_parent = ofw_bus_find_iparent(node)) == 0) { + device_printf(dev, "Cannot find our parent interrupt controller\n"); + return (ENXIO); + } + if ((sc->parent = OF_device_from_xref(intr_parent)) == NULL) { + device_printf(dev, "cannot find parent interrupt controller device\n"); + return (ENXIO); + } + + sc->spi_ranges_cnt = OF_getencprop_alloc(node, "marvell,spi-ranges", + (void **)&sc->spi_ranges); + + xref = OF_xref_from_node(node); + if (intr_pic_register(dev, xref) == NULL) { + device_printf(dev, "Cannot register GICP\n"); + return (ENXIO); + } + + OF_device_register_xref(xref, dev); + + return (0); +} + +static int +mv_ap806_gicp_detach(device_t dev) +{ + + return (EBUSY); +} + +static int +mv_ap806_gicp_activate_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + return (PIC_ACTIVATE_INTR(sc->parent, isrc, res, data)); +} + +static void +mv_ap806_gicp_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_ENABLE_INTR(sc->parent, isrc); +} + +static void +mv_ap806_gicp_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_DISABLE_INTR(sc->parent, isrc); +} + +static int +mv_ap806_gicp_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct mv_ap806_gicp_softc *sc; + struct intr_map_data_fdt *daf; + uint32_t group, irq_num, irq_type; + int i; + + sc = device_get_softc(dev); + + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + + daf = (struct intr_map_data_fdt *)data; + if (daf->ncells != 3 || daf->cells[0] >= MV_AP806_GICP_MAX_NIRQS) + return (EINVAL); + + group = daf->cells[0]; + irq_num = daf->cells[1]; + irq_type = daf->cells[2]; + + /* Map the interrupt number to spi number */ + for (i = 0; i < sc->spi_ranges_cnt / 2; i += 2) { + if (irq_num < sc->spi_ranges[i + 1]) { + irq_num += sc->spi_ranges[i]; + break; + } + + irq_num -= sc->spi_ranges[i]; + } + + daf->cells[1] = irq_num - 32; + + return (PIC_MAP_INTR(sc->parent, data, isrcp)); +} + +static int +mv_ap806_gicp_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + return (PIC_DEACTIVATE_INTR(sc->parent, isrc, res, data)); +} + +static int +mv_ap806_gicp_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + return (PIC_SETUP_INTR(sc->parent, isrc, res, data)); +} + +static int +mv_ap806_gicp_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + return (PIC_TEARDOWN_INTR(sc->parent, isrc, res, data)); +} + +static void +mv_ap806_gicp_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_PRE_ITHREAD(sc->parent, isrc); +} + +static void +mv_ap806_gicp_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_POST_ITHREAD(sc->parent, isrc); +} + +static void +mv_ap806_gicp_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct mv_ap806_gicp_softc *sc; + + sc = device_get_softc(dev); + + PIC_POST_FILTER(sc->parent, isrc); +} + +static device_method_t mv_ap806_gicp_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mv_ap806_gicp_probe), + DEVMETHOD(device_attach, mv_ap806_gicp_attach), + DEVMETHOD(device_detach, mv_ap806_gicp_detach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_activate_intr, mv_ap806_gicp_activate_intr), + DEVMETHOD(pic_disable_intr, mv_ap806_gicp_disable_intr), + DEVMETHOD(pic_enable_intr, mv_ap806_gicp_enable_intr), + DEVMETHOD(pic_map_intr, mv_ap806_gicp_map_intr), + DEVMETHOD(pic_deactivate_intr, mv_ap806_gicp_deactivate_intr), + DEVMETHOD(pic_setup_intr, mv_ap806_gicp_setup_intr), + DEVMETHOD(pic_teardown_intr, mv_ap806_gicp_teardown_intr), + DEVMETHOD(pic_post_filter, mv_ap806_gicp_post_filter), + DEVMETHOD(pic_post_ithread, mv_ap806_gicp_post_ithread), + DEVMETHOD(pic_pre_ithread, mv_ap806_gicp_pre_ithread), + + DEVMETHOD_END +}; + +static devclass_t mv_ap806_gicp_devclass; + +static driver_t mv_ap806_gicp_driver = { + "mv_ap806_gicp", + mv_ap806_gicp_methods, + sizeof(struct mv_ap806_gicp_softc), +}; + +EARLY_DRIVER_MODULE(mv_ap806_gicp, simplebus, mv_ap806_gicp_driver, + mv_ap806_gicp_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Copied: stable/12/sys/arm/mv/mv_cp110_clock.c (from r342020, head/sys/arm/mv/mv_cp110_clock.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/mv/mv_cp110_clock.c Mon Aug 5 17:43:44 2019 (r350600, copy of r342020, head/sys/arm/mv/mv_cp110_clock.c) @@ -0,0 +1,375 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Rubicon Communications, LLC (Netgate) + * + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include + +#include "clkdev_if.h" + +/* Clocks */ +static struct clk_fixed_def cp110_clk_pll_0 = { + .clkdef.id = CP110_PLL_0, + .freq = 1000000000, +}; + +static const char *clk_parents_0[] = {"cp110-pll0-0"}; +static const char *clk_parents_1[] = {"cp110-pll0-1"}; + +static struct clk_fixed_def cp110_clk_ppv2_core = { + .clkdef.id = CP110_PPV2_CORE, + .clkdef.parent_cnt = 1, + .mult = 1, + .div = 3, +}; + +static struct clk_fixed_def cp110_clk_x2core = { + .clkdef.id = CP110_X2CORE, + .clkdef.parent_cnt = 1, + .mult = 1, + .div = 2, +}; + +static const char *core_parents_0[] = {"cp110-x2core-0"}; +static const char *core_parents_1[] = {"cp110-x2core-1"}; + +static struct clk_fixed_def cp110_clk_core = { + .clkdef.id = CP110_CORE, + .clkdef.parent_cnt = 1, + .mult = 1, + .div = 2, +}; + +static struct clk_fixed_def cp110_clk_sdio = { + .clkdef.id = CP110_SDIO, + .clkdef.parent_cnt = 1, + .mult = 2, + .div = 5, +}; + +/* Gates */ + +static struct cp110_gate cp110_gates[] = { + CCU_GATE(CP110_GATE_AUDIO, "cp110-gate-audio", 0) + CCU_GATE(CP110_GATE_COMM_UNIT, "cp110-gate-comm_unit", 1) + /* CCU_GATE(CP110_GATE_NAND, "cp110-gate-nand", 2) */ + CCU_GATE(CP110_GATE_PPV2, "cp110-gate-ppv2", 3) + CCU_GATE(CP110_GATE_SDIO, "cp110-gate-sdio", 4) + CCU_GATE(CP110_GATE_MG, "cp110-gate-mg", 5) + CCU_GATE(CP110_GATE_MG_CORE, "cp110-gate-mg_core", 6) + CCU_GATE(CP110_GATE_XOR1, "cp110-gate-xor1", 7) + CCU_GATE(CP110_GATE_XOR0, "cp110-gate-xor0", 8) + CCU_GATE(CP110_GATE_GOP_DP, "cp110-gate-gop_dp", 9) + CCU_GATE(CP110_GATE_PCIE_X1_0, "cp110-gate-pcie_x10", 11) + CCU_GATE(CP110_GATE_PCIE_X1_1, "cp110-gate-pcie_x11", 12) + CCU_GATE(CP110_GATE_PCIE_X4, "cp110-gate-pcie_x4", 13) + CCU_GATE(CP110_GATE_PCIE_XOR, "cp110-gate-pcie_xor", 14) + CCU_GATE(CP110_GATE_SATA, "cp110-gate-sata", 15) + CCU_GATE(CP110_GATE_SATA_USB, "cp110-gate-sata_usb", 16) + CCU_GATE(CP110_GATE_MAIN, "cp110-gate-main", 17) + CCU_GATE(CP110_GATE_SDMMC_GOP, "cp110-gate-sdmmc_gop", 18) + CCU_GATE(CP110_GATE_SLOW_IO, "cp110-gate-slow_io", 21) + CCU_GATE(CP110_GATE_USB3H0, "cp110-gate-usb3h0", 22) + CCU_GATE(CP110_GATE_USB3H1, "cp110-gate-usb3h1", 23) + CCU_GATE(CP110_GATE_USB3DEV, "cp110-gate-usb3dev", 24) + CCU_GATE(CP110_GATE_EIP150, "cp110-gate-eip150", 25) + CCU_GATE(CP110_GATE_EIP197, "cp110-gate-eip197", 26) +}; + +struct mv_cp110_clock_softc { + struct simplebus_softc simplebus_sc; + device_t dev; + struct resource *res; + struct mtx mtx; +}; + +static struct resource_spec mv_cp110_clock_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + +static struct ofw_compat_data compat_data[] = { + {"marvell,cp110-clock", 1}, + {NULL, 0} +}; + +#define RD4(sc, reg) bus_read_4((sc)->res, (reg)) +#define WR4(sc, reg, val) bus_write_4((sc)->res, (reg), (val)) + +static char * +mv_cp110_clock_name(device_t dev, const char *name) +{ + char *clkname = NULL; + int unit; + + unit = device_get_unit(dev); + if (asprintf(&clkname, M_DEVBUF, "%s-%d", name, unit) <= 0) + panic("Cannot generate unique clock name for %s\n", name); + return (clkname); +} + +static int +mv_cp110_clock_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Marvell CP110 Clock Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +cp110_ofw_map(struct clkdom *clkdom, uint32_t ncells, + phandle_t *cells, struct clknode **clk) +{ + int id = 0; + + if (ncells != 2) + return (ENXIO); + + id = cells[1]; + if (cells[0] == 1) + id += CP110_MAX_CLOCK; + + *clk = clknode_find_by_id(clkdom, id); + + return (0); +} + +static int +mv_cp110_clock_attach(device_t dev) +{ + struct mv_cp110_clock_softc *sc; + struct clkdom *clkdom; + struct clk_gate_def def; + char *pll0_name; + int unit, i; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, mv_cp110_clock_res_spec, &sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + return (ENXIO); + } + + unit = device_get_unit(dev); + if (unit > 1) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 5 17:54:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9057EA9345; Mon, 5 Aug 2019 17:54:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462QPZ3XDyz40Wl; Mon, 5 Aug 2019 17:54:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AE7B1F6E8; Mon, 5 Aug 2019 17:54:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75HsAo2004239; Mon, 5 Aug 2019 17:54:10 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75Hs9xr004233; Mon, 5 Aug 2019 17:54:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051754.x75Hs9xr004233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 17:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350601 - in stable/12/sys: arm/mv arm64/conf conf dev/usb/controller X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/mv arm64/conf conf dev/usb/controller X-SVN-Commit-Revision: 350601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 17:54:10 -0000 Author: manu Date: Mon Aug 5 17:54:08 2019 New Revision: 350601 URL: https://svnweb.freebsd.org/changeset/base/350601 Log: MFC r344633-r344634, r344638 r344633: usb_nop_xceiv: Add support for this pseudo device This is a "fake" phy that handle regulator, clocks and reset gpio. Only clock and regulator is supported for now. Sponsored-by: Rubicon Communications, LCC ("Netgate") r344634: xhci_mv: Move the driver to generic_xhci Marvell XHCI is in fact generic-xhci, so move the driver and add the compatible string. While here, get and enable the phy if the dtb provide one. The xhci bindings state that phys should be in a 'phys' property but Marvell DTS uses 'usb-phy', only add support for 'usb-phy' for now. Sponsored-by: Rubicon Communications, LCC ("Netgate") r344638: Fix armv6/armv7 build after the move from xhci_mv to generic_xhci Added: stable/12/sys/dev/usb/controller/generic_xhci.c - copied unchanged from r344634, head/sys/dev/usb/controller/generic_xhci.c stable/12/sys/dev/usb/controller/usb_nop_xceiv.c - copied unchanged from r344634, head/sys/dev/usb/controller/usb_nop_xceiv.c Deleted: stable/12/sys/dev/usb/controller/xhci_mv.c Modified: stable/12/sys/arm/mv/files.arm7 stable/12/sys/arm/mv/files.mv stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files.arm64 Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/mv/files.arm7 ============================================================================== --- stable/12/sys/arm/mv/files.arm7 Mon Aug 5 17:43:44 2019 (r350600) +++ stable/12/sys/arm/mv/files.arm7 Mon Aug 5 17:54:08 2019 (r350601) @@ -33,7 +33,7 @@ dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci -dev/usb/controller/xhci_mv.c optional xhci +dev/usb/controller/generic_xhci.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci kern/kern_clocksource.c standard Modified: stable/12/sys/arm/mv/files.mv ============================================================================== --- stable/12/sys/arm/mv/files.mv Mon Aug 5 17:43:44 2019 (r350600) +++ stable/12/sys/arm/mv/files.mv Mon Aug 5 17:54:08 2019 (r350601) @@ -31,7 +31,7 @@ dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci -dev/usb/controller/xhci_mv.c optional xhci +dev/usb/controller/generic_xhci.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci kern/kern_clocksource.c standard Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Mon Aug 5 17:43:44 2019 (r350600) +++ stable/12/sys/arm64/conf/GENERIC Mon Aug 5 17:54:08 2019 (r350601) @@ -182,7 +182,6 @@ device ohci # OHCI USB interface device ehci # EHCI USB interface (USB 2.0) device ehci_mv # Marvell EHCI USB interface device xhci # XHCI PCI->USB interface (USB 3.0) -device xhci_mv # Marvell XHCI USB interface device usb # USB Bus (required) device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Mon Aug 5 17:43:44 2019 (r350600) +++ stable/12/sys/conf/files.arm64 Mon Aug 5 17:54:08 2019 (r350601) @@ -232,7 +232,8 @@ dev/usb/controller/ehci_mv.c optional ehci_mv fdt dev/usb/controller/generic_ehci.c optional ehci acpi dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt -dev/usb/controller/xhci_mv.c optional xhci_mv fdt +dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources +dev/usb/controller/generic_xhci.c optional xhci fdt dev/vnic/mrml_bridge.c optional vnic fdt dev/vnic/nic_main.c optional vnic pci dev/vnic/nicvf_main.c optional vnic pci pci_iov Copied: stable/12/sys/dev/usb/controller/generic_xhci.c (from r344634, head/sys/dev/usb/controller/generic_xhci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/usb/controller/generic_xhci.c Mon Aug 5 17:54:08 2019 (r350601, copy of r344634, head/sys/dev/usb/controller/generic_xhci.c) @@ -0,0 +1,243 @@ +/*- + * Copyright (c) 2015 Semihalf. + * Copyright (c) 2015 Stormshield. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef EXT_RESOURCES +#include +#endif + +#define XHCI_HC_DEVSTR "Marvell Integrated USB 3.0 controller" +#define XHCI_HC_VENDOR "Marvell" + +#define IS_DMA_32B 1 + +static device_attach_t xhci_attach; +static device_detach_t xhci_detach; + +static struct ofw_compat_data compat_data[] = { + {"marvell,armada-380-xhci", true}, + {"marvell,armada3700-xhci", true}, + {"marvell,armada-8k-xhci", true}, + {"generic-xhci", true}, + {NULL, false} +}; + +static int +xhci_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, XHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +xhci_attach(device_t dev) +{ + struct xhci_softc *sc = device_get_softc(dev); + int err = 0, rid = 0; +#ifdef EXT_RESOURCES + phandle_t node; + phy_t phy; +#endif + + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = XHCI_MAX_DEVICES; + + sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_io_res == NULL) { + device_printf(dev, "Failed to map memory\n"); + xhci_detach(dev); + return (ENXIO); + } + + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(dev, "Failed to allocate IRQ\n"); + xhci_detach(dev); + return (ENXIO); + } + +#ifdef EXT_RESOURCES + node = ofw_bus_get_node(dev); + if (phy_get_by_ofw_property(dev, node, "usb-phy", &phy) == 0) + if (phy_enable(phy) != 0) + device_printf(dev, "Cannot enable phy\n"); +#endif + + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (sc->sc_bus.bdev == NULL) { + device_printf(dev, "Failed to add USB device\n"); + xhci_detach(dev); + return (ENXIO); + } + + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + sprintf(sc->sc_vendor, XHCI_HC_VENDOR); + device_set_desc(sc->sc_bus.bdev, XHCI_HC_DEVSTR); + + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)xhci_interrupt, sc, &sc->sc_intr_hdl); + if (err != 0) { + device_printf(dev, "Failed to setup error IRQ, %d\n", err); + sc->sc_intr_hdl = NULL; + xhci_detach(dev); + return (err); + } + + err = xhci_init(sc, dev, IS_DMA_32B); + if (err != 0) { + device_printf(dev, "Failed to init XHCI, with error %d\n", err); + xhci_detach(dev); + return (ENXIO); + } + + err = xhci_start_controller(sc); + if (err != 0) { + device_printf(dev, "Failed to start XHCI controller, with error %d\n", err); + xhci_detach(dev); + return (ENXIO); + } + + err = device_probe_and_attach(sc->sc_bus.bdev); + if (err != 0) { + device_printf(dev, "Failed to initialize USB, with error %d\n", err); + xhci_detach(dev); + return (ENXIO); + } + + return (0); +} + +static int +xhci_detach(device_t dev) +{ + struct xhci_softc *sc = device_get_softc(dev); + int err; + + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + if (sc->sc_irq_res != NULL && sc->sc_intr_hdl != NULL) { + err = bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intr_hdl); + if (err != 0) + device_printf(dev, "Could not tear down irq, %d\n", + err); + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_irq_res != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->sc_irq_res), sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + + if (sc->sc_io_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->sc_io_res), sc->sc_io_res); + sc->sc_io_res = NULL; + } + + xhci_uninit(sc); + + return (0); +} + +static device_method_t xhci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, xhci_probe), + DEVMETHOD(device_attach, xhci_attach), + DEVMETHOD(device_detach, xhci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t xhci_driver = { + "xhci", + xhci_methods, + sizeof(struct xhci_softc), +}; + +static devclass_t xhci_devclass; + +DRIVER_MODULE(xhci, simplebus, xhci_driver, xhci_devclass, 0, 0); +MODULE_DEPEND(xhci, usb, 1, 1, 1); Copied: stable/12/sys/dev/usb/controller/usb_nop_xceiv.c (from r344634, head/sys/dev/usb/controller/usb_nop_xceiv.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dev/usb/controller/usb_nop_xceiv.c Mon Aug 5 17:54:08 2019 (r350601, copy of r344634, head/sys/dev/usb/controller/usb_nop_xceiv.c) @@ -0,0 +1,211 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Rubicon Communications, LLC (Netgate) + * + * 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 "phynode_if.h" + +struct usb_nop_xceiv_softc { + device_t dev; + regulator_t vcc_supply; + clk_t clk; + uint32_t clk_freq; +}; + +static struct ofw_compat_data compat_data[] = { + {"usb-nop-xceiv", 1}, + {NULL, 0} +}; + +/* Phy class and methods. */ +static int usb_nop_xceiv_phy_enable(struct phynode *phy, bool enable); +static phynode_usb_method_t usb_nop_xceiv_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, usb_nop_xceiv_phy_enable), + + PHYNODEMETHOD_END +}; +DEFINE_CLASS_1(usb_nop_xceiv_phynode, usb_nop_xceiv_phynode_class, + usb_nop_xceiv_phynode_methods, + sizeof(struct phynode_usb_sc), phynode_usb_class); + +static int +usb_nop_xceiv_phy_enable(struct phynode *phynode, bool enable) +{ + struct usb_nop_xceiv_softc *sc; + device_t dev; + intptr_t phy; + int error; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy != 0) + return (ERANGE); + + /* Enable the phy clock */ + if (sc->clk_freq != 0) { + if (enable) { + error = clk_set_freq(sc->clk, sc->clk_freq, + CLK_SET_ROUND_ANY); + if (error != 0) { + device_printf(dev, "Cannot set clock to %dMhz\n", + sc->clk_freq); + goto fail; + } + + error = clk_enable(sc->clk); + } else + error = clk_disable(sc->clk); + + if (error != 0) { + device_printf(dev, "Cannot %sable the clock\n", + enable ? "En" : "Dis"); + goto fail; + } + } + if (sc->vcc_supply) { + if (enable) + error = regulator_enable(sc->vcc_supply); + else + error = regulator_disable(sc->vcc_supply); + if (error != 0) { + device_printf(dev, "Cannot %sable the regulator\n", + enable ? "En" : "Dis"); + goto fail; + } + } + + return (0); + +fail: + return (ENXIO); +} + +static int +usb_nop_xceiv_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "USB NOP PHY"); + return (BUS_PROBE_DEFAULT); +} + +static int +usb_nop_xceiv_attach(device_t dev) +{ + struct usb_nop_xceiv_softc *sc; + struct phynode *phynode; + struct phynode_init_def phy_init; + phandle_t node; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + /* Parse the optional properties */ + OF_getencprop(node, "clock-frequency", &sc->clk_freq, sizeof(uint32_t)); + + error = clk_get_by_ofw_name(dev, node, "main_clk", &sc->clk); + if (error != 0 && sc->clk_freq != 0) { + device_printf(dev, "clock property is mandatory if clock-frequency is present\n"); + return (ENXIO); + } + + regulator_get_by_ofw_property(dev, node, "vcc-supply", &sc->vcc_supply); + + phy_init.id = 0; + phy_init.ofw_node = node; + phynode = phynode_create(dev, &usb_nop_xceiv_phynode_class, + &phy_init); + if (phynode == NULL) { + device_printf(dev, "failed to create USB NOP PHY\n"); + return (ENXIO); + } + if (phynode_register(phynode) == NULL) { + device_printf(dev, "failed to create USB NOP PHY\n"); + return (ENXIO); + } + + OF_device_register_xref(OF_xref_from_node(node), dev); + + return (0); +} + +static int +usb_nop_xceiv_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t usb_nop_xceiv_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, usb_nop_xceiv_probe), + DEVMETHOD(device_attach, usb_nop_xceiv_attach), + DEVMETHOD(device_detach, usb_nop_xceiv_detach), + + DEVMETHOD_END +}; + +static devclass_t usb_nop_xceiv_devclass; + +static driver_t usb_nop_xceiv_driver = { + "usb_nop_xceiv", + usb_nop_xceiv_methods, + sizeof(struct usb_nop_xceiv_softc), +}; + +EARLY_DRIVER_MODULE(usb_nop_xceiv, simplebus, usb_nop_xceiv_driver, + usb_nop_xceiv_devclass, 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-all@freebsd.org Mon Aug 5 18:05:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE826A969B; Mon, 5 Aug 2019 18:05: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462QfX4Bnrz41Fn; Mon, 5 Aug 2019 18:05: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 71A5B1F8CE; Mon, 5 Aug 2019 18:05: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 x75I5Ocn010437; Mon, 5 Aug 2019 18:05:24 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75I5MMH010428; Mon, 5 Aug 2019 18:05:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051805.x75I5MMH010428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 18:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350602 - in stable/12/sys: arm/allwinner arm/conf modules/allwinner modules/allwinner/aw_rsb modules/allwinner/aw_rtc modules/allwinner/aw_sid modules/allwinner/aw_thermal modules/allw... X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner arm/conf modules/allwinner modules/allwinner/aw_rsb modules/allwinner/aw_rtc modules/allwinner/aw_sid modules/allwinner/aw_thermal modules/allwinner/axp81x modules/allw... X-SVN-Commit-Revision: 350602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 18:05:24 -0000 Author: manu Date: Mon Aug 5 18:05:22 2019 New Revision: 350602 URL: https://svnweb.freebsd.org/changeset/base/350602 Log: MFC r346305, r346691-r346694, r346696-r346697 r346305: arm: allwinner: Makes more device optional r346691: arm: allwinner: Add pnpinfo for aw_sid and add module Makefile r346692: arm: allwinner: Add pnp info to aw_thermal and compile it as module too r346693: arm: allwinner: Add pnp info to axp81x and compile it as module too r346694: arm: allwinner: Add pnp info to aw_rtc and compile it as module too r346696: arm: allwinner: Add pnp info to if_awg and compile it as module too While here make it depend on aw_sid as it's needed for mac generation. r346697: arm: allwinner: Add pnp info to aw_rsb and compile it as module too Added: stable/12/sys/modules/allwinner/aw_rsb/ - copied from r346697, head/sys/modules/allwinner/aw_rsb/ stable/12/sys/modules/allwinner/aw_rtc/ - copied from r346694, head/sys/modules/allwinner/aw_rtc/ stable/12/sys/modules/allwinner/aw_sid/ - copied from r346694, head/sys/modules/allwinner/aw_sid/ stable/12/sys/modules/allwinner/aw_thermal/ - copied from r346694, head/sys/modules/allwinner/aw_thermal/ stable/12/sys/modules/allwinner/axp81x/ - copied from r346694, head/sys/modules/allwinner/axp81x/ stable/12/sys/modules/allwinner/if_awg/ - copied from r346697, head/sys/modules/allwinner/if_awg/ Modified: stable/12/sys/arm/allwinner/aw_rsb.c stable/12/sys/arm/allwinner/aw_rtc.c stable/12/sys/arm/allwinner/aw_sid.c stable/12/sys/arm/allwinner/aw_thermal.c stable/12/sys/arm/allwinner/axp81x.c stable/12/sys/arm/allwinner/files.allwinner stable/12/sys/arm/allwinner/if_awg.c stable/12/sys/arm/conf/GENERIC stable/12/sys/modules/allwinner/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_rsb.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_rsb.c Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/arm/allwinner/aw_rsb.c Mon Aug 5 18:05:22 2019 (r350602) @@ -496,3 +496,5 @@ EARLY_DRIVER_MODULE(iicbus, rsb, iicbus_driver, iicbus EARLY_DRIVER_MODULE(rsb, simplebus, rsb_driver, rsb_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(rsb, 1); +MODULE_DEPEND(rsb, iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/arm/allwinner/aw_rtc.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_rtc.c Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/arm/allwinner/aw_rtc.c Mon Aug 5 18:05:22 2019 (r350602) @@ -185,6 +185,8 @@ static devclass_t aw_rtc_devclass; EARLY_DRIVER_MODULE(aw_rtc, simplebus, aw_rtc_driver, aw_rtc_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(aw_rtc, 1); +SIMPLEBUS_PNP_INFO(compat_data); static int aw_rtc_probe(device_t dev) Modified: stable/12/sys/arm/allwinner/aw_sid.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_sid.c Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/arm/allwinner/aw_sid.c Mon Aug 5 18:05:22 2019 (r350602) @@ -414,3 +414,4 @@ static devclass_t aw_sid_devclass; EARLY_DRIVER_MODULE(aw_sid, simplebus, aw_sid_driver, aw_sid_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_FIRST); MODULE_VERSION(aw_sid, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/arm/allwinner/aw_thermal.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_thermal.c Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/arm/allwinner/aw_thermal.c Mon Aug 5 18:05:22 2019 (r350602) @@ -728,3 +728,5 @@ static devclass_t aw_thermal_devclass; DRIVER_MODULE(aw_thermal, simplebus, aw_thermal_driver, aw_thermal_devclass, 0, 0); MODULE_VERSION(aw_thermal, 1); +MODULE_DEPEND(aw_thermal, aw_sid, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/arm/allwinner/axp81x.c ============================================================================== --- stable/12/sys/arm/allwinner/axp81x.c Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/arm/allwinner/axp81x.c Mon Aug 5 18:05:22 2019 (r350602) @@ -1172,3 +1172,4 @@ EARLY_DRIVER_MODULE(ofw_gpiobus, axp8xx_pmu, ofw_gpiob DRIVER_MODULE(gpioc, axp8xx_pmu, gpioc_driver, gpioc_devclass, 0, 0); MODULE_VERSION(axp8xx, 1); MODULE_DEPEND(axp8xx, iicbus, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/arm/allwinner/files.allwinner ============================================================================== --- stable/12/sys/arm/allwinner/files.allwinner Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/arm/allwinner/files.allwinner Mon Aug 5 18:05:22 2019 (r350602) @@ -3,10 +3,10 @@ kern/kern_clocksource.c standard arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_codec.c optional sound -arm/allwinner/a10_dmac.c standard -arm/allwinner/a31_dmac.c standard +arm/allwinner/a10_dmac.c optional a10_dmac +arm/allwinner/a31_dmac.c optional a31_dmac arm/allwinner/a10_ehci.c optional ehci -arm/allwinner/a10_sramc.c standard +arm/allwinner/a10_sramc.c optional SOC_ALLWINNER_A10 arm/allwinner/aw_gpio.c optional gpio arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_machdep.c standard @@ -14,21 +14,21 @@ arm/allwinner/aw_mmc.c optional mmc | mmccam arm/allwinner/aw_mp.c optional smp arm/allwinner/aw_nmi.c optional intrng arm/allwinner/aw_rsb.c optional rsb | p2wi -arm/allwinner/aw_rtc.c standard +arm/allwinner/aw_rtc.c optional aw_rtc arm/allwinner/aw_syscon.c optional ext_resources syscon -arm/allwinner/aw_ts.c standard +arm/allwinner/aw_ts.c optional aw_thermal arm/allwinner/aw_usbphy.c optional ehci | ohci -arm/allwinner/aw_wdog.c standard +arm/allwinner/aw_wdog.c optional aw_wdog arm/allwinner/axp209.c optional axp209 arm/allwinner/axp81x.c optional axp81x arm/allwinner/if_awg.c optional awg ext_resources syscon arm/allwinner/if_emac.c optional emac -arm/allwinner/sunxi_dma_if.m standard +arm/allwinner/sunxi_dma_if.m optional a10_dmac | a31_dmac dev/iicbus/twsi/a10_twsi.c optional twsi dev/usb/controller/generic_ohci.c optional ohci dev/usb/controller/generic_usb_if.m optional ohci -arm/allwinner/aw_sid.c standard -arm/allwinner/aw_thermal.c standard +arm/allwinner/aw_sid.c optional aw_sid +arm/allwinner/aw_thermal.c optional aw_thermal dev/iicbus/sy8106a.c optional sy8106a arm/allwinner/aw_cir.c optional aw_cir evdev Modified: stable/12/sys/arm/allwinner/if_awg.c ============================================================================== --- stable/12/sys/arm/allwinner/if_awg.c Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/arm/allwinner/if_awg.c Mon Aug 5 18:05:22 2019 (r350602) @@ -1967,6 +1967,7 @@ static devclass_t awg_devclass; DRIVER_MODULE(awg, simplebus, awg_driver, awg_devclass, 0, 0); DRIVER_MODULE(miibus, awg, miibus_driver, miibus_devclass, 0, 0); - MODULE_DEPEND(awg, ether, 1, 1, 1); MODULE_DEPEND(awg, miibus, 1, 1, 1); +MODULE_DEPEND(awg, aw_sid, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); Modified: stable/12/sys/arm/conf/GENERIC ============================================================================== --- stable/12/sys/arm/conf/GENERIC Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/arm/conf/GENERIC Mon Aug 5 18:05:22 2019 (r350602) @@ -183,6 +183,7 @@ device pwm # watchdog. device ti_wdt device imxwdt # Watchdog. WARNING: can't be disabled!!! +device aw_wdog # Allwinner Watchdog device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) @@ -255,6 +256,8 @@ device ti_mbox # DMA controller device fslsdma device ti_sdma +device a10_dmac +device a31_dmac # Extensible Firmware Interface options EFI @@ -264,8 +267,15 @@ device cesa device crypto device cryptodev -# imx6 on-chip RTC -device imx6_snvs # On-chip RTC +# RTC +device imx6_snvs # IMX6 On-chip RTC +device aw_rtc # Allwinner On-chip RTC + +# EFUSE +device aw_sid # Allwinner Secure ID EFUSE + +# Thermal sensors +device aw_thermal # Allwinner Thermal Sensor Controller # Flattened Device Tree options FDT # Configure using FDT/DTB data Modified: stable/12/sys/modules/allwinner/Makefile ============================================================================== --- stable/12/sys/modules/allwinner/Makefile Mon Aug 5 17:54:08 2019 (r350601) +++ stable/12/sys/modules/allwinner/Makefile Mon Aug 5 18:05:22 2019 (r350602) @@ -3,6 +3,12 @@ SUBDIR = \ aw_pwm \ + aw_rtc \ + aw_rsb \ + aw_sid \ aw_spi \ + aw_thermal \ + axp81x \ + if_awg .include From owner-svn-src-all@freebsd.org Mon Aug 5 18:13:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91A28A9C4B; Mon, 5 Aug 2019 18:13:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Qqf3DC1z41v4; Mon, 5 Aug 2019 18:13:18 +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 383331FA95; Mon, 5 Aug 2019 18:13:18 +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 x75IDIlE016035; Mon, 5 Aug 2019 18:13:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75IDD66016013; Mon, 5 Aug 2019 18:13:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051813.x75IDD66016013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 18:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350603 - in stable/12/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra... X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/broadcom/bcm2835 arm/freescale/imx arm/freescale/vybrid arm/mv arm/nvidia/tegra124 arm/qemu arm/ralink a... X-SVN-Commit-Revision: 350603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 18:13:18 -0000 Author: manu Date: Mon Aug 5 18:13:13 2019 New Revision: 350603 URL: https://svnweb.freebsd.org/changeset/base/350603 Log: MFC r346295, r346297 r346295: arm: Add kern_clocksource.c directly in files.arm This files is needed and included in all our config so move it to a common location. r346297: arm: Order files.arm to have cloudabi and annapurna sections Modified: stable/12/sys/arm/allwinner/files.allwinner stable/12/sys/arm/altera/socfpga/files.socfpga stable/12/sys/arm/amlogic/aml8726/files.aml8726 stable/12/sys/arm/annapurna/alpine/files.alpine stable/12/sys/arm/broadcom/bcm2835/files.bcm283x stable/12/sys/arm/freescale/imx/files.imx5 stable/12/sys/arm/freescale/imx/files.imx6 stable/12/sys/arm/freescale/vybrid/files.vybrid stable/12/sys/arm/mv/files.arm7 stable/12/sys/arm/mv/files.mv stable/12/sys/arm/nvidia/tegra124/files.tegra124 stable/12/sys/arm/qemu/files.qemu stable/12/sys/arm/ralink/files.ralink stable/12/sys/arm/rockchip/files.rk30xx stable/12/sys/arm/samsung/exynos/files.exynos5 stable/12/sys/arm/ti/files.ti stable/12/sys/arm/versatile/files.versatile stable/12/sys/arm/xilinx/files.zynq7 stable/12/sys/conf/files.arm Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/files.allwinner ============================================================================== --- stable/12/sys/arm/allwinner/files.allwinner Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/allwinner/files.allwinner Mon Aug 5 18:13:13 2019 (r350603) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_codec.c optional sound Modified: stable/12/sys/arm/altera/socfpga/files.socfpga ============================================================================== --- stable/12/sys/arm/altera/socfpga/files.socfpga Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/altera/socfpga/files.socfpga Mon Aug 5 18:13:13 2019 (r350603) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/altera/socfpga/socfpga_common.c standard arm/altera/socfpga/socfpga_machdep.c standard arm/altera/socfpga/socfpga_manager.c standard Modified: stable/12/sys/arm/amlogic/aml8726/files.aml8726 ============================================================================== --- stable/12/sys/arm/amlogic/aml8726/files.aml8726 Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/amlogic/aml8726/files.aml8726 Mon Aug 5 18:13:13 2019 (r350603) @@ -1,7 +1,5 @@ #$FreeBSD$ -kern/kern_clocksource.c standard - arm/amlogic/aml8726/aml8726_l2cache.c standard arm/amlogic/aml8726/aml8726_machdep.c standard Modified: stable/12/sys/arm/annapurna/alpine/files.alpine ============================================================================== --- stable/12/sys/arm/annapurna/alpine/files.alpine Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/annapurna/alpine/files.alpine Mon Aug 5 18:13:13 2019 (r350603) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/versatile/sp804.c standard dev/uart/uart_dev_ns8250.c optional uart Modified: stable/12/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- stable/12/sys/arm/broadcom/bcm2835/files.bcm283x Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/broadcom/bcm2835/files.bcm283x Mon Aug 5 18:13:13 2019 (r350603) @@ -18,8 +18,6 @@ arm/broadcom/bcm2835/bcm2835_vcio.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt -kern/kern_clocksource.c standard - dev/mbox/mbox_if.m standard arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ Modified: stable/12/sys/arm/freescale/imx/files.imx5 ============================================================================== --- stable/12/sys/arm/freescale/imx/files.imx5 Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/freescale/imx/files.imx5 Mon Aug 5 18:13:13 2019 (r350603) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard # Init arm/freescale/imx/imx_common.c standard Modified: stable/12/sys/arm/freescale/imx/files.imx6 ============================================================================== --- stable/12/sys/arm/freescale/imx/files.imx6 Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/freescale/imx/files.imx6 Mon Aug 5 18:13:13 2019 (r350603) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard imx6 devices and support. # arm/freescale/fsl_ocotp.c standard Modified: stable/12/sys/arm/freescale/vybrid/files.vybrid ============================================================================== --- stable/12/sys/arm/freescale/vybrid/files.vybrid Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/freescale/vybrid/files.vybrid Mon Aug 5 18:13:13 2019 (r350603) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/freescale/vybrid/vf_machdep.c standard arm/freescale/vybrid/vf_ccm.c standard arm/freescale/vybrid/vf_anadig.c standard Modified: stable/12/sys/arm/mv/files.arm7 ============================================================================== --- stable/12/sys/arm/mv/files.arm7 Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/mv/files.arm7 Mon Aug 5 18:13:13 2019 (r350603) @@ -35,5 +35,3 @@ dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci dev/usb/controller/generic_xhci.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci - -kern/kern_clocksource.c standard Modified: stable/12/sys/arm/mv/files.mv ============================================================================== --- stable/12/sys/arm/mv/files.mv Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/mv/files.mv Mon Aug 5 18:13:13 2019 (r350603) @@ -33,5 +33,3 @@ dev/uart/uart_dev_snps.c optional uart dev/usb/controller/ehci_mv.c optional ehci dev/usb/controller/generic_xhci.c optional xhci dev/ahci/ahci_mv_fdt.c optional ahci - -kern/kern_clocksource.c standard Modified: stable/12/sys/arm/nvidia/tegra124/files.tegra124 ============================================================================== --- stable/12/sys/arm/nvidia/tegra124/files.tegra124 Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/nvidia/tegra124/files.tegra124 Mon Aug 5 18:13:13 2019 (r350603) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard tegra124 devices and support. # arm/nvidia/tegra124/tegra124_machdep.c standard Modified: stable/12/sys/arm/qemu/files.qemu ============================================================================== --- stable/12/sys/arm/qemu/files.qemu Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/qemu/files.qemu Mon Aug 5 18:13:13 2019 (r350603) @@ -1,11 +1,6 @@ # $FreeBSD$ # -# Standard ARM support. -# -kern/kern_clocksource.c standard - -# # Standard qemu virt devices and support. # arm/qemu/virt_machdep.c standard Modified: stable/12/sys/arm/ralink/files.ralink ============================================================================== --- stable/12/sys/arm/ralink/files.ralink Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/ralink/files.ralink Mon Aug 5 18:13:13 2019 (r350603) @@ -5,5 +5,3 @@ arm/ralink/rt1310_gpio.c optional rt1310gpio arm/ralink/rt1310_timer.c standard arm/ralink/if_fv.c optional fv -kern/kern_clocksource.c standard - Modified: stable/12/sys/arm/rockchip/files.rk30xx ============================================================================== --- stable/12/sys/arm/rockchip/files.rk30xx Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/rockchip/files.rk30xx Mon Aug 5 18:13:13 2019 (r350603) @@ -1,5 +1,4 @@ # $FreeBSD$ -kern/kern_clocksource.c standard arm/rockchip/rk30xx_machdep.c standard arm/rockchip/rk30xx_pmu.c standard Modified: stable/12/sys/arm/samsung/exynos/files.exynos5 ============================================================================== --- stable/12/sys/arm/samsung/exynos/files.exynos5 Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/samsung/exynos/files.exynos5 Mon Aug 5 18:13:13 2019 (r350603) @@ -1,7 +1,5 @@ # $FreeBSD$ -kern/kern_clocksource.c standard - arm/samsung/exynos/exynos5_mct.c standard arm/samsung/exynos/exynos5_mp.c optional smp arm/samsung/exynos/exynos5_machdep.c standard Modified: stable/12/sys/arm/ti/files.ti ============================================================================== --- stable/12/sys/arm/ti/files.ti Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/ti/files.ti Mon Aug 5 18:13:13 2019 (r350603) @@ -1,7 +1,5 @@ #$FreeBSD$ -kern/kern_clocksource.c standard - arm/ti/ti_cpuid.c standard arm/ti/ti_hwmods.c standard arm/ti/ti_machdep.c standard Modified: stable/12/sys/arm/versatile/files.versatile ============================================================================== --- stable/12/sys/arm/versatile/files.versatile Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/versatile/files.versatile Mon Aug 5 18:13:13 2019 (r350603) @@ -8,5 +8,3 @@ arm/versatile/versatile_common.c standard arm/versatile/versatile_pci.c optional pci arm/versatile/versatile_scm.c standard arm/versatile/versatile_sic.c standard - -kern/kern_clocksource.c standard Modified: stable/12/sys/arm/xilinx/files.zynq7 ============================================================================== --- stable/12/sys/arm/xilinx/files.zynq7 Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/arm/xilinx/files.zynq7 Mon Aug 5 18:13:13 2019 (r350603) @@ -3,8 +3,6 @@ # # $FreeBSD$ -kern/kern_clocksource.c standard - arm/xilinx/zy7_machdep.c standard arm/xilinx/zy7_l2cache.c standard arm/xilinx/zy7_slcr.c standard Modified: stable/12/sys/conf/files.arm ============================================================================== --- stable/12/sys/conf/files.arm Mon Aug 5 18:05:22 2019 (r350602) +++ stable/12/sys/conf/files.arm Mon Aug 5 18:13:13 2019 (r350603) @@ -1,23 +1,7 @@ # $FreeBSD$ -cloudabi32_vdso.o optional compat_cloudabi32 \ - dependency "$S/contrib/cloudabi/cloudabi_vdso_armv6.S" \ - compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_armv6.S -o ${.TARGET}" \ - no-obj no-implicit-rule \ - clean "cloudabi32_vdso.o" -# -cloudabi32_vdso_blob.o optional compat_cloudabi32 \ - dependency "cloudabi32_vdso.o" \ - compile-with "${OBJCOPY} --input-target binary --output-target elf32-littlearm --binary-architecture arm cloudabi32_vdso.o ${.TARGET}" \ - no-implicit-rule \ - clean "cloudabi32_vdso_blob.o" -# -arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt -arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt -arm/annapurna/alpine/alpine_pci.c optional al_pci fdt -arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt -arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ - no-depend \ - compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" + +kern/kern_clocksource.c standard + arm/arm/autoconf.c standard arm/arm/bcopy_page.S standard arm/arm/bcopyinout.S standard @@ -169,3 +153,26 @@ libkern/qdivrem.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard + +# CloudABI support +cloudabi32_vdso.o optional compat_cloudabi32 \ + dependency "$S/contrib/cloudabi/cloudabi_vdso_armv6.S" \ + compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_armv6.S -o ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "cloudabi32_vdso.o" +# +cloudabi32_vdso_blob.o optional compat_cloudabi32 \ + dependency "cloudabi32_vdso.o" \ + compile-with "${OBJCOPY} --input-target binary --output-target elf32-littlearm --binary-architecture arm cloudabi32_vdso.o ${.TARGET}" \ + no-implicit-rule \ + clean "cloudabi32_vdso_blob.o" +# + +# Annapurna support +arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt +arm/annapurna/alpine/alpine_nb_service.c optional al_nb_service fdt +arm/annapurna/alpine/alpine_pci.c optional al_pci fdt +arm/annapurna/alpine/alpine_pci_msix.c optional al_pci fdt +arm/annapurna/alpine/alpine_serdes.c optional al_serdes fdt \ + no-depend \ + compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" From owner-svn-src-all@freebsd.org Mon Aug 5 18:17:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB1E5A9D5F; Mon, 5 Aug 2019 18:17: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Qw050zzz423p; Mon, 5 Aug 2019 18:17: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 8D9221FA9E; Mon, 5 Aug 2019 18:17: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 x75IH4us016273; Mon, 5 Aug 2019 18:17:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75IH44v016272; Mon, 5 Aug 2019 18:17:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051817.x75IH44v016272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 18:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350604 - stable/12/usr.sbin/config X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/usr.sbin/config X-SVN-Commit-Revision: 350604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 18:17:04 -0000 Author: manu Date: Mon Aug 5 18:17:03 2019 New Revision: 350604 URL: https://svnweb.freebsd.org/changeset/base/350604 Log: MFC r346298: config: Only warn if duplicate option/device comes from the same file This is useful for arm (possibly other arches too) where we want to have a GENERIC kernel that only include files for the different SoC. Since multiple SoCs/Board needs the same device we would need to do either : Include the device in a generic file Include the device in each file that really needs it Option 1 works but if someone wants to create a specific kernel config (which isn't uncommon for embedded system), he will need to add a lots of nodevice to it. Option 2 also works but produce a lots of warnings. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D19424 Modified: stable/12/usr.sbin/config/config.h stable/12/usr.sbin/config/config.y Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/config/config.h ============================================================================== --- stable/12/usr.sbin/config/config.h Mon Aug 5 18:13:13 2019 (r350603) +++ stable/12/usr.sbin/config/config.h Mon Aug 5 18:17:03 2019 (r350604) @@ -86,6 +86,7 @@ struct files_name { struct device { int d_done; /* processed */ char *d_name; /* name of device (e.g. rk11) */ + char *yyfile; /* name of the file that first include the device */ #define UNKNOWN -2 /* -2 means not set yet */ STAILQ_ENTRY(device) d_next; /* Next one in list */ }; @@ -125,6 +126,7 @@ struct opt { char *op_name; char *op_value; int op_ownfile; /* true = own file, false = makefile */ + char *yyfile; /* name of the file that first include the option */ SLIST_ENTRY(opt) op_next; SLIST_ENTRY(opt) op_append; }; Modified: stable/12/usr.sbin/config/config.y ============================================================================== --- stable/12/usr.sbin/config/config.y Mon Aug 5 18:13:13 2019 (r350603) +++ stable/12/usr.sbin/config/config.y Mon Aug 5 18:17:03 2019 (r350604) @@ -382,11 +382,13 @@ finddev(struct device_head *dlist, char *name) static void newdev(char *name) { - struct device *np; + struct device *np, *dp; - if (finddev(&dtab, name)) { - fprintf(stderr, - "WARNING: duplicate device `%s' encountered.\n", name); + if ((dp = finddev(&dtab, name)) != NULL) { + if (strcmp(dp->yyfile, yyfile) == 0) + fprintf(stderr, + "WARNING: duplicate device `%s' encountered in %s\n", + name, yyfile); return; } @@ -394,6 +396,7 @@ newdev(char *name) if (np == NULL) err(EXIT_FAILURE, "calloc"); np->d_name = name; + np->yyfile = strdup(yyfile); STAILQ_INSERT_TAIL(&dtab, np, d_next); } @@ -408,6 +411,7 @@ rmdev_schedule(struct device_head *dh, char *name) dp = finddev(dh, name); if (dp != NULL) { STAILQ_REMOVE(dh, dp, device, d_next); + free(dp->yyfile); free(dp->d_name); free(dp); } @@ -446,8 +450,9 @@ newopt(struct opt_head *list, char *name, char *value, op2 = findopt(list, name); if (op2 != NULL && !append && !dupe) { - fprintf(stderr, - "WARNING: duplicate option `%s' encountered.\n", name); + if (strcmp(op2->yyfile, yyfile) == 0) + fprintf(stderr, + "WARNING: duplicate option `%s' encountered.\n", name); return; } @@ -457,6 +462,7 @@ newopt(struct opt_head *list, char *name, char *value, op->op_name = name; op->op_ownfile = 0; op->op_value = value; + op->yyfile = strdup(yyfile); if (op2 != NULL) { if (append) { while (SLIST_NEXT(op2, op_append) != NULL) @@ -481,6 +487,7 @@ rmopt_schedule(struct opt_head *list, char *name) while ((op = findopt(list, name)) != NULL) { SLIST_REMOVE(list, op, opt, op_next); + free(op->yyfile); free(op->op_name); free(op); } From owner-svn-src-all@freebsd.org Mon Aug 5 18:27:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84CB9AA065; Mon, 5 Aug 2019 18:27:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462R803ltzz42XV; Mon, 5 Aug 2019 18:27:28 +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 44E601FC69; Mon, 5 Aug 2019 18:27:28 +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 x75IRSj5022401; Mon, 5 Aug 2019 18:27:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75IRPZO022389; Mon, 5 Aug 2019 18:27:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051827.x75IRPZO022389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 18:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350605 - in stable/12/sys: arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm64/conf conf dts/arm64/overlays modules/dtb/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner arm/allwinner/a10 arm/allwinner/clkng arm64/conf conf dts/arm64/overlays modules/dtb/allwinner X-SVN-Commit-Revision: 350605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 18:27:28 -0000 Author: manu Date: Mon Aug 5 18:27:25 2019 New Revision: 350605 URL: https://svnweb.freebsd.org/changeset/base/350605 Log: MFC r346334, r346787-r346789, r347017 r346334: arm: allwinner: Fix audio for Allwinner H3/H5 Due to three conditions the codec driver for Allwinner A10/A20 and H3/H5 did not work properly here: Wrong bit position for the analog audio reset Hardware Reset of codec was not de-asserted correctly Linux DTS file did not contain the address of the analog register the way as the driver was expecting it. This patch proposes fixes for those three parts. Submitted by: freebsdnewbie@freenet.de (Manuel Stühn) Differential Revision: https://reviews.freebsd.org/D19910 r346787: arm64: allwinner: Add compatible strings for clock devices used on both Allwinner H3 and H5 Allwinner H3 and H5 share many internal components, that's why they can use the same drivers. This patch adds the compatible strings to enable clock drivers probing on Allwinner NanoPI NEO2 device. Tested on: NanoPi NEO2 (by submitter), OrangePi PC2 (by manu) Submitted by: Manuel Stühn (freebsdnewbie@freenet.de) Differential Revision: https://reviews.freebsd.org/D20069 r346788: arm64: allwinner: ccu_de2: Remove H5 compatible We don't have the display engine driver commited in FreeBSD yet so it is useless to expose the clocks yet (and also it have not been tested on H5). Reported by: Manuel Stühn (freebsdnewbie@freenet.de) PR: 237571 r346789: arm: allwinner: a10: Correct pin functions PB20 and PB21 alternate function 1 is i2c2 not i2c1 Reported by: Horiki Mori (yamori813@yahoo.co.jp) PR: 237401 r347017: arm64: Add support for NanoPI NEO2 Add overlay files and activate devicetree file for NanoPi NEO2 featuring Allwinner H5 ARM64 core. To enable sound, dma and codec drivers are enabled for build. Submitted by: Manuel Stühn (freebsdnewbie@freenet.de) Differential Revision: https://reviews.freebsd.org/D20129 Added: stable/12/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso - copied unchanged from r347017, head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso stable/12/sys/dts/arm64/overlays/sun50i-h5-opp.dtso - copied unchanged from r347017, head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso stable/12/sys/dts/arm64/overlays/sun50i-h5-sid.dtso - copied unchanged from r347017, head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso stable/12/sys/dts/arm64/overlays/sun50i-h5-ths.dtso - copied unchanged from r347017, head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso Modified: stable/12/sys/arm/allwinner/a10/a10_padconf.c stable/12/sys/arm/allwinner/a10_codec.c stable/12/sys/arm/allwinner/aw_rtc.c stable/12/sys/arm/allwinner/aw_syscon.c stable/12/sys/arm/allwinner/clkng/ccu_de2.c stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files.arm64 stable/12/sys/modules/dtb/allwinner/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/a10/a10_padconf.c ============================================================================== --- stable/12/sys/arm/allwinner/a10/a10_padconf.c Mon Aug 5 18:17:03 2019 (r350604) +++ stable/12/sys/arm/allwinner/a10/a10_padconf.c Mon Aug 5 18:27:25 2019 (r350605) @@ -77,8 +77,8 @@ const static struct allwinner_pins a10_pins[] = { {"PB17", 1, 17, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, {"PB18", 1, 18, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, {"PB19", 1, 19, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, - {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, - {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, + {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c2", NULL, NULL, NULL, NULL, NULL}}, {"PB22", 1, 22, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, {"PB23", 1, 23, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, Modified: stable/12/sys/arm/allwinner/a10_codec.c ============================================================================== --- stable/12/sys/arm/allwinner/a10_codec.c Mon Aug 5 18:17:03 2019 (r350604) +++ stable/12/sys/arm/allwinner/a10_codec.c Mon Aug 5 18:27:25 2019 (r350605) @@ -164,7 +164,7 @@ struct a10codec_chinfo { struct a10codec_info { device_t dev; - struct resource *res[3]; + struct resource *res[2]; struct mtx *lock; bus_dma_tag_t dmat; unsigned dmasize; @@ -178,11 +178,12 @@ struct a10codec_info { static struct resource_spec a10codec_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { SYS_RES_MEMORY, 1, RF_ACTIVE | RF_OPTIONAL }, - { SYS_RES_IRQ, 0, RF_ACTIVE }, { -1, 0 } }; +#define CODEC_ANALOG_READ(sc, reg) bus_read_4((sc)->res[1], (reg)) +#define CODEC_ANALOG_WRITE(sc, reg, val) bus_write_4((sc)->res[1], (reg), (val)) + #define CODEC_READ(sc, reg) bus_read_4((sc)->res[0], (reg)) #define CODEC_WRITE(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) @@ -372,7 +373,7 @@ MIXER_DECLARE(a10_mixer); */ #define H3_PR_CFG 0x00 -#define H3_AC_PR_RST (1 << 18) +#define H3_AC_PR_RST (1 << 28) #define H3_AC_PR_RW (1 << 24) #define H3_AC_PR_ADDR_SHIFT 16 #define H3_AC_PR_ADDR_MASK (0x1f << H3_AC_PR_ADDR_SHIFT) @@ -424,23 +425,23 @@ h3_pr_read(struct a10codec_info *sc, u_int addr) uint32_t val; /* Read current value */ - val = bus_read_4(sc->res[1], H3_PR_CFG); + val = CODEC_ANALOG_READ(sc, H3_PR_CFG); /* De-assert reset */ val |= H3_AC_PR_RST; - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Read mode */ val &= ~H3_AC_PR_RW; - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Set address */ val &= ~H3_AC_PR_ADDR_MASK; val |= (addr << H3_AC_PR_ADDR_SHIFT); - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Read data */ - return (bus_read_4(sc->res[1], H3_PR_CFG) & H3_ACDA_PR_RDAT_MASK); + return (CODEC_ANALOG_READ(sc , H3_PR_CFG) & H3_ACDA_PR_RDAT_MASK); } static void @@ -449,25 +450,25 @@ h3_pr_write(struct a10codec_info *sc, u_int addr, u_in uint32_t val; /* Read current value */ - val = bus_read_4(sc->res[1], H3_PR_CFG); + val = CODEC_ANALOG_READ(sc, H3_PR_CFG); /* De-assert reset */ val |= H3_AC_PR_RST; - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Set address */ val &= ~H3_AC_PR_ADDR_MASK; val |= (addr << H3_AC_PR_ADDR_SHIFT); - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Write data */ val &= ~H3_ACDA_PR_WDAT_MASK; val |= (data << H3_ACDA_PR_WDAT_SHIFT); - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); /* Write mode */ val |= H3_AC_PR_RW; - bus_write_4(sc->res[1], H3_PR_CFG, val); + CODEC_ANALOG_WRITE(sc, H3_PR_CFG, val); } static void @@ -483,8 +484,28 @@ h3_pr_set_clear(struct a10codec_info *sc, u_int addr, static int h3_mixer_init(struct snd_mixer *m) { + int rid=1; + pcell_t reg[2]; + phandle_t analogref; struct a10codec_info *sc = mix_getdevinfo(m); + if (OF_getencprop(ofw_bus_get_node(sc->dev), "allwinner,codec-analog-controls", + &analogref, sizeof(analogref)) <= 0) { + return (ENXIO); + } + + if (OF_getencprop(OF_node_from_xref(analogref), "reg", + reg, sizeof(reg)) <= 0) { + return (ENXIO); + } + + sc->res[1] = bus_alloc_resource(sc->dev, SYS_RES_MEMORY, &rid, reg[0], + reg[0]+reg[1], reg[1], RF_ACTIVE ); + + if (sc->res[1] == NULL) { + return (ENXIO); + } + mix_setdevs(m, SOUND_MASK_PCM | SOUND_MASK_VOLUME | SOUND_MASK_RECLEV | SOUND_MASK_MIC | SOUND_MASK_LINE | SOUND_MASK_LINE1); mix_setrecdevs(m, SOUND_MASK_MIC | SOUND_MASK_LINE | SOUND_MASK_LINE1 | @@ -940,6 +961,7 @@ a10codec_chan_trigger(kobj_t obj, void *data, int go) switch (go) { case PCMTRIG_START: ch->run = 1; + a10codec_stop(ch); a10codec_start(ch); break; case PCMTRIG_STOP: @@ -1124,8 +1146,7 @@ a10codec_attach(device_t dev) } /* De-assert hwreset */ - if (hwreset_get_by_ofw_name(dev, 0, "apb", &rst) == 0 || - hwreset_get_by_ofw_name(dev, 0, "ahb", &rst) == 0) { + if (hwreset_get_by_ofw_idx(dev, 0, 0, &rst) == 0) { error = hwreset_deassert(rst); if (error != 0) { device_printf(dev, "cannot de-assert reset\n"); @@ -1137,15 +1158,6 @@ a10codec_attach(device_t dev) val = CODEC_READ(sc, AC_DAC_DPC(sc)); val |= DAC_DPC_EN_DA; CODEC_WRITE(sc, AC_DAC_DPC(sc), val); - -#ifdef notdef - error = snd_setup_intr(dev, sc->irq, INTR_MPSAFE, a10codec_intr, sc, - &sc->ih); - if (error != 0) { - device_printf(dev, "could not setup interrupt handler\n"); - goto fail; - } -#endif if (mixer_init(dev, sc->cfg->mixer_class, sc)) { device_printf(dev, "mixer_init failed\n"); Modified: stable/12/sys/arm/allwinner/aw_rtc.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_rtc.c Mon Aug 5 18:17:03 2019 (r350604) +++ stable/12/sys/arm/allwinner/aw_rtc.c Mon Aug 5 18:27:25 2019 (r350605) @@ -137,6 +137,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf }, + { "allwinner,sun50i-h5-rtc", (uintptr_t) &h3_conf }, { NULL, 0 } }; Modified: stable/12/sys/arm/allwinner/aw_syscon.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_syscon.c Mon Aug 5 18:17:03 2019 (r350604) +++ stable/12/sys/arm/allwinner/aw_syscon.c Mon Aug 5 18:27:25 2019 (r350605) @@ -53,6 +53,7 @@ static struct ofw_compat_data compat_data[] = { {"allwinner,sun8i-a83t-system-controller", 1}, {"allwinner,sun8i-h3-system-controller", 1}, {"allwinner,sun8i-h3-system-control", 1}, + {"allwinner,sun50i-h5-system-control", 1}, {NULL, 0} }; Modified: stable/12/sys/arm/allwinner/clkng/ccu_de2.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_de2.c Mon Aug 5 18:17:03 2019 (r350604) +++ stable/12/sys/arm/allwinner/clkng/ccu_de2.c Mon Aug 5 18:27:25 2019 (r350605) @@ -115,7 +115,6 @@ static struct aw_ccung_clk de2_ccu_clks[] = { static struct ofw_compat_data compat_data[] = { {"allwinner,sun50i-a64-de2-clk", 1}, - {"allwinner,sun50i-h5-de2-clk", 1}, {NULL, 0} }; Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Mon Aug 5 18:17:03 2019 (r350604) +++ stable/12/sys/arm64/conf/GENERIC Mon Aug 5 18:27:25 2019 (r350605) @@ -191,11 +191,19 @@ device muge device smcphy device smsc +# Sound support +device sound +device a10_codec + +# DMA controller +device a31_dmac + # GPIO / PINCTRL device aw_gpio # Allwinner GPIO controller device gpio device gpioled device fdt_pinctrl +device gpioregulator device mv_gpio # Marvell GPIO controller device mvebu_pinctrl # Marvell Pinmux Controller Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Mon Aug 5 18:17:03 2019 (r350604) +++ stable/12/sys/conf/files.arm64 Mon Aug 5 18:27:25 2019 (r350605) @@ -27,6 +27,10 @@ cloudabi64_vdso_blob.o optional compat_cloudabi64 \ # Allwinner common files arm/allwinner/a10_ehci.c optional ehci aw_ehci fdt arm/allwinner/a10_timer.c optional a10_timer fdt +arm/allwinner/a10_codec.c optional sound a10_codec +arm/allwinner/a31_dmac.c optional a31_dmac +arm/allwinner/sunxi_dma_if.m optional a31_dmac +arm/allwinner/aw_cir.c optional evdev aw_cir fdt arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt arm/allwinner/aw_nmi.c optional aw_nmi fdt \ Copied: stable/12/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso (from r347017, head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso Mon Aug 5 18:27:25 2019 (r350605, copy of r347017, head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso) @@ -0,0 +1,32 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/} { + vdd_cpux: gpio-regulator { + compatible = "regulator-gpio"; + pinctrl-names = "default"; + regulator-name = "vdd-cpux"; + regulator-type = "voltage"; + regulator-boot-on; + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1300000>; + regulator-ramp-delay = <50>; /* 4ms */ + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + gpios-states = <0x1>; + states = <1100000 0x0 + 1300000 0x1>; + }; + +}; + +&{/cpus/cpu@0} { + cpu-supply = <&vdd_cpux>; +}; + Copied: stable/12/sys/dts/arm64/overlays/sun50i-h5-opp.dtso (from r347017, head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/overlays/sun50i-h5-opp.dtso Mon Aug 5 18:27:25 2019 (r350605, copy of r347017, head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso) @@ -0,0 +1,99 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/} { + cpu_opp_table: opp_table { + compatible = "operating-points-v2"; + opp-shared; + + opp@408000000 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <1000000 1000000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@648000000 { + opp-hz = /bits/ 64 <648000000>; + opp-microvolt = <1040000 1040000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1080000 1080000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@912000000 { + opp-hz = /bits/ 64 <912000000>; + opp-microvolt = <1120000 1120000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@960000000 { + opp-hz = /bits/ 64 <960000000>; + opp-microvolt = <1160000 1160000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1200000 1200000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1056000000 { + opp-hz = /bits/ 64 <1056000000>; + opp-microvolt = <1240000 1240000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1104000000 { + opp-hz = /bits/ 64 <1104000000>; + opp-microvolt = <1260000 1260000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1152000000 { + opp-hz = /bits/ 64 <1152000000>; + opp-microvolt = <1300000 1300000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + }; + + reg_cpu_fallback: reg_cpu_fallback { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpux-dummy"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + }; + +}; + +&{/cpus/cpu@0} { + clocks = <&ccu CLK_CPUX>; + clock-names = "cpu"; + clock-latency = <244144>; /* 8 32k periods */ + operating-points-v2 = <&cpu_opp_table>; + cpu-supply = <®_cpu_fallback>; + #cooling-cells = <2>; +}; + +&{/cpus/cpu@1} { + operating-points-v2 = <&cpu_opp_table>; +}; + +&{/cpus/cpu@2} { + operating-points-v2 = <&cpu_opp_table>; +}; + +&{/cpus/cpu@3} { + operating-points-v2 = <&cpu_opp_table>; +}; + Copied: stable/12/sys/dts/arm64/overlays/sun50i-h5-sid.dtso (from r347017, head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/overlays/sun50i-h5-sid.dtso Mon Aug 5 18:27:25 2019 (r350605, copy of r347017, head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso) @@ -0,0 +1,17 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/soc} { + sid: eeprom@1c14000 { + compatible = "allwinner,sun50i-h5-sid"; + reg = <0x1c14000 0x400>; + + ths_calib: calib@234 { + reg = <0x234 0x4>; + }; + }; +}; Copied: stable/12/sys/dts/arm64/overlays/sun50i-h5-ths.dtso (from r347017, head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/overlays/sun50i-h5-ths.dtso Mon Aug 5 18:27:25 2019 (r350605, copy of r347017, head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso) @@ -0,0 +1,26 @@ +/dts-v1/; +/plugin/; + +#include +#include +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/soc} { + ths: thermal_sensor@1c25000 { + compatible = "allwinner,sun50i-h5-ths"; + reg = <0x01c25000 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; + clock-names = "apb", "ths"; + resets = <&ccu RST_BUS_THS>; + reset-names = "apb"; + #thermal-sensor-cells = <1>; + + nvmem-cells = <&ths_calib>; + nvmem-cell-names = "ths-calib"; + }; +}; Modified: stable/12/sys/modules/dtb/allwinner/Makefile ============================================================================== --- stable/12/sys/modules/dtb/allwinner/Makefile Mon Aug 5 18:17:03 2019 (r350604) +++ stable/12/sys/modules/dtb/allwinner/Makefile Mon Aug 5 18:27:25 2019 (r350605) @@ -44,14 +44,19 @@ DTS= \ allwinner/sun50i-a64-pine64-plus.dts \ allwinner/sun50i-a64-pine64.dts \ allwinner/sun50i-a64-sopine-baseboard.dts \ - allwinner/sun50i-h5-orangepi-pc2.dts + allwinner/sun50i-h5-orangepi-pc2.dts \ + allwinner/sun50i-h5-nanopi-neo2.dts DTSO= sun50i-a64-opp.dtso \ sun50i-a64-pwm.dtso \ sun50i-a64-rpwm.dtso \ sun50i-a64-sid.dtso \ sun50i-a64-ths.dtso \ - sun50i-a64-timer.dtso + sun50i-a64-timer.dtso \ + sun50i-h5-opp.dtso \ + sun50i-h5-sid.dtso \ + sun50i-h5-ths.dtso \ + sun50i-h5-nanopi-neo2-opp.dtso .endif From owner-svn-src-all@freebsd.org Mon Aug 5 18:59:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE504AA8DE; Mon, 5 Aug 2019 18:59:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462RsP4YJ9z444y; Mon, 5 Aug 2019 18:59:53 +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 7DD74201E3; Mon, 5 Aug 2019 18:59:53 +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 x75Ixrob040070; Mon, 5 Aug 2019 18:59:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75Ixrbh040069; Mon, 5 Aug 2019 18:59:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908051859.x75Ixrbh040069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 5 Aug 2019 18:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350606 - stable/12/sys/modules/dtb/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/12/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 350606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 18:59:53 -0000 Author: manu Date: Mon Aug 5 18:59:53 2019 New Revision: 350606 URL: https://svnweb.freebsd.org/changeset/base/350606 Log: MFC r347362: dtb: allwinner: Add the pinebook dtb to the build Modified: stable/12/sys/modules/dtb/allwinner/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/modules/dtb/allwinner/Makefile ============================================================================== --- stable/12/sys/modules/dtb/allwinner/Makefile Mon Aug 5 18:27:25 2019 (r350605) +++ stable/12/sys/modules/dtb/allwinner/Makefile Mon Aug 5 18:59:53 2019 (r350606) @@ -43,6 +43,7 @@ DTS= \ allwinner/sun50i-a64-pine64-lts.dts \ allwinner/sun50i-a64-pine64-plus.dts \ allwinner/sun50i-a64-pine64.dts \ + allwinner/sun50i-a64-pinebook.dts \ allwinner/sun50i-a64-sopine-baseboard.dts \ allwinner/sun50i-h5-orangepi-pc2.dts \ allwinner/sun50i-h5-nanopi-neo2.dts From owner-svn-src-all@freebsd.org Mon Aug 5 19:16:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC57FAADCA; Mon, 5 Aug 2019 19:16:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462SDf457rz45Kc; Mon, 5 Aug 2019 19:16: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 69AEB20587; Mon, 5 Aug 2019 19:16: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 x75JGYCO051758; Mon, 5 Aug 2019 19:16:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75JGYcS051757; Mon, 5 Aug 2019 19:16:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908051916.x75JGYcS051757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 5 Aug 2019 19:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350607 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 19:16:34 -0000 Author: kib Date: Mon Aug 5 19:16:33 2019 New Revision: 350607 URL: https://svnweb.freebsd.org/changeset/base/350607 Log: Fix mis-merge Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Mon Aug 5 18:59:53 2019 (r350606) +++ head/sys/kern/kern_exec.c Mon Aug 5 19:16:33 2019 (r350607) @@ -1128,7 +1128,9 @@ exec_new_vmspace(struct image_params *imgp, struct sys } else { ssiz = maxssiz; } - imgp->eff_stack_sz = ssiz; + imgp->eff_stack_sz = lim_cur(curthread, RLIMIT_STACK); + if (ssiz < imgp->eff_stack_sz) + imgp->eff_stack_sz = ssiz; stack_addr = sv->sv_usrstack - ssiz; error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : From owner-svn-src-all@freebsd.org Mon Aug 5 19:19:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3E8FAAECC; Mon, 5 Aug 2019 19:19:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462SHx6Cblz45j9; Mon, 5 Aug 2019 19:19:25 +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 B79FD2058B; Mon, 5 Aug 2019 19:19:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75JJPse052320; Mon, 5 Aug 2019 19:19:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75JJPPO052319; Mon, 5 Aug 2019 19:19:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908051919.x75JJPPO052319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 5 Aug 2019 19:19:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350608 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 19:19:26 -0000 Author: kib Date: Mon Aug 5 19:19:25 2019 New Revision: 350608 URL: https://svnweb.freebsd.org/changeset/base/350608 Log: Fix mis-merge. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Aug 5 19:16:33 2019 (r350607) +++ head/sys/kern/imgact_elf.c Mon Aug 5 19:19:25 2019 (r350608) @@ -2741,7 +2741,6 @@ __elfN(stackgap)(struct image_params *imgp, u_long *st if (pct > 50) pct = 50; range = imgp->eff_stack_sz * pct / 100; - range *= pct; arc4rand(&rbase, sizeof(rbase), 0); gap = rbase % range; gap &= ~(sizeof(u_long) - 1); From owner-svn-src-all@freebsd.org Mon Aug 5 19:19:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00D10AAEC9; Mon, 5 Aug 2019 19:19:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 462SHm6FTwz45cx; Mon, 5 Aug 2019 19:19:16 +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 x75JJ1bP021224 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 5 Aug 2019 22:19:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x75JJ1bP021224 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x75JJ10f021223; Mon, 5 Aug 2019 22:19:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 5 Aug 2019 22:19:01 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350607 - head/sys/kern Message-ID: <20190805191901.GB2731@kib.kiev.ua> References: <201908051916.x75JGYcS051757@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908051916.x75JGYcS051757@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 462SHm6FTwz45cx X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-1.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; TO_DN_NONE(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-2.52), ipnet: 2001:470::/32(-4.51), asn: 6939(-2.90), country: US(-0.05)]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Aug 2019 19:19:18 -0000 On Mon, Aug 05, 2019 at 07:16:34PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Aug 5 19:16:33 2019 > New Revision: 350607 > URL: https://svnweb.freebsd.org/changeset/base/350607 > > Log: > Fix mis-merge This should have been: Account for the stack limit when calculating effective stack size. > > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > > Modified: > head/sys/kern/kern_exec.c > > Modified: head/sys/kern/kern_exec.c > ============================================================================== > --- head/sys/kern/kern_exec.c Mon Aug 5 18:59:53 2019 (r350606) > +++ head/sys/kern/kern_exec.c Mon Aug 5 19:16:33 2019 (r350607) > @@ -1128,7 +1128,9 @@ exec_new_vmspace(struct image_params *imgp, struct sys > } else { > ssiz = maxssiz; > } > - imgp->eff_stack_sz = ssiz; > + imgp->eff_stack_sz = lim_cur(curthread, RLIMIT_STACK); > + if (ssiz < imgp->eff_stack_sz) > + imgp->eff_stack_sz = ssiz; > stack_addr = sv->sv_usrstack - ssiz; > error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, > obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : From owner-svn-src-all@freebsd.org Mon Aug 5 19:30:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DD4FAB562; Mon, 5 Aug 2019 19:30:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462SXj0m8vz46mj; Mon, 5 Aug 2019 19:30:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9C020755; Mon, 5 Aug 2019 19:30:28 +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 x75JUSma058609; Mon, 5 Aug 2019 19:30:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75JUSr2058608; Mon, 5 Aug 2019 19:30:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908051930.x75JUSr2058608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 5 Aug 2019 19:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350609 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 350609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 19:30:29 -0000 Author: mav Date: Mon Aug 5 19:30:28 2019 New Revision: 350609 URL: https://svnweb.freebsd.org/changeset/base/350609 Log: Fix alignment issue r350599. MFC after: 10 days Modified: head/sbin/nvmecontrol/resv.c Modified: head/sbin/nvmecontrol/resv.c ============================================================================== --- head/sbin/nvmecontrol/resv.c Mon Aug 5 19:19:25 2019 (r350608) +++ head/sbin/nvmecontrol/resv.c Mon Aug 5 19:30:28 2019 (r350609) @@ -351,7 +351,7 @@ resvreport(const struct cmd *f, int argc, char *argv[] struct nvme_pt_command pt; struct nvme_resv_status *s; struct nvme_resv_status_ext *e; - uint8_t data[4096]; + uint8_t data[4096] __aligned(4); int fd; u_int i, n; uint32_t nsid; From owner-svn-src-all@freebsd.org Mon Aug 5 19:59:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D47FFABCE9; Mon, 5 Aug 2019 19:59:23 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462TB35GFDz486P; Mon, 5 Aug 2019 19:59:23 +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 9652420CA3; Mon, 5 Aug 2019 19:59:23 +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 x75JxNg5076486; Mon, 5 Aug 2019 19:59:23 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75JxNIm076485; Mon, 5 Aug 2019 19:59:23 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201908051959.x75JxNIm076485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 5 Aug 2019 19:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350610 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 19:59:23 -0000 Author: oshogbo Date: Mon Aug 5 19:59:23 2019 New Revision: 350610 URL: https://svnweb.freebsd.org/changeset/base/350610 Log: exit1: postpone clearing P_TRACED flag until the proctree lock is acquired In case of the process being debugged. The P_TRACED is cleared very early, which would make procdesc_close() not calling proc_clear_orphan(). That would result in the debugged process can not be able to collect status of the process with process descriptor. Reviewed by: markj, kib Tested by: pho MFC after: 1 month Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Aug 5 19:30:28 2019 (r350609) +++ head/sys/kern/kern_exit.c Mon Aug 5 19:59:23 2019 (r350610) @@ -355,7 +355,6 @@ exit1(struct thread *td, int rval, int signo) */ PROC_LOCK(p); stopprofclock(p); - p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); p->p_ptevents = 0; /* @@ -458,6 +457,9 @@ exit1(struct thread *td, int rval, int signo) sx_xunlock(&allproc_lock); sx_xlock(&proctree_lock); + PROC_LOCK(p); + p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); + PROC_UNLOCK(p); /* * Reparent all children processes: From owner-svn-src-all@freebsd.org Mon Aug 5 20:11:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F688AC258; Mon, 5 Aug 2019 20:11:58 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462TSZ13JQz4962; Mon, 5 Aug 2019 20:11:58 +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 05C1C20FF0; Mon, 5 Aug 2019 20:11:58 +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 x75KBvCd087717; Mon, 5 Aug 2019 20:11:57 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75KBvot087715; Mon, 5 Aug 2019 20:11:57 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201908052011.x75KBvot087715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 5 Aug 2019 20:11:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350611 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 350611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 20:11:58 -0000 Author: oshogbo Date: Mon Aug 5 20:11:57 2019 New Revision: 350611 URL: https://svnweb.freebsd.org/changeset/base/350611 Log: proc: introduce the proc_add_orphan function This API allows adding the process to its parent orphan list. Reviewed by: kib, markj MFC after: 1 month Modified: head/sys/kern/kern_exit.c head/sys/sys/proc.h Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Aug 5 19:59:23 2019 (r350610) +++ head/sys/kern/kern_exit.c Mon Aug 5 20:11:57 2019 (r350611) @@ -1355,6 +1355,24 @@ loop_locked: goto loop; } +void +proc_add_orphan(struct proc *child, struct proc *parent) +{ + + sx_assert(&proctree_lock, SX_XLOCKED); + KASSERT((child->p_flag & P_TRACED) != 0, + ("proc_add_orphan: not traced")); + + if (LIST_EMPTY(&parent->p_orphans)) { + child->p_treeflag |= P_TREE_FIRST_ORPHAN; + LIST_INSERT_HEAD(&parent->p_orphans, child, p_orphan); + } else { + LIST_INSERT_AFTER(LIST_FIRST(&parent->p_orphans), + child, p_orphan); + } + child->p_treeflag |= P_TREE_ORPHANED; +} + /* * Make process 'parent' the new parent of process 'child'. * Must be called with an exclusive hold of proctree lock. @@ -1375,16 +1393,8 @@ proc_reparent(struct proc *child, struct proc *parent, LIST_INSERT_HEAD(&parent->p_children, child, p_sibling); proc_clear_orphan(child); - if (child->p_flag & P_TRACED) { - if (LIST_EMPTY(&child->p_pptr->p_orphans)) { - child->p_treeflag |= P_TREE_FIRST_ORPHAN; - LIST_INSERT_HEAD(&child->p_pptr->p_orphans, child, - p_orphan); - } else { - LIST_INSERT_AFTER(LIST_FIRST(&child->p_pptr->p_orphans), - child, p_orphan); - } - child->p_treeflag |= P_TREE_ORPHANED; + if ((child->p_flag & P_TRACED) != 0) { + proc_add_orphan(child, child->p_pptr); } child->p_pptr = parent; Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Aug 5 19:59:23 2019 (r350610) +++ head/sys/sys/proc.h Mon Aug 5 20:11:57 2019 (r350611) @@ -1069,6 +1069,7 @@ void proc_linkup(struct proc *p, struct thread *td); 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, bool set_oppid); +void proc_add_orphan(struct proc *child, struct proc *parent); void proc_set_traced(struct proc *p, bool stop); void proc_wkilled(struct proc *p); struct pstats *pstats_alloc(void); From owner-svn-src-all@freebsd.org Mon Aug 5 20:15:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B402AC3CC; Mon, 5 Aug 2019 20:15:47 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462TXy6zWcz49Js; Mon, 5 Aug 2019 20:15:46 +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 CD0412102E; Mon, 5 Aug 2019 20:15:46 +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 x75KFkjD088669; Mon, 5 Aug 2019 20:15:46 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75KFk2R088667; Mon, 5 Aug 2019 20:15:46 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201908052015.x75KFk2R088667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 5 Aug 2019 20:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350612 - in head: sys/kern tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: sys/kern tests/sys/kern X-SVN-Commit-Revision: 350612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 20:15:47 -0000 Author: oshogbo Date: Mon Aug 5 20:15:46 2019 New Revision: 350612 URL: https://svnweb.freebsd.org/changeset/base/350612 Log: procdesc: fix reparenting when the debugger is attached The process is reparented to the debugger while it is attached. B B / ----> | A A D Every time when the process is reparented, it is added to the orphan list of the previous parent: A->orphan = B D->orphan = NULL When the A process will close the process descriptor to the B process, the B process will be reparented to the init process. B B - init | ----> A D A D A->orphan = B D->orphan = B In this scenario, the B process is in the orphan list of A and D. When the last process descriptor is closed instead of reparenting it to the reaper let it stay with the debugger process and set our previews parent to the reaper. Add test case for this situation. Notice that without this patch the kernel will crash with this test case: panic: orphan 0xfffff8000e990530 of 0xfffff8000e990000 has unexpected oppid 1 Reviewed by: markj, kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20361 Modified: head/sys/kern/sys_procdesc.c head/tests/sys/kern/ptrace_test.c Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Mon Aug 5 20:11:57 2019 (r350611) +++ head/sys/kern/sys_procdesc.c Mon Aug 5 20:15:46 2019 (r350612) @@ -416,7 +416,13 @@ procdesc_close(struct file *fp, struct thread *td) * terminate with prejudice. */ p->p_sigparent = SIGCHLD; - proc_reparent(p, p->p_reaper, true); + if ((p->p_flag & P_TRACED) == 0) { + proc_reparent(p, p->p_reaper, true); + } else { + clear_orphan(p); + p->p_oppid = p->p_reaper->p_pid; + proc_add_orphan(p, p->p_reaper); + } if ((pd->pd_flags & PDF_DAEMON) == 0) kern_psignal(p, SIGKILL); PROC_UNLOCK(p); Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Mon Aug 5 20:11:57 2019 (r350611) +++ head/tests/sys/kern/ptrace_test.c Mon Aug 5 20:15:46 2019 (r350612) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -4075,6 +4076,60 @@ ATF_TC_BODY(ptrace__syscall_args, tc) ATF_REQUIRE(errno == ECHILD); } +/* + * Verify that when the process is traced that it isn't reparent + * to the init process when we close all process descriptors. + */ +ATF_TC(ptrace__proc_reparent); +ATF_TC_HEAD(ptrace__proc_reparent, tc) +{ + + atf_tc_set_md_var(tc, "timeout", "2"); +} +ATF_TC_BODY(ptrace__proc_reparent, tc) +{ + pid_t traced, debuger, wpid; + int pd, status; + + traced = pdfork(&pd, 0); + ATF_REQUIRE(traced >= 0); + if (traced == 0) { + raise(SIGSTOP); + exit(0); + } + ATF_REQUIRE(pd >= 0); + + debuger = fork(); + ATF_REQUIRE(debuger >= 0); + if (debuger == 0) { + /* The traced process is reparented to debuger. */ + ATF_REQUIRE(ptrace(PT_ATTACH, traced, 0, 0) == 0); + wpid = waitpid(traced, &status, 0); + ATF_REQUIRE(wpid == traced); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + ATF_REQUIRE(close(pd) == 0); + ATF_REQUIRE(ptrace(PT_DETACH, traced, (caddr_t)1, 0) == 0); + + /* We closed pd so we should not have any child. */ + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); + + exit(0); + } + + ATF_REQUIRE(close(pd) == 0); + wpid = waitpid(debuger, &status, 0); + ATF_REQUIRE(wpid == debuger); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + /* Check if we still have any child. */ + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -4137,6 +4192,7 @@ ATF_TP_ADD_TCS(tp) #endif ATF_TP_ADD_TC(tp, ptrace__PT_LWPINFO_stale_siginfo); ATF_TP_ADD_TC(tp, ptrace__syscall_args); + ATF_TP_ADD_TC(tp, ptrace__proc_reparent); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon Aug 5 20:19:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C07ADAC4A2; Mon, 5 Aug 2019 20:19:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462TdQ4k1Lz49V9; Mon, 5 Aug 2019 20:19:38 +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 83B4121039; Mon, 5 Aug 2019 20:19:38 +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 x75KJc0G088903; Mon, 5 Aug 2019 20:19:38 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75KJcUQ088902; Mon, 5 Aug 2019 20:19:38 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201908052019.x75KJcUQ088902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 5 Aug 2019 20:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350613 - stable/12/usr.bin/printf X-SVN-Group: stable-12 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: stable/12/usr.bin/printf X-SVN-Commit-Revision: 350613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 20:19:38 -0000 Author: jilles Date: Mon Aug 5 20:19:38 2019 New Revision: 350613 URL: https://svnweb.freebsd.org/changeset/base/350613 Log: MFC r350425: printf(1): Note that \c only works in %b strings PR: 238313 Modified: stable/12/usr.bin/printf/printf.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/printf/printf.1 ============================================================================== --- stable/12/usr.bin/printf/printf.1 Mon Aug 5 20:15:46 2019 (r350612) +++ stable/12/usr.bin/printf/printf.1 Mon Aug 5 20:19:38 2019 (r350613) @@ -31,7 +31,7 @@ .\" @(#)printf.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 21, 2014 +.Dd July 29, 2019 .Dt PRINTF 1 .Os .Sh NAME @@ -87,8 +87,6 @@ are as follows: Write a character. .It Cm \eb Write a character. -.It Cm \ec -Ignore remaining characters in this string. .It Cm \ef Write a character. .It Cm \en @@ -289,7 +287,12 @@ The permitted escape sequences are slightly different octal escapes are .Cm \e0 Ns Ar num instead of -.Cm \e Ns Ar num . +.Cm \e Ns Ar num +and that an additional escape sequence +.Cm \ec +stops further output from this +.Nm +invocation. .It Cm n$ Allows reordering of the output according to .Ar argument . From owner-svn-src-all@freebsd.org Mon Aug 5 20:20:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BA5AAC4D1; Mon, 5 Aug 2019 20:20:15 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Tf70ky2z49bg; Mon, 5 Aug 2019 20:20:15 +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 EF1E321044; Mon, 5 Aug 2019 20:20:14 +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 x75KKERG089043; Mon, 5 Aug 2019 20:20:14 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75KKElk089042; Mon, 5 Aug 2019 20:20:14 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201908052020.x75KKElk089042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 5 Aug 2019 20:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350614 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 20:20:15 -0000 Author: oshogbo Date: Mon Aug 5 20:20:14 2019 New Revision: 350614 URL: https://svnweb.freebsd.org/changeset/base/350614 Log: exit1: fix style nits MFC after: 1 month Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Mon Aug 5 20:19:38 2019 (r350613) +++ head/sys/kern/kern_exit.c Mon Aug 5 20:20:14 2019 (r350614) @@ -475,7 +475,7 @@ exit1(struct thread *td, int rval, int signo) PROC_LOCK(q); q->p_sigparent = SIGCHLD; - if (!(q->p_flag & P_TRACED)) { + if ((q->p_flag & P_TRACED) == 0) { proc_reparent(q, q->p_reaper, true); if (q->p_state == PRS_ZOMBIE) { /* From owner-svn-src-all@freebsd.org Mon Aug 5 20:21:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30249AC534; Mon, 5 Aug 2019 20:21:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Tgh05P3z49pf; Mon, 5 Aug 2019 20:21:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8CA92109F; Mon, 5 Aug 2019 20:21:35 +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 x75KLZpT089163; Mon, 5 Aug 2019 20:21:35 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75KLZdD089162; Mon, 5 Aug 2019 20:21:35 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201908052021.x75KLZdD089162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Mon, 5 Aug 2019 20:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350615 - stable/11/usr.bin/printf X-SVN-Group: stable-11 X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: stable/11/usr.bin/printf X-SVN-Commit-Revision: 350615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 20:21:36 -0000 Author: jilles Date: Mon Aug 5 20:21:35 2019 New Revision: 350615 URL: https://svnweb.freebsd.org/changeset/base/350615 Log: MFC r350425: printf(1): Note that \c only works in %b strings PR: 238313 Modified: stable/11/usr.bin/printf/printf.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/printf/printf.1 ============================================================================== --- stable/11/usr.bin/printf/printf.1 Mon Aug 5 20:20:14 2019 (r350614) +++ stable/11/usr.bin/printf/printf.1 Mon Aug 5 20:21:35 2019 (r350615) @@ -31,7 +31,7 @@ .\" @(#)printf.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 21, 2014 +.Dd July 29, 2019 .Dt PRINTF 1 .Os .Sh NAME @@ -87,8 +87,6 @@ are as follows: Write a character. .It Cm \eb Write a character. -.It Cm \ec -Ignore remaining characters in this string. .It Cm \ef Write a character. .It Cm \en @@ -289,7 +287,12 @@ The permitted escape sequences are slightly different octal escapes are .Cm \e0 Ns Ar num instead of -.Cm \e Ns Ar num . +.Cm \e Ns Ar num +and that an additional escape sequence +.Cm \ec +stops further output from this +.Nm +invocation. .It Cm n$ Allows reordering of the output according to .Ar argument . From owner-svn-src-all@freebsd.org Mon Aug 5 20:26:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0991AC8A3; Mon, 5 Aug 2019 20:26:01 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Tmn67tPz4BXN; Mon, 5 Aug 2019 20:26:01 +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 B5AC22121D; Mon, 5 Aug 2019 20:26:01 +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 x75KQ1AE094796; Mon, 5 Aug 2019 20:26:01 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75KQ1UU094795; Mon, 5 Aug 2019 20:26:01 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201908052026.x75KQ1UU094795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 5 Aug 2019 20:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350616 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 20:26:02 -0000 Author: oshogbo Date: Mon Aug 5 20:26:01 2019 New Revision: 350616 URL: https://svnweb.freebsd.org/changeset/base/350616 Log: process: style We don't need to check if the parent is already set. This is done already in the proc_reparent. No functional behaviour changes intended. MFC after: 1 month Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Aug 5 20:21:35 2019 (r350615) +++ head/sys/kern/sys_process.c Mon Aug 5 20:26:01 2019 (r350616) @@ -958,9 +958,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi * on a "detach". */ proc_set_traced(p, true); - if (p->p_pptr != td->td_proc) { - proc_reparent(p, td->td_proc, false); - } + proc_reparent(p, td->td_proc, false); CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid, p->p_oppid); @@ -1109,7 +1107,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi p->p_pid, psr->sr_error, psr->sr_retval[0], psr->sr_retval[1]); break; - + case PT_STEP: case PT_CONTINUE: case PT_TO_SCE: @@ -1219,8 +1217,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi sendsig: MPASS(proctree_locked == 0); - - /* + + /* * Clear the pending event for the thread that just * reported its event (p_xthread). This may not be * the thread passed to PT_CONTINUE, PT_STEP, etc. if From owner-svn-src-all@freebsd.org Mon Aug 5 20:31:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7DF8DACED6; Mon, 5 Aug 2019 20:31:18 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Ttt2pZsz4C9R; Mon, 5 Aug 2019 20:31:18 +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 420D02136D; Mon, 5 Aug 2019 20:31:18 +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 x75KVIQj098445; Mon, 5 Aug 2019 20:31:18 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75KVIO4098444; Mon, 5 Aug 2019 20:31:18 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201908052031.x75KVIO4098444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 5 Aug 2019 20:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350617 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 20:31:18 -0000 Author: oshogbo Date: Mon Aug 5 20:31:17 2019 New Revision: 350617 URL: https://svnweb.freebsd.org/changeset/base/350617 Log: procdesc: fix the function name I changed name of the function r350429 and forgot to update the r350612 patch. Reported by: jenkins MFC after: 1 month Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c ============================================================================== --- head/sys/kern/sys_procdesc.c Mon Aug 5 20:26:01 2019 (r350616) +++ head/sys/kern/sys_procdesc.c Mon Aug 5 20:31:17 2019 (r350617) @@ -419,7 +419,7 @@ procdesc_close(struct file *fp, struct thread *td) if ((p->p_flag & P_TRACED) == 0) { proc_reparent(p, p->p_reaper, true); } else { - clear_orphan(p); + proc_clear_orphan(p); p->p_oppid = p->p_reaper->p_pid; proc_add_orphan(p, p->p_reaper); } From owner-svn-src-all@freebsd.org Mon Aug 5 21:39:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E36D1AE3B7; Mon, 5 Aug 2019 21:39:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462WQ34WM6z4Gfb; Mon, 5 Aug 2019 21:39:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 779F421EBC; Mon, 5 Aug 2019 21:39:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75LdtjP037379; Mon, 5 Aug 2019 21:39:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75Ldtph037378; Mon, 5 Aug 2019 21:39:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908052139.x75Ldtph037378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Aug 2019 21:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350618 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 350618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 21:39:56 -0000 Author: jhb Date: Mon Aug 5 21:39:55 2019 New Revision: 350618 URL: https://svnweb.freebsd.org/changeset/base/350618 Log: Validate guest-supplied length of headers for TSO transmit requests. When transmitting a large TCP packet, the final transmit descriptor includes the length of the protocol headers to be duplicated on each segment. The device model was trusting the guest-supplied value without validating it. A value of zero would result in the guest being able to indirect a garbage pointer on the stack to overwrite arbitrary memory in the bhyve process. A value that was non-zero but too small for the requested parameters resulted in the device model reading and writing values beyond the end of the on-stack buffer used to hold the template header. To fix, validate the supplied length and drop requests to transmit packets that would overflow the header buffer. While here, initialize the header pointer to NULL as a preventive measure so that any access to an unallocated template header crashes they hypervisor deterministically. While here, only read the TCP sequence number if the packet being split is a TCP packet. The e1000 logic supports a segmentation of UDP frames, and while UDP segmentation requires this part of the header to be valid (so there is no buffer overflow), only reading the field when needed is cleaner. admbugs: 918 Reported by: Reno Robert Reviewed by: markj Approved by: so Security: CVE-2019-5609 Modified: head/usr.sbin/bhyve/pci_e82545.c Modified: head/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Mon Aug 5 20:31:17 2019 (r350617) +++ head/usr.sbin/bhyve/pci_e82545.c Mon Aug 5 21:39:55 2019 (r350618) @@ -1080,8 +1080,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head struct ck_info ckinfo[2]; struct iovec *iov; union e1000_tx_udesc *dsc; - int desc, dtype, len, ntype, iovcnt, tlen, hdrlen, vlen, tcp, tso; + int desc, dtype, len, ntype, iovcnt, tlen, tcp, tso; int mss, paylen, seg, tiovcnt, left, now, nleft, nnow, pv, pvoff; + unsigned hdrlen, vlen; uint32_t tcpsum, tcpseq; uint16_t ipcs, tcpcs, ipid, ohead; @@ -1225,6 +1226,68 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head } else { /* In case of TSO header length provided by software. */ hdrlen = sc->esc_txctx.tcp_seg_setup.fields.hdr_len; + + /* + * Cap the header length at 240 based on 7.2.4.5 of + * the Intel 82576EB (Rev 2.63) datasheet. + */ + if (hdrlen > 240) { + WPRINTF("TSO hdrlen too large: %d\r\n", hdrlen); + goto done; + } + + /* + * If VLAN insertion is requested, ensure the header + * at least holds the amount of data copied during + * VLAN insertion below. + * + * XXX: Realistic packets will include a full Ethernet + * header before the IP header at ckinfo[0].ck_start, + * but this check is sufficient to prevent + * out-of-bounds access below. + */ + if (vlen != 0 && hdrlen < ETHER_ADDR_LEN*2) { + WPRINTF("TSO hdrlen too small for vlan insertion " + "(%d vs %d) -- dropped\r\n", hdrlen, + ETHER_ADDR_LEN*2); + goto done; + } + + /* + * Ensure that the header length covers the used fields + * in the IP and TCP headers as well as the IP and TCP + * checksums. The following fields are accessed below: + * + * Header | Field | Offset | Length + * -------+-------+--------+------- + * IPv4 | len | 2 | 2 + * IPv4 | ID | 4 | 2 + * IPv6 | len | 4 | 2 + * TCP | seq # | 4 | 4 + * TCP | flags | 13 | 1 + * UDP | len | 4 | 4 + */ + if (hdrlen < ckinfo[0].ck_start + 6 || + hdrlen < ckinfo[0].ck_off + 2) { + WPRINTF("TSO hdrlen too small for IP fields (%d) " + "-- dropped\r\n", hdrlen); + goto done; + } + if (sc->esc_txctx.cmd_and_length & E1000_TXD_CMD_TCP) { + if (hdrlen < ckinfo[1].ck_start + 14 || + (ckinfo[1].ck_valid && + hdrlen < ckinfo[1].ck_off + 2)) { + WPRINTF("TSO hdrlen too small for TCP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } else { + if (hdrlen < ckinfo[1].ck_start + 8) { + WPRINTF("TSO hdrlen too small for UDP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } } /* Allocate, fill and prepend writable header vector. */ @@ -1246,7 +1309,8 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head iovcnt++; iov->iov_base = hdr; iov->iov_len = hdrlen; - } + } else + hdr = NULL; /* Insert VLAN tag. */ if (vlen != 0) { @@ -1288,7 +1352,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head DPRINTF("tx %s segmentation offload %d+%d/%d bytes %d iovs\r\n", tcp ? "TCP" : "UDP", hdrlen, paylen, mss, iovcnt); ipid = ntohs(*(uint16_t *)&hdr[ckinfo[0].ck_start + 4]); - tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); + tcpseq = 0; + if (tcp) + tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); ipcs = *(uint16_t *)&hdr[ckinfo[0].ck_off]; tcpcs = 0; if (ckinfo[1].ck_valid) /* Save partial pseudo-header checksum. */ From owner-svn-src-all@freebsd.org Mon Aug 5 22:04:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E68D4AEEB3; Mon, 5 Aug 2019 22:04:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Wy85qdrz4J4k; Mon, 5 Aug 2019 22:04:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9E5922405; Mon, 5 Aug 2019 22:04:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75M4Gig054891; Mon, 5 Aug 2019 22:04:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75M4GP7054890; Mon, 5 Aug 2019 22:04:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908052204.x75M4GP7054890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Aug 2019 22:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350619 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 350619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 22:04:17 -0000 Author: jhb Date: Mon Aug 5 22:04:16 2019 New Revision: 350619 URL: https://svnweb.freebsd.org/changeset/base/350619 Log: MFC 350618: Validate guest-supplied length of headers for TSO transmit requests. When transmitting a large TCP packet, the final transmit descriptor includes the length of the protocol headers to be duplicated on each segment. The device model was trusting the guest-supplied value without validating it. A value of zero would result in the guest being able to indirect a garbage pointer on the stack to overwrite arbitrary memory in the bhyve process. A value that was non-zero but too small for the requested parameters resulted in the device model reading and writing values beyond the end of the on-stack buffer used to hold the template header. To fix, validate the supplied length and drop requests to transmit packets that would overflow the header buffer. While here, initialize the header pointer to NULL as a preventive measure so that any access to an unallocated template header crashes they hypervisor deterministically. While here, only read the TCP sequence number if the packet being split is a TCP packet. The e1000 logic supports a segmentation of UDP frames, and while UDP segmentation requires this part of the header to be valid (so there is no buffer overflow), only reading the field when needed is cleaner. admbugs: 918 Reported by: Reno Robert Approved by: so Security: CVE-2019-5609 Modified: stable/12/usr.sbin/bhyve/pci_e82545.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/bhyve/pci_e82545.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_e82545.c Mon Aug 5 21:39:55 2019 (r350618) +++ stable/12/usr.sbin/bhyve/pci_e82545.c Mon Aug 5 22:04:16 2019 (r350619) @@ -1080,8 +1080,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head struct ck_info ckinfo[2]; struct iovec *iov; union e1000_tx_udesc *dsc; - int desc, dtype, len, ntype, iovcnt, tlen, hdrlen, vlen, tcp, tso; + int desc, dtype, len, ntype, iovcnt, tlen, tcp, tso; int mss, paylen, seg, tiovcnt, left, now, nleft, nnow, pv, pvoff; + unsigned hdrlen, vlen; uint32_t tcpsum, tcpseq; uint16_t ipcs, tcpcs, ipid, ohead; @@ -1225,6 +1226,68 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head } else { /* In case of TSO header length provided by software. */ hdrlen = sc->esc_txctx.tcp_seg_setup.fields.hdr_len; + + /* + * Cap the header length at 240 based on 7.2.4.5 of + * the Intel 82576EB (Rev 2.63) datasheet. + */ + if (hdrlen > 240) { + WPRINTF("TSO hdrlen too large: %d\r\n", hdrlen); + goto done; + } + + /* + * If VLAN insertion is requested, ensure the header + * at least holds the amount of data copied during + * VLAN insertion below. + * + * XXX: Realistic packets will include a full Ethernet + * header before the IP header at ckinfo[0].ck_start, + * but this check is sufficient to prevent + * out-of-bounds access below. + */ + if (vlen != 0 && hdrlen < ETHER_ADDR_LEN*2) { + WPRINTF("TSO hdrlen too small for vlan insertion " + "(%d vs %d) -- dropped\r\n", hdrlen, + ETHER_ADDR_LEN*2); + goto done; + } + + /* + * Ensure that the header length covers the used fields + * in the IP and TCP headers as well as the IP and TCP + * checksums. The following fields are accessed below: + * + * Header | Field | Offset | Length + * -------+-------+--------+------- + * IPv4 | len | 2 | 2 + * IPv4 | ID | 4 | 2 + * IPv6 | len | 4 | 2 + * TCP | seq # | 4 | 4 + * TCP | flags | 13 | 1 + * UDP | len | 4 | 4 + */ + if (hdrlen < ckinfo[0].ck_start + 6 || + hdrlen < ckinfo[0].ck_off + 2) { + WPRINTF("TSO hdrlen too small for IP fields (%d) " + "-- dropped\r\n", hdrlen); + goto done; + } + if (sc->esc_txctx.cmd_and_length & E1000_TXD_CMD_TCP) { + if (hdrlen < ckinfo[1].ck_start + 14 || + (ckinfo[1].ck_valid && + hdrlen < ckinfo[1].ck_off + 2)) { + WPRINTF("TSO hdrlen too small for TCP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } else { + if (hdrlen < ckinfo[1].ck_start + 8) { + WPRINTF("TSO hdrlen too small for UDP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } } /* Allocate, fill and prepend writable header vector. */ @@ -1246,7 +1309,8 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head iovcnt++; iov->iov_base = hdr; iov->iov_len = hdrlen; - } + } else + hdr = NULL; /* Insert VLAN tag. */ if (vlen != 0) { @@ -1288,7 +1352,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head DPRINTF("tx %s segmentation offload %d+%d/%d bytes %d iovs\r\n", tcp ? "TCP" : "UDP", hdrlen, paylen, mss, iovcnt); ipid = ntohs(*(uint16_t *)&hdr[ckinfo[0].ck_start + 4]); - tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); + tcpseq = 0; + if (tcp) + tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); ipcs = *(uint16_t *)&hdr[ckinfo[0].ck_off]; tcpcs = 0; if (ckinfo[1].ck_valid) /* Save partial pseudo-header checksum. */ From owner-svn-src-all@freebsd.org Mon Aug 5 22:04:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4511BAEEBB; Mon, 5 Aug 2019 22:04:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Wy919tMz4J4l; Mon, 5 Aug 2019 22:04:17 +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 0AF0E22406; Mon, 5 Aug 2019 22:04:17 +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 x75M4GYb054897; Mon, 5 Aug 2019 22:04:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75M4Gap054896; Mon, 5 Aug 2019 22:04:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908052204.x75M4Gap054896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Aug 2019 22:04:16 +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: r350619 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 350619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 22:04:17 -0000 Author: jhb Date: Mon Aug 5 22:04:16 2019 New Revision: 350619 URL: https://svnweb.freebsd.org/changeset/base/350619 Log: MFC 350618: Validate guest-supplied length of headers for TSO transmit requests. When transmitting a large TCP packet, the final transmit descriptor includes the length of the protocol headers to be duplicated on each segment. The device model was trusting the guest-supplied value without validating it. A value of zero would result in the guest being able to indirect a garbage pointer on the stack to overwrite arbitrary memory in the bhyve process. A value that was non-zero but too small for the requested parameters resulted in the device model reading and writing values beyond the end of the on-stack buffer used to hold the template header. To fix, validate the supplied length and drop requests to transmit packets that would overflow the header buffer. While here, initialize the header pointer to NULL as a preventive measure so that any access to an unallocated template header crashes they hypervisor deterministically. While here, only read the TCP sequence number if the packet being split is a TCP packet. The e1000 logic supports a segmentation of UDP frames, and while UDP segmentation requires this part of the header to be valid (so there is no buffer overflow), only reading the field when needed is cleaner. admbugs: 918 Reported by: Reno Robert Approved by: so Security: CVE-2019-5609 Modified: stable/11/usr.sbin/bhyve/pci_e82545.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/bhyve/pci_e82545.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_e82545.c Mon Aug 5 21:39:55 2019 (r350618) +++ stable/11/usr.sbin/bhyve/pci_e82545.c Mon Aug 5 22:04:16 2019 (r350619) @@ -1079,8 +1079,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head struct ck_info ckinfo[2]; struct iovec *iov; union e1000_tx_udesc *dsc; - int desc, dtype, len, ntype, iovcnt, tlen, hdrlen, vlen, tcp, tso; + int desc, dtype, len, ntype, iovcnt, tlen, tcp, tso; int mss, paylen, seg, tiovcnt, left, now, nleft, nnow, pv, pvoff; + unsigned hdrlen, vlen; uint32_t tcpsum, tcpseq; uint16_t ipcs, tcpcs, ipid, ohead; @@ -1224,6 +1225,68 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head } else { /* In case of TSO header length provided by software. */ hdrlen = sc->esc_txctx.tcp_seg_setup.fields.hdr_len; + + /* + * Cap the header length at 240 based on 7.2.4.5 of + * the Intel 82576EB (Rev 2.63) datasheet. + */ + if (hdrlen > 240) { + WPRINTF("TSO hdrlen too large: %d\r\n", hdrlen); + goto done; + } + + /* + * If VLAN insertion is requested, ensure the header + * at least holds the amount of data copied during + * VLAN insertion below. + * + * XXX: Realistic packets will include a full Ethernet + * header before the IP header at ckinfo[0].ck_start, + * but this check is sufficient to prevent + * out-of-bounds access below. + */ + if (vlen != 0 && hdrlen < ETHER_ADDR_LEN*2) { + WPRINTF("TSO hdrlen too small for vlan insertion " + "(%d vs %d) -- dropped\r\n", hdrlen, + ETHER_ADDR_LEN*2); + goto done; + } + + /* + * Ensure that the header length covers the used fields + * in the IP and TCP headers as well as the IP and TCP + * checksums. The following fields are accessed below: + * + * Header | Field | Offset | Length + * -------+-------+--------+------- + * IPv4 | len | 2 | 2 + * IPv4 | ID | 4 | 2 + * IPv6 | len | 4 | 2 + * TCP | seq # | 4 | 4 + * TCP | flags | 13 | 1 + * UDP | len | 4 | 4 + */ + if (hdrlen < ckinfo[0].ck_start + 6 || + hdrlen < ckinfo[0].ck_off + 2) { + WPRINTF("TSO hdrlen too small for IP fields (%d) " + "-- dropped\r\n", hdrlen); + goto done; + } + if (sc->esc_txctx.cmd_and_length & E1000_TXD_CMD_TCP) { + if (hdrlen < ckinfo[1].ck_start + 14 || + (ckinfo[1].ck_valid && + hdrlen < ckinfo[1].ck_off + 2)) { + WPRINTF("TSO hdrlen too small for TCP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } else { + if (hdrlen < ckinfo[1].ck_start + 8) { + WPRINTF("TSO hdrlen too small for UDP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } } /* Allocate, fill and prepend writable header vector. */ @@ -1245,7 +1308,8 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head iovcnt++; iov->iov_base = hdr; iov->iov_len = hdrlen; - } + } else + hdr = NULL; /* Insert VLAN tag. */ if (vlen != 0) { @@ -1287,7 +1351,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head DPRINTF("tx %s segmentation offload %d+%d/%d bytes %d iovs\r\n", tcp ? "TCP" : "UDP", hdrlen, paylen, mss, iovcnt); ipid = ntohs(*(uint16_t *)&hdr[ckinfo[0].ck_start + 4]); - tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); + tcpseq = 0; + if (tcp) + tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); ipcs = *(uint16_t *)&hdr[ckinfo[0].ck_off]; tcpcs = 0; if (ckinfo[1].ck_valid) /* Save partial pseudo-header checksum. */ From owner-svn-src-all@freebsd.org Mon Aug 5 22:59:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01491AFD58; Mon, 5 Aug 2019 22:59:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Y9z6HPcz4LPp; Mon, 5 Aug 2019 22:59:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B52B422CFB; Mon, 5 Aug 2019 22:59:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75MxZgH084702; Mon, 5 Aug 2019 22:59:35 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75MxZ6U084701; Mon, 5 Aug 2019 22:59:35 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201908052259.x75MxZ6U084701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 5 Aug 2019 22:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350620 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libpthread X-SVN-Commit-Revision: 350620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2019 22:59:36 -0000 Author: vangyzen Date: Mon Aug 5 22:59:35 2019 New Revision: 350620 URL: https://svnweb.freebsd.org/changeset/base/350620 Log: Relax time constraint in pthread_cond_timedwait unit test pthread_cond_timedwait() should wait _at least_ until the timeout, but it might appear to wait longer due to system activity and scheduling. The test ignored fractional seconds when comparing the actual and expected timeouts, so it allowed anywhere between zero and one extra second of wait time. Zero is a bit unreasonable. Compare fractional seconds so we always allow up to one extra second. Reviewed by: ngie MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libpthread/t_condwait.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_condwait.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_condwait.c Mon Aug 5 22:04:16 2019 (r350619) +++ head/contrib/netbsd-tests/lib/libpthread/t_condwait.c Mon Aug 5 22:59:35 2019 (r350620) @@ -51,6 +51,9 @@ static void * run(void *param) { struct timespec ts, to, te; +#ifdef __FreeBSD__ + struct timespec tw; +#endif clockid_t clck; pthread_condattr_t attr; pthread_cond_t cond; @@ -91,7 +94,15 @@ run(void *param) /* Loose upper limit because of qemu timing bugs */ ATF_REQUIRE(to_seconds < WAITTIME * 2.5); } else { +#ifdef __FreeBSD__ + tw.tv_sec = WAITTIME; + tw.tv_nsec = 0; + ATF_REQUIRE(timespeccmp(&to, &tw, >=)); + tw.tv_sec++; + ATF_REQUIRE(timespeccmp(&to, &tw, <=)); +#else ATF_REQUIRE_EQ(to.tv_sec, WAITTIME); +#endif } break; default: From owner-svn-src-all@freebsd.org Tue Aug 6 01:13:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAFA0B1FE3; Tue, 6 Aug 2019 01:13:20 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 462c8J54gQz4S1d; Tue, 6 Aug 2019 01:13:20 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x761DIqh017377 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 5 Aug 2019 18:13:18 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x761DHRA017376; Mon, 5 Aug 2019 18:13:18 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 5 Aug 2019 18:13:17 -0700 From: Gleb Smirnoff To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349929 - head/sys/contrib/ipfilter/netinet Message-ID: <20190806011317.GG1398@FreeBSD.org> References: <201907120159.x6C1x9go013298@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201907120159.x6C1x9go013298@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 462c8J54gQz4S1d X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.38 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.85)[-0.853,0]; NEURAL_HAM_SHORT(-0.53)[-0.525,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 01:13:21 -0000 Hi, On Fri, Jul 12, 2019 at 01:59:09AM +0000, Cy Schubert wrote: C> Log: C> Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c. C> The reason for this is that ipftest(8), which still works on FreeBSD-11, C> fails to link to it, breaking stable/11 builds. C> C> ipftest(8) was broken (segfault) sometime during the FreeBSD-12 cycle. C> glebius@ suggested we disable building it until I can get around to C> fixing it. Hence this was not caught in -current. C> C> The intention is to fix ipftest(8) as it is used by the netbsd-tests C> (imported by ngie@ many moons ago) for regression testing. AFAIR, maintaining ipftest always was a PITA, as it wants to compile lots of kernel code into a userland utility. Of course, once disabled it will bitrot very quickly. I'd suggest to achive functionality of ipftest in a different way. Add a new ioctl() to the pfil(9), that will read a packet from the userland and match it against a given pfil head and report the result. This will make a universal tool for packet against ruleset checking for all existing firewalls, including ipfw and pf. Let's call it pfiltest utility. It can also be a part of existing pfilctl, invoked as "pfilctl test". The second missing bit of functionality is that ipftest can test against not the running ruleset, but some other ruleset. This can be achieved by adding multiple ruleset feature into existing firewalls. The pfil(9) already has notion of ruleset names, but so far ipfw, pf and ipf provide only "default". Once a firewall is able to make alternative rulesets, we can match this functionality: ipftest would install temporary ruleset, don't connect it to any head, run the new ioctl() on it, then destroy the ruleset. I'm sorry to come with a suggestion but can't contribute any time into it. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Aug 6 02:06:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B64CB2EAC; Tue, 6 Aug 2019 02:06:56 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (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 462dL64xx4z4Tpl; Tue, 6 Aug 2019 02:06:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id uosDhsCgsSrVcuosEhgkXV; Mon, 05 Aug 2019 20:06:51 -0600 X-Authority-Analysis: v=2.3 cv=L5ZjvNb8 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=ZkAF0KX_x8muuJWAYVIA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id EA3771E8; Mon, 5 Aug 2019 19:06:48 -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 x7626mIc053398; Mon, 5 Aug 2019 19:06:48 -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 x7626mkb053395; Mon, 5 Aug 2019 19:06:48 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908060206.x7626mkb053395@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Gleb Smirnoff cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r349929 - head/sys/contrib/ipfilter/netinet In-reply-to: <20190806011317.GG1398@FreeBSD.org> References: <201907120159.x6C1x9go013298@repo.freebsd.org> <20190806011317.GG1398@FreeBSD.org> Comments: In-reply-to Gleb Smirnoff message dated "Mon, 05 Aug 2019 18:13:17 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 05 Aug 2019 19:06:48 -0700 X-CMAE-Envelope: MS4wfMNMasMsZncm6imcKeyvj8GbMMulbgvhoy4z6xSN81gtn/BFI+DDuKZ7JCDj8XyZcMs84veR4U1m5OpMad8hIHa5De9wNsSjPswBjiVdLsz/k5gaSPAR CzdVr+vQG2joYyIFcnlGFLbL0gaDMYwXIv52xJnCkJ6jzlZ+1eu7uU2DzVWwyWdne1uwm60dyj3KDm1R4BCXCqujCwNw5OUtYKFyHsDi4FGwHiOn3QVBi5hg E9okz9f0kj5I3xjAn8/GWDwxec8DDPVG9BnATEBiizFq+udHY4QJHqZu0SYmG0a9DlrwESIUrvAInsqCPX2jPQ== X-Rspamd-Queue-Id: 462dL64xx4z4Tpl X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.139) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-3.90 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; IP_SCORE(-2.30)[ip: (-5.76), ipnet: 64.59.128.0/20(-3.18), asn: 6327(-2.48), country: CA(-0.09)]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; RCVD_IN_DNSWL_NONE(0.00)[139.136.59.64.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Aug 2019 02:06:56 -0000 In message <20190806011317.GG1398@FreeBSD.org>, Gleb Smirnoff writes: > Hi, > > On Fri, Jul 12, 2019 at 01:59:09AM +0000, Cy Schubert wrote: > C> Log: > C> Move the new ipf_pcksum6() function from ip_fil_freebsd.c to fil.c. > C> The reason for this is that ipftest(8), which still works on FreeBSD-11, > C> fails to link to it, breaking stable/11 builds. > C> > C> ipftest(8) was broken (segfault) sometime during the FreeBSD-12 cycle. > C> glebius@ suggested we disable building it until I can get around to > C> fixing it. Hence this was not caught in -current. > C> > C> The intention is to fix ipftest(8) as it is used by the netbsd-tests > C> (imported by ngie@ many moons ago) for regression testing. > > AFAIR, maintaining ipftest always was a PITA, as it wants to compile > lots of kernel code into a userland utility. Of course, once disabled > it will bitrot very quickly. > > I'd suggest to achive functionality of ipftest in a different way. Add > a new ioctl() to the pfil(9), that will read a packet from the userland > and match it against a given pfil head and report the result. This will > make a universal tool for packet against ruleset checking for all existing > firewalls, including ipfw and pf. Let's call it pfiltest utility. It can > also be a part of existing pfilctl, invoked as "pfilctl test". This would make firewall testing more consistent. The approach currently used by SoC project uses VNET jails. An ioctl() to inject packets into pfil(9) is intriguing. ipftest(8) uses pcap file for testing, providing serially reproducible input. OTOH, a userland utility can be rebuilt at will without affecting the running system. A person could test yet to be implemented changes without affecting the currently running packet filter. Still this is an interesting idea. When I was an MVS systems programmer I had developed extensions to the JES2 job entry subsystem. MVS allowed for a primary and secondary subsystem allowing the primary to process jobs while the secondary could be used for testing or other purposes. In a similar vein, possibly having a primary and secondary pfil(9) to which alternate packet filters could attach for would allow for testing without the disruption of kldload/kldunload of the primary packet filters or even worse, reboot. (And reboots for the sake of testing are annoying for the impatient.) Anticipating the next point, why not a VM? Again, time. > > The second missing bit of functionality is that ipftest can test against > not the running ruleset, but some other ruleset. This can be achieved by > adding multiple ruleset feature into existing firewalls. The pfil(9) already > has notion of ruleset names, but so far ipfw, pf and ipf provide only "defaul > t". ipfilter already uses a active and inactive rulesets. Best practice is to clear and load new rules into the inactive ruleset and switch it to active. If it causes problems, switch back. One could extend this functionality to multiple rulesets or map the active/inactive rulesets back to pfil(9). > Once a firewall is able to make alternative rulesets, we can match this > functionality: ipftest would install temporary ruleset, don't connect it > to any head, run the new ioctl() on it, then destroy the ruleset. > > I'm sorry to come with a suggestion but can't contribute any time into it. Thanks for giving me more things to ponder. Lastly, in defense of ipftest, the NetBSD tests that ngie@ imported uses ipftest, as do our friends at NetBSD. If anything I'd like to at least maintain the same UI such that sharing of scripts, tests, and ideas would still be possible. -- 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 6 03:16:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3F36B47DE; Tue, 6 Aug 2019 03:16:06 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462fsy4XCPz4XsF; Tue, 6 Aug 2019 03:16:06 +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 647E625C38; Tue, 6 Aug 2019 03:16:06 +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 x763G6Kd043140; Tue, 6 Aug 2019 03:16:06 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x763G6la043139; Tue, 6 Aug 2019 03:16:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908060316.x763G6la043139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 6 Aug 2019 03:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350622 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 350622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 03:16:06 -0000 Author: jhibbits Date: Tue Aug 6 03:16:06 2019 New Revision: 350622 URL: https://svnweb.freebsd.org/changeset/base/350622 Log: powerpc/pmap: Simplify Book-E 64-bit page table management There is no need for the 64-bit pmap to have a fixed number of page table buffers. Since the 64-bit pmap has a DMAP, we can effectively have user page tables limited only by total RAM size. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Aug 6 00:50:25 2019 (r350621) +++ head/sys/powerpc/booke/pmap.c Tue Aug 6 03:16:06 2019 (r350622) @@ -59,8 +59,7 @@ * 0xc000_0000_0000_0000 - 0xcfff_ffff_ffff_ffff : kernel reserved * 0xc000_0000_0000_0000 - endkernel-1 : kernel code & data * endkernel - msgbufp-1 : flat device tree - * msgbufp - ptbl_bufs-1 : message buffer - * ptbl_bufs - kernel_pdir-1 : kernel page tables + * msgbufp - kernel_pdir-1 : message buffer * kernel_pdir - kernel_pp2d-1 : kernel page directory * kernel_pp2d - . : kernel pointers to page directory * pmap_zero_copy_min - crashdumpmap-1 : reserved for page zero/copy @@ -262,11 +261,6 @@ static int pv_entry_count = 0, pv_entry_max = 0, pv_en #define PMAP_SHPGPERPROC 200 #endif -static void ptbl_init(void); -static struct ptbl_buf *ptbl_buf_alloc(void); -static void ptbl_buf_free(struct ptbl_buf *); -static void ptbl_free_pmap_ptbl(pmap_t, pte_t *); - #ifdef __powerpc64__ static pte_t *ptbl_alloc(mmu_t, pmap_t, pte_t **, unsigned int, boolean_t); @@ -274,6 +268,11 @@ static void ptbl_free(mmu_t, pmap_t, pte_t **, unsigne static void ptbl_hold(mmu_t, pmap_t, pte_t **, unsigned int); static int ptbl_unhold(mmu_t, pmap_t, vm_offset_t); #else +static void ptbl_init(void); +static struct ptbl_buf *ptbl_buf_alloc(void); +static void ptbl_buf_free(struct ptbl_buf *); +static void ptbl_free_pmap_ptbl(pmap_t, pte_t *); + static pte_t *ptbl_alloc(mmu_t, pmap_t, unsigned int, boolean_t); static void ptbl_free(mmu_t, pmap_t, unsigned int); static void ptbl_hold(mmu_t, pmap_t, unsigned int); @@ -293,18 +292,15 @@ static void pv_remove(pmap_t, vm_offset_t, vm_page_t); static void booke_pmap_init_qpages(void); -/* Number of kva ptbl buffers, each covering one ptbl (PTBL_PAGES). */ -#ifdef __powerpc64__ -#define PTBL_BUFS (16UL * 16 * 16) -#else -#define PTBL_BUFS (128 * 16) -#endif - struct ptbl_buf { TAILQ_ENTRY(ptbl_buf) link; /* list link */ vm_offset_t kva; /* va of mapping */ }; +#ifndef __powerpc64__ +/* Number of kva ptbl buffers, each covering one ptbl (PTBL_PAGES). */ +#define PTBL_BUFS (128 * 16) + /* ptbl free list and a lock used for access synchronization. */ static TAILQ_HEAD(, ptbl_buf) ptbl_buf_freelist; static struct mtx ptbl_buf_freelist_lock; @@ -314,6 +310,7 @@ static vm_offset_t ptbl_buf_pool_vabase; /* Pointer to ptbl_buf structures. */ static struct ptbl_buf *ptbl_bufs; +#endif #ifdef SMP extern tlb_entry_t __boot_tlb1[]; @@ -574,63 +571,8 @@ tlb1_get_tlbconf(void) static void ptbl_init(void) { - int i; - - mtx_init(&ptbl_buf_freelist_lock, "ptbl bufs lock", NULL, MTX_DEF); - TAILQ_INIT(&ptbl_buf_freelist); - - for (i = 0; i < PTBL_BUFS; i++) { - ptbl_bufs[i].kva = ptbl_buf_pool_vabase + - i * MAX(PTBL_PAGES,PDIR_PAGES) * PAGE_SIZE; - TAILQ_INSERT_TAIL(&ptbl_buf_freelist, &ptbl_bufs[i], link); - } } -/* Get an sf_buf from the freelist. */ -static struct ptbl_buf * -ptbl_buf_alloc(void) -{ - struct ptbl_buf *buf; - - mtx_lock(&ptbl_buf_freelist_lock); - buf = TAILQ_FIRST(&ptbl_buf_freelist); - if (buf != NULL) - TAILQ_REMOVE(&ptbl_buf_freelist, buf, link); - mtx_unlock(&ptbl_buf_freelist_lock); - - return (buf); -} - -/* Return ptbl buff to free pool. */ -static void -ptbl_buf_free(struct ptbl_buf *buf) -{ - mtx_lock(&ptbl_buf_freelist_lock); - TAILQ_INSERT_TAIL(&ptbl_buf_freelist, buf, link); - mtx_unlock(&ptbl_buf_freelist_lock); -} - -/* - * Search the list of allocated ptbl bufs and find on list of allocated ptbls - */ -static void -ptbl_free_pmap_ptbl(pmap_t pmap, pte_t * ptbl) -{ - struct ptbl_buf *pbuf; - - TAILQ_FOREACH(pbuf, &pmap->pm_ptbl_list, link) { - if (pbuf->kva == (vm_offset_t) ptbl) { - /* Remove from pmap ptbl buf list. */ - TAILQ_REMOVE(&pmap->pm_ptbl_list, pbuf, link); - - /* Free corresponding ptbl buf. */ - ptbl_buf_free(pbuf); - - break; - } - } -} - /* Get a pointer to a PTE in a page table. */ static __inline pte_t * pte_find(mmu_t mmu, pmap_t pmap, vm_offset_t va) @@ -648,25 +590,36 @@ pte_find(mmu_t mmu, pmap_t pmap, vm_offset_t va) } /* - * Search the list of allocated pdir bufs and find on list of allocated pdirs + * allocate a page of pointers to page directories, do not preallocate the + * page tables */ -static void -ptbl_free_pmap_pdir(mmu_t mmu, pmap_t pmap, pte_t ** pdir) +static pte_t ** +pdir_alloc(mmu_t mmu, pmap_t pmap, unsigned int pp2d_idx, bool nosleep) { - struct ptbl_buf *pbuf; + vm_page_t m; + pte_t **pdir; + int req; - TAILQ_FOREACH(pbuf, &pmap->pm_pdir_list, link) { - if (pbuf->kva == (vm_offset_t) pdir) { - /* Remove from pmap ptbl buf list. */ - TAILQ_REMOVE(&pmap->pm_pdir_list, pbuf, link); + KASSERT((pdir[pdir_idx] == NULL), + ("%s: valid pdir entry exists!", __func__)); - /* Free corresponding pdir buf. */ - ptbl_buf_free(pbuf); - - break; + req = VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; + while ((m = vm_page_alloc(NULL, pp2d_idx, req)) == NULL) { + PMAP_UNLOCK(pmap); + if (nosleep) { + return (NULL); } + vm_wait(NULL); + PMAP_LOCK(pmap); } + + /* Zero whole ptbl. */ + pdir = (pte_t **)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + bzero(pdir, PAGE_SIZE); + + return (pdir); } + /* Free pdir pages and invalidate pdir entry. */ static void pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_idx) @@ -675,7 +628,6 @@ pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_id vm_paddr_t pa; vm_offset_t va; vm_page_t m; - int i; pdir = pmap->pm_pp2d[pp2d_idx]; @@ -683,16 +635,10 @@ pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_id pmap->pm_pp2d[pp2d_idx] = NULL; - for (i = 0; i < PDIR_PAGES; i++) { - va = ((vm_offset_t) pdir + (i * PAGE_SIZE)); - pa = pte_vatopa(mmu, kernel_pmap, va); - m = PHYS_TO_VM_PAGE(pa); - vm_page_free_zero(m); - vm_wire_sub(1); - pmap_kremove(va); - } - - ptbl_free_pmap_pdir(mmu, pmap, pdir); + va = (vm_offset_t) pdir; + pa = DMAP_TO_PHYS(va); + m = PHYS_TO_VM_PAGE(pa); + vm_page_free_zero(m); } /* @@ -707,30 +653,20 @@ pdir_unhold(mmu_t mmu, pmap_t pmap, u_int pp2d_idx) pte_t **pdir; vm_paddr_t pa; vm_page_t m; - int i; KASSERT((pmap != kernel_pmap), ("pdir_unhold: unholding kernel pdir!")); pdir = pmap->pm_pp2d[pp2d_idx]; - KASSERT(((vm_offset_t) pdir >= VM_MIN_KERNEL_ADDRESS), - ("pdir_unhold: non kva pdir")); - /* decrement hold count */ - for (i = 0; i < PDIR_PAGES; i++) { - pa = pte_vatopa(mmu, kernel_pmap, - (vm_offset_t) pdir + (i * PAGE_SIZE)); - m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; - } + pa = DMAP_TO_PHYS((vm_offset_t) pdir); + m = PHYS_TO_VM_PAGE(pa); /* - * Free pdir pages if there are no dir entries in this pdir. - * wire_count has the same value for all ptbl pages, so check the - * last page. + * Free pdir page if there are no dir entries in this pdir. */ - if (m->wire_count == 0) { + if (vm_page_unwire_noq(m)) { pdir_free(mmu, pmap, pp2d_idx); return (1); } @@ -744,21 +680,15 @@ pdir_unhold(mmu_t mmu, pmap_t pmap, u_int pp2d_idx) static void pdir_hold(mmu_t mmu, pmap_t pmap, pte_t ** pdir) { - vm_paddr_t pa; vm_page_t m; - int i; KASSERT((pmap != kernel_pmap), ("pdir_hold: holding kernel pdir!")); KASSERT((pdir != NULL), ("pdir_hold: null pdir")); - for (i = 0; i < PDIR_PAGES; i++) { - pa = pte_vatopa(mmu, kernel_pmap, - (vm_offset_t) pdir + (i * PAGE_SIZE)); - m = PHYS_TO_VM_PAGE(pa); - m->wire_count++; - } + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pdir)); + vm_page_wire(m); } /* Allocate page table. */ @@ -766,51 +696,29 @@ static pte_t * ptbl_alloc(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsigned int pdir_idx, boolean_t nosleep) { - vm_page_t mtbl [PTBL_PAGES]; vm_page_t m; - struct ptbl_buf *pbuf; - unsigned int pidx; pte_t *ptbl; - int i, j; int req; KASSERT((pdir[pdir_idx] == NULL), ("%s: valid ptbl entry exists!", __func__)); - pbuf = ptbl_buf_alloc(); - if (pbuf == NULL) - panic("%s: couldn't alloc kernel virtual memory", __func__); - - ptbl = (pte_t *) pbuf->kva; - - for (i = 0; i < PTBL_PAGES; i++) { - pidx = (PTBL_PAGES * pdir_idx) + i; - req = VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; - while ((m = vm_page_alloc(NULL, pidx, req)) == NULL) { - PMAP_UNLOCK(pmap); - rw_wunlock(&pvh_global_lock); - if (nosleep) { - ptbl_free_pmap_ptbl(pmap, ptbl); - for (j = 0; j < i; j++) - vm_page_free(mtbl[j]); - vm_wire_sub(i); - return (NULL); - } - vm_wait(NULL); - rw_wlock(&pvh_global_lock); - PMAP_LOCK(pmap); + req = VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; + while ((m = vm_page_alloc(NULL, pdir_idx, req)) == NULL) { + PMAP_UNLOCK(pmap); + rw_wunlock(&pvh_global_lock); + if (nosleep) { + return (NULL); } - mtbl[i] = m; + vm_wait(NULL); + rw_wlock(&pvh_global_lock); + PMAP_LOCK(pmap); } - /* Mapin allocated pages into kernel_pmap. */ - mmu_booke_qenter(mmu, (vm_offset_t) ptbl, mtbl, PTBL_PAGES); /* Zero whole ptbl. */ - bzero((caddr_t) ptbl, PTBL_PAGES * PAGE_SIZE); + ptbl = (pte_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + bzero(ptbl, PAGE_SIZE); - /* Add pbuf to the pmap ptbl bufs list. */ - TAILQ_INSERT_TAIL(&pmap->pm_ptbl_list, pbuf, link); - return (ptbl); } @@ -822,7 +730,6 @@ ptbl_free(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsig vm_paddr_t pa; vm_offset_t va; vm_page_t m; - int i; ptbl = pdir[pdir_idx]; @@ -830,16 +737,10 @@ ptbl_free(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsig pdir[pdir_idx] = NULL; - for (i = 0; i < PTBL_PAGES; i++) { - va = ((vm_offset_t) ptbl + (i * PAGE_SIZE)); - pa = pte_vatopa(mmu, kernel_pmap, va); - m = PHYS_TO_VM_PAGE(pa); - vm_page_free_zero(m); - vm_wire_sub(1); - pmap_kremove(va); - } - - ptbl_free_pmap_ptbl(pmap, ptbl); + va = (vm_offset_t) ptbl; + pa = DMAP_TO_PHYS(va); + m = PHYS_TO_VM_PAGE(pa); + vm_page_free_zero(m); } /* @@ -852,12 +753,10 @@ static int ptbl_unhold(mmu_t mmu, pmap_t pmap, vm_offset_t va) { pte_t *ptbl; - vm_paddr_t pa; vm_page_t m; u_int pp2d_idx; pte_t **pdir; u_int pdir_idx; - int i; pp2d_idx = PP2D_IDX(va); pdir_idx = PDIR_IDX(va); @@ -868,30 +767,15 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, vm_offset_t va) pdir = pmap->pm_pp2d[pp2d_idx]; ptbl = pdir[pdir_idx]; - KASSERT(((vm_offset_t) ptbl >= VM_MIN_KERNEL_ADDRESS), - ("ptbl_unhold: non kva ptbl")); - /* decrement hold count */ - for (i = 0; i < PTBL_PAGES; i++) { - pa = pte_vatopa(mmu, kernel_pmap, - (vm_offset_t) ptbl + (i * PAGE_SIZE)); - m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; - } + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t) ptbl)); /* * Free ptbl pages if there are no pte entries in this ptbl. * wire_count has the same value for all ptbl pages, so check the * last page. */ - if (m->wire_count == 0) { - /* A pair of indirect entries might point to this ptbl page */ -#if 0 - tlb_flush_entry(pmap, va & ~((2UL * PAGE_SIZE_1M) - 1), - TLB_SIZE_1M, MAS6_SIND); - tlb_flush_entry(pmap, (va & ~((2UL * PAGE_SIZE_1M) - 1)) | PAGE_SIZE_1M, - TLB_SIZE_1M, MAS6_SIND); -#endif + if (vm_page_unwire_noq(m)) { ptbl_free(mmu, pmap, pdir, pdir_idx); pdir_unhold(mmu, pmap, pp2d_idx); return (1); @@ -906,10 +790,8 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, vm_offset_t va) static void ptbl_hold(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsigned int pdir_idx) { - vm_paddr_t pa; pte_t *ptbl; vm_page_t m; - int i; KASSERT((pmap != kernel_pmap), ("ptbl_hold: holding kernel ptbl!")); @@ -918,12 +800,8 @@ ptbl_hold(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsig KASSERT((ptbl != NULL), ("ptbl_hold: null ptbl")); - for (i = 0; i < PTBL_PAGES; i++) { - pa = pte_vatopa(mmu, kernel_pmap, - (vm_offset_t) ptbl + (i * PAGE_SIZE)); - m = PHYS_TO_VM_PAGE(pa); - m->wire_count++; - } + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t) ptbl)); + vm_page_wire(m); } #else @@ -1328,51 +1206,6 @@ pte_remove(mmu_t mmu, pmap_t pmap, vm_offset_t va, u_i } /* - * allocate a page of pointers to page directories, do not preallocate the - * page tables - */ -static pte_t ** -pdir_alloc(mmu_t mmu, pmap_t pmap, unsigned int pp2d_idx, bool nosleep) -{ - vm_page_t mtbl [PDIR_PAGES]; - vm_page_t m; - struct ptbl_buf *pbuf; - pte_t **pdir; - unsigned int pidx; - int i; - int req; - - pbuf = ptbl_buf_alloc(); - - if (pbuf == NULL) - panic("%s: couldn't alloc kernel virtual memory", __func__); - - /* Allocate pdir pages, this will sleep! */ - for (i = 0; i < PDIR_PAGES; i++) { - pidx = (PDIR_PAGES * pp2d_idx) + i; - req = VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; - while ((m = vm_page_alloc(NULL, pidx, req)) == NULL) { - PMAP_UNLOCK(pmap); - vm_wait(NULL); - PMAP_LOCK(pmap); - } - mtbl[i] = m; - } - - /* Mapin allocated pages into kernel_pmap. */ - pdir = (pte_t **) pbuf->kva; - pmap_qenter((vm_offset_t) pdir, mtbl, PDIR_PAGES); - - /* Zero whole pdir. */ - bzero((caddr_t) pdir, PDIR_PAGES * PAGE_SIZE); - - /* Add pdir to the pmap pdir bufs list. */ - TAILQ_INSERT_TAIL(&pmap->pm_pdir_list, pbuf, link); - - return pdir; -} - -/* * Insert PTE for a given page and virtual address. */ static int @@ -1485,8 +1318,8 @@ kernel_pte_alloc(vm_offset_t data_end, vm_offset_t add for (j = PDIR_IDX(va + (i * PAGE_SIZE * PDIR_NENTRIES * PTBL_NENTRIES)); j < PDIR_NENTRIES; j++) { kernel_pmap->pm_pp2d[i + PP2D_IDX(va)][j] = - (pte_t *)(pdir + (kernel_pdirs * PAGE_SIZE * PDIR_PAGES) + - (((i * PDIR_NENTRIES) + j) * PAGE_SIZE * PTBL_PAGES)); + (pte_t *)(pdir + (kernel_pdirs * PAGE_SIZE) + + (((i * PDIR_NENTRIES) + j) * PAGE_SIZE)); } } @@ -1764,6 +1597,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o data_end = round_page(data_end); +#ifndef __powerpc64__ /* Allocate space for ptbl_bufs. */ ptbl_bufs = (struct ptbl_buf *)data_end; data_end += sizeof(struct ptbl_buf) * PTBL_BUFS; @@ -1771,6 +1605,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o (uintptr_t)ptbl_bufs, data_end); data_end = round_page(data_end); +#endif /* Allocate PTE tables for kernel KVA. */ kernel_pdir = data_end; @@ -1799,12 +1634,12 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o * all range up to the currently calculated 'data_end' is covered. */ dpcpu_init(dpcpu, 0); - memset((void *)ptbl_bufs, 0, sizeof(struct ptbl_buf) * PTBL_SIZE); #ifdef __powerpc64__ memset((void *)kernel_pdir, 0, kernel_pdirs * PDIR_PAGES * PAGE_SIZE + kernel_ptbls * PTBL_PAGES * PAGE_SIZE); #else + memset((void *)ptbl_bufs, 0, sizeof(struct ptbl_buf) * PTBL_SIZE); memset((void *)kernel_pdir, 0, kernel_ptbls * PTBL_PAGES * PAGE_SIZE); #endif @@ -1829,11 +1664,13 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_o mtx_init(&zero_page_mutex, "mmu_booke_zero_page", NULL, MTX_DEF); mtx_init(©_page_mutex, "mmu_booke_copy_page", NULL, MTX_DEF); +#ifndef __powerpc64__ /* Allocate KVA space for ptbl bufs. */ ptbl_buf_pool_vabase = virtual_avail; virtual_avail += PTBL_BUFS * PTBL_PAGES * PAGE_SIZE; debugf("ptbl_buf_pool_vabase = 0x%"PRI0ptrX" end = 0x%"PRI0ptrX"\n", ptbl_buf_pool_vabase, virtual_avail); +#endif /* Calculate corresponding physical addresses for the kernel region. */ phys_kernelend = kernload + kernsize; From owner-svn-src-all@freebsd.org Tue Aug 6 03:54:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A811B5287; Tue, 6 Aug 2019 03:54:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462gkD358hz4ZF1; Tue, 6 Aug 2019 03:54:28 +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 472BB26348; Tue, 6 Aug 2019 03:54:28 +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 x763sSCn066516; Tue, 6 Aug 2019 03:54:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x763sRBZ066514; Tue, 6 Aug 2019 03:54:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908060354.x763sRBZ066514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 6 Aug 2019 03:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350624 - in head/sys/dev: amdsmn amdtemp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/dev: amdsmn amdtemp X-SVN-Commit-Revision: 350624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 03:54:28 -0000 Author: cem Date: Tue Aug 6 03:54:27 2019 New Revision: 350624 URL: https://svnweb.freebsd.org/changeset/base/350624 Log: amdtemp(4), amdsmn(4): Attach to Ryzen 3 (Zen 2) hostbridges PR: 239607 Reported by: "drclaw" Modified: head/sys/dev/amdsmn/amdsmn.c head/sys/dev/amdtemp/amdtemp.c Modified: head/sys/dev/amdsmn/amdsmn.c ============================================================================== --- head/sys/dev/amdsmn/amdsmn.c Tue Aug 6 03:49:40 2019 (r350623) +++ head/sys/dev/amdsmn/amdsmn.c Tue Aug 6 03:54:27 2019 (r350624) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define PCI_DEVICE_ID_AMD_15H_M60H_ROOT 0x1576 #define PCI_DEVICE_ID_AMD_17H_ROOT 0x1450 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0 +#define PCI_DEVICE_ID_AMD_17H_M30H_ROOT 0x1480 struct pciid; struct amdsmn_softc { @@ -87,6 +88,12 @@ static const struct pciid { { .amdsmn_vendorid = CPU_VENDOR_AMD, .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M10H_ROOT, + .amdsmn_addr_reg = F17H_SMN_ADDR_REG, + .amdsmn_data_reg = F17H_SMN_DATA_REG, + }, + { + .amdsmn_vendorid = CPU_VENDOR_AMD, + .amdsmn_deviceid = PCI_DEVICE_ID_AMD_17H_M30H_ROOT, .amdsmn_addr_reg = F17H_SMN_ADDR_REG, .amdsmn_data_reg = F17H_SMN_DATA_REG, }, Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Tue Aug 6 03:49:40 2019 (r350623) +++ head/sys/dev/amdtemp/amdtemp.c Tue Aug 6 03:54:27 2019 (r350624) @@ -96,6 +96,7 @@ struct amdtemp_softc { #define DEVICEID_AMD_MISC16_M30H 0x1583 #define DEVICEID_AMD_HOSTB17H_ROOT 0x1450 #define DEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0 +#define DEVICEID_AMD_HOSTB17H_M30H_ROOT 0x1480 static const struct amdtemp_product { uint16_t amdtemp_vendorid; @@ -118,6 +119,7 @@ static const struct amdtemp_product { { VENDORID_AMD, DEVICEID_AMD_MISC16_M30H, true }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT, false }, { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT, false }, + { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M30H_ROOT, false }, }; /* From owner-svn-src-all@freebsd.org Tue Aug 6 03:49:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC9A0B5089; Tue, 6 Aug 2019 03:49:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462gch5W11z4YvM; Tue, 6 Aug 2019 03:49:40 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EABA26191; Tue, 6 Aug 2019 03:49:40 +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 x763neFV060895; Tue, 6 Aug 2019 03:49:40 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x763neNw060894; Tue, 6 Aug 2019 03:49:40 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908060349.x763neNw060894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 6 Aug 2019 03:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350623 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 350623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 03:49:40 -0000 Author: jhibbits Date: Tue Aug 6 03:49:40 2019 New Revision: 350623 URL: https://svnweb.freebsd.org/changeset/base/350623 Log: Fix build from r350622 It helps if my local kernel build has INVARIANTS. Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Aug 6 03:16:06 2019 (r350622) +++ head/sys/powerpc/booke/pmap.c Tue Aug 6 03:49:40 2019 (r350623) @@ -600,7 +600,7 @@ pdir_alloc(mmu_t mmu, pmap_t pmap, unsigned int pp2d_i pte_t **pdir; int req; - KASSERT((pdir[pdir_idx] == NULL), + KASSERT((pdir[pp2d_idx] == NULL), ("%s: valid pdir entry exists!", __func__)); req = VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; From owner-svn-src-all@freebsd.org Tue Aug 6 10:29:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71158BEA4D; Tue, 6 Aug 2019 10:29:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462rTr2G8tz3PYr; Tue, 6 Aug 2019 10:29:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B4642A91F; Tue, 6 Aug 2019 10:29:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76ATKiR097722; Tue, 6 Aug 2019 10:29:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76ATK0E097721; Tue, 6 Aug 2019 10:29:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908061029.x76ATK0E097721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Aug 2019 10:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350626 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 350626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 10:29:20 -0000 Author: tuexen Date: Tue Aug 6 10:29:19 2019 New Revision: 350626 URL: https://svnweb.freebsd.org/changeset/base/350626 Log: Fix a locking issue in sctp_accept. PR: 238520 Reported by: pho@ MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Aug 6 08:33:21 2019 (r350625) +++ head/sys/netinet/sctp_usrreq.c Tue Aug 6 10:29:19 2019 (r350626) @@ -7226,28 +7226,56 @@ sctp_accept(struct socket *so, struct sockaddr **addr) SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (ECONNRESET); } - SCTP_INP_RLOCK(inp); + SCTP_INP_WLOCK(inp); if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_WUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP); return (EOPNOTSUPP); } if (so->so_state & SS_ISDISCONNECTED) { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_WUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ECONNABORTED); return (ECONNABORTED); } stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb == NULL) { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_WUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (ECONNRESET); } SCTP_TCB_LOCK(stcb); - SCTP_INP_RUNLOCK(inp); store = stcb->asoc.primary_destination->ro._l_addr; SCTP_CLEAR_SUBSTATE(stcb, SCTP_STATE_IN_ACCEPT_QUEUE); - SCTP_TCB_UNLOCK(stcb); + /* Wake any delayed sleep action */ + if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) { + inp->sctp_flags &= ~SCTP_PCB_FLAGS_DONT_WAKE; + if (inp->sctp_flags & SCTP_PCB_FLAGS_WAKEOUTPUT) { + inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT; + SOCKBUF_LOCK(&inp->sctp_socket->so_snd); + if (sowriteable(inp->sctp_socket)) { + sowwakeup_locked(inp->sctp_socket); + } else { + SOCKBUF_UNLOCK(&inp->sctp_socket->so_snd); + } + } + if (inp->sctp_flags & SCTP_PCB_FLAGS_WAKEINPUT) { + inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT; + SOCKBUF_LOCK(&inp->sctp_socket->so_rcv); + if (soreadable(inp->sctp_socket)) { + sctp_defered_wakeup_cnt++; + sorwakeup_locked(inp->sctp_socket); + } else { + SOCKBUF_UNLOCK(&inp->sctp_socket->so_rcv); + } + } + } + SCTP_INP_WUNLOCK(inp); + if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, + SCTP_FROM_SCTP_USRREQ + SCTP_LOC_19); + } else { + SCTP_TCB_UNLOCK(stcb); + } switch (store.sa.sa_family) { #ifdef INET case AF_INET: @@ -7288,40 +7316,6 @@ sctp_accept(struct socket *so, struct sockaddr **addr) default: /* TSNH */ break; - } - /* Wake any delayed sleep action */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_DONT_WAKE) { - SCTP_INP_WLOCK(inp); - inp->sctp_flags &= ~SCTP_PCB_FLAGS_DONT_WAKE; - if (inp->sctp_flags & SCTP_PCB_FLAGS_WAKEOUTPUT) { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEOUTPUT; - SCTP_INP_WUNLOCK(inp); - SOCKBUF_LOCK(&inp->sctp_socket->so_snd); - if (sowriteable(inp->sctp_socket)) { - sowwakeup_locked(inp->sctp_socket); - } else { - SOCKBUF_UNLOCK(&inp->sctp_socket->so_snd); - } - SCTP_INP_WLOCK(inp); - } - if (inp->sctp_flags & SCTP_PCB_FLAGS_WAKEINPUT) { - inp->sctp_flags &= ~SCTP_PCB_FLAGS_WAKEINPUT; - SCTP_INP_WUNLOCK(inp); - SOCKBUF_LOCK(&inp->sctp_socket->so_rcv); - if (soreadable(inp->sctp_socket)) { - sctp_defered_wakeup_cnt++; - sorwakeup_locked(inp->sctp_socket); - } else { - SOCKBUF_UNLOCK(&inp->sctp_socket->so_rcv); - } - SCTP_INP_WLOCK(inp); - } - SCTP_INP_WUNLOCK(inp); - } - if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { - SCTP_TCB_LOCK(stcb); - sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, - SCTP_FROM_SCTP_USRREQ + SCTP_LOC_19); } return (0); } From owner-svn-src-all@freebsd.org Tue Aug 6 08:33:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7A68BC831; Tue, 6 Aug 2019 08:33:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462nw24H5Mz3K50; Tue, 6 Aug 2019 08:33:22 +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 748D62951A; Tue, 6 Aug 2019 08:33:22 +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 x768XMjl031480; Tue, 6 Aug 2019 08:33:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x768XMJX031478; Tue, 6 Aug 2019 08:33:22 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908060833.x768XMJX031478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Aug 2019 08:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350625 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 350625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 08:33:22 -0000 Author: tuexen Date: Tue Aug 6 08:33:21 2019 New Revision: 350625 URL: https://svnweb.freebsd.org/changeset/base/350625 Log: Fix build issues for the userland stack on Raspbian. Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Aug 6 03:54:27 2019 (r350624) +++ head/sys/netinet/sctp_output.c Tue Aug 6 08:33:21 2019 (r350625) @@ -12534,7 +12534,7 @@ sctp_lower_sosend(struct socket *so, struct thread *p ) { - ssize_t sndlen = 0, max_len; + ssize_t sndlen = 0, max_len, local_add_more; int error, len; struct mbuf *top = NULL; int queue_only = 0, queue_only_for_init = 0; @@ -12556,7 +12556,6 @@ sctp_lower_sosend(struct socket *so, int got_all_of_the_send = 0; int hold_tcblock = 0; int non_blocking = 0; - uint32_t local_add_more; ssize_t local_soresv = 0; uint16_t port; uint16_t sinfo_flags; @@ -12860,7 +12859,7 @@ sctp_lower_sosend(struct socket *so, free_cnt_applied = 1; if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NO_FRAGMENT)) { - if (sndlen > asoc->smallest_mtu) { + if (sndlen > (ssize_t)asoc->smallest_mtu) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EMSGSIZE); error = EMSGSIZE; goto out_unlocked; @@ -12888,7 +12887,7 @@ sctp_lower_sosend(struct socket *so, if ((SCTP_SB_LIMIT_SND(so) < (amount + inqueue_bytes + stcb->asoc.sb_send_resv)) || (stcb->asoc.chunks_on_out_queue >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { SCTP_LTRACE_ERR_RET(inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EWOULDBLOCK); - if (sndlen > SCTP_SB_LIMIT_SND(so)) + if (sndlen > (ssize_t)SCTP_SB_LIMIT_SND(so)) error = EMSGSIZE; else error = EWOULDBLOCK; @@ -13070,7 +13069,7 @@ sctp_lower_sosend(struct socket *so, /* Unless E_EOR mode is on, we must make a send FIT in one call. */ if ((user_marks_eor == 0) && - (sndlen > SCTP_SB_LIMIT_SND(stcb->sctp_socket))) { + (sndlen > (ssize_t)SCTP_SB_LIMIT_SND(stcb->sctp_socket))) { /* It will NEVER fit */ SCTP_LTRACE_ERR_RET(NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, EMSGSIZE); error = EMSGSIZE; @@ -13087,20 +13086,20 @@ sctp_lower_sosend(struct socket *so, } if (user_marks_eor) { - local_add_more = min(SCTP_SB_LIMIT_SND(so), SCTP_BASE_SYSCTL(sctp_add_more_threshold)); + local_add_more = (ssize_t)min(SCTP_SB_LIMIT_SND(so), SCTP_BASE_SYSCTL(sctp_add_more_threshold)); } else { /*- * For non-eeor the whole message must fit in * the socket send buffer. */ - local_add_more = (uint32_t)sndlen; + local_add_more = sndlen; } len = 0; if (non_blocking) { goto skip_preblock; } if (((max_len <= local_add_more) && - (SCTP_SB_LIMIT_SND(so) >= local_add_more)) || + ((ssize_t)SCTP_SB_LIMIT_SND(so) >= local_add_more)) || (max_len == 0) || ((stcb->asoc.chunks_on_out_queue + stcb->asoc.stream_queue_cnt) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { /* No room right now ! */ @@ -13108,7 +13107,7 @@ sctp_lower_sosend(struct socket *so, inqueue_bytes = stcb->asoc.total_output_queue_size - (stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb)); while ((SCTP_SB_LIMIT_SND(so) < (inqueue_bytes + local_add_more)) || ((stcb->asoc.stream_queue_cnt + stcb->asoc.chunks_on_out_queue) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "pre_block limit:%u <(inq:%d + %d) || (%d+%d > %d)\n", + SCTPDBG(SCTP_DEBUG_OUTPUT1, "pre_block limit:%u <(inq:%d + %zd) || (%d+%d > %d)\n", (unsigned int)SCTP_SB_LIMIT_SND(so), inqueue_bytes, local_add_more, @@ -13241,7 +13240,7 @@ skip_preblock: else max_len = 0; - if ((max_len > SCTP_BASE_SYSCTL(sctp_add_more_threshold)) || + if ((max_len > (ssize_t)SCTP_BASE_SYSCTL(sctp_add_more_threshold)) || (max_len && (SCTP_SB_LIMIT_SND(so) < SCTP_BASE_SYSCTL(sctp_add_more_threshold))) || (uio->uio_resid && (uio->uio_resid <= max_len))) { sndout = 0; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Aug 6 03:54:27 2019 (r350624) +++ head/sys/netinet/sctputil.c Tue Aug 6 08:33:21 2019 (r350625) @@ -5930,7 +5930,7 @@ get_more_data: } if ((uio->uio_resid == 0) || ((in_eeor_mode) && - (copied_so_far >= (uint32_t)max(so->so_rcv.sb_lowat, 1)))) { + (copied_so_far >= max(so->so_rcv.sb_lowat, 1)))) { goto release; } /* From owner-svn-src-all@freebsd.org Tue Aug 6 12:12:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50C3BC0CAE; Tue, 6 Aug 2019 12:12:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462tmv1VVJz3yb9; Tue, 6 Aug 2019 12:12:31 +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 154EE2BCA4; Tue, 6 Aug 2019 12:12:31 +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 x76CCUdM062061; Tue, 6 Aug 2019 12:12:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76CCTFX062056; Tue, 6 Aug 2019 12:12:29 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908061212.x76CCTFX062056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 6 Aug 2019 12:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350628 - in stable/12/sys: arm/allwinner/clkng dev/iicbus/twsi X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner/clkng dev/iicbus/twsi X-SVN-Commit-Revision: 350628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 12:12:31 -0000 Author: manu Date: Tue Aug 6 12:12:29 2019 New Revision: 350628 URL: https://svnweb.freebsd.org/changeset/base/350628 Log: MFC r347489-r347491, r347512 r347489: allwinner: clk: prediv_mux: Init the current parent Do not init the first parent but read the clock register to find it's current parent and init this one. r347490: allwinner: clk: sun8i_r: Correct resets The i2c reset wasn't defined and some bits where wrong, correct them. r347491: twsi: Calculate the clock param based on the bus frequency Instead of precalculating the different speed, respect the bus frequency and calculate the clock register parameter based on it. If the platform didn't register the core clk, fallback on the precomputed values (This is likely do be the case on Marvell boards). r347512: arm: allwinner: aw_clk_nm: Don't reparent the clock if we didn't ask When looking for the best frequency don't change the clock parent if the clock wasn't configured to do that. Modified: stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c stable/12/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c stable/12/sys/arm/allwinner/clkng/ccu_sun8i_r.c stable/12/sys/dev/iicbus/twsi/a10_twsi.c stable/12/sys/dev/iicbus/twsi/twsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c Tue Aug 6 11:26:30 2019 (r350627) +++ stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c Tue Aug 6 12:12:29 2019 (r350628) @@ -236,7 +236,7 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare return (ERANGE); } - if (p_idx != best_parent) + if ((sc->flags & AW_CLK_REPARENT) != 0 && p_idx != best_parent) clknode_set_parent_by_idx(clk, best_parent); DEVICE_LOCK(clk); Modified: stable/12/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c Tue Aug 6 11:26:30 2019 (r350627) +++ stable/12/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c Tue Aug 6 12:12:29 2019 (r350628) @@ -75,7 +75,19 @@ struct aw_clk_prediv_mux_sc { static int aw_clk_prediv_mux_init(struct clknode *clk, device_t dev) { - clknode_init_parent_idx(clk, 0); + struct aw_clk_prediv_mux_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + /* Init the current parent */ + val = (val & sc->mux_mask) >> sc->mux_shift; + clknode_init_parent_idx(clk, val); + return (0); } Modified: stable/12/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_sun8i_r.c Tue Aug 6 11:26:30 2019 (r350627) +++ stable/12/sys/arm/allwinner/clkng/ccu_sun8i_r.c Tue Aug 6 12:12:29 2019 (r350628) @@ -63,8 +63,9 @@ __FBSDID("$FreeBSD$"); static struct aw_ccung_reset ccu_sun8i_r_resets[] = { CCU_RESET(RST_APB0_IR, 0xb0, 1) CCU_RESET(RST_APB0_TIMER, 0xb0, 2) - CCU_RESET(RST_APB0_RSB, 0xb0, 4) - CCU_RESET(RST_APB0_UART, 0xb0, 6) + CCU_RESET(RST_APB0_RSB, 0xb0, 3) + CCU_RESET(RST_APB0_UART, 0xb0, 4) + CCU_RESET(RST_APB0_I2C, 0xb0, 6) }; static struct aw_ccung_gate ccu_sun8i_r_gates[] = { Modified: stable/12/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/a10_twsi.c Tue Aug 6 11:26:30 2019 (r350627) +++ stable/12/sys/dev/iicbus/twsi/a10_twsi.c Tue Aug 6 12:12:29 2019 (r350628) @@ -87,9 +87,7 @@ static int a10_twsi_attach(device_t dev) { struct twsi_softc *sc; - clk_t clk; hwreset_t rst; - uint64_t freq; int error; sc = device_get_softc(dev); @@ -104,12 +102,12 @@ a10_twsi_attach(device_t dev) } /* Activate clock */ - error = clk_get_by_ofw_index(dev, 0, 0, &clk); + error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_core); if (error != 0) { device_printf(dev, "could not find clock\n"); return (error); } - error = clk_enable(clk); + error = clk_enable(sc->clk_core); if (error != 0) { device_printf(dev, "could not enable clock\n"); return (error); @@ -122,31 +120,6 @@ a10_twsi_attach(device_t dev) sc->reg_status = TWI_STAT; sc->reg_baud_rate = TWI_CCR; sc->reg_soft_reset = TWI_SRST; - - /* Setup baud rate params */ - clk_get_freq(clk, &freq); - switch (freq) { - /* - * Formula is - * F0 = FINT / 2 ^ CLK_N - * F1 = F0 / (CLK_M + 1) - * - * Doc says that the output freq is F1/10 but my logic analyzer says otherwise - */ - case 48000000: - sc->baud_rate[IIC_SLOW].param = TWSI_BAUD_RATE_PARAM(11, 1); - sc->baud_rate[IIC_FAST].param = TWSI_BAUD_RATE_PARAM(11, 1); - sc->baud_rate[IIC_FASTEST].param = TWSI_BAUD_RATE_PARAM(2, 1); - break; - case 24000000: - sc->baud_rate[IIC_SLOW].param = TWSI_BAUD_RATE_PARAM(5, 2); - sc->baud_rate[IIC_FAST].param = TWSI_BAUD_RATE_PARAM(5, 2); - sc->baud_rate[IIC_FASTEST].param = TWSI_BAUD_RATE_PARAM(2, 2); - break; - default: - device_printf(dev, "Non supported frequency\n"); - return (ENXIO); - } sc->need_ack = true; return (twsi_attach(dev)); Modified: stable/12/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.c Tue Aug 6 11:26:30 2019 (r350627) +++ stable/12/sys/dev/iicbus/twsi/twsi.c Tue Aug 6 12:12:29 2019 (r350628) @@ -243,6 +243,43 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, return (IIC_NOERR); } +#ifdef EXT_RESOURCES +#define TWSI_BAUD_RATE_RAW(C,M,N) ((C)/((10*(M+1))<<(N))) +#define ABSSUB(a,b) (((a) > (b)) ? (a) - (b) : (b) - (a)) + +static int +twsi_calc_baud_rate(struct twsi_softc *sc, const u_int target, + int *param) +{ + uint64_t clk; + uint32_t cur, diff, diff0; + int m, n, m0, n0; + + /* Calculate baud rate. */ + diff0 = 0xffffffff; + + if (clk_get_freq(sc->clk_core, &clk) < 0) + return (-1); + + debugf(sc->dev, "Bus clock is at %lu\n", clk); + + for (n = 0; n < 8; n++) { + for (m = 0; m < 16; m++) { + cur = TWSI_BAUD_RATE_RAW(clk,m,n); + diff = ABSSUB(target, cur); + if (diff < diff0) { + m0 = m; + n0 = n; + diff0 = diff; + } + } + } + *param = TWSI_BAUD_RATE_PARAM(m0, n0); + + return (0); +} +#endif /* EXT_RESOURCES */ + /* * Only slave mode supported, disregard [old]addr */ @@ -251,24 +288,36 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_ { struct twsi_softc *sc; uint32_t param; - /* uint32_t val; */ +#ifdef EXT_RESOURCES + u_int busfreq; +#endif sc = device_get_softc(dev); - switch (speed) { - case IIC_SLOW: - case IIC_FAST: - param = sc->baud_rate[speed].param; - debugf(dev, "Using IIC_FAST mode with speed param=%x\n", param); - break; - case IIC_FASTEST: - case IIC_UNKNOWN: - default: - param = sc->baud_rate[IIC_FAST].param; - debugf(dev, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param); - break; +#ifdef EXT_RESOURCES + busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed); + + if (twsi_calc_baud_rate(sc, busfreq, ¶m) == -1) { +#endif + switch (speed) { + case IIC_SLOW: + case IIC_FAST: + param = sc->baud_rate[speed].param; + debugf(dev, "Using IIC_FAST mode with speed param=%x\n", param); + break; + case IIC_FASTEST: + case IIC_UNKNOWN: + default: + param = sc->baud_rate[IIC_FAST].param; + debugf(dev, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param); + break; + } +#ifdef EXT_RESOURCES } +#endif + debugf(dev, "Using clock param=%x\n", param); + mtx_lock(&sc->mutex); TWSI_WRITE(sc, sc->reg_soft_reset, 0x0); TWSI_WRITE(sc, sc->reg_baud_rate, param); @@ -521,6 +570,7 @@ twsi_intr(void *arg) break; case TWSI_STATUS_ADDR_R_ACK: + debugf(sc->dev, "Ack received after transmitting the address\n"); sc->recv_bytes = 0; TWSI_WRITE(sc, sc->reg_control, sc->control_val); From owner-svn-src-all@freebsd.org Tue Aug 6 11:26:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 580ADBFC74; Tue, 6 Aug 2019 11:26:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462slq1VXGz3wtX; Tue, 6 Aug 2019 11:26:31 +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 10C0C2B3D8; Tue, 6 Aug 2019 11:26:31 +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 x76BQUq2033067; Tue, 6 Aug 2019 11:26:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76BQUZ6033065; Tue, 6 Aug 2019 11:26:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908061126.x76BQUZ6033065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Aug 2019 11:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350627 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 350627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 11:26:31 -0000 Author: tuexen Date: Tue Aug 6 11:26:30 2019 New Revision: 350627 URL: https://svnweb.freebsd.org/changeset/base/350627 Log: Reference the RFC instead of the internet draft. MFC after: 1 week Sponsored by: Netflix, Inc. Modified: head/share/man/man4/cc_newreno.4 head/share/man/man4/mod_cc.4 Modified: head/share/man/man4/cc_newreno.4 ============================================================================== --- head/share/man/man4/cc_newreno.4 Tue Aug 6 10:29:19 2019 (r350626) +++ head/share/man/man4/cc_newreno.4 Tue Aug 6 11:26:30 2019 (r350627) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2018 +.Dd August 6, 2019 .Dt CC_NEWRENO 4 .Os .Sh NAME @@ -117,10 +117,7 @@ Default is 80. .%A "Grenville Armitage" .%A "Gorry Fairhurst" .%T "TCP Alternative Backoff with ECN (ABE)" -.%R "internet draft" -.%D "February 2018" -.%N "draft-ietf-tcpm-alternativebackoff-ecn" -.%O "work in progress" +.%O "RFC 8511" .Re .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants Modified: head/share/man/man4/mod_cc.4 ============================================================================== --- head/share/man/man4/mod_cc.4 Tue Aug 6 10:29:19 2019 (r350626) +++ head/share/man/man4/mod_cc.4 Tue Aug 6 11:26:30 2019 (r350627) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2018 +.Dd August 6, 2019 .Dt MOD_CC 4 .Os .Sh NAME @@ -84,7 +84,7 @@ one of the names listed by the .Va net.inet.tcp.cc.available MIB variable. .It Va abe -Enable support for draft-ietf-tcpm-alternativebackoff-ecn, +Enable support for RFC 8511, which alters the window decrease factor applied to the congestion window in response to an ECN congestion signal. Refer to individual congestion control man pages to determine if they implement From owner-svn-src-all@freebsd.org Tue Aug 6 12:19:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79D33C0F32; Tue, 6 Aug 2019 12:19:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462twc3Mptz3ynn; Tue, 6 Aug 2019 12:19:12 +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 6A09A2BCB2; Tue, 6 Aug 2019 12:19:12 +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 x76CJCXg062475; Tue, 6 Aug 2019 12:19:12 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76CJ9Mu062460; Tue, 6 Aug 2019 12:19:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908061219.x76CJ9Mu062460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 6 Aug 2019 12:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350629 - in stable/12/sys: arm/allwinner arm/allwinner/clkng conf X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner arm/allwinner/clkng conf X-SVN-Commit-Revision: 350629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 12:19:12 -0000 Author: manu Date: Tue Aug 6 12:19:09 2019 New Revision: 350629 URL: https://svnweb.freebsd.org/changeset/base/350629 Log: MFC r348179-r348182 r348179: allwinner: aw_ccu: Add some debug printfs (disabled by default) Also print information about setting frequency at boot under bootverbose r348180: arm: allwinner: clk: Add new clock aw_clk_frac Add a clock driver for clock that can either be used in integer mode with one N factor and one M divider or in fractional mode where the output frequency is chosen between two predifined output. r348181: arm: allwinner: clk: Use the new frac clock Some clocks used the NM type but this clock is for the ones with the formula "clk = clkin / n / m" and not "clk = clkin * n / m" Use the new frac clock for them. r348182: arm: allwinner: Remove frac mode from NM clk We have a correct clock type aw_clk_frac now for this. Added: stable/12/sys/arm/allwinner/clkng/aw_clk_frac.c - copied unchanged from r348182, head/sys/arm/allwinner/clkng/aw_clk_frac.c stable/12/sys/arm/allwinner/clkng/aw_clk_frac.h - copied unchanged from r348182, head/sys/arm/allwinner/clkng/aw_clk_frac.h Modified: stable/12/sys/arm/allwinner/clkng/aw_ccung.c stable/12/sys/arm/allwinner/clkng/aw_ccung.h stable/12/sys/arm/allwinner/clkng/aw_clk.h stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c stable/12/sys/arm/allwinner/clkng/aw_clk_nm.h stable/12/sys/arm/allwinner/clkng/ccu_a10.c stable/12/sys/arm/allwinner/clkng/ccu_a31.c stable/12/sys/arm/allwinner/clkng/ccu_a64.c stable/12/sys/arm/allwinner/clkng/ccu_h3.c stable/12/sys/arm/allwinner/files.allwinner stable/12/sys/conf/files.arm64 Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/aw_ccung.c Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/aw_ccung.c Tue Aug 6 12:19:09 2019 (r350629) @@ -62,6 +62,12 @@ __FBSDID("$FreeBSD$"); #include "clkdev_if.h" #include "hwreset_if.h" +#if 0 +#define dprintf(format, arg...) device_printf(dev, "%s: " format, __func__, arg) +#else +#define dprintf(format, arg...) +#endif + static struct resource_spec aw_ccung_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { -1, 0 } @@ -76,6 +82,7 @@ aw_ccung_write_4(device_t dev, bus_addr_t addr, uint32 struct aw_ccung_softc *sc; sc = device_get_softc(dev); + dprintf("offset=%lx write %x\n", addr, val); CCU_WRITE4(sc, addr, val); return (0); } @@ -88,6 +95,7 @@ aw_ccung_read_4(device_t dev, bus_addr_t addr, uint32_ sc = device_get_softc(dev); *val = CCU_READ4(sc, addr); + dprintf("offset=%lx Read %x\n", addr, *val); return (0); } @@ -99,6 +107,7 @@ aw_ccung_modify_4(device_t dev, bus_addr_t addr, uint3 sc = device_get_softc(dev); + dprintf("offset=%lx clr: %x set: %x\n", addr, clr, set); reg = CCU_READ4(sc, addr); reg &= ~clr; reg |= set; @@ -115,6 +124,7 @@ aw_ccung_reset_assert(device_t dev, intptr_t id, bool sc = device_get_softc(dev); + dprintf("%sassert reset id %ld\n", reset ? "" : "De", id); if (id >= sc->nresets || sc->resets[id].offset == 0) return (0); @@ -222,6 +232,11 @@ aw_ccung_init_clocks(struct aw_ccung_softc *sc) } } if (sc->clk_init[i].default_freq != 0) { + if (bootverbose) + device_printf(sc->dev, + "Setting freq %ju for %s\n", + sc->clk_init[i].default_freq, + sc->clk_init[i].name); error = clknode_set_freq(clknode, sc->clk_init[i].default_freq, 0 , 0); if (error != 0) { @@ -287,6 +302,9 @@ aw_ccung_attach(device_t dev) case AW_CLK_PREDIV_MUX: aw_clk_prediv_mux_register(sc->clkdom, sc->clks[i].clk.prediv_mux); + break; + case AW_CLK_FRAC: + aw_clk_frac_register(sc->clkdom, sc->clks[i].clk.frac); break; } } Modified: stable/12/sys/arm/allwinner/clkng/aw_ccung.h ============================================================================== --- stable/12/sys/arm/allwinner/clkng/aw_ccung.h Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/aw_ccung.h Tue Aug 6 12:19:09 2019 (r350629) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -46,6 +47,7 @@ enum aw_ccung_clk_type { AW_CLK_NKMP, AW_CLK_NM, AW_CLK_PREDIV_MUX, + AW_CLK_FRAC, }; struct aw_ccung_clk { @@ -57,6 +59,7 @@ struct aw_ccung_clk { struct aw_clk_nkmp_def *nkmp; struct aw_clk_nm_def *nm; struct aw_clk_prediv_mux_def *prediv_mux; + struct aw_clk_frac_def *frac; } clk; }; Modified: stable/12/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- stable/12/sys/arm/allwinner/clkng/aw_clk.h Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/aw_clk.h Tue Aug 6 12:19:09 2019 (r350629) @@ -64,7 +64,6 @@ struct aw_clk_init { #define AW_CLK_HAS_MUX 0x0004 #define AW_CLK_REPARENT 0x0008 #define AW_CLK_SCALE_CHANGE 0x0010 -#define AW_CLK_HAS_FRAC 0x0020 #define AW_CLK_HAS_UPDATE 0x0040 #define AW_CLK_HAS_PREDIV 0x0080 @@ -309,14 +308,13 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .flags = _flags | AW_CLK_HAS_UPDATE, \ } -#define NM_CLK(_clkname, _id, _name, _pnames, \ +#define FRAC_CLK(_clkname, _id, _name, _pnames, \ _offset, \ _nshift, _nwidth, _nvalue, _nflags, \ _mshift, _mwidth, _mvalue, _mflags, \ - _mux_shift, _mux_width, \ - _gate_shift, \ - _flags) \ - static struct aw_clk_nm_def _clkname = { \ + _gate_shift, _lock_shift,_lock_retries, \ + _flags, _freq0, _freq1, _mode_sel, _freq_sel) \ + static struct aw_clk_frac_def _clkname = { \ .clkdef = { \ .id = _id, \ .name = _name, \ @@ -328,23 +326,28 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .n.width = _nwidth, \ .n.value = _nvalue, \ .n.flags = _nflags, \ - .mux_shift = _mux_shift, \ .m.shift = _mshift, \ .m.width = _mwidth, \ .m.value = _mvalue, \ .m.flags = _mflags, \ - .mux_width = _mux_width, \ .gate_shift = _gate_shift, \ + .lock_shift = _lock_shift, \ + .lock_retries = _lock_retries, \ .flags = _flags, \ + .frac.freq0 = _freq0, \ + .frac.freq1 = _freq1, \ + .frac.mode_sel = _mode_sel, \ + .frac.freq_sel = _freq_sel, \ } -#define NM_CLK_WITH_FRAC(_clkname, _id, _name, _pnames, \ +#define NM_CLK(_clkname, _id, _name, _pnames, \ _offset, \ _nshift, _nwidth, _nvalue, _nflags, \ _mshift, _mwidth, _mvalue, _mflags, \ - _gate_shift, _lock_shift,_lock_retries, \ - _flags, _freq0, _freq1, _mode_sel, _freq_sel) \ - static struct aw_clk_nm_def _clkname = { \ + _mux_shift, _mux_width, \ + _gate_shift, \ + _flags) \ + static struct aw_clk_nm_def _clkname = { \ .clkdef = { \ .id = _id, \ .name = _name, \ @@ -356,18 +359,14 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .n.width = _nwidth, \ .n.value = _nvalue, \ .n.flags = _nflags, \ + .mux_shift = _mux_shift, \ .m.shift = _mshift, \ .m.width = _mwidth, \ .m.value = _mvalue, \ .m.flags = _mflags, \ + .mux_width = _mux_width, \ .gate_shift = _gate_shift, \ - .lock_shift = _lock_shift, \ - .lock_retries = _lock_retries, \ - .flags = _flags | AW_CLK_HAS_FRAC, \ - .frac.freq0 = _freq0, \ - .frac.freq1 = _freq1, \ - .frac.mode_sel = _mode_sel, \ - .frac.freq_sel = _freq_sel, \ + .flags = _flags, \ } #define PREDIV_CLK(_clkname, _id, _name, _pnames, \ Copied: stable/12/sys/arm/allwinner/clkng/aw_clk_frac.c (from r348182, head/sys/arm/allwinner/clkng/aw_clk_frac.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/allwinner/clkng/aw_clk_frac.c Tue Aug 6 12:19:09 2019 (r350629, copy of r348182, head/sys/arm/allwinner/clkng/aw_clk_frac.c) @@ -0,0 +1,338 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include + +#include "clkdev_if.h" + +/* + * clknode for clocks matching the formula : + * + * clk = (24Mhz * n) / m in integer mode + * clk = frac_out1 or frac_out2 in fractional mode + * + */ + +struct aw_clk_frac_sc { + uint32_t offset; + + struct aw_clk_factor m; + struct aw_clk_factor n; + struct aw_clk_frac frac; + + uint32_t mux_shift; + uint32_t mux_mask; + uint32_t gate_shift; + uint32_t lock_shift; + uint32_t lock_retries; + + uint32_t flags; +}; + +#define WRITE4(_clk, off, val) \ + CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) +#define READ4(_clk, off, val) \ + CLKDEV_READ_4(clknode_get_device(_clk), off, val) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) + +static int +aw_clk_frac_init(struct clknode *clk, device_t dev) +{ + struct aw_clk_frac_sc *sc; + uint32_t val, idx; + + sc = clknode_get_softc(clk); + + idx = 0; + if ((sc->flags & AW_CLK_HAS_MUX) != 0) { + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + idx = (val & sc->mux_mask) >> sc->mux_shift; + } + + clknode_init_parent_idx(clk, idx); + return (0); +} + +static int +aw_clk_frac_set_gate(struct clknode *clk, bool enable) +{ + struct aw_clk_frac_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & AW_CLK_HAS_GATE) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + if (enable) + val |= (1 << sc->gate_shift); + else + val &= ~(1 << sc->gate_shift); + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static int +aw_clk_frac_set_mux(struct clknode *clk, int index) +{ + struct aw_clk_frac_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & AW_CLK_HAS_MUX) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + val &= ~sc->mux_mask; + val |= index << sc->mux_shift; + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static uint64_t +aw_clk_frac_find_best(struct aw_clk_frac_sc *sc, uint64_t fparent, uint64_t *fout, + uint32_t *factor_n, uint32_t *factor_m) +{ + uint64_t cur, best; + uint32_t m, n, max_m, max_n, min_m, min_n; + + *factor_n = *factor_m = 0; + best = cur = 0; + + max_m = aw_clk_factor_get_max(&sc->m); + max_n = aw_clk_factor_get_max(&sc->n); + min_m = aw_clk_factor_get_min(&sc->m); + min_n = aw_clk_factor_get_min(&sc->n); + + for (n = min_n; n <= max_n; n++) { + for (m = min_m; m <= max_m; m++) { + cur = fparent * n / m; + if ((*fout - cur) < (*fout - best)) { + best = cur; + *factor_n = n; + *factor_m = m; + } + if (best == *fout) + return (best); + } + } + + return (best); +} + +static int +aw_clk_frac_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, + int flags, int *stop) +{ + struct aw_clk_frac_sc *sc; + uint64_t cur, best, best_frac; + uint32_t val, m, n, best_m, best_n; + int retry; + + sc = clknode_get_softc(clk); + + best = best_frac = cur = 0; + + if (*fout == sc->frac.freq0) + best = best_frac = sc->frac.freq0; + else if (*fout == sc->frac.freq1) + best = best_frac = sc->frac.freq1; + else + best = aw_clk_frac_find_best(sc, fparent, fout, + &best_n, &best_m); + + if ((flags & CLK_SET_DRYRUN) != 0) { + *fout = best; + *stop = 1; + return (0); + } + + if ((best < *fout) && + ((flags & CLK_SET_ROUND_DOWN) == 0)) { + *stop = 1; + return (ERANGE); + } + if ((best > *fout) && + ((flags & CLK_SET_ROUND_UP) == 0)) { + *stop = 1; + return (ERANGE); + } + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + /* Disable clock during freq changes */ + val &= ~(1 << sc->gate_shift); + WRITE4(clk, sc->offset, val); + + if (best_frac != 0) { + val &= ~sc->frac.mode_sel; + /* M should be 0 per the manual */ + val &= ~sc->m.mask; + if (best_frac == sc->frac.freq0) + val &= ~sc->frac.freq_sel; + else + val |= sc->frac.freq_sel; + } else { + val |= sc->frac.mode_sel; /* Select integer mode */ + n = aw_clk_factor_get_value(&sc->n, best_n); + m = aw_clk_factor_get_value(&sc->m, best_m); + val &= ~sc->n.mask; + val &= ~sc->m.mask; + val |= n << sc->n.shift; + val |= m << sc->m.shift; + } + + /* Write the clock changes */ + WRITE4(clk, sc->offset, val); + + /* Enable clock now that we've change it */ + val |= 1 << sc->gate_shift; + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + for (retry = 0; retry < sc->lock_retries; retry++) { + READ4(clk, sc->offset, &val); + if ((val & (1 << sc->lock_shift)) != 0) + break; + DELAY(1000); + } + + *fout = best; + *stop = 1; + + return (0); +} + +static int +aw_clk_frac_recalc(struct clknode *clk, uint64_t *freq) +{ + struct aw_clk_frac_sc *sc; + uint32_t val, m, n; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + if ((val & sc->frac.mode_sel) == 0) { + if (val & sc->frac.freq_sel) + *freq = sc->frac.freq1; + else + *freq = sc->frac.freq0; + } else { + m = aw_clk_get_factor(val, &sc->m); + n = aw_clk_get_factor(val, &sc->n); + + *freq = *freq * n / m; + } + + return (0); +} + +static clknode_method_t aw_frac_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, aw_clk_frac_init), + CLKNODEMETHOD(clknode_set_gate, aw_clk_frac_set_gate), + CLKNODEMETHOD(clknode_set_mux, aw_clk_frac_set_mux), + CLKNODEMETHOD(clknode_recalc_freq, aw_clk_frac_recalc), + CLKNODEMETHOD(clknode_set_freq, aw_clk_frac_set_freq), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(aw_frac_clknode, aw_frac_clknode_class, aw_frac_clknode_methods, + sizeof(struct aw_clk_frac_sc), clknode_class); + +int +aw_clk_frac_register(struct clkdom *clkdom, struct aw_clk_frac_def *clkdef) +{ + struct clknode *clk; + struct aw_clk_frac_sc *sc; + + clk = clknode_create(clkdom, &aw_frac_clknode_class, &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + + sc->offset = clkdef->offset; + + sc->m.shift = clkdef->m.shift; + sc->m.width = clkdef->m.width; + sc->m.mask = ((1 << sc->m.width) - 1) << sc->m.shift; + sc->m.value = clkdef->m.value; + sc->m.flags = clkdef->m.flags; + + sc->n.shift = clkdef->n.shift; + sc->n.width = clkdef->n.width; + sc->n.mask = ((1 << sc->n.width) - 1) << sc->n.shift; + sc->n.value = clkdef->n.value; + sc->n.flags = clkdef->n.flags; + + sc->frac.freq0 = clkdef->frac.freq0; + sc->frac.freq1 = clkdef->frac.freq1; + sc->frac.mode_sel = 1 << clkdef->frac.mode_sel; + sc->frac.freq_sel = 1 << clkdef->frac.freq_sel; + + sc->mux_shift = clkdef->mux_shift; + sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; + + sc->gate_shift = clkdef->gate_shift; + + sc->lock_shift = clkdef->lock_shift; + sc->lock_retries = clkdef->lock_retries; + + sc->flags = clkdef->flags; + + clknode_register(clkdom, clk); + + return (0); +} Copied: stable/12/sys/arm/allwinner/clkng/aw_clk_frac.h (from r348182, head/sys/arm/allwinner/clkng/aw_clk_frac.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/allwinner/clkng/aw_clk_frac.h Tue Aug 6 12:19:09 2019 (r350629, copy of r348182, head/sys/arm/allwinner/clkng/aw_clk_frac.h) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __AW_CLK_FRAC_H__ +#define __AW_CLK_FRAC_H__ + +#include + +struct aw_clk_frac_def { + struct clknode_init_def clkdef; + uint32_t offset; + + struct aw_clk_factor m; + struct aw_clk_factor n; + struct aw_clk_frac frac; + + uint32_t mux_shift; + uint32_t mux_width; + uint32_t gate_shift; + uint32_t lock_shift; + uint32_t lock_retries; + + uint32_t flags; +}; + +int aw_clk_frac_register(struct clkdom *clkdom, struct aw_clk_frac_def *clkdef); + +#endif /* __AW_CLK_FRAC_H__ */ Modified: stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/aw_clk_nm.c Tue Aug 6 12:19:09 2019 (r350629) @@ -53,7 +53,6 @@ struct aw_clk_nm_sc { struct aw_clk_factor m; struct aw_clk_factor n; struct aw_clk_factor prediv; - struct aw_clk_frac frac; uint32_t mux_shift; uint32_t mux_mask; @@ -182,13 +181,13 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare struct aw_clk_nm_sc *sc; struct clknode *p_clk; const char **p_names; - uint64_t cur, best, best_frac; + uint64_t cur, best; uint32_t val, m, n, best_m, best_n; int p_idx, best_parent, retry; sc = clknode_get_softc(clk); - best = best_frac = cur = 0; + best = cur = 0; best_parent = 0; if ((sc->flags & AW_CLK_REPARENT) != 0) { @@ -210,13 +209,8 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare p_clk = clknode_get_parent(clk); clknode_get_freq(p_clk, &fparent); } else { - if (sc->flags & AW_CLK_HAS_FRAC && - (*fout == sc->frac.freq0 || *fout == sc->frac.freq1)) - best = best_frac = *fout; - - if (best == 0) - best = aw_clk_nm_find_best(sc, fparent, fout, - &best_n, &best_m); + best = aw_clk_nm_find_best(sc, fparent, fout, + &best_n, &best_m); } if ((flags & CLK_SET_DRYRUN) != 0) { @@ -242,20 +236,12 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare DEVICE_LOCK(clk); READ4(clk, sc->offset, &val); - if (best_frac != 0) { - val &= ~sc->frac.mode_sel; - if (best_frac == sc->frac.freq0) - val &= ~sc->frac.freq_sel; - else - val |= sc->frac.freq_sel; - } else { - n = aw_clk_factor_get_value(&sc->n, best_n); - m = aw_clk_factor_get_value(&sc->m, best_m); - val &= ~sc->n.mask; - val &= ~sc->m.mask; - val |= n << sc->n.shift; - val |= m << sc->m.shift; - } + n = aw_clk_factor_get_value(&sc->n, best_n); + m = aw_clk_factor_get_value(&sc->m, best_m); + val &= ~sc->n.mask; + val &= ~sc->m.mask; + val |= n << sc->n.shift; + val |= m << sc->m.shift; WRITE4(clk, sc->offset, val); DEVICE_UNLOCK(clk); @@ -287,25 +273,14 @@ aw_clk_nm_recalc(struct clknode *clk, uint64_t *freq) READ4(clk, sc->offset, &val); DEVICE_UNLOCK(clk); - if (sc->flags & AW_CLK_HAS_FRAC && ((val & sc->frac.mode_sel) == 0)) { - if (val & sc->frac.freq_sel) - *freq = sc->frac.freq1; - else - *freq = sc->frac.freq0; - } else { - m = aw_clk_get_factor(val, &sc->m); - n = aw_clk_get_factor(val, &sc->n); - if (sc->flags & AW_CLK_HAS_PREDIV) - prediv = aw_clk_get_factor(val, &sc->prediv); - else - prediv = 1; + m = aw_clk_get_factor(val, &sc->m); + n = aw_clk_get_factor(val, &sc->n); + if (sc->flags & AW_CLK_HAS_PREDIV) + prediv = aw_clk_get_factor(val, &sc->prediv); + else + prediv = 1; - /* For FRAC NM the formula is freq_parent * n / m */ - if (sc->flags & AW_CLK_HAS_FRAC) - *freq = *freq * n / m; - else - *freq = *freq / prediv / n / m; - } + *freq = *freq / prediv / n / m; return (0); } @@ -360,11 +335,6 @@ aw_clk_nm_register(struct clkdom *clkdom, struct aw_cl else sc->prediv.cond_mask = clkdef->prediv.cond_mask; sc->prediv.cond_value = clkdef->prediv.cond_value; - - sc->frac.freq0 = clkdef->frac.freq0; - sc->frac.freq1 = clkdef->frac.freq1; - sc->frac.mode_sel = 1 << clkdef->frac.mode_sel; - sc->frac.freq_sel = 1 << clkdef->frac.freq_sel; sc->mux_shift = clkdef->mux_shift; sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; Modified: stable/12/sys/arm/allwinner/clkng/aw_clk_nm.h ============================================================================== --- stable/12/sys/arm/allwinner/clkng/aw_clk_nm.h Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/aw_clk_nm.h Tue Aug 6 12:19:09 2019 (r350629) @@ -38,7 +38,6 @@ struct aw_clk_nm_def { struct aw_clk_factor m; struct aw_clk_factor n; struct aw_clk_factor prediv; - struct aw_clk_frac frac; uint32_t mux_shift; uint32_t mux_width; Modified: stable/12/sys/arm/allwinner/clkng/ccu_a10.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_a10.c Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/ccu_a10.c Tue Aug 6 12:19:09 2019 (r350629) @@ -212,7 +212,7 @@ NKMP_CLK(pll_core_clk, 0, 0, /* lock */ AW_CLK_HAS_GATE); /* flags */ -NM_CLK_WITH_FRAC(pll_video0_clk, +FRAC_CLK(pll_video0_clk, CLK_PLL_VIDEO0, /* id */ "pll_video0", pll_parents, /* name, parents */ 0x10, /* offset */ @@ -231,7 +231,7 @@ FIXED_CLK(pll_video0_2x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_video1_clk, +FRAC_CLK(pll_video1_clk, CLK_PLL_VIDEO1, /* id */ "pll_video1", pll_parents, /* name, parents */ 0x30, /* offset */ @@ -537,8 +537,8 @@ static struct aw_ccung_clk a10_ccu_clks[] = { { .type = AW_CLK_NM, .clk.nm = &ahb_clk}, { .type = AW_CLK_NM, .clk.nm = &apb0_clk}, { .type = AW_CLK_NM, .clk.nm = &apb1_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video0_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video1_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video0_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video1_clk}, { .type = AW_CLK_NM, .clk.nm = &nand_clk}, { .type = AW_CLK_NM, .clk.nm = &ms_clk}, { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, Modified: stable/12/sys/arm/allwinner/clkng/ccu_a31.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_a31.c Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/ccu_a31.c Tue Aug 6 12:19:09 2019 (r350629) @@ -293,7 +293,7 @@ FIXED_CLK(pll_audio_8x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_video0_clk, +FRAC_CLK(pll_video0_clk, CLK_PLL_VIDEO0, /* id */ "pll_video0", pll_parents, /* name, parents */ 0x10, /* offset */ @@ -314,7 +314,7 @@ FIXED_CLK(pll_video0_2x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_ve_clk, +FRAC_CLK(pll_ve_clk, CLK_PLL_VE, /* id */ "pll_ve", pll_parents, /* name, parents */ 0x18, /* offset */ @@ -360,7 +360,7 @@ FIXED_CLK(pll_periph_2x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_video1_clk, +FRAC_CLK(pll_video1_clk, CLK_PLL_VIDEO1, /* id */ "pll_video1", pll_parents, /* name, parents */ 0x30, /* offset */ @@ -381,7 +381,7 @@ FIXED_CLK(pll_video1_2x_clk, 1, /* div */ 0); /* flags */ -NM_CLK_WITH_FRAC(pll_gpu_clk, +FRAC_CLK(pll_gpu_clk, CLK_PLL_GPU, /* id */ "pll_gpu", pll_parents, /* name, parents */ 0x38, /* offset */ @@ -405,7 +405,7 @@ NKMP_CLK(pll_mipi_clk, 28, 1000, /* lock */ AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ -NM_CLK_WITH_FRAC(pll9_clk, +FRAC_CLK(pll9_clk, CLK_PLL9, /* id */ "pll9", pll_parents, /* name, parents */ 0x44, /* offset */ @@ -416,7 +416,7 @@ NM_CLK_WITH_FRAC(pll9_clk, 270000000, 297000000, /* freq0, freq1 */ 24, 25); /* mode sel, freq sel */ -NM_CLK_WITH_FRAC(pll10_clk, +FRAC_CLK(pll10_clk, CLK_PLL10, /* id */ "pll10", pll_parents, /* name, parents */ 0x48, /* offset */ @@ -869,12 +869,12 @@ static struct aw_ccung_clk a31_ccu_clks[] = { { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_mipi_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video0_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_ve_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video1_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_gpu_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll9_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll10_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video0_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_ve_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video1_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_gpu_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll9_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll10_clk}, { .type = AW_CLK_NM, .clk.nm = &apb2_clk}, { .type = AW_CLK_NM, .clk.nm = &nand0_clk}, { .type = AW_CLK_NM, .clk.nm = &nand1_clk}, Modified: stable/12/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_a64.c Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/ccu_a64.c Tue Aug 6 12:19:09 2019 (r350629) @@ -279,7 +279,7 @@ FIXED_CLK(pll_audio_8x_clk, 0); /* flags */ static const char *pll_video0_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_video0_clk, +FRAC_CLK(pll_video0_clk, CLK_PLL_VIDEO0, /* id */ "pll_video0", pll_video0_parents, /* name, parents */ 0x10, /* offset */ @@ -300,7 +300,7 @@ FIXED_CLK(pll_video0_2x_clk, 0); /* flags */ static const char *pll_ve_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_ve_clk, +FRAC_CLK(pll_ve_clk, CLK_PLL_VE, /* id */ "pll_ve", pll_ve_parents, /* name, parents */ 0x18, /* offset */ @@ -370,7 +370,7 @@ FIXED_CLK(pll_periph1_clk, 0); /* flags */ static const char *pll_video1_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_video1_clk, +FRAC_CLK(pll_video1_clk, CLK_PLL_VIDEO1, /* id */ "pll_video1", pll_video1_parents, /* name, parents */ 0x30, /* offset */ @@ -382,7 +382,7 @@ NM_CLK_WITH_FRAC(pll_video1_clk, 24, 25); /* mode sel, freq sel */ static const char *pll_gpu_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_gpu_clk, +FRAC_CLK(pll_gpu_clk, CLK_PLL_GPU, /* id */ "pll_gpu", pll_gpu_parents, /* name, parents */ 0x38, /* offset */ @@ -396,7 +396,7 @@ NM_CLK_WITH_FRAC(pll_gpu_clk, /* PLL MIPI is missing */ static const char *pll_hsic_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_hsic_clk, +FRAC_CLK(pll_hsic_clk, CLK_PLL_HSIC, /* id */ "pll_hsic", pll_hsic_parents, /* name, parents */ 0x44, /* offset */ @@ -408,7 +408,7 @@ NM_CLK_WITH_FRAC(pll_hsic_clk, 24, 25); /* mode sel, freq sel */ static const char *pll_de_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_de_clk, +FRAC_CLK(pll_de_clk, CLK_PLL_DE, /* id */ "pll_de", pll_de_parents, /* name, parents */ 0x48, /* offset */ @@ -723,16 +723,18 @@ NM_CLK(gpu_clk, static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_NKMP, .clk.nkmp = &pll_cpux_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_audio_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video0_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_ve_clk}, + { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr0_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph0_2x_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph1_2x_clk}, - { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr0_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video1_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_gpu_clk}, + /* PLL_MIPI */ + { .type = AW_CLK_FRAC, .clk.frac = &pll_hsic_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_de_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr1_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video0_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video1_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_ve_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_gpu_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_de_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_hsic_clk}, + { .type = AW_CLK_NM, .clk.nm = &apb2_clk}, { .type = AW_CLK_NM, .clk.nm = &nand_clk}, { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, Modified: stable/12/sys/arm/allwinner/clkng/ccu_h3.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_h3.c Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/clkng/ccu_h3.c Tue Aug 6 12:19:09 2019 (r350629) @@ -297,7 +297,7 @@ FIXED_CLK(pll_audio_8x_clk, 0); /* flags */ static const char *pll_video_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_video_clk, +FRAC_CLK(pll_video_clk, CLK_PLL_VIDEO, /* id */ "pll_video", pll_video_parents, /* name, parents */ 0x10, /* offset */ @@ -309,7 +309,7 @@ NM_CLK_WITH_FRAC(pll_video_clk, 24, 25); /* mode sel, freq sel */ static const char *pll_ve_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_ve_clk, +FRAC_CLK(pll_ve_clk, CLK_PLL_VE, /* id */ "pll_ve", pll_ve_parents, /* name, parents */ 0x18, /* offset */ @@ -357,7 +357,7 @@ FIXED_CLK(pll_periph0_2x_clk, 0); /* flags */ static const char *pll_gpu_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_gpu_clk, +FRAC_CLK(pll_gpu_clk, CLK_PLL_GPU, /* id */ "pll_gpu", pll_gpu_parents, /* name, parents */ 0x38, /* offset */ @@ -382,7 +382,7 @@ NKMP_CLK(pll_periph1_clk, AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK); /* flags */ static const char *pll_de_parents[] = {"osc24M"}; -NM_CLK_WITH_FRAC(pll_de_clk, +FRAC_CLK(pll_de_clk, CLK_PLL_DE, /* id */ "pll_de", pll_de_parents, /* name, parents */ 0x48, /* offset */ @@ -684,10 +684,10 @@ static struct aw_ccung_clk h3_ccu_clks[] = { { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph0_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_periph1_clk}, { .type = AW_CLK_NKMP, .clk.nkmp = &pll_ddr_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_video_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_ve_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_gpu_clk}, - { .type = AW_CLK_NM, .clk.nm = &pll_de_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_video_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_ve_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_gpu_clk}, + { .type = AW_CLK_FRAC, .clk.frac = &pll_de_clk}, { .type = AW_CLK_NM, .clk.nm = &apb2_clk}, { .type = AW_CLK_NM, .clk.nm = &nand_clk}, { .type = AW_CLK_NM, .clk.nm = &mmc0_clk}, Modified: stable/12/sys/arm/allwinner/files.allwinner ============================================================================== --- stable/12/sys/arm/allwinner/files.allwinner Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/arm/allwinner/files.allwinner Tue Aug 6 12:19:09 2019 (r350629) @@ -36,6 +36,7 @@ arm/allwinner/aw_ccu.c standard arm/allwinner/aw_gmacclk.c standard arm/allwinner/clkng/aw_ccung.c standard +arm/allwinner/clkng/aw_clk_frac.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard arm/allwinner/clkng/aw_clk_nm.c standard arm/allwinner/clkng/aw_clk_prediv_mux.c standard Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Tue Aug 6 12:12:29 2019 (r350628) +++ stable/12/sys/conf/files.arm64 Tue Aug 6 12:19:09 2019 (r350629) @@ -49,6 +49,7 @@ arm/allwinner/if_awg.c optional awg ext_resources sys # Allwinner clock driver arm/allwinner/clkng/aw_ccung.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_frac.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nkmp.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt From owner-svn-src-all@freebsd.org Tue Aug 6 13:09:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 783AFC1C75; Tue, 6 Aug 2019 13:09:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462w2T2ZYSz41f4; Tue, 6 Aug 2019 13:09: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 3A1A82C597; Tue, 6 Aug 2019 13:09: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 x76D9LmH091858; Tue, 6 Aug 2019 13:09:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76D9LX4091857; Tue, 6 Aug 2019 13:09:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201908061309.x76D9LX4091857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 6 Aug 2019 13:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350630 - head/sys/dev/oce X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/oce X-SVN-Commit-Revision: 350630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 13:09:21 -0000 Author: kevans Date: Tue Aug 6 13:09:20 2019 New Revision: 350630 URL: https://svnweb.freebsd.org/changeset/base/350630 Log: oce(4): potential out of bounds access before vector validation Submitted by: Augustin Cavalier Obtained from: Haiku (ec2b89264cfc63e05e611cce82cc449197403aa4) MFC after: 3 days Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Tue Aug 6 12:19:09 2019 (r350629) +++ head/sys/dev/oce/oce_if.c Tue Aug 6 13:09:20 2019 (r350630) @@ -836,11 +836,13 @@ oce_fast_isr(void *arg) static int oce_alloc_intr(POCE_SOFTC sc, int vector, void (*isr) (void *arg, int pending)) { - POCE_INTR_INFO ii = &sc->intrs[vector]; + POCE_INTR_INFO ii; int rc = 0, rr; if (vector >= OCE_MAX_EQ) return (EINVAL); + + ii = &sc->intrs[vector]; /* Set the resource id for the interrupt. * MSIx is vector + 1 for the resource id, From owner-svn-src-all@freebsd.org Tue Aug 6 12:31:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C6CEC1586; Tue, 6 Aug 2019 12:31:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 462vBy4Pvjz40Wv; Tue, 6 Aug 2019 12:31:38 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1huych-000NlR-6o; Tue, 06 Aug 2019 15:31:27 +0300 Date: Tue, 6 Aug 2019 15:31:27 +0300 From: Slawa Olhovchenkov To: Baptiste Daroussin 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: r350402 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common Message-ID: <20190806123127.GM47119@zxy.spb.ru> References: <201907290823.x6T8NFAu064976@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201907290823.x6T8NFAu064976@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 462vBy4Pvjz40Wv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of slw@zxy.spb.ru has no SPF policy when checking 195.70.199.98) smtp.mailfrom=slw@zxy.spb.ru X-Spamd-Result: default: False [0.93 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[zxy.spb.ru]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.33)[0.334,0]; IP_SCORE(0.00)[country: RU(0.01)]; NEURAL_HAM_SHORT(-0.46)[-0.461,0]; NEURAL_SPAM_LONG(0.16)[0.161,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5495, ipnet:195.70.192.0/19, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Aug 2019 12:31:40 -0000 On Mon, Jul 29, 2019 at 08:23:15AM +0000, Baptiste Daroussin wrote: still broken: # ls -l /poudriere/ports/default ls: /poudriere/ports/default: No such file or directory # zfs list NAME USED AVAIL REFER MOUNTPOINT DB 256G 643G 96K /DB DB/var 255G 643G 96K /DB/var DB/var/db 255G 643G 96K /DB/var/db DB/var/db/mysql 255G 643G 255G /var/db/mysql DB/var/db/mysql/MyISAM 96K 643G 96K /var/db/mysql/MyISAM DB/var/db/mysql/innodb-logs 128M 643G 128M /var/db/mysql/innodb-logs zroot 2.94T 551G 112K /ZROOT zroot/ROOT 352M 551G 352M / zroot/home 144K 551G 144K legacy zroot/poudriere 5.41G 551G 128K /poudriere zroot/poudriere/data 608M 551G 608M /poudriere/data zroot/poudriere/jails 2.71G 551G 128K /poudriere/jails zroot/poudriere/jails/10amd64 2.71G 551G 2.71G /poudriere/jails/10amd64 zroot/poudriere/ports 2.10G 551G 96K /poudriere/ports zroot/poudriere/ports/default 2.10G 551G 2.10G /poudriere/ports/default zroot/tmp 6.94G 551G 6.94G /tmp zroot/usr 630G 551G 57.0G /usr zroot/usr/local 543G 551G 543G /usr/local zroot/usr/obj 19.2G 551G 19.2G /usr/obj zroot/usr/ports 4.80G 551G 1.07G /usr/ports zroot/usr/ports/distfiles 3.72G 551G 3.72G /usr/ports/distfiles zroot/usr/ports/packages 7.04M 551G 7.04M /usr/ports/packages zroot/usr/src 5.51G 551G 5.51G /usr/src zroot/var 345G 551G 1.10G /var zroot/var/crash 148K 551G 148K /var/crash zroot/var/db 58.4G 551G 3.92G /var/db zroot/var/db/mysql 54.4G 551G 54.2G /var/db/mysql zroot/var/db/mysql/MyISAM 144K 551G 144K /var/db/mysql/MyISAM zroot/var/db/mysql/innodb-logs 128M 551G 128M /var/db/mysql/innodb-logs zroot/var/db/pkg 69.6M 551G 69.6M /var/db/pkg zroot/var/empty 144K 551G 144K /var/empty zroot/var/log 248G 551G 248G /var/log zroot/var/mail 148K 551G 148K /var/mail zroot/var/run 444K 551G 444K /var/run zroot/var/spool 37.3G 551G 37.3G /var/spool zroot/var/tmp 548K 551G 548K /var/tmp zroot/www 1.98T 551G 160K /www zroot/www/dev0 1.59G 551G 1.59G /www/dev0 zroot/www/dev1 1.48G 551G 1.48G /www/dev1 zroot/www/dev2 1.48G 551G 1.48G /www/dev2 zroot/www/dev3 1.59G 551G 1.59G /www/dev3 zroot/www/dev4 1.49G 551G 1.49G /www/dev4 zroot/www/dev5 1.47G 551G 1.47G /www/dev5 zroot/www/komandirovka 186G 551G 30.9G /www/komandirovka zroot/www/komandirovka_old 1.79T 551G 1.79T /www/komandirovka_old > Author: bapt > Date: Mon Jul 29 08:23:15 2019 > New Revision: 350402 > URL: https://svnweb.freebsd.org/changeset/base/350402 > > Log: > MFC r350358: > > Fix a bug introduced with parallel mounting of zfs > > Incorporate a fix from zol: > https://github.com/zfsonlinux/zfs/commit/ab5036df1ccbe1b18c1ce6160b5829e8039d94ce > > commit log from upstream: > Fix race in parallel mount's thread dispatching algorithm > > Strategy of parallel mount is as follows. > > 1) Initial thread dispatching is to select sets of mount points that > don't have dependencies on other sets, hence threads can/should run > lock-less and shouldn't race with other threads for other sets. Each > thread dispatched corresponds to top level directory which may or may > not have datasets to be mounted on sub directories. > > 2) Subsequent recursive thread dispatching for each thread from 1) > is to mount datasets for each set of mount points. The mount points > within each set have dependencies (i.e. child directories), so child > directories are processed only after parent directory completes. > > The problem is that the initial thread dispatching in > zfs_foreach_mountpoint() can be multi-threaded when it needs to be > single-threaded, and this puts threads under race condition. This race > appeared as mount/unmount issues on ZoL for ZoL having different > timing regarding mount(2) execution due to fork(2)/exec(2) of mount(8). > `zfs unmount -a` which expects proper mount order can't unmount if the > mounts were reordered by the race condition. > > There are currently two known patterns of input list `handles` in > `zfs_foreach_mountpoint(..,handles,..)` which cause the race condition. > > 1) #8833 case where input is `/a /a /a/b` after sorting. > The problem is that libzfs_path_contains() can't correctly handle an > input list with two same top level directories. > There is a race between two POSIX threads A and B, > * ThreadA for "/a" for test1 and "/a/b" > * ThreadB for "/a" for test0/a > and in case of #8833, ThreadA won the race. Two threads were created > because "/a" wasn't considered as `"/a" contains "/a"`. > > 2) #8450 case where input is `/ /var/data /var/data/test` after sorting. > The problem is that libzfs_path_contains() can't correctly handle an > input list containing "/". > There is a race between two POSIX threads A and B, > * ThreadA for "/" and "/var/data/test" > * ThreadB for "/var/data" > and in case of #8450, ThreadA won the race. Two threads were created > because "/var/data" wasn't considered as `"/" contains "/var/data"`. > In other words, if there is (at least one) "/" in the input list, > the initial thread dispatching must be single-threaded since every > directory is a child of "/", meaning they all directly or indirectly > depend on "/". > > In both cases, the first non_descendant_idx() call fails to correctly > determine "path1-contains-path2", and as a result the initial thread > dispatching creates another thread when it needs to be single-threaded. > Fix a conditional in libzfs_path_contains() to consider above two. > > Reviewed-by: Brian Behlendorf > Reviewed by: Sebastien Roy > Signed-off-by: Tomohiro Kusumi > > PR: 237517, 237397, 239243 > Submitted by: Matthew D. Fuller (by email) > > Modified: > stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c > ============================================================================== > --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Mon Jul 29 08:14:35 2019 (r350401) > +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c Mon Jul 29 08:23:15 2019 (r350402) > @@ -1281,12 +1281,14 @@ mountpoint_cmp(const void *arga, const void *argb) > } > > /* > - * Reutrn true if path2 is a child of path1 > + * Return true if path2 is a child of path1 or path2 equals path1 or > + * path1 is "/" (path2 is always a child of "/"). > */ > static boolean_t > libzfs_path_contains(const char *path1, const char *path2) > { > - return (strstr(path2, path1) == path2 && path2[strlen(path1)] == '/'); > + return (strcmp(path1, path2) == 0 || strcmp(path1, "/") == 0 || > + (strstr(path2, path1) == path2 && path2[strlen(path1)] == '/')); > } > > > _______________________________________________ > 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" From owner-svn-src-all@freebsd.org Tue Aug 6 16:12:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2327C4CAB; Tue, 6 Aug 2019 16:12:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4630635Dn8z49xC; Tue, 6 Aug 2019 16:12:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 954312E81D; Tue, 6 Aug 2019 16:12:43 +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 x76GChBE007363; Tue, 6 Aug 2019 16:12:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76GChOd007362; Tue, 6 Aug 2019 16:12:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908061612.x76GChOd007362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 6 Aug 2019 16:12: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: r350638 - stable/11/contrib/bsnmp/lib X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/bsnmp/lib X-SVN-Commit-Revision: 350638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 16:12:43 -0000 Author: emaste Date: Tue Aug 6 16:12:43 2019 New Revision: 350638 URL: https://svnweb.freebsd.org/changeset/base/350638 Log: MFC r350635: bsnmp: add asn1 message length validation admbugs: 780 Submitted by: Guido Vranken, bz Reported by: Guido Vranken Approved by: so Security: CVE-2019-5610 Modified: stable/11/contrib/bsnmp/lib/asn1.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/lib/asn1.c ============================================================================== --- stable/11/contrib/bsnmp/lib/asn1.c Tue Aug 6 16:11:16 2019 (r350637) +++ stable/11/contrib/bsnmp/lib/asn1.c Tue Aug 6 16:12:43 2019 (r350638) @@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le *len = *b->asn_cptr++; b->asn_len--; } + if (*len > b->asn_len) { + asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len); + return (ASN_ERR_EOBUF); + } + return (ASN_ERR_OK); } From owner-svn-src-all@freebsd.org Tue Aug 6 14:38:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23F7DC323A; Tue, 6 Aug 2019 14:38:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462y1504xhz459M; Tue, 6 Aug 2019 14:38:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D94702D615; Tue, 6 Aug 2019 14:38:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76EcGQe045637; Tue, 6 Aug 2019 14:38:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76EcGeK045636; Tue, 6 Aug 2019 14:38:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908061438.x76EcGeK045636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Aug 2019 14:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350632 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 350632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 14:38:17 -0000 Author: markj Date: Tue Aug 6 14:38:16 2019 New Revision: 350632 URL: https://svnweb.freebsd.org/changeset/base/350632 Log: MFC r350514: Add an MLINK for daemonfd(3). Modified: stable/12/lib/libc/gen/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/Makefile.inc ============================================================================== --- stable/12/lib/libc/gen/Makefile.inc Tue Aug 6 14:37:57 2019 (r350631) +++ stable/12/lib/libc/gen/Makefile.inc Tue Aug 6 14:38:16 2019 (r350632) @@ -324,6 +324,7 @@ MLINKS+=arc4random.3 arc4random_buf.3 \ arc4random.3 arc4random_uniform.3 MLINKS+=auxv.3 elf_aux_info.3 MLINKS+=ctermid.3 ctermid_r.3 +MLINKS+=daemon.3 daemonfd.3 MLINKS+=devname.3 devname_r.3 MLINKS+=devname.3 fdevname.3 MLINKS+=devname.3 fdevname_r.3 From owner-svn-src-all@freebsd.org Tue Aug 6 14:38:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 941BFC3247; Tue, 6 Aug 2019 14:38:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462y1d3Shvz45FX; Tue, 6 Aug 2019 14:38: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 542C22D617; Tue, 6 Aug 2019 14:38:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76Ecjl4045707; Tue, 6 Aug 2019 14:38:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76EcjcB045705; Tue, 6 Aug 2019 14:38:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908061438.x76EcjcB045705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Aug 2019 14:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350633 - stable/12/contrib/elftoolchain/elfcopy X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 350633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 14:38:45 -0000 Author: markj Date: Tue Aug 6 14:38:44 2019 New Revision: 350633 URL: https://svnweb.freebsd.org/changeset/base/350633 Log: MFC r350432: Merge r3778 and r3779 from ELFToolchain. Modified: stable/12/contrib/elftoolchain/elfcopy/main.c stable/12/contrib/elftoolchain/elfcopy/strip.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/main.c Tue Aug 6 14:38:16 2019 (r350632) +++ stable/12/contrib/elftoolchain/elfcopy/main.c Tue Aug 6 14:38:44 2019 (r350633) @@ -1187,6 +1187,12 @@ strip_main(struct elfcopy *ecp, int argc, char **argv) ecp->strip = STRIP_ALL; if (optind == argc) strip_usage(); + /* + * Only accept a single input file if an output file had been + * specified. + */ + if (outfile != NULL && argc != (optind + 1)) + strip_usage(); for (i = optind; i < argc; i++) create_file(ecp, argv[i], outfile); Modified: stable/12/contrib/elftoolchain/elfcopy/strip.1 ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/strip.1 Tue Aug 6 14:38:16 2019 (r350632) +++ stable/12/contrib/elftoolchain/elfcopy/strip.1 Tue Aug 6 14:38:44 2019 (r350633) @@ -23,7 +23,7 @@ .\" .\" $Id: strip.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" -.Dd September 17, 2011 +.Dd July 27, 2019 .Dt STRIP 1 .Os .Sh NAME @@ -51,8 +51,16 @@ .Sh DESCRIPTION The .Nm -utility is used to discard information from ELF objects. +utility is used to discard information from the ELF objects +specified by the arguments +.Ar . .Pp +If an explicit output file name is not specified using the +.Fl o +option, the +.Nm +utility will modify its input arguments in-place. +.Pp The .Nm utility supports the following options: @@ -65,8 +73,9 @@ Print a help message and exit. Remove all content except that which would be used for debugging. .It Fl o Ar outputfile | Fl -output-file= Ns Ar outputfile Write the stripped object to file -.Ar outputfile . -The default behaviour is to modify objects in place. +.Ar outputfile +instead of modifying the input in-place. +Only a single input object should be specified if this option is used. .It Fl p | Fl -preserve-dates Preserve the object's access and modification times. .It Fl s | Fl -strip-all From owner-svn-src-all@freebsd.org Tue Aug 6 14:39:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CA78C325E; Tue, 6 Aug 2019 14:39:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462y1z3dnTz45L0; Tue, 6 Aug 2019 14:39:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E7362D618; Tue, 6 Aug 2019 14:39:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76Ed3an045775; Tue, 6 Aug 2019 14:39:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76Ed3ui045774; Tue, 6 Aug 2019 14:39:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908061439.x76Ed3ui045774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Aug 2019 14:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350634 - stable/12/usr.bin/bzip2recover X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/bzip2recover X-SVN-Commit-Revision: 350634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 14:39:03 -0000 Author: markj Date: Tue Aug 6 14:39:02 2019 New Revision: 350634 URL: https://svnweb.freebsd.org/changeset/base/350634 Log: MFC r350544: Add bzip2recover.1. Modified: stable/12/usr.bin/bzip2recover/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/bzip2recover/Makefile ============================================================================== --- stable/12/usr.bin/bzip2recover/Makefile Tue Aug 6 14:38:44 2019 (r350633) +++ stable/12/usr.bin/bzip2recover/Makefile Tue Aug 6 14:39:02 2019 (r350634) @@ -6,6 +6,8 @@ BZ2DIR= ${SRCTOP}/contrib/bzip2 PROG= bzip2recover MAN= +MLINKS+=bzip2.1 bzip2recover.1 + NO_WMISSING_VARIABLE_DECLARATIONS= .include From owner-svn-src-all@freebsd.org Tue Aug 6 14:37:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45783C3231; Tue, 6 Aug 2019 14:37:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462y0k131Sz4559; Tue, 6 Aug 2019 14:37:58 +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 058352D614; Tue, 6 Aug 2019 14:37:58 +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 x76EbvR1045572; Tue, 6 Aug 2019 14:37:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76EbvH7045571; Tue, 6 Aug 2019 14:37:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908061437.x76EbvH7045571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Aug 2019 14:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350631 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 350631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 14:37:58 -0000 Author: markj Date: Tue Aug 6 14:37:57 2019 New Revision: 350631 URL: https://svnweb.freebsd.org/changeset/base/350631 Log: MFC r350513: Fix formatting. Modified: stable/12/lib/libc/gen/daemon.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/daemon.3 ============================================================================== --- stable/12/lib/libc/gen/daemon.3 Tue Aug 6 13:09:20 2019 (r350630) +++ stable/12/lib/libc/gen/daemon.3 Tue Aug 6 14:37:57 2019 (r350631) @@ -93,7 +93,7 @@ function may fail and set .Va errno for any of the errors specified for the library functions .Xr fork 2 -.Xr open 2, +.Xr open 2 , and .Xr setsid 2 . .Sh SEE ALSO From owner-svn-src-all@freebsd.org Tue Aug 6 16:53:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 917E3C56C6; Tue, 6 Aug 2019 16:53:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631123MGLz4CTs; Tue, 6 Aug 2019 16:53:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 547D02EF38; Tue, 6 Aug 2019 16:53:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76GrQ38031355; Tue, 6 Aug 2019 16:53:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76GrP7k031353; Tue, 6 Aug 2019 16:53:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908061653.x76GrP7k031353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 6 Aug 2019 16:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350639 - 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: 350639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 16:53:26 -0000 Author: kib Date: Tue Aug 6 16:53:25 2019 New Revision: 350639 URL: https://svnweb.freebsd.org/changeset/base/350639 Log: amd64: prevents speculations over swapgs reload of %gs base. Such speculations could use user-controlled %gs base, esp. since FreeBSD supports WRGSBASE instructions. Place LFENCEs on entry for each basic block after the test for previous kernel/user mode on the kernel entry, which prevents the speculation. Code accesses %gs-based PCPU before any serialization instructions are executed, like %cr3 reload for KPTI. With pti disabled, on haswell i7-4770S machine, "syscall_timings getppid" shows when no lfence is added to syscall path: test loop time iterations periteration getppid 0 1.040918865 4643611 0.000000224 getppid 1 1.004985962 4481816 0.000000224 getppid 2 1.005196483 4482363 0.000000224 with lfence: getppid 0 1.043701091 4554779 0.000000229 getppid 1 1.016930328 4438094 0.000000229 getppid 2 1.023223117 4466640 0.000000229 and ministat reports 'No difference proven at 95.0% confidence.' Security: CVE-2019-1125 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/include/asmacros.h Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Tue Aug 6 16:12:43 2019 (r350638) +++ head/sys/amd64/amd64/exception.S Tue Aug 6 16:53:25 2019 (r350639) @@ -129,6 +129,7 @@ X\l: testb $SEL_RPL_MASK,TF_CS(%rsp) jz alltraps_noen_k swapgs + lfence jmp alltraps_noen_u .endm @@ -163,6 +164,7 @@ X\l: testb $SEL_RPL_MASK,TF_CS(%rsp) jz alltraps_k swapgs + lfence jmp alltraps_u .endm @@ -198,6 +200,7 @@ X\l: testb $SEL_RPL_MASK,TF_CS(%rsp) jz alltraps_k swapgs + lfence jmp alltraps_u .endm @@ -227,6 +230,7 @@ alltraps_u: .globl alltraps_k .type alltraps_k,@function alltraps_k: + lfence movq %rdi,TF_RDI(%rsp) movq %rdx,TF_RDX(%rsp) movq %rax,TF_RAX(%rsp) @@ -304,6 +308,7 @@ alltraps_noen_u: .globl alltraps_noen_k .type alltraps_noen_k,@function alltraps_noen_k: + lfence movq %rdi,TF_RDI(%rsp) alltraps_noen_save_segs: SAVE_SEGS @@ -343,7 +348,7 @@ IDTVEC(dblfault) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz 1f /* already running with kernel GS.base */ swapgs -1: +1: lfence movq PCPU(KCR3),%rax cmpq $~0,%rax je 2f @@ -358,6 +363,7 @@ IDTVEC(page_pti) testb $SEL_RPL_MASK,PTI_CS-PTI_ERR(%rsp) jz page_k swapgs + lfence pushq %rax movq %cr3,%rax movq %rax,PCPU(SAVED_UCR3) @@ -373,6 +379,7 @@ IDTVEC(page) testb $SEL_RPL_MASK,TF_CS-TF_ERR(%rsp) /* Did we come from kernel? */ jnz page_u_swapgs /* already running with kernel GS.base */ page_k: + lfence subq $TF_ERR,%rsp movq %rdi,TF_RDI(%rsp) /* free up GP registers */ movq %rax,TF_RAX(%rsp) @@ -382,6 +389,7 @@ page_k: ALIGN_TEXT page_u_swapgs: swapgs + lfence page_u: subq $TF_ERR,%rsp movq %rdi,TF_RDI(%rsp) @@ -419,6 +427,7 @@ page_cr2: .macro PROTF_ENTRY name,trapno \name\()_pti_doreti: swapgs + lfence cmpq $~0,PCPU(UCR3) je 1f pushq %rax @@ -441,9 +450,9 @@ IDTVEC(\name\()_pti) cmpq $doreti_iret,PTI_RIP-2*8(%rsp) je \name\()_pti_doreti testb $SEL_RPL_MASK,PTI_CS-2*8(%rsp) /* %rax, %rdx not yet pushed */ - jz X\name + jz X\name /* lfence is not needed until %gs: use */ PTI_UENTRY has_err=1 - swapgs + swapgs /* fence provided by PTI_UENTRY */ IDTVEC(\name) subq $TF_ERR,%rsp movl $\trapno,TF_TRAPNO(%rsp) @@ -476,6 +485,7 @@ prot_addrf: jne 2f rdgsbase %rdx 2: swapgs + lfence movq PCPU(CURPCB),%rdi testb $CPUID_STDEXT_FSGSBASE,cpu_stdext_feature(%rip) jz 4f @@ -495,7 +505,8 @@ prot_addrf: jmp alltraps_pushregs_no_rax 5: swapgs -6: movq PCPU(CURPCB),%rdi +6: lfence + movq PCPU(CURPCB),%rdi jmp 4b /* @@ -510,6 +521,7 @@ prot_addrf: SUPERALIGN_TEXT IDTVEC(fast_syscall_pti) swapgs + lfence movq %rax,PCPU(SCRATCH_RAX) cmpq $~0,PCPU(UCR3) je fast_syscall_common @@ -519,6 +531,7 @@ IDTVEC(fast_syscall_pti) SUPERALIGN_TEXT IDTVEC(fast_syscall) swapgs + lfence movq %rax,PCPU(SCRATCH_RAX) fast_syscall_common: movq %rsp,PCPU(SCRATCH_RSP) @@ -647,6 +660,7 @@ IDTVEC(dbg) popfq testb $SEL_RPL_MASK,TF_CS(%rsp) jnz dbg_fromuserspace + lfence /* * We've interrupted the kernel. Preserve GS.base in %r12, * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d. @@ -702,6 +716,7 @@ dbg_fromuserspace: * in trap(). */ swapgs + lfence movq PCPU(KCR3),%rax cmpq $~0,%rax je 1f @@ -787,6 +802,7 @@ IDTVEC(nmi) * We've interrupted the kernel. Preserve GS.base in %r12, * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d. */ + lfence movl $MSR_GSBASE,%ecx rdmsr movq %rax,%r12 @@ -812,6 +828,7 @@ IDTVEC(nmi) nmi_fromuserspace: incl %ebx swapgs + lfence movq %cr3,%r13 movq PCPU(KCR3),%rax cmpq $~0,%rax Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Tue Aug 6 16:12:43 2019 (r350638) +++ head/sys/amd64/include/asmacros.h Tue Aug 6 16:53:25 2019 (r350639) @@ -196,6 +196,7 @@ .macro PTI_UENTRY has_err swapgs + lfence cmpq $~0,PCPU(UCR3) je 1f pushq %rax @@ -236,6 +237,7 @@ X\vec_name: jz .L\vec_name\()_u /* Yes, dont swapgs again */ swapgs .L\vec_name\()_u: + lfence subq $TF_RIP,%rsp /* skip dummy tf_err and tf_trapno */ movq %rdi,TF_RDI(%rsp) movq %rsi,TF_RSI(%rsp) From owner-svn-src-all@freebsd.org Tue Aug 6 16:56:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1308C570A; Tue, 6 Aug 2019 16:56:18 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46314L595Rz4CZk; Tue, 6 Aug 2019 16:56:18 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id E4DA4CA38; Tue, 6 Aug 2019 16:56:17 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Tue, 6 Aug 2019 16:56:14 +0000 From: Glen Barber To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: svn commit: r350550 - head/share/mk Message-ID: <20190806165614.GA41295@FreeBSD.org> References: <201908030106.x7316Ibx078529@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: <201908030106.x7316Ibx078529@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 16:56:18 -0000 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: > Author: jhb > Date: Sat Aug 3 01:06:17 2019 > New Revision: 350550 > URL: https://svnweb.freebsd.org/changeset/base/350550 >=20 > Log: > Flip REPRODUCIBLE_BUILD back to off by default in head. > =20 > Having the full uname output can be useful on head even with > unmodified trees or trees that newvers.sh fails to recognize as > modified. > =20 > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D20895 >=20 I would like to request this commit be reverted. While the original commit message to enable this knob stated the commit would be reverted after stable/12 branched, I have seen no public complaints about enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see the benefit of disabling it by default -- why wouldn't we want reproducibility?). To me, this feels like a step backwards, with no tangible benefit. Note, newvers.sh does properly detect a modified tree if it can find the VCS metadata directory (i.e., .git, .svn) -- I know this because I personally helped with it. In my opinion, those that want the non-reproducible metadata included in output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their src.conf. Turning off a sane default for the benefit of what I suspect is likely a short list of use cases feels like a step in the wrong direction. Glen --zhXaljGHf11kAtnf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAl1JsSkACgkQAxRYpUeP 4pP1iQ/9HRagGOeEniZZhcv+PYAPG3x5PGj2Jw7x6XAG36wFAGGsPDtOl5T4It0x OFtfhiMWOAIE6BOlG1/7FRfldQq7HiZRanMjp8fPwSEooDJGDs97Rfw2y3iyjUaf mBi90XjF8oKmnQVMDnv3bcXNII2pt79VaDDryvLhpRMuH4fYALinu9I8DU7W+anh EN2PXq8lCR5EdzasZh45Sa+987uhX2zyhUfQsM7Q+Sgfbxc5rrCP8IJkjtmoE6Bu w27/7dQbGuAtygl8Zl8iEYdnfm2yv3uY/05cnjwLK85VBlWaPEEZiV6Dq2iGurtw yrrQQczrlXuv8pzjT43p3IScWU+3kDd0mD5EUYSVpBbaVcFuCEEcyMmn/bYh75nr EvkWzYgrveFupykpgF9k0EsqGViEt8SQNRAf3KihJhpAN4kl7q+hEXZardIcwoz7 pLqMA6rRMB5leOPXwEpLtZxPDHq4MX+GbmtaEOQtuPyJKlbMQ/ieDrfFQZ/Hv8pP EaWiPn7w2iuUliRCHTWsggVgdF/7kEMTfIMNfae/KYmD7fSXC2BHi5wOgKLJGs7H dZibtfqBgGTs8/prHyhBHy7ptSjhknTATfPnUVQ1rkWnpSMvyekoaR8QPM9mfVLR Iv7n30+QiMmhkSvR2CY2GbzI9DDgXdz9SkbwdnQagodV4h7MLmo= =tIoZ -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf-- From owner-svn-src-all@freebsd.org Tue Aug 6 17:09:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EEDEC5E3B; Tue, 6 Aug 2019 17:09:56 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631N431X5z4DVr; Tue, 6 Aug 2019 17:09:56 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 305012F12D; Tue, 6 Aug 2019 17:09:56 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76H9uKW037875; Tue, 6 Aug 2019 17:09:56 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76H9m4X037832; Tue, 6 Aug 2019 17:09:48 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201908061709.x76H9m4X037832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 6 Aug 2019 17:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350643 - in releng: 11.2/contrib/bzip2 11.3/contrib/bzip2 12.0/contrib/bzip2 X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/contrib/bzip2 11.3/contrib/bzip2 12.0/contrib/bzip2 X-SVN-Commit-Revision: 350643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:09:56 -0000 Author: gordon Date: Tue Aug 6 17:09:47 2019 New Revision: 350643 URL: https://svnweb.freebsd.org/changeset/base/350643 Log: Fix multiple vulnerabilities in bzip2. Approved by: so Security: FreeBSD-SA-19:18.bzip2 Security: CVE-2016-3189 Security: CVE-2019-12900 Modified: releng/11.2/contrib/bzip2/CHANGES releng/11.2/contrib/bzip2/LICENSE releng/11.2/contrib/bzip2/README releng/11.2/contrib/bzip2/README.COMPILATION.PROBLEMS releng/11.2/contrib/bzip2/blocksort.c releng/11.2/contrib/bzip2/bzip2.1 releng/11.2/contrib/bzip2/bzip2.c releng/11.2/contrib/bzip2/bzip2recover.c releng/11.2/contrib/bzip2/bzlib.c releng/11.2/contrib/bzip2/bzlib.h releng/11.2/contrib/bzip2/bzlib_private.h releng/11.2/contrib/bzip2/compress.c releng/11.2/contrib/bzip2/crctable.c releng/11.2/contrib/bzip2/decompress.c releng/11.2/contrib/bzip2/huffman.c releng/11.2/contrib/bzip2/randtable.c releng/11.2/contrib/bzip2/spewG.c releng/11.2/contrib/bzip2/unzcrash.c releng/11.2/contrib/bzip2/words2 releng/11.3/contrib/bzip2/CHANGES releng/11.3/contrib/bzip2/LICENSE releng/11.3/contrib/bzip2/README releng/11.3/contrib/bzip2/README.COMPILATION.PROBLEMS releng/11.3/contrib/bzip2/blocksort.c releng/11.3/contrib/bzip2/bzip2.1 releng/11.3/contrib/bzip2/bzip2.c releng/11.3/contrib/bzip2/bzip2recover.c releng/11.3/contrib/bzip2/bzlib.c releng/11.3/contrib/bzip2/bzlib.h releng/11.3/contrib/bzip2/bzlib_private.h releng/11.3/contrib/bzip2/compress.c releng/11.3/contrib/bzip2/crctable.c releng/11.3/contrib/bzip2/decompress.c releng/11.3/contrib/bzip2/huffman.c releng/11.3/contrib/bzip2/randtable.c releng/11.3/contrib/bzip2/spewG.c releng/11.3/contrib/bzip2/unzcrash.c releng/11.3/contrib/bzip2/words2 releng/12.0/contrib/bzip2/CHANGES releng/12.0/contrib/bzip2/LICENSE releng/12.0/contrib/bzip2/README releng/12.0/contrib/bzip2/README.COMPILATION.PROBLEMS releng/12.0/contrib/bzip2/blocksort.c releng/12.0/contrib/bzip2/bzip2.1 releng/12.0/contrib/bzip2/bzip2.c releng/12.0/contrib/bzip2/bzip2recover.c releng/12.0/contrib/bzip2/bzlib.c releng/12.0/contrib/bzip2/bzlib.h releng/12.0/contrib/bzip2/bzlib_private.h releng/12.0/contrib/bzip2/compress.c releng/12.0/contrib/bzip2/crctable.c releng/12.0/contrib/bzip2/decompress.c releng/12.0/contrib/bzip2/huffman.c releng/12.0/contrib/bzip2/randtable.c releng/12.0/contrib/bzip2/spewG.c releng/12.0/contrib/bzip2/unzcrash.c releng/12.0/contrib/bzip2/words2 Modified: releng/11.2/contrib/bzip2/CHANGES ============================================================================== --- releng/11.2/contrib/bzip2/CHANGES Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/CHANGES Tue Aug 6 17:09:47 2019 (r350643) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies Izdebski. * Make the documentation build on Ubuntu 10.04 + +1.0.7 (27 Jun 19) +~~~~~~~~~~~~~~~~~ + +* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH + +* bzip2: Fix return value when combining --test,-t and -q. + +* bzip2recover: Fix buffer overflow for large argv[0] + +* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189) + +* Make sure nSelectors is not out of range (CVE-2019-12900) Modified: releng/11.2/contrib/bzip2/LICENSE ============================================================================== --- releng/11.2/contrib/bzip2/LICENSE Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/LICENSE Tue Aug 6 17:09:47 2019 (r350643) @@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Julian Seward, jseward@acm.org +bzip2/libbzip2 version 1.0.7 of 27 June 2019 -------------------------------------------------------------------------- Modified: releng/11.2/contrib/bzip2/README ============================================================================== --- releng/11.2/contrib/bzip2/README Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/README Tue Aug 6 17:09:47 2019 (r350643) @@ -6,8 +6,8 @@ This version is fully compatible with the previous pub This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in this file. @@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. It's difficult for me to support compilation on all these platforms. My approach is to collect binaries for these platforms, and put them -on the master web site (http://www.bzip.org). Look there. However +on the master web site (https://sourceware.org/bzip2/). Look there. However (FWIW), bzip2-1.0.X is very standard ANSI C and should compile unmodified with MS Visual C. If you have difficulties building, you might want to read README.COMPILATION.PROBLEMS. @@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ? * Many small improvements in file and flag handling. * A Y2K statement. -WHAT'S NEW IN 1.0.0 ? +WHAT'S NEW IN 1.0.x ? See the CHANGES file. -WHAT'S NEW IN 1.0.2 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.3 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.4 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.5 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.6 ? - - See the CHANGES file. - - I hope you find bzip2 useful. Feel free to contact me at - jseward@bzip.org + jseward@acm.org if you have any suggestions or queries. Many people mailed me with comments, suggestions and patches after the releases of bzip-0.15, bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this feedback. I thank you for your comments. -bzip2's "home" is http://www.bzip.org/ +bzip2's "home" is https://sourceware.org/bzip2/ Julian Seward -jseward@bzip.org +jseward@acm.org Cambridge, UK. 18 July 1996 (version 0.15) @@ -213,3 +192,4 @@ Cambridge, UK. 20 December 2006 (bzip2, version 1.0.4) 10 December 2007 (bzip2, version 1.0.5) 6 Sept 2010 (bzip2, version 1.0.6) +27 June 2019 (bzip2, version 1.0.7) Modified: releng/11.2/contrib/bzip2/README.COMPILATION.PROBLEMS ============================================================================== --- releng/11.2/contrib/bzip2/README.COMPILATION.PROBLEMS Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/README.COMPILATION.PROBLEMS Tue Aug 6 17:09:47 2019 (r350643) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -12,7 +12,7 @@ This program is released under the terms of the licens in the file LICENSE. ------------------------------------------------------------------ -bzip2-1.0.6 should compile without problems on the vast majority of +bzip2 should compile without problems on the vast majority of platforms. Using the supplied Makefile, I've built and tested it myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ 6.0 and nmake, you can build a native Win32 version too. Large file Modified: releng/11.2/contrib/bzip2/blocksort.c ============================================================================== --- releng/11.2/contrib/bzip2/blocksort.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/blocksort.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap, bhtab [ 0 .. 2+(nblock/32) ] destroyed */ -#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) -#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) -#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) +#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31)) +#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31)) +#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31))) #define WORD_BH(zz) bhtab[(zz) >> 5] #define UNALIGNED_BH(zz) ((zz) & 0x01f) Modified: releng/11.2/contrib/bzip2/bzip2.1 ============================================================================== --- releng/11.2/contrib/bzip2/bzip2.1 Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/bzip2.1 Tue Aug 6 17:09:47 2019 (r350643) @@ -1,6 +1,6 @@ .TH bzip2 1 .SH NAME -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6 +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7 .br bzcat \- decompresses files to stdout .br @@ -404,7 +404,7 @@ I/O error messages are not as helpful as they could be tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading. -This manual page pertains to version 1.0.6 of +This manual page pertains to version 1.0.7 of .I bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions @@ -426,9 +426,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer. .SH AUTHOR -Julian Seward, jsewardbzip.org. +Julian Seward, jseward@acm.org. -http://www.bzip.org +https://sourceware.org/bzip2/ The ideas embodied in .I bzip2 Modified: releng/11.2/contrib/bzip2/bzip2.c ============================================================================== --- releng/11.2/contrib/bzip2/bzip2.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/bzip2.c Tue Aug 6 17:09:47 2019 (r350643) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -554,7 +554,7 @@ static Bool testStream ( FILE *zStream ) { BZFILE* bzf = NULL; - Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; + Int32 bzerr, bzerr_dummy, ret, streamNo, i; UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; @@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream ) streamNo++; while (bzerr == BZ_OK) { - nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); + BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; } if (bzerr != BZ_STREAM_END) goto errhandler; @@ -749,7 +749,7 @@ void panic ( const Char* s ) "\n%s: PANIC -- internal consistency error:\n" "\t%s\n" "\tThis is a BUG. Please report it to me at:\n" - "\tjseward@bzip.org\n", + "\tjseward@acm.org\n", progName, s ); showFileNames(); cleanUpAndFail( 3 ); @@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (1) and (2).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (1)\n" - " or (2), feel free to report it to me at: jseward@bzip.org.\n" + " or (2), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (2) and (3).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (2)\n" - " or (3), feel free to report it to me at: jseward@bzip.org.\n" + " or (3), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -1609,7 +1609,7 @@ void license ( void ) " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" - " in the bzip2-1.0.6 source distribution.\n" + " in the bzip2 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -2005,12 +2005,14 @@ IntNative main ( IntNative argc, Char *argv[] ) testf ( aa->name ); } } - if (testFailsExist && noisy) { - fprintf ( stderr, - "\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); + if (testFailsExist) { + if (noisy) { + fprintf ( stderr, + "\n" + "You can use the `bzip2recover' program to attempt to recover\n" + "data from undamaged sections of corrupted files.\n\n" + ); + } setExit(2); exit(exitValue); } Modified: releng/11.2/contrib/bzip2/bzip2recover.c ============================================================================== --- releng/11.2/contrib/bzip2/bzip2recover.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/bzip2recover.c Tue Aug 6 17:09:47 2019 (r350643) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -309,11 +309,12 @@ Int32 main ( Int32 argc, Char** argv ) UInt32 buffHi, buffLo, blockCRC; Char* p; - strcpy ( progName, argv[0] ); + strncpy ( progName, argv[0], BZ_MAX_FILENAME-1); + progName[BZ_MAX_FILENAME-1]='\0'; inFileName[0] = outFileName[0] = 0; fprintf ( stderr, - "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" ); + "bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" ); if (argc != 2) { fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", @@ -457,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv ) bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 ); bsPutUInt32 ( bsWr, blockCRC ); bsClose ( bsWr ); + outFile = NULL; } if (wrBlock >= rbCtr) break; wrBlock++; Modified: releng/11.2/contrib/bzip2/bzlib.c ============================================================================== --- releng/11.2/contrib/bzip2/bzlib.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/bzlib.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -47,7 +47,7 @@ void BZ2_bz__AssertH__fail ( int errcode ) fprintf(stderr, "\n\nbzip2/libbzip2: internal error number %d.\n" "This is a bug in bzip2/libbzip2, %s.\n" - "Please report it to me at: jseward@bzip.org. If this happened\n" + "Please report it to me at: jseward@acm.org. If this happened\n" "when you were using some program which uses libbzip2 as a\n" "component, you should also report this bug to the author(s)\n" "of that program. Please make an effort to report this bug;\n" Modified: releng/11.2/contrib/bzip2/bzlib.h ============================================================================== --- releng/11.2/contrib/bzip2/bzlib.h Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/bzlib.h Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.2/contrib/bzip2/bzlib_private.h ============================================================================== --- releng/11.2/contrib/bzip2/bzlib_private.h Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/bzlib_private.h Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -36,7 +36,7 @@ /*-- General stuff. --*/ -#define BZ_VERSION "1.0.6, 6-Sept-2010" +#define BZ_VERSION "1.0.7, 27-Jun-2019" typedef char Char; typedef unsigned char Bool; Modified: releng/11.2/contrib/bzip2/compress.c ============================================================================== --- releng/11.2/contrib/bzip2/compress.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/compress.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.2/contrib/bzip2/crctable.c ============================================================================== --- releng/11.2/contrib/bzip2/crctable.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/crctable.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.2/contrib/bzip2/decompress.c ============================================================================== --- releng/11.2/contrib/bzip2/decompress.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/decompress.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -285,9 +285,9 @@ Int32 BZ2_decompress ( DState* s ) /*--- Now the selectors ---*/ GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); - if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); + if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); - if (nSelectors < 1) RETURN(BZ_DATA_ERROR); + if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); for (i = 0; i < nSelectors; i++) { j = 0; while (True) { Modified: releng/11.2/contrib/bzip2/huffman.c ============================================================================== --- releng/11.2/contrib/bzip2/huffman.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/huffman.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.2/contrib/bzip2/randtable.c ============================================================================== --- releng/11.2/contrib/bzip2/randtable.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/randtable.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.2/contrib/bzip2/spewG.c ============================================================================== --- releng/11.2/contrib/bzip2/spewG.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/spewG.c Tue Aug 6 17:09:47 2019 (r350643) @@ -13,8 +13,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.2/contrib/bzip2/unzcrash.c ============================================================================== --- releng/11.2/contrib/bzip2/unzcrash.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/unzcrash.c Tue Aug 6 17:09:47 2019 (r350643) @@ -17,8 +17,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.2/contrib/bzip2/words2 ============================================================================== --- releng/11.2/contrib/bzip2/words2 Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.2/contrib/bzip2/words2 Tue Aug 6 17:09:47 2019 (r350643) @@ -1,5 +1,5 @@ Checking test results. If any of the four "cmp"s which follow report any differences, something is wrong. If you can't easily -figure out what, please let me know (jseward@bzip.org). +figure out what, please let me know (jseward@acm.org). Modified: releng/11.3/contrib/bzip2/CHANGES ============================================================================== --- releng/11.3/contrib/bzip2/CHANGES Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/CHANGES Tue Aug 6 17:09:47 2019 (r350643) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies Izdebski. * Make the documentation build on Ubuntu 10.04 + +1.0.7 (27 Jun 19) +~~~~~~~~~~~~~~~~~ + +* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH + +* bzip2: Fix return value when combining --test,-t and -q. + +* bzip2recover: Fix buffer overflow for large argv[0] + +* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189) + +* Make sure nSelectors is not out of range (CVE-2019-12900) Modified: releng/11.3/contrib/bzip2/LICENSE ============================================================================== --- releng/11.3/contrib/bzip2/LICENSE Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/LICENSE Tue Aug 6 17:09:47 2019 (r350643) @@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Julian Seward, jseward@acm.org +bzip2/libbzip2 version 1.0.7 of 27 June 2019 -------------------------------------------------------------------------- Modified: releng/11.3/contrib/bzip2/README ============================================================================== --- releng/11.3/contrib/bzip2/README Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/README Tue Aug 6 17:09:47 2019 (r350643) @@ -6,8 +6,8 @@ This version is fully compatible with the previous pub This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in this file. @@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. It's difficult for me to support compilation on all these platforms. My approach is to collect binaries for these platforms, and put them -on the master web site (http://www.bzip.org). Look there. However +on the master web site (https://sourceware.org/bzip2/). Look there. However (FWIW), bzip2-1.0.X is very standard ANSI C and should compile unmodified with MS Visual C. If you have difficulties building, you might want to read README.COMPILATION.PROBLEMS. @@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ? * Many small improvements in file and flag handling. * A Y2K statement. -WHAT'S NEW IN 1.0.0 ? +WHAT'S NEW IN 1.0.x ? See the CHANGES file. -WHAT'S NEW IN 1.0.2 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.3 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.4 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.5 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.6 ? - - See the CHANGES file. - - I hope you find bzip2 useful. Feel free to contact me at - jseward@bzip.org + jseward@acm.org if you have any suggestions or queries. Many people mailed me with comments, suggestions and patches after the releases of bzip-0.15, bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this feedback. I thank you for your comments. -bzip2's "home" is http://www.bzip.org/ +bzip2's "home" is https://sourceware.org/bzip2/ Julian Seward -jseward@bzip.org +jseward@acm.org Cambridge, UK. 18 July 1996 (version 0.15) @@ -213,3 +192,4 @@ Cambridge, UK. 20 December 2006 (bzip2, version 1.0.4) 10 December 2007 (bzip2, version 1.0.5) 6 Sept 2010 (bzip2, version 1.0.6) +27 June 2019 (bzip2, version 1.0.7) Modified: releng/11.3/contrib/bzip2/README.COMPILATION.PROBLEMS ============================================================================== --- releng/11.3/contrib/bzip2/README.COMPILATION.PROBLEMS Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/README.COMPILATION.PROBLEMS Tue Aug 6 17:09:47 2019 (r350643) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -12,7 +12,7 @@ This program is released under the terms of the licens in the file LICENSE. ------------------------------------------------------------------ -bzip2-1.0.6 should compile without problems on the vast majority of +bzip2 should compile without problems on the vast majority of platforms. Using the supplied Makefile, I've built and tested it myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ 6.0 and nmake, you can build a native Win32 version too. Large file Modified: releng/11.3/contrib/bzip2/blocksort.c ============================================================================== --- releng/11.3/contrib/bzip2/blocksort.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/blocksort.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap, bhtab [ 0 .. 2+(nblock/32) ] destroyed */ -#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) -#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) -#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) +#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31)) +#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31)) +#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31))) #define WORD_BH(zz) bhtab[(zz) >> 5] #define UNALIGNED_BH(zz) ((zz) & 0x01f) Modified: releng/11.3/contrib/bzip2/bzip2.1 ============================================================================== --- releng/11.3/contrib/bzip2/bzip2.1 Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/bzip2.1 Tue Aug 6 17:09:47 2019 (r350643) @@ -1,6 +1,6 @@ .TH bzip2 1 .SH NAME -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6 +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7 .br bzcat \- decompresses files to stdout .br @@ -404,7 +404,7 @@ I/O error messages are not as helpful as they could be tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading. -This manual page pertains to version 1.0.6 of +This manual page pertains to version 1.0.7 of .I bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions @@ -426,9 +426,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer. .SH AUTHOR -Julian Seward, jsewardbzip.org. +Julian Seward, jseward@acm.org. -http://www.bzip.org +https://sourceware.org/bzip2/ The ideas embodied in .I bzip2 Modified: releng/11.3/contrib/bzip2/bzip2.c ============================================================================== --- releng/11.3/contrib/bzip2/bzip2.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/bzip2.c Tue Aug 6 17:09:47 2019 (r350643) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -554,7 +554,7 @@ static Bool testStream ( FILE *zStream ) { BZFILE* bzf = NULL; - Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; + Int32 bzerr, bzerr_dummy, ret, streamNo, i; UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; @@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream ) streamNo++; while (bzerr == BZ_OK) { - nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); + BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; } if (bzerr != BZ_STREAM_END) goto errhandler; @@ -749,7 +749,7 @@ void panic ( const Char* s ) "\n%s: PANIC -- internal consistency error:\n" "\t%s\n" "\tThis is a BUG. Please report it to me at:\n" - "\tjseward@bzip.org\n", + "\tjseward@acm.org\n", progName, s ); showFileNames(); cleanUpAndFail( 3 ); @@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (1) and (2).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (1)\n" - " or (2), feel free to report it to me at: jseward@bzip.org.\n" + " or (2), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (2) and (3).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (2)\n" - " or (3), feel free to report it to me at: jseward@bzip.org.\n" + " or (3), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -1609,7 +1609,7 @@ void license ( void ) " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" - " in the bzip2-1.0.6 source distribution.\n" + " in the bzip2 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -2005,12 +2005,14 @@ IntNative main ( IntNative argc, Char *argv[] ) testf ( aa->name ); } } - if (testFailsExist && noisy) { - fprintf ( stderr, - "\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); + if (testFailsExist) { + if (noisy) { + fprintf ( stderr, + "\n" + "You can use the `bzip2recover' program to attempt to recover\n" + "data from undamaged sections of corrupted files.\n\n" + ); + } setExit(2); exit(exitValue); } Modified: releng/11.3/contrib/bzip2/bzip2recover.c ============================================================================== --- releng/11.3/contrib/bzip2/bzip2recover.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/bzip2recover.c Tue Aug 6 17:09:47 2019 (r350643) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -309,11 +309,12 @@ Int32 main ( Int32 argc, Char** argv ) UInt32 buffHi, buffLo, blockCRC; Char* p; - strcpy ( progName, argv[0] ); + strncpy ( progName, argv[0], BZ_MAX_FILENAME-1); + progName[BZ_MAX_FILENAME-1]='\0'; inFileName[0] = outFileName[0] = 0; fprintf ( stderr, - "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" ); + "bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" ); if (argc != 2) { fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", @@ -457,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv ) bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 ); bsPutUInt32 ( bsWr, blockCRC ); bsClose ( bsWr ); + outFile = NULL; } if (wrBlock >= rbCtr) break; wrBlock++; Modified: releng/11.3/contrib/bzip2/bzlib.c ============================================================================== --- releng/11.3/contrib/bzip2/bzlib.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/bzlib.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -47,7 +47,7 @@ void BZ2_bz__AssertH__fail ( int errcode ) fprintf(stderr, "\n\nbzip2/libbzip2: internal error number %d.\n" "This is a bug in bzip2/libbzip2, %s.\n" - "Please report it to me at: jseward@bzip.org. If this happened\n" + "Please report it to me at: jseward@acm.org. If this happened\n" "when you were using some program which uses libbzip2 as a\n" "component, you should also report this bug to the author(s)\n" "of that program. Please make an effort to report this bug;\n" Modified: releng/11.3/contrib/bzip2/bzlib.h ============================================================================== --- releng/11.3/contrib/bzip2/bzlib.h Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/bzlib.h Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.3/contrib/bzip2/bzlib_private.h ============================================================================== --- releng/11.3/contrib/bzip2/bzlib_private.h Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/bzlib_private.h Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -36,7 +36,7 @@ /*-- General stuff. --*/ -#define BZ_VERSION "1.0.6, 6-Sept-2010" +#define BZ_VERSION "1.0.7, 27-Jun-2019" typedef char Char; typedef unsigned char Bool; Modified: releng/11.3/contrib/bzip2/compress.c ============================================================================== --- releng/11.3/contrib/bzip2/compress.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/compress.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.3/contrib/bzip2/crctable.c ============================================================================== --- releng/11.3/contrib/bzip2/crctable.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/crctable.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.3/contrib/bzip2/decompress.c ============================================================================== --- releng/11.3/contrib/bzip2/decompress.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/decompress.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -285,9 +285,9 @@ Int32 BZ2_decompress ( DState* s ) /*--- Now the selectors ---*/ GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); - if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); + if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); - if (nSelectors < 1) RETURN(BZ_DATA_ERROR); + if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); for (i = 0; i < nSelectors; i++) { j = 0; while (True) { Modified: releng/11.3/contrib/bzip2/huffman.c ============================================================================== --- releng/11.3/contrib/bzip2/huffman.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/huffman.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.3/contrib/bzip2/randtable.c ============================================================================== --- releng/11.3/contrib/bzip2/randtable.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/randtable.c Tue Aug 6 17:09:47 2019 (r350643) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.3/contrib/bzip2/spewG.c ============================================================================== --- releng/11.3/contrib/bzip2/spewG.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/spewG.c Tue Aug 6 17:09:47 2019 (r350643) @@ -13,8 +13,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.3/contrib/bzip2/unzcrash.c ============================================================================== --- releng/11.3/contrib/bzip2/unzcrash.c Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/unzcrash.c Tue Aug 6 17:09:47 2019 (r350643) @@ -17,8 +17,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: releng/11.3/contrib/bzip2/words2 ============================================================================== --- releng/11.3/contrib/bzip2/words2 Tue Aug 6 17:08:30 2019 (r350642) +++ releng/11.3/contrib/bzip2/words2 Tue Aug 6 17:09:47 2019 (r350643) @@ -1,5 +1,5 @@ Checking test results. If any of the four "cmp"s which follow report any differences, something is wrong. If you can't easily -figure out what, please let me know (jseward@bzip.org). +figure out what, please let me know (jseward@acm.org). Modified: releng/12.0/contrib/bzip2/CHANGES ============================================================================== --- releng/12.0/contrib/bzip2/CHANGES Tue Aug 6 17:08:30 2019 (r350642) +++ releng/12.0/contrib/bzip2/CHANGES Tue Aug 6 17:09:47 2019 (r350643) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies Izdebski. * Make the documentation build on Ubuntu 10.04 + +1.0.7 (27 Jun 19) +~~~~~~~~~~~~~~~~~ + +* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 6 17:11:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA532C5E79; Tue, 6 Aug 2019 17:11:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631Pv4Hzsz4DkG; Tue, 6 Aug 2019 17:11:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 762332F171; Tue, 6 Aug 2019 17:11:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76HBVMc039075; Tue, 6 Aug 2019 17:11:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76HBVrQ039074; Tue, 6 Aug 2019 17:11:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908061711.x76HBVrQ039074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 6 Aug 2019 17:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350645 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 350645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:11:31 -0000 Author: emaste Date: Tue Aug 6 17:11:30 2019 New Revision: 350645 URL: https://svnweb.freebsd.org/changeset/base/350645 Log: Correct ICMPv6/MLDv2 out-of-bounds memory access Previously the ICMPv6 input path incorrectly handled cases where an MLDv2 listener query packet was internally fragmented across multiple mbufs. admbugs: 921 Submitted by: jtl Reported by: CJD of Apple Approved by: so MFC after: 0 minutes Security: CVE-2019-5608 Modified: head/sys/netinet6/mld6.c Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Tue Aug 6 17:11:17 2019 (r350644) +++ head/sys/netinet6/mld6.c Tue Aug 6 17:11:30 2019 (r350645) @@ -139,14 +139,15 @@ static int mld_v2_enqueue_group_record(struct mbufq *, struct in6_multi *, const int, const int, const int, const int); static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *, - struct mbuf *, const int, const int); + struct mbuf *, struct mldv2_query *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, struct mbufq *); static void mld_v2_process_group_timers(struct in6_multi_head *, struct mbufq *, struct mbufq *, struct in6_multi *, const int); static int mld_v2_process_group_query(struct in6_multi *, - struct mld_ifsoftc *mli, int, struct mbuf *, const int); + struct mld_ifsoftc *mli, int, struct mbuf *, + struct mldv2_query *, const int); static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); @@ -804,16 +805,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t * Process a received MLDv2 general, group-specific or * group-and-source-specific query. * - * Assumes that the query header has been pulled up to sizeof(mldv2_query). + * Assumes that mld points to a struct mldv2_query which is stored in + * contiguous memory. * * Return 0 if successful, otherwise an appropriate error code is returned. */ static int mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, - struct mbuf *m, const int off, const int icmp6len) + struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len) { struct mld_ifsoftc *mli; - struct mldv2_query *mld; struct in6_multi *inm; uint32_t maxdelay, nsrc, qqi; int is_general_query; @@ -845,8 +846,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp)); - mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off); - maxdelay = ntohs(mld->mld_maxdelay); /* in 1/10ths of a second */ if (maxdelay >= 32768) { maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) << @@ -973,7 +972,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 * group-specific or group-and-source query. */ if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer) - mld_v2_process_group_query(inm, mli, timer, m, off); + mld_v2_process_group_query(inm, mli, timer, m, mld, off); /* XXX Clear embedded scope ID as userland won't expect it. */ in6_clearscope(&mld->mld_addr); @@ -994,9 +993,8 @@ out_locked: */ static int mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli, - int timer, struct mbuf *m0, const int off) + int timer, struct mbuf *m0, struct mldv2_query *mld, const int off) { - struct mldv2_query *mld; int retval; uint16_t nsrc; @@ -1004,7 +1002,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru MLD_LOCK_ASSERT(); retval = 0; - mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off); switch (inm->in6m_state) { case MLD_NOT_MEMBER: @@ -1024,6 +1021,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru nsrc = ntohs(mld->mld_numsrc); + /* Length should be checked by calling function. */ + KASSERT((m0->m_flags & M_PKTHDR) == 0 || + m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), + ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)", + m0->m_pkthdr.len, off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), m0)); + + /* * Deal with group-specific queries upfront. * If any group query is already pending, purge any recorded @@ -1065,28 +1071,20 @@ mld_v2_process_group_query(struct in6_multi *inm, stru * report for those sources. */ if (inm->in6m_nsrc > 0) { - struct mbuf *m; - uint8_t *sp; + struct in6_addr srcaddr; int i, nrecorded; int soff; - m = m0; soff = off + sizeof(struct mldv2_query); nrecorded = 0; for (i = 0; i < nsrc; i++) { - sp = mtod(m, uint8_t *) + soff; - retval = in6m_record_source(inm, - (const struct in6_addr *)sp); + m_copydata(m0, soff, sizeof(struct in6_addr), + (caddr_t)&srcaddr); + retval = in6m_record_source(inm, &srcaddr); if (retval < 0) break; nrecorded += retval; soff += sizeof(struct in6_addr); - if (soff >= m->m_len) { - soff = soff - m->m_len; - m = m->m_next; - if (m == NULL) - break; - } } if (nrecorded > 0) { CTR1(KTR_MLD, @@ -1296,8 +1294,8 @@ mld_input(struct mbuf *m, int off, int icmp6len) if (mld_v1_input_query(ifp, ip6, mld) != 0) return (0); } else if (icmp6len >= sizeof(struct mldv2_query)) { - if (mld_v2_input_query(ifp, ip6, m, off, - icmp6len) != 0) + if (mld_v2_input_query(ifp, ip6, m, + (struct mldv2_query *)mld, off, icmp6len) != 0) return (0); } break; From owner-svn-src-all@freebsd.org Tue Aug 6 17:15:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 222E3C606A; Tue, 6 Aug 2019 17:15:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631Vq04rJz4FMx; Tue, 6 Aug 2019 17:15:47 +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 D87EA2F2F5; Tue, 6 Aug 2019 17:15:46 +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 x76HFkiK044210; Tue, 6 Aug 2019 17:15:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76HFkgR044209; Tue, 6 Aug 2019 17:15:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908061715.x76HFkgR044209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 6 Aug 2019 17:15: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: r350650 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 350650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:15:47 -0000 Author: emaste Date: Tue Aug 6 17:15:46 2019 New Revision: 350650 URL: https://svnweb.freebsd.org/changeset/base/350650 Log: MFC r350645: Correct ICMPv6/MLDv2 out-of-bounds memory access Previously the ICMPv6 input path incorrectly handled cases where an MLDv2 listener query packet was internally fragmented across multiple mbufs. admbugs: 921 Submitted by: jtl Reported by: CJD of Apple Approved by: so MFC after: 0 minutes Security: CVE-2019-5608 Modified: stable/11/sys/netinet6/mld6.c Modified: stable/11/sys/netinet6/mld6.c ============================================================================== --- stable/11/sys/netinet6/mld6.c Tue Aug 6 17:14:09 2019 (r350649) +++ stable/11/sys/netinet6/mld6.c Tue Aug 6 17:15:46 2019 (r350650) @@ -137,14 +137,15 @@ static int mld_v2_enqueue_group_record(struct mbufq *, struct in6_multi *, const int, const int, const int, const int); static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *, - struct mbuf *, const int, const int); + struct mbuf *, struct mldv2_query *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, struct mbufq *); static void mld_v2_process_group_timers(struct mld_ifsoftc *, struct mbufq *, struct mbufq *, struct in6_multi *, const int); static int mld_v2_process_group_query(struct in6_multi *, - struct mld_ifsoftc *mli, int, struct mbuf *, const int); + struct mld_ifsoftc *mli, int, struct mbuf *, + struct mldv2_query *, const int); static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); @@ -794,16 +795,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t * Process a received MLDv2 general, group-specific or * group-and-source-specific query. * - * Assumes that the query header has been pulled up to sizeof(mldv2_query). + * Assumes that mld points to a struct mldv2_query which is stored in + * contiguous memory. * * Return 0 if successful, otherwise an appropriate error code is returned. */ static int mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, - struct mbuf *m, const int off, const int icmp6len) + struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len) { struct mld_ifsoftc *mli; - struct mldv2_query *mld; struct in6_multi *inm; uint32_t maxdelay, nsrc, qqi; int is_general_query; @@ -828,8 +829,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp)); - mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off); - maxdelay = ntohs(mld->mld_maxdelay); /* in 1/10ths of a second */ if (maxdelay >= 32768) { maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) << @@ -954,7 +953,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 * group-specific or group-and-source query. */ if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer) - mld_v2_process_group_query(inm, mli, timer, m, off); + mld_v2_process_group_query(inm, mli, timer, m, mld, off); /* XXX Clear embedded scope ID as userland won't expect it. */ in6_clearscope(&mld->mld_addr); @@ -975,9 +974,8 @@ out_locked: */ static int mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli, - int timer, struct mbuf *m0, const int off) + int timer, struct mbuf *m0, struct mldv2_query *mld, const int off) { - struct mldv2_query *mld; int retval; uint16_t nsrc; @@ -985,7 +983,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru MLD_LOCK_ASSERT(); retval = 0; - mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off); switch (inm->in6m_state) { case MLD_NOT_MEMBER: @@ -1005,6 +1002,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru nsrc = ntohs(mld->mld_numsrc); + /* Length should be checked by calling function. */ + KASSERT((m0->m_flags & M_PKTHDR) == 0 || + m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), + ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)", + m0->m_pkthdr.len, off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), m0)); + + /* * Deal with group-specific queries upfront. * If any group query is already pending, purge any recorded @@ -1046,28 +1052,20 @@ mld_v2_process_group_query(struct in6_multi *inm, stru * report for those sources. */ if (inm->in6m_nsrc > 0) { - struct mbuf *m; - uint8_t *sp; + struct in6_addr srcaddr; int i, nrecorded; int soff; - m = m0; soff = off + sizeof(struct mldv2_query); nrecorded = 0; for (i = 0; i < nsrc; i++) { - sp = mtod(m, uint8_t *) + soff; - retval = in6m_record_source(inm, - (const struct in6_addr *)sp); + m_copydata(m0, soff, sizeof(struct in6_addr), + (caddr_t)&srcaddr); + retval = in6m_record_source(inm, &srcaddr); if (retval < 0) break; nrecorded += retval; soff += sizeof(struct in6_addr); - if (soff >= m->m_len) { - soff = soff - m->m_len; - m = m->m_next; - if (m == NULL) - break; - } } if (nrecorded > 0) { CTR1(KTR_MLD, @@ -1276,8 +1274,8 @@ mld_input(struct mbuf *m, int off, int icmp6len) if (mld_v1_input_query(ifp, ip6, mld) != 0) return (0); } else if (icmp6len >= sizeof(struct mldv2_query)) { - if (mld_v2_input_query(ifp, ip6, m, off, - icmp6len) != 0) + if (mld_v2_input_query(ifp, ip6, m, + (struct mldv2_query *)mld, off, icmp6len) != 0) return (0); } break; From owner-svn-src-all@freebsd.org Tue Aug 6 18:10:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B730C7194; Tue, 6 Aug 2019 18:10:35 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4632k30f7mz4JYF; Tue, 6 Aug 2019 18:10:35 +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 D99AA2FC11; Tue, 6 Aug 2019 18:10:34 +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 x76IAYHL076014; Tue, 6 Aug 2019 18:10:34 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76IAYRA076013; Tue, 6 Aug 2019 18:10:34 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201908061810.x76IAYRA076013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Aug 2019 18:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350651 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 350651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 18:10:35 -0000 Author: mckusick Date: Tue Aug 6 18:10:34 2019 New Revision: 350651 URL: https://svnweb.freebsd.org/changeset/base/350651 Log: A race condition existed between the time a UFS/FFS superblock check hash was computed and the time that the superblock was copied to a buffer to be written to disk. The result was a failed superblock check hash the next time that the superblock was read. The fix is to compute the check hash after the superblock has been copied to a buffer to be written. PR: 236504 Reported by: Peter Holm Tested by: Peter Holm Sponsored by: Netflix Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Aug 6 17:15:46 2019 (r350650) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Aug 6 18:10:34 2019 (r350651) @@ -1998,7 +1998,13 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int if (MOUNTEDSOFTDEP(ump->um_mountp)) softdep_setup_sbupdate(ump, (struct fs *)bp->b_data, bp); bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize); - ffs_oldfscompat_write((struct fs *)bp->b_data, ump); + fs = (struct fs *)bp->b_data; + ffs_oldfscompat_write(fs, ump); + /* + * Because we may have made changes to the superblock, we need to + * recompute its check-hash. + */ + fs->fs_ckhash = ffs_calc_sbhash(fs); if (devfdp->suspended) bp->b_flags |= B_VALIDSUSPWRT; if (devfdp->waitfor != MNT_WAIT) From owner-svn-src-all@freebsd.org Tue Aug 6 16:09:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6C7A6C4AD1; Tue, 6 Aug 2019 16:09:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46301v2JtGz49KK; Tue, 6 Aug 2019 16:09:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4896A2E659; Tue, 6 Aug 2019 16:09:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76G977f001538; Tue, 6 Aug 2019 16:09:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76G97xX001537; Tue, 6 Aug 2019 16:09:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908061609.x76G97xX001537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 6 Aug 2019 16:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350635 - head/contrib/bsnmp/lib X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/bsnmp/lib X-SVN-Commit-Revision: 350635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 16:09:07 -0000 Author: emaste Date: Tue Aug 6 16:09:06 2019 New Revision: 350635 URL: https://svnweb.freebsd.org/changeset/base/350635 Log: bsnmp: add asn1 message length validation admbugs: 780 Submitted by: Guido Vranken, bz Reported by: Guido Vranken Security: CVE-2019-5610 Modified: head/contrib/bsnmp/lib/asn1.c Modified: head/contrib/bsnmp/lib/asn1.c ============================================================================== --- head/contrib/bsnmp/lib/asn1.c Tue Aug 6 14:39:02 2019 (r350634) +++ head/contrib/bsnmp/lib/asn1.c Tue Aug 6 16:09:06 2019 (r350635) @@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le *len = *b->asn_cptr++; b->asn_len--; } + if (*len > b->asn_len) { + asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len); + return (ASN_ERR_EOBUF); + } + return (ASN_ERR_OK); } From owner-svn-src-all@freebsd.org Tue Aug 6 19:27:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B1B4C8EE8; Tue, 6 Aug 2019 19:27:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4634Qn2z5Dz4N28; Tue, 6 Aug 2019 19:27:29 +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 479F0B34; Tue, 6 Aug 2019 19:27:29 +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 x76JRTZX022876; Tue, 6 Aug 2019 19:27:29 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76JRRrn022866; Tue, 6 Aug 2019 19:27:27 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201908061927.x76JRRrn022866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 6 Aug 2019 19:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350654 - in head/stand/efi: boot1 gptboot libefi loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: boot1 gptboot libefi loader X-SVN-Commit-Revision: 350654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 19:27:29 -0000 Author: tsoome Date: Tue Aug 6 19:27:27 2019 New Revision: 350654 URL: https://svnweb.freebsd.org/changeset/base/350654 Log: loader.efi: replace HandleProtocol() with OpenProtocol() The HandleProtocol() is deprecated interface and we should use OpenProtocol() instead. Moreover, in some firmware implementation(s), the HandleProtocol() does return device path using static storage, so we can not keep the value returned there. With same firmware, the OpenProtocol() does return data we do not need to clone. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D21162 Modified: head/stand/efi/boot1/proto.c head/stand/efi/gptboot/proto.c head/stand/efi/libefi/devpath.c head/stand/efi/libefi/efinet.c head/stand/efi/libefi/efipart.c head/stand/efi/loader/efi_main.c head/stand/efi/loader/framebuffer.c head/stand/efi/loader/main.c Modified: head/stand/efi/boot1/proto.c ============================================================================== --- head/stand/efi/boot1/proto.c Tue Aug 6 18:28:44 2019 (r350653) +++ head/stand/efi/boot1/proto.c Tue Aug 6 19:27:27 2019 (r350654) @@ -61,7 +61,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) int preferred; /* Figure out if we're dealing with an actual partition. */ - status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + status = OpenProtocolByHandle(h, &DevicePathGUID, (void **)&devpath); if (status == EFI_UNSUPPORTED) return (0); @@ -77,7 +77,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) efi_free_devpath_name(text); } #endif - status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + status = OpenProtocolByHandle(h, &BlockIoProtocolGUID, (void **)&blkio); if (status == EFI_UNSUPPORTED) return (0); Modified: head/stand/efi/gptboot/proto.c ============================================================================== --- head/stand/efi/gptboot/proto.c Tue Aug 6 18:28:44 2019 (r350653) +++ head/stand/efi/gptboot/proto.c Tue Aug 6 19:27:27 2019 (r350654) @@ -146,7 +146,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) EFI_STATUS status; /* Figure out if we're dealing with an actual partition. */ - status = BS->HandleProtocol(h, &DevicePathGUID, (void **)&devpath); + status = OpenProtocolByHandle(h, &DevicePathGUID, (void **)&devpath); if (status != EFI_SUCCESS) return; #ifdef EFI_DEBUG @@ -169,7 +169,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath) return; } } - status = BS->HandleProtocol(h, &BlockIoProtocolGUID, (void **)&blkio); + status = OpenProtocolByHandle(h, &BlockIoProtocolGUID, (void **)&blkio); if (status != EFI_SUCCESS) { DPRINTF("Can't get the block I/O protocol block\n"); return; Modified: head/stand/efi/libefi/devpath.c ============================================================================== --- head/stand/efi/libefi/devpath.c Tue Aug 6 18:28:44 2019 (r350653) +++ head/stand/efi/libefi/devpath.c Tue Aug 6 19:27:27 2019 (r350654) @@ -44,8 +44,8 @@ efi_lookup_image_devpath(EFI_HANDLE handle) EFI_DEVICE_PATH *devpath; EFI_STATUS status; - status = BS->HandleProtocol(handle, &ImageDevicePathGUID, - (VOID **)&devpath); + status = OpenProtocolByHandle(handle, &ImageDevicePathGUID, + (void **)&devpath); if (EFI_ERROR(status)) devpath = NULL; return (devpath); @@ -57,7 +57,8 @@ efi_lookup_devpath(EFI_HANDLE handle) EFI_DEVICE_PATH *devpath; EFI_STATUS status; - status = BS->HandleProtocol(handle, &DevicePathGUID, (VOID **)&devpath); + status = OpenProtocolByHandle(handle, &DevicePathGUID, + (void **)&devpath); if (EFI_ERROR(status)) devpath = NULL; return (devpath); Modified: head/stand/efi/libefi/efinet.c ============================================================================== --- head/stand/efi/libefi/efinet.c Tue Aug 6 18:28:44 2019 (r350653) +++ head/stand/efi/libefi/efinet.c Tue Aug 6 19:27:27 2019 (r350654) @@ -286,7 +286,7 @@ efinet_init(struct iodesc *desc, void *machdep_hint) } h = nif->nif_driver->netif_ifs[nif->nif_unit].dif_private; - status = BS->HandleProtocol(h, &sn_guid, (VOID **)&nif->nif_devdata); + status = OpenProtocolByHandle(h, &sn_guid, (void **)&nif->nif_devdata); if (status != EFI_SUCCESS) { printf("net%d: cannot fetch interface data (status=%lu)\n", nif->nif_unit, EFI_ERROR_CODE(status)); Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Tue Aug 6 18:28:44 2019 (r350653) +++ head/stand/efi/libefi/efipart.c Tue Aug 6 19:27:27 2019 (r350654) @@ -297,8 +297,8 @@ efipart_hdd(EFI_DEVICE_PATH *dp) } /* Make sure we do have the media. */ - status = BS->HandleProtocol(efipart_handles[i], - &blkio_guid, (void **)&blkio); + status = OpenProtocolByHandle(efipart_handles[i], &blkio_guid, + (void **)&blkio); if (EFI_ERROR(status)) return (false); @@ -439,8 +439,8 @@ efipart_updatecd(void) if (efipart_hdd(devpath)) continue; - status = BS->HandleProtocol(efipart_handles[i], - &blkio_guid, (void **)&blkio); + status = OpenProtocolByHandle(efipart_handles[i], &blkio_guid, + (void **)&blkio); if (EFI_ERROR(status)) continue; /* @@ -691,8 +691,8 @@ efipart_updatehd(void) if (!efipart_hdd(devpath)) continue; - status = BS->HandleProtocol(efipart_handles[i], - &blkio_guid, (void **)&blkio); + status = OpenProtocolByHandle(efipart_handles[i], &blkio_guid, + (void **)&blkio); if (EFI_ERROR(status)) continue; @@ -779,7 +779,7 @@ efipart_print_common(struct devsw *dev, pdinfo_list_t snprintf(line, sizeof(line), " %s%d", dev->dv_name, pd->pd_unit); printf("%s:", line); - status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio); + status = OpenProtocolByHandle(h, &blkio_guid, (void **)&blkio); if (!EFI_ERROR(status)) { printf(" %llu", blkio->Media->LastBlock == 0? 0: @@ -862,7 +862,7 @@ efipart_open(struct open_file *f, ...) return (EIO); if (pd->pd_blkio == NULL) { - status = BS->HandleProtocol(pd->pd_handle, &blkio_guid, + status = OpenProtocolByHandle(pd->pd_handle, &blkio_guid, (void **)&pd->pd_blkio); if (EFI_ERROR(status)) return (efi_status_to_errno(status)); Modified: head/stand/efi/loader/efi_main.c ============================================================================== --- head/stand/efi/loader/efi_main.c Tue Aug 6 18:28:44 2019 (r350653) +++ head/stand/efi/loader/efi_main.c Tue Aug 6 19:27:27 2019 (r350654) @@ -103,7 +103,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy /* Use efi_exit() from here on... */ - status = BS->HandleProtocol(IH, &image_protocol, (VOID**)&img); + status = OpenProtocolByHandle(IH, &image_protocol, (void**)&img); if (status != EFI_SUCCESS) efi_exit(status); Modified: head/stand/efi/loader/framebuffer.c ============================================================================== --- head/stand/efi/loader/framebuffer.c Tue Aug 6 18:28:44 2019 (r350653) +++ head/stand/efi/loader/framebuffer.c Tue Aug 6 19:27:27 2019 (r350654) @@ -244,7 +244,8 @@ efifb_uga_get_pciio(void) /* Get the PCI I/O interface of the first handle that supports it. */ pciio = NULL; for (hp = buf; hp < buf + bufsz; hp++) { - status = BS->HandleProtocol(*hp, &pciio_guid, (void **)&pciio); + status = OpenProtocolByHandle(*hp, &pciio_guid, + (void **)&pciio); if (status == EFI_SUCCESS) { free(buf); return (pciio); Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Tue Aug 6 18:28:44 2019 (r350653) +++ head/stand/efi/loader/main.c Tue Aug 6 19:27:27 2019 (r350654) @@ -128,7 +128,7 @@ has_keyboard(void) */ hin_end = &hin[sz / sizeof(*hin)]; for (walker = hin; walker < hin_end; walker++) { - status = BS->HandleProtocol(*walker, &devid, (VOID **)&path); + status = OpenProtocolByHandle(*walker, &devid, (void **)&path); if (EFI_ERROR(status)) continue; @@ -864,7 +864,7 @@ main(int argc, CHAR16 *argv[]) archsw.arch_zfs_probe = efi_zfs_probe; /* Get our loaded image protocol interface structure. */ - BS->HandleProtocol(IH, &imgid, (VOID**)&boot_img); + (void) OpenProtocolByHandle(IH, &imgid, (void **)&boot_img); /* * Chicken-and-egg problem; we want to have console output early, but @@ -1004,7 +1004,8 @@ main(int argc, CHAR16 *argv[]) efi_free_devpath_name(text); } - rv = BS->HandleProtocol(boot_img->DeviceHandle, &devid, (void **)&imgpath); + rv = OpenProtocolByHandle(boot_img->DeviceHandle, &devid, + (void **)&imgpath); if (rv == EFI_SUCCESS) { text = efi_devpath_name(imgpath); if (text != NULL) { @@ -1464,7 +1465,7 @@ command_chain(int argc, char *argv[]) command_errmsg = "LoadImage failed"; return (CMD_ERROR); } - status = BS->HandleProtocol(loaderhandle, &LoadedImageGUID, + status = OpenProtocolByHandle(loaderhandle, &LoadedImageGUID, (void **)&loaded_image); if (argc > 2) { From owner-svn-src-all@freebsd.org Tue Aug 6 20:21:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 43BE3C9B0A; Tue, 6 Aug 2019 20:21: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4635df16NJz4Sfq; Tue, 6 Aug 2019 20:21: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 0791D14B0; Tue, 6 Aug 2019 20:21: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 x76KLvL6057680; Tue, 6 Aug 2019 20:21:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76KLvAp057679; Tue, 6 Aug 2019 20:21:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201908062021.x76KLvAp057679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 6 Aug 2019 20:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350657 - head/sys/dev/ral X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/dev/ral X-SVN-Commit-Revision: 350657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 20:21:58 -0000 Author: kevans Date: Tue Aug 6 20:21:57 2019 New Revision: 350657 URL: https://svnweb.freebsd.org/changeset/base/350657 Log: ral: rt2860: fix wcid2ni access/size issue RT2860_WCID_MAX is supposed to describe the max STA index for wcid2ni, and was instead being used as the size -- off-by-one. rt2860_drain_stats_fifo was range-checking wcid only after accessing out-of-bounds potentially. Submitted by: Augustin Cavalier (basically) Obtained from: Haiku (58d16d9fe2d5a209cf22823359a8407d138e1a87) Differential Revision: 3 days Modified: head/sys/dev/ral/rt2860.c head/sys/dev/ral/rt2860var.h Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Tue Aug 6 20:13:28 2019 (r350656) +++ head/sys/dev/ral/rt2860.c Tue Aug 6 20:21:57 2019 (r350657) @@ -1092,10 +1092,12 @@ rt2860_drain_stats_fifo(struct rt2860_softc *sc) DPRINTFN(4, ("tx stat 0x%08x\n", stat)); wcid = (stat >> RT2860_TXQ_WCID_SHIFT) & 0xff; + if (wcid > RT2860_WCID_MAX) + continue; ni = sc->wcid2ni[wcid]; /* if no ACK was requested, no feedback is available */ - if (!(stat & RT2860_TXQ_ACKREQ) || wcid == 0xff || ni == NULL) + if (!(stat & RT2860_TXQ_ACKREQ) || ni == NULL) continue; /* update per-STA AMRR stats */ Modified: head/sys/dev/ral/rt2860var.h ============================================================================== --- head/sys/dev/ral/rt2860var.h Tue Aug 6 20:13:28 2019 (r350656) +++ head/sys/dev/ral/rt2860var.h Tue Aug 6 20:21:57 2019 (r350657) @@ -142,7 +142,7 @@ struct rt2860_softc { #define RT2860_PCIE (1 << 2) #define RT2860_RUNNING (1 << 3) - struct ieee80211_node *wcid2ni[RT2860_WCID_MAX]; + struct ieee80211_node *wcid2ni[RT2860_WCID_MAX + 1]; struct rt2860_tx_ring txq[6]; struct rt2860_rx_ring rxq; From owner-svn-src-all@freebsd.org Tue Aug 6 20:13:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0895C9940; Tue, 6 Aug 2019 20:13:29 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4635Rs4yG2z4Qrb; Tue, 6 Aug 2019 20:13:29 +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 8BEF51428; Tue, 6 Aug 2019 20:13:29 +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 x76KDTU0052587; Tue, 6 Aug 2019 20:13:29 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76KDTHl052583; Tue, 6 Aug 2019 20:13:29 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201908062013.x76KDTHl052583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 6 Aug 2019 20:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350656 - in head/stand/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: include libefi X-SVN-Commit-Revision: 350656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 20:13:29 -0000 Author: tsoome Date: Tue Aug 6 20:13:28 2019 New Revision: 350656 URL: https://svnweb.freebsd.org/changeset/base/350656 Log: loader.efi: efilib.h and libefi.c were left out of 350654 And this is second followup for 350654 Modified: head/stand/efi/include/efilib.h head/stand/efi/libefi/libefi.c Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Tue Aug 6 20:08:01 2019 (r350655) +++ head/stand/efi/include/efilib.h Tue Aug 6 20:13:28 2019 (r350656) @@ -70,6 +70,7 @@ pdinfo_t *efiblk_get_pdinfo_by_handle(EFI_HANDLE h); pdinfo_t *efiblk_get_pdinfo_by_device_path(EFI_DEVICE_PATH *path); void *efi_get_table(EFI_GUID *tbl); +EFI_STATUS OpenProtocolByHandle(EFI_HANDLE, EFI_GUID *, void **); int efi_getdev(void **vdev, const char *devspec, const char **path); char *efi_fmtdev(void *vdev); Modified: head/stand/efi/libefi/libefi.c ============================================================================== --- head/stand/efi/libefi/libefi.c Tue Aug 6 20:08:01 2019 (r350655) +++ head/stand/efi/libefi/libefi.c Tue Aug 6 20:13:28 2019 (r350656) @@ -50,3 +50,10 @@ efi_get_table(EFI_GUID *tbl) } return (NULL); } + +EFI_STATUS +OpenProtocolByHandle(EFI_HANDLE handle, EFI_GUID *protocol, void **interface) +{ + return (BS->OpenProtocol(handle, protocol, interface, IH, NULL, + EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL)); +} From owner-svn-src-all@freebsd.org Tue Aug 6 21:50:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95CE3CAF58; Tue, 6 Aug 2019 21:50:36 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4637bw4H3tz4X2F; Tue, 6 Aug 2019 21:50:36 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75B81249E; Tue, 6 Aug 2019 21:50:36 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76Loaw8006255; Tue, 6 Aug 2019 21:50:36 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76LoYvh006243; Tue, 6 Aug 2019 21:50:34 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201908062150.x76LoYvh006243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 6 Aug 2019 21:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350659 - in head: lib/libmemstat sys/conf sys/vm usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head: lib/libmemstat sys/conf sys/vm usr.bin/vmstat X-SVN-Commit-Revision: 350659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 21:50:36 -0000 Author: jeff Date: Tue Aug 6 21:50:34 2019 New Revision: 350659 URL: https://svnweb.freebsd.org/changeset/base/350659 Log: Add two new kernel options to control memory locality on NUMA hardware. - UMA_XDOMAIN enables an additional per-cpu bucket for freed memory that was freed on a different domain from where it was allocated. This is only used for UMA_ZONE_NUMA (first-touch) zones. - UMA_FIRSTTOUCH sets the default UMA policy to be first-touch for all zones. This tries to maintain locality for kernel memory. Reviewed by: gallatin, alc, kib Tested by: pho, gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20929 Modified: head/lib/libmemstat/memstat.c head/lib/libmemstat/memstat.h head/lib/libmemstat/memstat_internal.h head/lib/libmemstat/memstat_uma.c head/sys/conf/options head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/usr.bin/vmstat/vmstat.c Modified: head/lib/libmemstat/memstat.c ============================================================================== --- head/lib/libmemstat/memstat.c Tue Aug 6 21:17:22 2019 (r350658) +++ head/lib/libmemstat/memstat.c Tue Aug 6 21:50:34 2019 (r350659) @@ -326,6 +326,13 @@ memstat_get_sleeps(const struct memory_type *mtp) return (mtp->mt_sleeps); } +uint64_t +memstat_get_xdomain(const struct memory_type *mtp) +{ + + return (mtp->mt_xdomain); +} + void * memstat_get_caller_pointer(const struct memory_type *mtp, int index) { Modified: head/lib/libmemstat/memstat.h ============================================================================== --- head/lib/libmemstat/memstat.h Tue Aug 6 21:17:22 2019 (r350658) +++ head/lib/libmemstat/memstat.h Tue Aug 6 21:50:34 2019 (r350659) @@ -136,6 +136,7 @@ uint64_t memstat_get_count(const struct memory_type * uint64_t memstat_get_free(const struct memory_type *mtp); uint64_t memstat_get_failures(const struct memory_type *mtp); uint64_t memstat_get_sleeps(const struct memory_type *mtp); +uint64_t memstat_get_xdomain(const struct memory_type *mtp); void *memstat_get_caller_pointer(const struct memory_type *mtp, int index); void memstat_set_caller_pointer(struct memory_type *mtp, Modified: head/lib/libmemstat/memstat_internal.h ============================================================================== --- head/lib/libmemstat/memstat_internal.h Tue Aug 6 21:17:22 2019 (r350658) +++ head/lib/libmemstat/memstat_internal.h Tue Aug 6 21:50:34 2019 (r350659) @@ -69,6 +69,7 @@ struct memory_type { uint64_t mt_free; /* Number of cached free items. */ uint64_t mt_failures; /* Number of allocation failures. */ uint64_t mt_sleeps; /* Number of allocation sleeps. */ + uint64_t mt_xdomain; /* Number of cross domain sleeps. */ /* * Caller-owned memory. Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Tue Aug 6 21:17:22 2019 (r350658) +++ head/lib/libmemstat/memstat_uma.c Tue Aug 6 21:50:34 2019 (r350659) @@ -201,6 +201,7 @@ retry: mtp->mt_numfrees = uthp->uth_frees; mtp->mt_failures = uthp->uth_fails; mtp->mt_sleeps = uthp->uth_sleeps; + mtp->mt_xdomain = uthp->uth_xdomain; for (j = 0; j < maxcpus; j++) { upsp = (struct uma_percpu_stat *)p; @@ -423,11 +424,11 @@ memstat_kvm_uma(struct memory_type_list *list, void *k mtp->mt_failures = kvm_counter_u64_fetch(kvm, (unsigned long )uz.uz_fails); mtp->mt_sleeps = uz.uz_sleeps; - /* See comment above in memstat_sysctl_uma(). */ if (mtp->mt_numallocs < mtp->mt_numfrees) mtp->mt_numallocs = mtp->mt_numfrees; + mtp->mt_xdomain = uz.uz_xdomain; if (kz.uk_flags & UMA_ZFLAG_INTERNAL) goto skip_percpu; for (i = 0; i < mp_maxid + 1; i++) { Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Aug 6 21:17:22 2019 (r350658) +++ head/sys/conf/options Tue Aug 6 21:50:34 2019 (r350659) @@ -618,6 +618,8 @@ NO_SWAPPING opt_vm.h MALLOC_MAKE_FAILURES opt_vm.h MALLOC_PROFILE opt_vm.h MALLOC_DEBUG_MAXZONES opt_vm.h +UMA_XDOMAIN opt_vm.h +UMA_FIRSTTOUCH opt_vm.h # The MemGuard replacement allocator used for tamper-after-free detection DEBUG_MEMGUARD opt_vm.h Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Aug 6 21:17:22 2019 (r350658) +++ head/sys/vm/uma.h Tue Aug 6 21:50:34 2019 (r350659) @@ -282,7 +282,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma */ #define UMA_ZONE_INHERIT \ (UMA_ZONE_OFFPAGE | UMA_ZONE_MALLOC | UMA_ZONE_NOFREE | \ - UMA_ZONE_HASH | UMA_ZONE_VTOSLAB | UMA_ZONE_PCPU) + UMA_ZONE_HASH | UMA_ZONE_VTOSLAB | UMA_ZONE_PCPU | UMA_ZONE_NUMA) /* Definitions for align */ #define UMA_ALIGN_PTR (sizeof(void *) - 1) /* Alignment fit for ptr */ @@ -689,7 +689,8 @@ struct uma_type_header { uint64_t uth_frees; /* Zone: number of frees. */ uint64_t uth_fails; /* Zone: number of alloc failures. */ uint64_t uth_sleeps; /* Zone: number of alloc sleeps. */ - uint64_t _uth_reserved1[2]; /* Reserved. */ + uint64_t uth_xdomain; /* Zone: Number of cross domain frees. */ + uint64_t _uth_reserved1[1]; /* Reserved. */ }; struct uma_percpu_stat { Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Aug 6 21:17:22 2019 (r350658) +++ head/sys/vm/uma_core.c Tue Aug 6 21:50:34 2019 (r350659) @@ -785,12 +785,17 @@ cache_drain(uma_zone_t zone) CPU_FOREACH(cpu) { cache = &zone->uz_cpu[cpu]; bucket_drain(zone, cache->uc_allocbucket); - bucket_drain(zone, cache->uc_freebucket); if (cache->uc_allocbucket != NULL) bucket_free(zone, cache->uc_allocbucket, NULL); + cache->uc_allocbucket = NULL; + bucket_drain(zone, cache->uc_freebucket); if (cache->uc_freebucket != NULL) bucket_free(zone, cache->uc_freebucket, NULL); - cache->uc_allocbucket = cache->uc_freebucket = NULL; + cache->uc_freebucket = NULL; + bucket_drain(zone, cache->uc_crossbucket); + if (cache->uc_crossbucket != NULL) + bucket_free(zone, cache->uc_crossbucket, NULL); + cache->uc_crossbucket = NULL; } ZONE_LOCK(zone); bucket_cache_drain(zone); @@ -813,13 +818,13 @@ static void cache_drain_safe_cpu(uma_zone_t zone) { uma_cache_t cache; - uma_bucket_t b1, b2; + uma_bucket_t b1, b2, b3; int domain; if (zone->uz_flags & UMA_ZFLAG_INTERNAL) return; - b1 = b2 = NULL; + b1 = b2 = b3 = NULL; ZONE_LOCK(zone); critical_enter(); if (zone->uz_flags & UMA_ZONE_NUMA) @@ -843,12 +848,18 @@ cache_drain_safe_cpu(uma_zone_t zone) b2 = cache->uc_freebucket; cache->uc_freebucket = NULL; } + b3 = cache->uc_crossbucket; + cache->uc_crossbucket = NULL; critical_exit(); ZONE_UNLOCK(zone); if (b1) bucket_free(zone, b1, NULL); if (b2) bucket_free(zone, b2, NULL); + if (b3) { + bucket_drain(zone, b3); + bucket_free(zone, b3, NULL); + } } /* @@ -1754,6 +1765,7 @@ zone_ctor(void *mem, int size, void *udata, int flags) zone->uz_init = NULL; zone->uz_fini = NULL; zone->uz_sleeps = 0; + zone->uz_xdomain = 0; zone->uz_count = 0; zone->uz_count_min = 0; zone->uz_count_max = BUCKET_MAX; @@ -2185,6 +2197,11 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct KASSERT(powerof2(align + 1), ("invalid zone alignment %d for \"%s\"", align, name)); + /* Sets all zones to a first-touch domain policy. */ +#ifdef UMA_FIRSTTOUCH + flags |= UMA_ZONE_NUMA; +#endif + /* This stuff is essential for the zone ctor */ memset(&args, 0, sizeof(args)); args.name = name; @@ -2456,16 +2473,13 @@ zalloc_start: if (bucket != NULL) bucket_free(zone, bucket, udata); - if (zone->uz_flags & UMA_ZONE_NUMA) { - domain = PCPU_GET(domain); - if (VM_DOMAIN_EMPTY(domain)) - domain = UMA_ANYDOMAIN; - } else - domain = UMA_ANYDOMAIN; - /* Short-circuit for zones without buckets and low memory. */ if (zone->uz_count == 0 || bucketdisable) { ZONE_LOCK(zone); + if (zone->uz_flags & UMA_ZONE_NUMA) + domain = PCPU_GET(domain); + else + domain = UMA_ANYDOMAIN; goto zalloc_item; } @@ -2497,10 +2511,14 @@ zalloc_start: /* * Check the zone's cache of buckets. */ - if (domain == UMA_ANYDOMAIN) - zdom = &zone->uz_domain[0]; - else + if (zone->uz_flags & UMA_ZONE_NUMA) { + domain = PCPU_GET(domain); zdom = &zone->uz_domain[domain]; + } else { + domain = UMA_ANYDOMAIN; + zdom = &zone->uz_domain[0]; + } + if ((bucket = zone_try_fetch_bucket(zone, zdom, true)) != NULL) { KASSERT(bucket->ub_cnt != 0, ("uma_zalloc_arg: Returning an empty bucket.")); @@ -2842,6 +2860,10 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int do CTR1(KTR_UMA, "zone_alloc:_bucket domain %d)", domain); + /* Avoid allocs targeting empty domains. */ + if (domain != UMA_ANYDOMAIN && VM_DOMAIN_EMPTY(domain)) + domain = UMA_ANYDOMAIN; + /* Don't wait for buckets, preserve caller's NOVM setting. */ bucket = bucket_alloc(zone, udata, M_NOWAIT | (flags & M_NOVM)); if (bucket == NULL) @@ -2941,11 +2963,10 @@ zone_alloc_item_locked(uma_zone_t zone, void *udata, i } ZONE_UNLOCK(zone); - if (domain != UMA_ANYDOMAIN) { - /* avoid allocs targeting empty domains */ - if (VM_DOMAIN_EMPTY(domain)) - domain = UMA_ANYDOMAIN; - } + /* Avoid allocs targeting empty domains. */ + if (domain != UMA_ANYDOMAIN && VM_DOMAIN_EMPTY(domain)) + domain = UMA_ANYDOMAIN; + if (zone->uz_import(zone->uz_arg, &item, 1, domain, flags) != 1) goto fail; @@ -3006,6 +3027,9 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata uma_bucket_t bucket; uma_zone_domain_t zdom; int cpu, domain; +#ifdef UMA_XDOMAIN + int itemdomain; +#endif bool lockfail; #ifdef INVARIANTS bool skipdbg; @@ -3055,6 +3079,11 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata if (zone->uz_sleepers > 0) goto zfree_item; +#ifdef UMA_XDOMAIN + if ((zone->uz_flags & UMA_ZONE_NUMA) != 0) + itemdomain = _vm_phys_domain(pmap_kextract((vm_offset_t)item)); +#endif + /* * If possible, free to the per-CPU cache. There are two * requirements for safe access to the per-CPU cache: (1) the thread @@ -3072,14 +3101,26 @@ zfree_restart: cache = &zone->uz_cpu[cpu]; zfree_start: + domain = PCPU_GET(domain); +#ifdef UMA_XDOMAIN + if ((zone->uz_flags & UMA_ZONE_NUMA) == 0) + itemdomain = domain; +#endif /* * Try to free into the allocbucket first to give LIFO ordering * for cache-hot datastructures. Spill over into the freebucket * if necessary. Alloc will swap them if one runs dry. */ - bucket = cache->uc_allocbucket; - if (bucket == NULL || bucket->ub_cnt >= bucket->ub_entries) - bucket = cache->uc_freebucket; +#ifdef UMA_XDOMAIN + if (domain != itemdomain) { + bucket = cache->uc_crossbucket; + } else +#endif + { + bucket = cache->uc_allocbucket; + if (bucket == NULL || bucket->ub_cnt >= bucket->ub_entries) + bucket = cache->uc_freebucket; + } if (bucket != NULL && bucket->ub_cnt < bucket->ub_entries) { KASSERT(bucket->ub_bucket[bucket->ub_cnt] == NULL, ("uma_zfree: Freeing to non free bucket index.")); @@ -3110,24 +3151,66 @@ zfree_start: } critical_enter(); cpu = curcpu; + domain = PCPU_GET(domain); cache = &zone->uz_cpu[cpu]; - bucket = cache->uc_freebucket; +#ifdef UMA_XDOMAIN + if (domain != itemdomain) + bucket = cache->uc_crossbucket; + else +#endif + bucket = cache->uc_freebucket; if (bucket != NULL && bucket->ub_cnt < bucket->ub_entries) { ZONE_UNLOCK(zone); goto zfree_start; } - cache->uc_freebucket = NULL; +#ifdef UMA_XDOMAIN + if (domain != itemdomain) + cache->uc_crossbucket = NULL; + else +#endif + cache->uc_freebucket = NULL; /* We are no longer associated with this CPU. */ critical_exit(); +#ifdef UMA_XDOMAIN + if (domain != itemdomain) { + if (bucket != NULL) { + zone->uz_xdomain += bucket->ub_cnt; + if (vm_ndomains > 2 || + zone->uz_bkt_count >= zone->uz_bkt_max) { + ZONE_UNLOCK(zone); + bucket_drain(zone, bucket); + bucket_free(zone, bucket, udata); + } else { + zdom = &zone->uz_domain[itemdomain]; + zone_put_bucket(zone, zdom, bucket, true); + ZONE_UNLOCK(zone); + } + } else + ZONE_UNLOCK(zone); + bucket = bucket_alloc(zone, udata, M_NOWAIT); + if (bucket == NULL) + goto zfree_item; + critical_enter(); + cpu = curcpu; + cache = &zone->uz_cpu[cpu]; + if (cache->uc_crossbucket == NULL) { + cache->uc_crossbucket = bucket; + goto zfree_start; + } + critical_exit(); + bucket_free(zone, bucket, udata); + goto zfree_restart; + } +#endif + if ((zone->uz_flags & UMA_ZONE_NUMA) != 0) { - domain = PCPU_GET(domain); - if (VM_DOMAIN_EMPTY(domain)) - domain = UMA_ANYDOMAIN; - } else + zdom = &zone->uz_domain[domain]; + } else { domain = 0; - zdom = &zone->uz_domain[0]; + zdom = &zone->uz_domain[0]; + } /* Can we throw this on the zone full list? */ if (bucket != NULL) { @@ -3768,11 +3851,13 @@ slab_print(uma_slab_t slab) static void cache_print(uma_cache_t cache) { - printf("alloc: %p(%d), free: %p(%d)\n", + printf("alloc: %p(%d), free: %p(%d), cross: %p(%d)j\n", cache->uc_allocbucket, cache->uc_allocbucket?cache->uc_allocbucket->ub_cnt:0, cache->uc_freebucket, - cache->uc_freebucket?cache->uc_freebucket->ub_cnt:0); + cache->uc_freebucket?cache->uc_freebucket->ub_cnt:0, + cache->uc_crossbucket, + cache->uc_crossbucket?cache->uc_crossbucket->ub_cnt:0); } static void @@ -3834,13 +3919,13 @@ uma_print_zone(uma_zone_t zone) */ static void uma_zone_sumstat(uma_zone_t z, long *cachefreep, uint64_t *allocsp, - uint64_t *freesp, uint64_t *sleepsp) + uint64_t *freesp, uint64_t *sleepsp, uint64_t *xdomainp) { uma_cache_t cache; - uint64_t allocs, frees, sleeps; + uint64_t allocs, frees, sleeps, xdomain; int cachefree, cpu; - allocs = frees = sleeps = 0; + allocs = frees = sleeps = xdomain = 0; cachefree = 0; CPU_FOREACH(cpu) { cache = &z->uz_cpu[cpu]; @@ -3848,12 +3933,17 @@ uma_zone_sumstat(uma_zone_t z, long *cachefreep, uint6 cachefree += cache->uc_allocbucket->ub_cnt; if (cache->uc_freebucket != NULL) cachefree += cache->uc_freebucket->ub_cnt; + if (cache->uc_crossbucket != NULL) { + xdomain += cache->uc_crossbucket->ub_cnt; + cachefree += cache->uc_crossbucket->ub_cnt; + } allocs += cache->uc_allocs; frees += cache->uc_frees; } allocs += counter_u64_fetch(z->uz_allocs); frees += counter_u64_fetch(z->uz_frees); sleeps += z->uz_sleeps; + xdomain += z->uz_xdomain; if (cachefreep != NULL) *cachefreep = cachefree; if (allocsp != NULL) @@ -3862,6 +3952,8 @@ uma_zone_sumstat(uma_zone_t z, long *cachefreep, uint6 *freesp = frees; if (sleepsp != NULL) *sleepsp = sleeps; + if (xdomainp != NULL) + *xdomainp = xdomain; } #endif /* DDB */ @@ -3902,6 +3994,7 @@ uma_vm_zone_stats(struct uma_type_header *uth, uma_zon uth->uth_frees = counter_u64_fetch(z->uz_frees); uth->uth_fails = counter_u64_fetch(z->uz_fails); uth->uth_sleeps = z->uz_sleeps; + uth->uth_xdomain = z->uz_xdomain; /* * While it is not normally safe to access the cache * bucket pointers while not on the CPU that owns the @@ -3921,6 +4014,9 @@ uma_vm_zone_stats(struct uma_type_header *uth, uma_zon if (cache->uc_freebucket != NULL) ups[i].ups_cache_free += cache->uc_freebucket->ub_cnt; + if (cache->uc_crossbucket != NULL) + ups[i].ups_cache_free += + cache->uc_crossbucket->ub_cnt; ups[i].ups_allocs = cache->uc_allocs; ups[i].ups_frees = cache->uc_frees; } @@ -4176,12 +4272,12 @@ DB_SHOW_COMMAND(uma, db_show_uma) { uma_keg_t kz; uma_zone_t z; - uint64_t allocs, frees, sleeps; + uint64_t allocs, frees, sleeps, xdomain; long cachefree; int i; - db_printf("%18s %8s %8s %8s %12s %8s %8s\n", "Zone", "Size", "Used", - "Free", "Requests", "Sleeps", "Bucket"); + db_printf("%18s %8s %8s %8s %12s %8s %8s %8s\n", "Zone", "Size", "Used", + "Free", "Requests", "Sleeps", "Bucket", "XFree"); LIST_FOREACH(kz, &uma_kegs, uk_link) { LIST_FOREACH(z, &kz->uk_zones, uz_link) { if (kz->uk_flags & UMA_ZFLAG_INTERNAL) { @@ -4191,17 +4287,17 @@ DB_SHOW_COMMAND(uma, db_show_uma) cachefree = 0; } else uma_zone_sumstat(z, &cachefree, &allocs, - &frees, &sleeps); + &frees, &sleeps, &xdomain); if (!((z->uz_flags & UMA_ZONE_SECONDARY) && (LIST_FIRST(&kz->uk_zones) != z))) cachefree += kz->uk_free; for (i = 0; i < vm_ndomains; i++) cachefree += z->uz_domain[i].uzd_nitems; - db_printf("%18s %8ju %8jd %8ld %12ju %8ju %8u\n", + db_printf("%18s %8ju %8jd %8ld %12ju %8ju %8u %8ju\n", z->uz_name, (uintmax_t)kz->uk_size, (intmax_t)(allocs - frees), cachefree, - (uintmax_t)allocs, sleeps, z->uz_count); + (uintmax_t)allocs, sleeps, z->uz_count, xdomain); if (db_pager_quit) return; } @@ -4218,7 +4314,7 @@ DB_SHOW_COMMAND(umacache, db_show_umacache) db_printf("%18s %8s %8s %8s %12s %8s\n", "Zone", "Size", "Used", "Free", "Requests", "Bucket"); LIST_FOREACH(z, &uma_cachezones, uz_link) { - uma_zone_sumstat(z, &cachefree, &allocs, &frees, NULL); + uma_zone_sumstat(z, &cachefree, &allocs, &frees, NULL, NULL); for (i = 0; i < vm_ndomains; i++) cachefree += z->uz_domain[i].uzd_nitems; db_printf("%18s %8ju %8jd %8ld %12ju %8u\n", Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Aug 6 21:17:22 2019 (r350658) +++ head/sys/vm/uma_int.h Tue Aug 6 21:50:34 2019 (r350659) @@ -208,6 +208,7 @@ typedef struct uma_bucket * uma_bucket_t; struct uma_cache { uma_bucket_t uc_freebucket; /* Bucket we're freeing to */ uma_bucket_t uc_allocbucket; /* Bucket to allocate from */ + uma_bucket_t uc_crossbucket; /* cross domain bucket */ uint64_t uc_allocs; /* Count of allocations */ uint64_t uc_frees; /* Count of frees */ } UMA_ALIGN; @@ -368,6 +369,7 @@ struct uma_zone { counter_u64_t uz_frees; /* Total number of frees */ counter_u64_t uz_fails; /* Total number of alloc failures */ uint64_t uz_sleeps; /* Total number of alloc sleeps */ + uint64_t uz_xdomain; /* Total number of cross-domain frees */ /* * This HAS to be the last item because we adjust the zone size Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Tue Aug 6 21:17:22 2019 (r350658) +++ head/sys/vm/vm_phys.c Tue Aug 6 21:50:34 2019 (r350659) @@ -623,6 +623,26 @@ vm_phys_register_domains(int ndomains, struct mem_affi #endif } +int +_vm_phys_domain(vm_paddr_t pa) +{ +#ifdef NUMA + int i; + + if (vm_ndomains == 1 || mem_affinity == NULL) + return (0); + + /* + * Check for any memory that overlaps. + */ + for (i = 0; mem_affinity[i].end != 0; i++) + if (mem_affinity[i].start <= pa && + mem_affinity[i].end >= pa) + return (mem_affinity[i].domain); +#endif + return (0); +} + /* * Split a contiguous, power of two-sized set of physical pages. * Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Tue Aug 6 21:17:22 2019 (r350658) +++ head/sys/vm/vm_phys.h Tue Aug 6 21:50:34 2019 (r350659) @@ -123,6 +123,7 @@ vm_phys_domain(vm_page_t m) return (0); #endif } +int _vm_phys_domain(vm_paddr_t pa); #endif /* _KERNEL */ #endif /* !_VM_PHYS_H_ */ Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Tue Aug 6 21:17:22 2019 (r350658) +++ head/usr.bin/vmstat/vmstat.c Tue Aug 6 21:50:34 2019 (r350659) @@ -1483,9 +1483,9 @@ domemstat_zone(void) } } xo_open_container("memory-zone-statistics"); - xo_emit("{T:/%-20s} {T:/%6s} {T:/%6s} {T:/%8s} {T:/%8s} {T:/%8s} " + xo_emit("{T:/%-20s} {T:/%6s} {T:/%6s} {T:/%8s} {T:/%8s} {T:/%8s} {T:/%8s}" "{T:/%4s} {T:/%4s}\n\n", "ITEM", "SIZE", - "LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP"); + "LIMIT", "USED", "FREE", "REQ", "FAIL", "SLEEP", "XDOMAIN"); xo_open_list("zone"); for (mtp = memstat_mtl_first(mtlp); mtp != NULL; mtp = memstat_mtl_next(mtp)) { @@ -1495,7 +1495,7 @@ domemstat_zone(void) xo_emit("{d:name/%-20s}{ke:name/%s} {:size/%6ju}, " "{:limit/%6ju},{:used/%8ju}," "{:free/%8ju},{:requests/%8ju}," - "{:fail/%4ju},{:sleep/%4ju}\n", name, + "{:fail/%4ju},{:sleep/%4ju},{:xdomain/%4ju}\n", name, memstat_get_name(mtp), (uintmax_t)memstat_get_size(mtp), (uintmax_t)memstat_get_countlimit(mtp), @@ -1503,7 +1503,8 @@ domemstat_zone(void) (uintmax_t)memstat_get_free(mtp), (uintmax_t)memstat_get_numallocs(mtp), (uintmax_t)memstat_get_failures(mtp), - (uintmax_t)memstat_get_sleeps(mtp)); + (uintmax_t)memstat_get_sleeps(mtp), + (uintmax_t)memstat_get_xdomain(mtp)); xo_close_instance("zone"); } memstat_mtl_free(mtlp); From owner-svn-src-all@freebsd.org Tue Aug 6 17:05:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0EADC5DC7; Tue, 6 Aug 2019 17:05:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631HV5pH3z4DCm; Tue, 6 Aug 2019 17:05:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8D9D2F117; Tue, 6 Aug 2019 17:05:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76H5woC037480; Tue, 6 Aug 2019 17:05:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76H5wZU037479; Tue, 6 Aug 2019 17:05:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908061705.x76H5wZU037479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 6 Aug 2019 17:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350640 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 350640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:05:59 -0000 Author: kib Date: Tue Aug 6 17:05:58 2019 New Revision: 350640 URL: https://svnweb.freebsd.org/changeset/base/350640 Log: Provide the list of knobs related to mitigations. Discussed with: bjk, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21087 Modified: head/share/man/man7/security.7 Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Tue Aug 6 16:53:25 2019 (r350639) +++ head/share/man/man7/security.7 Tue Aug 6 17:05:58 2019 (r350640) @@ -1,5 +1,10 @@ .\" Copyright (C) 1998 Matthew Dillon. All rights reserved. +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. .\" +.\" Parts of this documentation were written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -23,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd July 27, 2019 .Dt SECURITY 7 .Os .Sh NAME @@ -941,12 +946,125 @@ option that SSH allows in its .Pa authorized_keys file to make the key only usable to entities logging in from specific machines. +.Sh KNOBS AND TWEAKS +.Fx +provides several knobs and tweak handles that make some introspection +information access more restricted. +Some people consider this as improving system security, so the knobs are +briefly listed there, together with controls which enable some mitigations +of the hardware state leaks. +.Bl -tag -width security.bsd.unprivileged_proc_debug +.It Dv security.bsd.see_other_uids +Controls visibility of processes owned by different uid. +The knob directly affects the +.Dv kern.proc +sysctls filtering of data, which results in restricted output from +utilities like +.Xr ps 1 . +.It Dv security.bsd.see_other_gids +Same, for processes owned by different gid. +.It Dv security.bsd.see_jail_proc +Same, for processes belonging to a jail. +.It Dv security.bsd.conservative_signals +When enabled, unprivileged users are only allowed to send job control +and usual termination signals like +.Dv SIGKILL , +.Dv SIGINT , +and +.Dv SIGTERM , +to the processes executing programs with changed uids. +.It Dv security.bsd.unprivileged_proc_debug +Controls availability of the process debugging facilities to non-root users. +See also +.Xr proccontrol 1 +mode +.Dv trace . +.It Dv vm.pmap.pti +Tunable, amd64-only. +Enables mode of operation of virtual memory system where usermode page +tables are sanitized to prevent so-called Meltdown information leak on +some Intel CPUs. +By default, the system detects whether the CPU needs the workaround, +and enables it automatically. +See also +.Xr proccontrol 1 +mode +.Dv kpti . +.It Dv hw.mds_disable +amd64 and i386. +Controls Microarchitectural Data Sampling hardware information leak +mitigation. +.It Dv hw.spec_store_bypass_disable +amd64 and i386. +Controls Speculative Store Bypass hardware information leak mitigation. +.It Dv hw.ibrs_disable +amd64 and i386. +Controls Indirect Branch Restricted Speculation hardware information leak +mitigation. +.It Dv machdep.syscall_ret_l1d_flush +amd64. +Controls force-flush of L1D cache on return from syscalls which report +errors other than +.Ev EEXIST , +.Ev EAGAIN , +.Ev EXDEV , +.Ev ENOENT , +.Ev ENOTCONN , +and +.Ev EINPROGRESS . +This is mostly a paranoid setting added to prevent hypothetical exploitation +of unknown gadgets for unknown hardware issues. +The error codes exclusion list is composed of the most common errors which +typically occurs on normal system operation. +.It Dv machdep.nmi_flush_l1d_sw +amd64. +Controls force-flush of L1D cache on NMI; +this provides software assist for bhyve mitigation of L1 terminal fault +hardware information leak. +.It Dv hw.vmm.vmx.l1d_flush +amd64. +Controls the mitigation of L1 Terminal Fault in bhyve hypervisor. +.It Dv kern.elf32.aslr.enable +Controls system-global Address Space Layour Randomization (ASLR) for +normal non-PIE (Position Independent Executable) 32bit binaries. +See also +.Xr proccontrol 1 +mode +.Dv aslr , +also affected by the per-image control note flag. +.It Dv kern.elf32.aslr.pie_enable +Controls system-global Address Space Layout Randomization for +position-independent (PIE) 32bit binaries. +.It Dv kern.elf32.aslr.honor_sbrk +Makes ASLR less aggressive and more compatible with old binaries +relying on the sbrk area. +.It Dv kern.elf32.aslr.aslr_stack_gap +If ASLR is enabled for a binary, a non-zero value creates a randomized +stack gap between strings and the end of the aux vector. +The value is the maximum percentage of main stack to waste on the gap. +Cannot be greater than 50, i.e., at most half of the stack. +.It Dv kern.elf64.aslr.enable +64bit binaries ASLR control. +.It Dv kern.elf64.aslr.pie_enable +64bit PIE binaries ASLR control. +.It Dv kern.elf64.aslr.honor_sbrk +64bit binaries ASLR sbrk compatibility control. +.It Dv kern.elf32.aslr.aslr_stack_gap +Controls stack gap for 64bit binaries. +.It Dv kern.elf32.nxstack +Enables non-executable stack for 32bit processes. +Enabled by default if supported by hardware and corresponding binary. +.It Dv kern.elf64.nxstack +Enables non-executable stack for 64bit processes. +.El .Sh SEE ALSO .Xr chflags 1 , .Xr find 1 , .Xr md5 1 , .Xr netstat 1 , .Xr openssl 1 , +.Xr proccontrol 1 , +.Xr ps 1 , .Xr ssh 1 , .Xr xdm 1 Pq Pa ports/x11/xorg-clients , .Xr group 5 , From owner-svn-src-all@freebsd.org Tue Aug 6 17:08:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F594C5E1D; Tue, 6 Aug 2019 17:08:31 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631LR2nhXz4DQ5; Tue, 6 Aug 2019 17:08:31 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 415062F12C; Tue, 6 Aug 2019 17:08:31 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76H8VFc037714; Tue, 6 Aug 2019 17:08:31 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76H8Upt037712; Tue, 6 Aug 2019 17:08:30 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201908061708.x76H8Upt037712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 6 Aug 2019 17:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350642 - in releng: 11.2/contrib/llvm/projects/libunwind/src 12.0/contrib/llvm/projects/libunwind/src X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/contrib/llvm/projects/libunwind/src 12.0/contrib/llvm/projects/libunwind/src X-SVN-Commit-Revision: 350642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:08:31 -0000 Author: gordon Date: Tue Aug 6 17:08:30 2019 New Revision: 350642 URL: https://svnweb.freebsd.org/changeset/base/350642 Log: Fix incorrect exception handling. Approved by: so Security: FreeBSD-EN-19:15.libunwind Modified: releng/11.2/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp releng/12.0/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Modified: releng/11.2/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp ============================================================================== --- releng/11.2/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Tue Aug 6 17:07:43 2019 (r350641) +++ releng/11.2/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Tue Aug 6 17:08:30 2019 (r350642) @@ -68,7 +68,9 @@ void EHHeaderParser::decodeEHHdr(A &addressSpace, p ehHdrInfo.eh_frame_ptr = addressSpace.getEncodedP(p, ehHdrEnd, eh_frame_ptr_enc, ehHdrStart); ehHdrInfo.fde_count = - addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart); + fde_count_enc == DW_EH_PE_omit + ? 0 + : addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart); ehHdrInfo.table = p; } Modified: releng/12.0/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp ============================================================================== --- releng/12.0/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Tue Aug 6 17:07:43 2019 (r350641) +++ releng/12.0/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Tue Aug 6 17:08:30 2019 (r350642) @@ -68,7 +68,9 @@ void EHHeaderParser::decodeEHHdr(A &addressSpace, p ehHdrInfo.eh_frame_ptr = addressSpace.getEncodedP(p, ehHdrEnd, eh_frame_ptr_enc, ehHdrStart); ehHdrInfo.fde_count = - addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart); + fde_count_enc == DW_EH_PE_omit + ? 0 + : addressSpace.getEncodedP(p, ehHdrEnd, fde_count_enc, ehHdrStart); ehHdrInfo.table = p; } From owner-svn-src-all@freebsd.org Tue Aug 6 17:07:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4696EC5E06; Tue, 6 Aug 2019 17:07:44 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631KX16qVz4DKc; Tue, 6 Aug 2019 17:07:44 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0840B2F12B; Tue, 6 Aug 2019 17:07:44 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76H7hgQ037625; Tue, 6 Aug 2019 17:07:43 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76H7hRg037622; Tue, 6 Aug 2019 17:07:43 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201908061707.x76H7hRg037622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 6 Aug 2019 17:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350641 - in releng/12.0/sys: kern sys X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng/12.0/sys: kern sys X-SVN-Commit-Revision: 350641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:07:44 -0000 Author: gordon Date: Tue Aug 6 17:07:43 2019 New Revision: 350641 URL: https://svnweb.freebsd.org/changeset/base/350641 Log: Fix incorrect locking in epoch(9). Approved by: so Security: FreeBSD-EN-19:14.epoch Modified: releng/12.0/sys/kern/subr_epoch.c releng/12.0/sys/kern/subr_turnstile.c releng/12.0/sys/sys/turnstile.h Modified: releng/12.0/sys/kern/subr_epoch.c ============================================================================== --- releng/12.0/sys/kern/subr_epoch.c Tue Aug 6 17:05:58 2019 (r350640) +++ releng/12.0/sys/kern/subr_epoch.c Tue Aug 6 17:07:43 2019 (r350641) @@ -325,24 +325,20 @@ epoch_block_handler_preempt(struct ck_epoch *global __ */ critical_enter(); thread_unlock(td); - owner = turnstile_lock(ts, &lock); - /* - * The owner pointer indicates that the lock succeeded. Only - * in case we hold the lock and the turnstile we locked is still - * the one that curwaittd is blocked on can we continue. Otherwise - * The turnstile pointer has been changed out from underneath - * us, as in the case where the lock holder has signalled curwaittd, - * and we need to continue. - */ - if (owner != NULL && ts == curwaittd->td_blocked) { - MPASS(TD_IS_INHIBITED(curwaittd) && TD_ON_LOCK(curwaittd)); - critical_exit(); - turnstile_wait(ts, owner, curwaittd->td_tsqueue); - counter_u64_add(turnstile_count, 1); - thread_lock(td); - return; - } else if (owner != NULL) + + if (turnstile_lock(ts, &lock, &owner)) { + if (ts == curwaittd->td_blocked) { + MPASS(TD_IS_INHIBITED(curwaittd) && + TD_ON_LOCK(curwaittd)); + critical_exit(); + turnstile_wait(ts, owner, + curwaittd->td_tsqueue); + counter_u64_add(turnstile_count, 1); + thread_lock(td); + return; + } turnstile_unlock(ts, lock); + } thread_lock(td); critical_exit(); KASSERT(td->td_locks == locksheld, Modified: releng/12.0/sys/kern/subr_turnstile.c ============================================================================== --- releng/12.0/sys/kern/subr_turnstile.c Tue Aug 6 17:05:58 2019 (r350640) +++ releng/12.0/sys/kern/subr_turnstile.c Tue Aug 6 17:07:43 2019 (r350641) @@ -566,24 +566,26 @@ turnstile_trywait(struct lock_object *lock) return (ts); } -struct thread * -turnstile_lock(struct turnstile *ts, struct lock_object **lockp) +bool +turnstile_lock(struct turnstile *ts, struct lock_object **lockp, + struct thread **tdp) { struct turnstile_chain *tc; struct lock_object *lock; if ((lock = ts->ts_lockobj) == NULL) - return (NULL); + return (false); tc = TC_LOOKUP(lock); mtx_lock_spin(&tc->tc_lock); mtx_lock_spin(&ts->ts_lock); if (__predict_false(lock != ts->ts_lockobj)) { mtx_unlock_spin(&tc->tc_lock); mtx_unlock_spin(&ts->ts_lock); - return (NULL); + return (false); } *lockp = lock; - return (ts->ts_owner); + *tdp = ts->ts_owner; + return (true); } void Modified: releng/12.0/sys/sys/turnstile.h ============================================================================== --- releng/12.0/sys/sys/turnstile.h Tue Aug 6 17:05:58 2019 (r350640) +++ releng/12.0/sys/sys/turnstile.h Tue Aug 6 17:07:43 2019 (r350641) @@ -100,7 +100,8 @@ int turnstile_signal(struct turnstile *, int); struct turnstile *turnstile_trywait(struct lock_object *); void turnstile_unpend(struct turnstile *); void turnstile_wait(struct turnstile *, struct thread *, int); -struct thread *turnstile_lock(struct turnstile *, struct lock_object **); +bool turnstile_lock(struct turnstile *, struct lock_object **, + struct thread **); void turnstile_unlock(struct turnstile *, struct lock_object *); void turnstile_assert(struct turnstile *); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Tue Aug 6 17:12:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A92E0C5FEB; Tue, 6 Aug 2019 17:12:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631Qp3fdYz4F0G; Tue, 6 Aug 2019 17:12:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F03D2F2C3; Tue, 6 Aug 2019 17:12:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76HCIDu042856; Tue, 6 Aug 2019 17:12:18 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76HCHt6042854; Tue, 6 Aug 2019 17:12:17 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201908061712.x76HCHt6042854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 6 Aug 2019 17:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350646 - in releng: 11.2/contrib/bsnmp/lib 11.3/contrib/bsnmp/lib 12.0/contrib/bsnmp/lib X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/contrib/bsnmp/lib 11.3/contrib/bsnmp/lib 12.0/contrib/bsnmp/lib X-SVN-Commit-Revision: 350646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:12:18 -0000 Author: gordon Date: Tue Aug 6 17:12:17 2019 New Revision: 350646 URL: https://svnweb.freebsd.org/changeset/base/350646 Log: Fix insufficient message length validation in bsnmp library. Approved by: so Security: FreeBSD-SA-19:20.bsnmp Security: CVE-2019-5610 Modified: releng/11.2/contrib/bsnmp/lib/asn1.c releng/11.3/contrib/bsnmp/lib/asn1.c releng/12.0/contrib/bsnmp/lib/asn1.c Modified: releng/11.2/contrib/bsnmp/lib/asn1.c ============================================================================== --- releng/11.2/contrib/bsnmp/lib/asn1.c Tue Aug 6 17:11:30 2019 (r350645) +++ releng/11.2/contrib/bsnmp/lib/asn1.c Tue Aug 6 17:12:17 2019 (r350646) @@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le *len = *b->asn_cptr++; b->asn_len--; } + if (*len > b->asn_len) { + asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len); + return (ASN_ERR_EOBUF); + } + return (ASN_ERR_OK); } Modified: releng/11.3/contrib/bsnmp/lib/asn1.c ============================================================================== --- releng/11.3/contrib/bsnmp/lib/asn1.c Tue Aug 6 17:11:30 2019 (r350645) +++ releng/11.3/contrib/bsnmp/lib/asn1.c Tue Aug 6 17:12:17 2019 (r350646) @@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le *len = *b->asn_cptr++; b->asn_len--; } + if (*len > b->asn_len) { + asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len); + return (ASN_ERR_EOBUF); + } + return (ASN_ERR_OK); } Modified: releng/12.0/contrib/bsnmp/lib/asn1.c ============================================================================== --- releng/12.0/contrib/bsnmp/lib/asn1.c Tue Aug 6 17:11:30 2019 (r350645) +++ releng/12.0/contrib/bsnmp/lib/asn1.c Tue Aug 6 17:12:17 2019 (r350646) @@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le *len = *b->asn_cptr++; b->asn_len--; } + if (*len > b->asn_len) { + asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len); + return (ASN_ERR_EOBUF); + } + return (ASN_ERR_OK); } From owner-svn-src-all@freebsd.org Tue Aug 6 17:11:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 349F2C5E6D; Tue, 6 Aug 2019 17:11:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631Pf1Jpxz4DdG; Tue, 6 Aug 2019 17:11:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E899D2F15A; Tue, 6 Aug 2019 17:11:17 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76HBHiU039010; Tue, 6 Aug 2019 17:11:17 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76HBHa6039007; Tue, 6 Aug 2019 17:11:17 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201908061711.x76HBHa6039007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 6 Aug 2019 17:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350644 - in releng: 11.2/sys/netinet6 11.3/sys/netinet6 12.0/sys/netinet6 X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/sys/netinet6 11.3/sys/netinet6 12.0/sys/netinet6 X-SVN-Commit-Revision: 350644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:11:18 -0000 Author: gordon Date: Tue Aug 6 17:11:17 2019 New Revision: 350644 URL: https://svnweb.freebsd.org/changeset/base/350644 Log: Fix ICMPv6 / MLDv2 out-of-bounds memory access. Approved by: so Security: FreeBSD-SA-19:19.mldv2 Security: CVE-2019-5608 Modified: releng/11.2/sys/netinet6/mld6.c releng/11.3/sys/netinet6/mld6.c releng/12.0/sys/netinet6/mld6.c Modified: releng/11.2/sys/netinet6/mld6.c ============================================================================== --- releng/11.2/sys/netinet6/mld6.c Tue Aug 6 17:09:47 2019 (r350643) +++ releng/11.2/sys/netinet6/mld6.c Tue Aug 6 17:11:17 2019 (r350644) @@ -137,14 +137,15 @@ static int mld_v2_enqueue_group_record(struct mbufq *, struct in6_multi *, const int, const int, const int, const int); static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *, - struct mbuf *, const int, const int); + struct mbuf *, struct mldv2_query *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, struct mbufq *); static void mld_v2_process_group_timers(struct mld_ifsoftc *, struct mbufq *, struct mbufq *, struct in6_multi *, const int); static int mld_v2_process_group_query(struct in6_multi *, - struct mld_ifsoftc *mli, int, struct mbuf *, const int); + struct mld_ifsoftc *mli, int, struct mbuf *, + struct mldv2_query *, const int); static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); @@ -794,16 +795,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t * Process a received MLDv2 general, group-specific or * group-and-source-specific query. * - * Assumes that the query header has been pulled up to sizeof(mldv2_query). + * Assumes that mld points to a struct mldv2_query which is stored in + * contiguous memory. * * Return 0 if successful, otherwise an appropriate error code is returned. */ static int mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, - struct mbuf *m, const int off, const int icmp6len) + struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len) { struct mld_ifsoftc *mli; - struct mldv2_query *mld; struct in6_multi *inm; uint32_t maxdelay, nsrc, qqi; int is_general_query; @@ -828,8 +829,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp)); - mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off); - maxdelay = ntohs(mld->mld_maxdelay); /* in 1/10ths of a second */ if (maxdelay >= 32768) { maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) << @@ -954,7 +953,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 * group-specific or group-and-source query. */ if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer) - mld_v2_process_group_query(inm, mli, timer, m, off); + mld_v2_process_group_query(inm, mli, timer, m, mld, off); /* XXX Clear embedded scope ID as userland won't expect it. */ in6_clearscope(&mld->mld_addr); @@ -975,9 +974,8 @@ out_locked: */ static int mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli, - int timer, struct mbuf *m0, const int off) + int timer, struct mbuf *m0, struct mldv2_query *mld, const int off) { - struct mldv2_query *mld; int retval; uint16_t nsrc; @@ -985,7 +983,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru MLD_LOCK_ASSERT(); retval = 0; - mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off); switch (inm->in6m_state) { case MLD_NOT_MEMBER: @@ -1005,6 +1002,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru nsrc = ntohs(mld->mld_numsrc); + /* Length should be checked by calling function. */ + KASSERT((m0->m_flags & M_PKTHDR) == 0 || + m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), + ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)", + m0->m_pkthdr.len, off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), m0)); + + /* * Deal with group-specific queries upfront. * If any group query is already pending, purge any recorded @@ -1046,28 +1052,20 @@ mld_v2_process_group_query(struct in6_multi *inm, stru * report for those sources. */ if (inm->in6m_nsrc > 0) { - struct mbuf *m; - uint8_t *sp; + struct in6_addr srcaddr; int i, nrecorded; int soff; - m = m0; soff = off + sizeof(struct mldv2_query); nrecorded = 0; for (i = 0; i < nsrc; i++) { - sp = mtod(m, uint8_t *) + soff; - retval = in6m_record_source(inm, - (const struct in6_addr *)sp); + m_copydata(m0, soff, sizeof(struct in6_addr), + (caddr_t)&srcaddr); + retval = in6m_record_source(inm, &srcaddr); if (retval < 0) break; nrecorded += retval; soff += sizeof(struct in6_addr); - if (soff >= m->m_len) { - soff = soff - m->m_len; - m = m->m_next; - if (m == NULL) - break; - } } if (nrecorded > 0) { CTR1(KTR_MLD, @@ -1276,8 +1274,8 @@ mld_input(struct mbuf *m, int off, int icmp6len) if (mld_v1_input_query(ifp, ip6, mld) != 0) return (0); } else if (icmp6len >= sizeof(struct mldv2_query)) { - if (mld_v2_input_query(ifp, ip6, m, off, - icmp6len) != 0) + if (mld_v2_input_query(ifp, ip6, m, + (struct mldv2_query *)mld, off, icmp6len) != 0) return (0); } break; Modified: releng/11.3/sys/netinet6/mld6.c ============================================================================== --- releng/11.3/sys/netinet6/mld6.c Tue Aug 6 17:09:47 2019 (r350643) +++ releng/11.3/sys/netinet6/mld6.c Tue Aug 6 17:11:17 2019 (r350644) @@ -137,14 +137,15 @@ static int mld_v2_enqueue_group_record(struct mbufq *, struct in6_multi *, const int, const int, const int, const int); static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *, - struct mbuf *, const int, const int); + struct mbuf *, struct mldv2_query *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, struct mbufq *); static void mld_v2_process_group_timers(struct mld_ifsoftc *, struct mbufq *, struct mbufq *, struct in6_multi *, const int); static int mld_v2_process_group_query(struct in6_multi *, - struct mld_ifsoftc *mli, int, struct mbuf *, const int); + struct mld_ifsoftc *mli, int, struct mbuf *, + struct mldv2_query *, const int); static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); @@ -794,16 +795,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t * Process a received MLDv2 general, group-specific or * group-and-source-specific query. * - * Assumes that the query header has been pulled up to sizeof(mldv2_query). + * Assumes that mld points to a struct mldv2_query which is stored in + * contiguous memory. * * Return 0 if successful, otherwise an appropriate error code is returned. */ static int mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, - struct mbuf *m, const int off, const int icmp6len) + struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len) { struct mld_ifsoftc *mli; - struct mldv2_query *mld; struct in6_multi *inm; uint32_t maxdelay, nsrc, qqi; int is_general_query; @@ -828,8 +829,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp)); - mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off); - maxdelay = ntohs(mld->mld_maxdelay); /* in 1/10ths of a second */ if (maxdelay >= 32768) { maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) << @@ -954,7 +953,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 * group-specific or group-and-source query. */ if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer) - mld_v2_process_group_query(inm, mli, timer, m, off); + mld_v2_process_group_query(inm, mli, timer, m, mld, off); /* XXX Clear embedded scope ID as userland won't expect it. */ in6_clearscope(&mld->mld_addr); @@ -975,9 +974,8 @@ out_locked: */ static int mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli, - int timer, struct mbuf *m0, const int off) + int timer, struct mbuf *m0, struct mldv2_query *mld, const int off) { - struct mldv2_query *mld; int retval; uint16_t nsrc; @@ -985,7 +983,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru MLD_LOCK_ASSERT(); retval = 0; - mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off); switch (inm->in6m_state) { case MLD_NOT_MEMBER: @@ -1005,6 +1002,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru nsrc = ntohs(mld->mld_numsrc); + /* Length should be checked by calling function. */ + KASSERT((m0->m_flags & M_PKTHDR) == 0 || + m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), + ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)", + m0->m_pkthdr.len, off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), m0)); + + /* * Deal with group-specific queries upfront. * If any group query is already pending, purge any recorded @@ -1046,28 +1052,20 @@ mld_v2_process_group_query(struct in6_multi *inm, stru * report for those sources. */ if (inm->in6m_nsrc > 0) { - struct mbuf *m; - uint8_t *sp; + struct in6_addr srcaddr; int i, nrecorded; int soff; - m = m0; soff = off + sizeof(struct mldv2_query); nrecorded = 0; for (i = 0; i < nsrc; i++) { - sp = mtod(m, uint8_t *) + soff; - retval = in6m_record_source(inm, - (const struct in6_addr *)sp); + m_copydata(m0, soff, sizeof(struct in6_addr), + (caddr_t)&srcaddr); + retval = in6m_record_source(inm, &srcaddr); if (retval < 0) break; nrecorded += retval; soff += sizeof(struct in6_addr); - if (soff >= m->m_len) { - soff = soff - m->m_len; - m = m->m_next; - if (m == NULL) - break; - } } if (nrecorded > 0) { CTR1(KTR_MLD, @@ -1276,8 +1274,8 @@ mld_input(struct mbuf *m, int off, int icmp6len) if (mld_v1_input_query(ifp, ip6, mld) != 0) return (0); } else if (icmp6len >= sizeof(struct mldv2_query)) { - if (mld_v2_input_query(ifp, ip6, m, off, - icmp6len) != 0) + if (mld_v2_input_query(ifp, ip6, m, + (struct mldv2_query *)mld, off, icmp6len) != 0) return (0); } break; Modified: releng/12.0/sys/netinet6/mld6.c ============================================================================== --- releng/12.0/sys/netinet6/mld6.c Tue Aug 6 17:09:47 2019 (r350643) +++ releng/12.0/sys/netinet6/mld6.c Tue Aug 6 17:11:17 2019 (r350644) @@ -139,14 +139,15 @@ static int mld_v2_enqueue_group_record(struct mbufq *, struct in6_multi *, const int, const int, const int, const int); static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *, - struct mbuf *, const int, const int); + struct mbuf *, struct mldv2_query *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, struct mbufq *); static void mld_v2_process_group_timers(struct in6_multi_head *, struct mbufq *, struct mbufq *, struct in6_multi *, const int); static int mld_v2_process_group_query(struct in6_multi *, - struct mld_ifsoftc *mli, int, struct mbuf *, const int); + struct mld_ifsoftc *mli, int, struct mbuf *, + struct mldv2_query *, const int); static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); @@ -797,16 +798,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t * Process a received MLDv2 general, group-specific or * group-and-source-specific query. * - * Assumes that the query header has been pulled up to sizeof(mldv2_query). + * Assumes that mld points to a struct mldv2_query which is stored in + * contiguous memory. * * Return 0 if successful, otherwise an appropriate error code is returned. */ static int mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, - struct mbuf *m, const int off, const int icmp6len) + struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len) { struct mld_ifsoftc *mli; - struct mldv2_query *mld; struct in6_multi *inm; uint32_t maxdelay, nsrc, qqi; int is_general_query; @@ -831,8 +832,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp)); - mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off); - maxdelay = ntohs(mld->mld_maxdelay); /* in 1/10ths of a second */ if (maxdelay >= 32768) { maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) << @@ -957,7 +956,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 * group-specific or group-and-source query. */ if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer) - mld_v2_process_group_query(inm, mli, timer, m, off); + mld_v2_process_group_query(inm, mli, timer, m, mld, off); /* XXX Clear embedded scope ID as userland won't expect it. */ in6_clearscope(&mld->mld_addr); @@ -978,9 +977,8 @@ out_locked: */ static int mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli, - int timer, struct mbuf *m0, const int off) + int timer, struct mbuf *m0, struct mldv2_query *mld, const int off) { - struct mldv2_query *mld; int retval; uint16_t nsrc; @@ -988,7 +986,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru MLD_LOCK_ASSERT(); retval = 0; - mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off); switch (inm->in6m_state) { case MLD_NOT_MEMBER: @@ -1008,6 +1005,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru nsrc = ntohs(mld->mld_numsrc); + /* Length should be checked by calling function. */ + KASSERT((m0->m_flags & M_PKTHDR) == 0 || + m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), + ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)", + m0->m_pkthdr.len, off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), m0)); + + /* * Deal with group-specific queries upfront. * If any group query is already pending, purge any recorded @@ -1049,28 +1055,20 @@ mld_v2_process_group_query(struct in6_multi *inm, stru * report for those sources. */ if (inm->in6m_nsrc > 0) { - struct mbuf *m; - uint8_t *sp; + struct in6_addr srcaddr; int i, nrecorded; int soff; - m = m0; soff = off + sizeof(struct mldv2_query); nrecorded = 0; for (i = 0; i < nsrc; i++) { - sp = mtod(m, uint8_t *) + soff; - retval = in6m_record_source(inm, - (const struct in6_addr *)sp); + m_copydata(m0, soff, sizeof(struct in6_addr), + (caddr_t)&srcaddr); + retval = in6m_record_source(inm, &srcaddr); if (retval < 0) break; nrecorded += retval; soff += sizeof(struct in6_addr); - if (soff >= m->m_len) { - soff = soff - m->m_len; - m = m->m_next; - if (m == NULL) - break; - } } if (nrecorded > 0) { CTR1(KTR_MLD, @@ -1279,8 +1277,8 @@ mld_input(struct mbuf *m, int off, int icmp6len) if (mld_v1_input_query(ifp, ip6, mld) != 0) return (0); } else if (icmp6len >= sizeof(struct mldv2_query)) { - if (mld_v2_input_query(ifp, ip6, m, off, - icmp6len) != 0) + if (mld_v2_input_query(ifp, ip6, m, + (struct mldv2_query *)mld, off, icmp6len) != 0) return (0); } break; From owner-svn-src-all@freebsd.org Tue Aug 6 17:13:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D9BCC6036; Tue, 6 Aug 2019 17:13:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631SP6bctz4FB8; Tue, 6 Aug 2019 17:13:41 +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 C42552F2F1; Tue, 6 Aug 2019 17:13:41 +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 x76HDfZJ043964; Tue, 6 Aug 2019 17:13:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76HDfl3043963; Tue, 6 Aug 2019 17:13:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908061713.x76HDfl3043963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 6 Aug 2019 17:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350648 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 350648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:13:42 -0000 Author: emaste Date: Tue Aug 6 17:13:41 2019 New Revision: 350648 URL: https://svnweb.freebsd.org/changeset/base/350648 Log: MFC r350645: Correct ICMPv6/MLDv2 out-of-bounds memory access Previously the ICMPv6 input path incorrectly handled cases where an MLDv2 listener query packet was internally fragmented across multiple mbufs. admbugs: 921 Submitted by: jtl Reported by: CJD of Apple Approved by: so Security: CVE-2019-5608 Modified: stable/12/sys/netinet6/mld6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/mld6.c ============================================================================== --- stable/12/sys/netinet6/mld6.c Tue Aug 6 17:13:17 2019 (r350647) +++ stable/12/sys/netinet6/mld6.c Tue Aug 6 17:13:41 2019 (r350648) @@ -139,14 +139,15 @@ static int mld_v2_enqueue_group_record(struct mbufq *, struct in6_multi *, const int, const int, const int, const int); static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *, - struct mbuf *, const int, const int); + struct mbuf *, struct mldv2_query *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, struct mbufq *); static void mld_v2_process_group_timers(struct in6_multi_head *, struct mbufq *, struct mbufq *, struct in6_multi *, const int); static int mld_v2_process_group_query(struct in6_multi *, - struct mld_ifsoftc *mli, int, struct mbuf *, const int); + struct mld_ifsoftc *mli, int, struct mbuf *, + struct mldv2_query *, const int); static int sysctl_mld_gsr(SYSCTL_HANDLER_ARGS); static int sysctl_mld_ifinfo(SYSCTL_HANDLER_ARGS); @@ -803,16 +804,16 @@ mld_v1_update_group(struct in6_multi *inm, const int t * Process a received MLDv2 general, group-specific or * group-and-source-specific query. * - * Assumes that the query header has been pulled up to sizeof(mldv2_query). + * Assumes that mld points to a struct mldv2_query which is stored in + * contiguous memory. * * Return 0 if successful, otherwise an appropriate error code is returned. */ static int mld_v2_input_query(struct ifnet *ifp, const struct ip6_hdr *ip6, - struct mbuf *m, const int off, const int icmp6len) + struct mbuf *m, struct mldv2_query *mld, const int off, const int icmp6len) { struct mld_ifsoftc *mli; - struct mldv2_query *mld; struct in6_multi *inm; uint32_t maxdelay, nsrc, qqi; int is_general_query; @@ -844,8 +845,6 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 CTR2(KTR_MLD, "input v2 query on ifp %p(%s)", ifp, if_name(ifp)); - mld = (struct mldv2_query *)(mtod(m, uint8_t *) + off); - maxdelay = ntohs(mld->mld_maxdelay); /* in 1/10ths of a second */ if (maxdelay >= 32768) { maxdelay = (MLD_MRC_MANT(maxdelay) | 0x1000) << @@ -970,7 +969,7 @@ mld_v2_input_query(struct ifnet *ifp, const struct ip6 * group-specific or group-and-source query. */ if (mli->mli_v2_timer == 0 || mli->mli_v2_timer >= timer) - mld_v2_process_group_query(inm, mli, timer, m, off); + mld_v2_process_group_query(inm, mli, timer, m, mld, off); /* XXX Clear embedded scope ID as userland won't expect it. */ in6_clearscope(&mld->mld_addr); @@ -991,9 +990,8 @@ out_locked: */ static int mld_v2_process_group_query(struct in6_multi *inm, struct mld_ifsoftc *mli, - int timer, struct mbuf *m0, const int off) + int timer, struct mbuf *m0, struct mldv2_query *mld, const int off) { - struct mldv2_query *mld; int retval; uint16_t nsrc; @@ -1001,7 +999,6 @@ mld_v2_process_group_query(struct in6_multi *inm, stru MLD_LOCK_ASSERT(); retval = 0; - mld = (struct mldv2_query *)(mtod(m0, uint8_t *) + off); switch (inm->in6m_state) { case MLD_NOT_MEMBER: @@ -1021,6 +1018,15 @@ mld_v2_process_group_query(struct in6_multi *inm, stru nsrc = ntohs(mld->mld_numsrc); + /* Length should be checked by calling function. */ + KASSERT((m0->m_flags & M_PKTHDR) == 0 || + m0->m_pkthdr.len >= off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), + ("mldv2 packet is too short: (%d bytes < %zd bytes, m=%p)", + m0->m_pkthdr.len, off + sizeof(struct mldv2_query) + + nsrc * sizeof(struct in6_addr), m0)); + + /* * Deal with group-specific queries upfront. * If any group query is already pending, purge any recorded @@ -1062,28 +1068,20 @@ mld_v2_process_group_query(struct in6_multi *inm, stru * report for those sources. */ if (inm->in6m_nsrc > 0) { - struct mbuf *m; - uint8_t *sp; + struct in6_addr srcaddr; int i, nrecorded; int soff; - m = m0; soff = off + sizeof(struct mldv2_query); nrecorded = 0; for (i = 0; i < nsrc; i++) { - sp = mtod(m, uint8_t *) + soff; - retval = in6m_record_source(inm, - (const struct in6_addr *)sp); + m_copydata(m0, soff, sizeof(struct in6_addr), + (caddr_t)&srcaddr); + retval = in6m_record_source(inm, &srcaddr); if (retval < 0) break; nrecorded += retval; soff += sizeof(struct in6_addr); - if (soff >= m->m_len) { - soff = soff - m->m_len; - m = m->m_next; - if (m == NULL) - break; - } } if (nrecorded > 0) { CTR1(KTR_MLD, @@ -1292,8 +1290,8 @@ mld_input(struct mbuf *m, int off, int icmp6len) if (mld_v1_input_query(ifp, ip6, mld) != 0) return (0); } else if (icmp6len >= sizeof(struct mldv2_query)) { - if (mld_v2_input_query(ifp, ip6, m, off, - icmp6len) != 0) + if (mld_v2_input_query(ifp, ip6, m, + (struct mldv2_query *)mld, off, icmp6len) != 0) return (0); } break; From owner-svn-src-all@freebsd.org Tue Aug 6 18:28:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC4A3C785E; Tue, 6 Aug 2019 18:28:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46337053XLz4KPR; Tue, 6 Aug 2019 18:28:44 +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 8AEFD2FFAB; Tue, 6 Aug 2019 18:28:44 +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 x76ISikV087621; Tue, 6 Aug 2019 18:28:44 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76ISicx087620; Tue, 6 Aug 2019 18:28:44 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201908061828.x76ISicx087620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Aug 2019 18:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350653 - head/sys/geom/label X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/geom/label X-SVN-Commit-Revision: 350653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 18:28:44 -0000 Author: mckusick Date: Tue Aug 6 18:28:44 2019 New Revision: 350653 URL: https://svnweb.freebsd.org/changeset/base/350653 Log: Ignore UFS/FFS superblock check hash failures so as to allow a higher level in the filesystem stack to decide what to do about them. Reported by: Peter Holm Tested by: Peter Holm Sponsored by: Netflix Modified: head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Tue Aug 6 18:15:26 2019 (r350652) +++ head/sys/geom/label/g_label_ufs.c Tue Aug 6 18:28:44 2019 (r350653) @@ -76,8 +76,8 @@ g_label_ufs_taste_common(struct g_consumer *cp, char * label[0] = '\0'; fs = NULL; - if (SBLOCKSIZE % pp->sectorsize != 0 || - ffs_sbget(cp, &fs, STDSB, M_GEOM, g_use_g_read_data) != 0) { + if (SBLOCKSIZE % pp->sectorsize != 0 || ffs_sbget(cp, &fs, + STDSB_NOHASHFAIL, M_GEOM, g_use_g_read_data) != 0) { KASSERT(fs == NULL, ("g_label_ufs_taste_common: non-NULL fs %p\n", fs)); return; From owner-svn-src-all@freebsd.org Tue Aug 6 16:11:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45462C4C59; Tue, 6 Aug 2019 16:11:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46304517Gzz49Rp; Tue, 6 Aug 2019 16:11:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0873B2E67B; Tue, 6 Aug 2019 16:11:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76GB0ik004231; Tue, 6 Aug 2019 16:11:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76GB0ul004230; Tue, 6 Aug 2019 16:11:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201908061611.x76GB0ul004230@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Aug 2019 16:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350636 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 16:11:01 -0000 Author: glebius Date: Tue Aug 6 16:11:00 2019 New Revision: 350636 URL: https://svnweb.freebsd.org/changeset/base/350636 Log: Since r350426 this KASSERT doesn't serve any useful purpose. Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Aug 6 16:09:06 2019 (r350635) +++ head/sys/kern/kern_sendfile.c Tue Aug 6 16:11:00 2019 (r350636) @@ -392,8 +392,6 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, i VM_OBJECT_WUNLOCK(obj); return (EIO); } - KASSERT(rv == VM_PAGER_OK, ("%s: pager fail obj %p page %p", - __func__, obj, pa[i])); SFSTAT_INC(sf_iocnt); SFSTAT_ADD(sf_pages_read, count); From owner-svn-src-all@freebsd.org Tue Aug 6 16:11:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBB08C4C5F; Tue, 6 Aug 2019 16:11:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46304N60Vdz49ZH; Tue, 6 Aug 2019 16:11:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C92842E69C; Tue, 6 Aug 2019 16:11:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76GBGBc005014; Tue, 6 Aug 2019 16:11:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76GBG7u005013; Tue, 6 Aug 2019 16:11:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908061611.x76GBG7u005013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 6 Aug 2019 16:11:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350637 - stable/12/contrib/bsnmp/lib X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/contrib/bsnmp/lib X-SVN-Commit-Revision: 350637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 16:11:17 -0000 Author: emaste Date: Tue Aug 6 16:11:16 2019 New Revision: 350637 URL: https://svnweb.freebsd.org/changeset/base/350637 Log: MFC r350635: bsnmp: add asn1 message length validation admbugs: 780 Submitted by: Guido Vranken, bz Reported by: Guido Vranken Approved by: so Security: CVE-2019-5610 Modified: stable/12/contrib/bsnmp/lib/asn1.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bsnmp/lib/asn1.c ============================================================================== --- stable/12/contrib/bsnmp/lib/asn1.c Tue Aug 6 16:11:00 2019 (r350636) +++ stable/12/contrib/bsnmp/lib/asn1.c Tue Aug 6 16:11:16 2019 (r350637) @@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le *len = *b->asn_cptr++; b->asn_len--; } + if (*len > b->asn_len) { + asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len); + return (ASN_ERR_EOBUF); + } + return (ASN_ERR_OK); } From owner-svn-src-all@freebsd.org Tue Aug 6 17:14:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B828C603D; Tue, 6 Aug 2019 17:14:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631Sz38Mhz4FGV; Tue, 6 Aug 2019 17:14:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DE592F2F2; Tue, 6 Aug 2019 17:14:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76HEBYu044048; Tue, 6 Aug 2019 17:14:11 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76HEAen044043; Tue, 6 Aug 2019 17:14:10 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201908061714.x76HEAen044043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 6 Aug 2019 17:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350649 - in releng: 11.2 11.2/sys/conf 11.3 11.3/sys/conf 12.0 12.0/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2 11.2/sys/conf 11.3 11.3/sys/conf 12.0 12.0/sys/conf X-SVN-Commit-Revision: 350649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:14:11 -0000 Author: gordon Date: Tue Aug 6 17:14:09 2019 New Revision: 350649 URL: https://svnweb.freebsd.org/changeset/base/350649 Log: Bump version information and add UPDATING entries. Approved by: so Modified: releng/11.2/UPDATING releng/11.2/sys/conf/newvers.sh releng/11.3/UPDATING releng/11.3/sys/conf/newvers.sh releng/12.0/UPDATING releng/12.0/sys/conf/newvers.sh Modified: releng/11.2/UPDATING ============================================================================== --- releng/11.2/UPDATING Tue Aug 6 17:13:41 2019 (r350648) +++ releng/11.2/UPDATING Tue Aug 6 17:14:09 2019 (r350649) @@ -16,6 +16,24 @@ 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. +20190806 p13 FreeBSD-EN-19:15.libunwind + FreeBSD-SA-19:18.bzip2 + FreeBSD-SA-19:19.mldv2 + FreeBSD-SA-19:20.bsnmp + FreeBSD-SA-19:21.bhyve + + Fix incorrect exception handling. [EN-19:15.libunwind] + + Fix multiple vulnerabilities in bzip2. [SA-19:18.bzip2] + + Fix ICMPv6 / MLDv2 out-of-bounds memory access. [SA-19:19.mldv2] + + Fix insufficient message length validation in bsnmp library. + [SA-19:20.bsnmp] + + Fix insufficient validation of guest-supplied data (e1000 device). + [SA-19:21.bhyve] + 20190724 p12 FreeBSD-EN-19:13.mds FreeBSD-SA-19:12.telnet FreeBSD-SA-19:13.pts Modified: releng/11.2/sys/conf/newvers.sh ============================================================================== --- releng/11.2/sys/conf/newvers.sh Tue Aug 6 17:13:41 2019 (r350648) +++ releng/11.2/sys/conf/newvers.sh Tue Aug 6 17:14:09 2019 (r350649) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.2" -BRANCH="RELEASE-p12" +BRANCH="RELEASE-p13" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.3/UPDATING ============================================================================== --- releng/11.3/UPDATING Tue Aug 6 17:13:41 2019 (r350648) +++ releng/11.3/UPDATING Tue Aug 6 17:14:09 2019 (r350649) @@ -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. +20190806 p2 FreeBSD-SA-19:18.bzip2 + FreeBSD-SA-19:19.mldv2 + FreeBSD-SA-19:20.bsnmp + FreeBSD-SA-19:21.bhyve + + Fix multiple vulnerabilities in bzip2. [SA-19:18.bzip2] + + Fix ICMPv6 / MLDv2 out-of-bounds memory access. [SA-19:19.mldv2] + + Fix insufficient message length validation in bsnmp library. + [SA-19:20.bsnmp] + + Fix insufficient validation of guest-supplied data (e1000 device). + [SA-19:21.bhyve] + 20190724 p1 FreeBSD-EN-19:13.mds FreeBSD-SA-19:12.telnet FreeBSD-SA-19:13.pts Modified: releng/11.3/sys/conf/newvers.sh ============================================================================== --- releng/11.3/sys/conf/newvers.sh Tue Aug 6 17:13:41 2019 (r350648) +++ releng/11.3/sys/conf/newvers.sh Tue Aug 6 17:14:09 2019 (r350649) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="RELEASE-p1" +BRANCH="RELEASE-p2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/12.0/UPDATING ============================================================================== --- releng/12.0/UPDATING Tue Aug 6 17:13:41 2019 (r350648) +++ releng/12.0/UPDATING Tue Aug 6 17:14:09 2019 (r350649) @@ -16,6 +16,27 @@ 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. +20190806 p9 FreeBSD-EN-19:14.epoch + FreeBSD-EN-19:15.libunwind + FreeBSD-SA-19:18.bzip2 + FreeBSD-SA-19:19.mldv2 + FreeBSD-SA-19:20.bsnmp + FreeBSD-SA-19:21.bhyve + + Fix incorrect locking in epoch(9). [EN-19:14.epoch] + + Fix incorrect exception handling. [EN-19:15.libunwind] + + Fix multiple vulnerabilities in bzip2. [SA-19:18.bzip2] + + Fix ICMPv6 / MLDv2 out-of-bounds memory access. [SA-19:19.mldv2] + + Fix insufficient message length validation in bsnmp library. + [SA-19:20.bsnmp] + + Fix insufficient validation of guest-supplied data (e1000 device). + [SA-19:21.bhyve] + 20190724 p8 FreeBSD-EN-19:13.mds FreeBSD-SA-19:12.telnet FreeBSD-SA-19:13.pts Modified: releng/12.0/sys/conf/newvers.sh ============================================================================== --- releng/12.0/sys/conf/newvers.sh Tue Aug 6 17:13:41 2019 (r350648) +++ releng/12.0/sys/conf/newvers.sh Tue Aug 6 17:14:09 2019 (r350649) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.0" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Tue Aug 6 17:13:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC32DC6024; Tue, 6 Aug 2019 17:13:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4631Ry5Kwzz4F5r; Tue, 6 Aug 2019 17:13:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98BD82F2ED; Tue, 6 Aug 2019 17:13:18 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76HDI9K043901; Tue, 6 Aug 2019 17:13:18 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76HDHDi043896; Tue, 6 Aug 2019 17:13:17 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201908061713.x76HDHDi043896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 6 Aug 2019 17:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r350647 - in releng: 11.2/usr.sbin/bhyve 11.3/usr.sbin/bhyve 12.0/usr.sbin/bhyve X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.2/usr.sbin/bhyve 11.3/usr.sbin/bhyve 12.0/usr.sbin/bhyve X-SVN-Commit-Revision: 350647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 17:13:18 -0000 Author: gordon Date: Tue Aug 6 17:13:17 2019 New Revision: 350647 URL: https://svnweb.freebsd.org/changeset/base/350647 Log: Fix insufficient validation of guest-supplied data (e1000 device). Approved by: so Security: FreeBSD-SA-19:21.bhyve Security: CVE-2019-5609 Modified: releng/11.2/usr.sbin/bhyve/pci_e82545.c releng/11.3/usr.sbin/bhyve/pci_e82545.c releng/12.0/usr.sbin/bhyve/pci_e82545.c Modified: releng/11.2/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- releng/11.2/usr.sbin/bhyve/pci_e82545.c Tue Aug 6 17:12:17 2019 (r350646) +++ releng/11.2/usr.sbin/bhyve/pci_e82545.c Tue Aug 6 17:13:17 2019 (r350647) @@ -1076,8 +1076,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head struct ck_info ckinfo[2]; struct iovec *iov; union e1000_tx_udesc *dsc; - int desc, dtype, len, ntype, iovcnt, tlen, hdrlen, vlen, tcp, tso; + int desc, dtype, len, ntype, iovcnt, tlen, tcp, tso; int mss, paylen, seg, tiovcnt, left, now, nleft, nnow, pv, pvoff; + unsigned hdrlen, vlen; uint32_t tcpsum, tcpseq; uint16_t ipcs, tcpcs, ipid, ohead; @@ -1221,6 +1222,68 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head } else { /* In case of TSO header length provided by software. */ hdrlen = sc->esc_txctx.tcp_seg_setup.fields.hdr_len; + + /* + * Cap the header length at 240 based on 7.2.4.5 of + * the Intel 82576EB (Rev 2.63) datasheet. + */ + if (hdrlen > 240) { + WPRINTF("TSO hdrlen too large: %d\r\n", hdrlen); + goto done; + } + + /* + * If VLAN insertion is requested, ensure the header + * at least holds the amount of data copied during + * VLAN insertion below. + * + * XXX: Realistic packets will include a full Ethernet + * header before the IP header at ckinfo[0].ck_start, + * but this check is sufficient to prevent + * out-of-bounds access below. + */ + if (vlen != 0 && hdrlen < ETHER_ADDR_LEN*2) { + WPRINTF("TSO hdrlen too small for vlan insertion " + "(%d vs %d) -- dropped\r\n", hdrlen, + ETHER_ADDR_LEN*2); + goto done; + } + + /* + * Ensure that the header length covers the used fields + * in the IP and TCP headers as well as the IP and TCP + * checksums. The following fields are accessed below: + * + * Header | Field | Offset | Length + * -------+-------+--------+------- + * IPv4 | len | 2 | 2 + * IPv4 | ID | 4 | 2 + * IPv6 | len | 4 | 2 + * TCP | seq # | 4 | 4 + * TCP | flags | 13 | 1 + * UDP | len | 4 | 4 + */ + if (hdrlen < ckinfo[0].ck_start + 6 || + hdrlen < ckinfo[0].ck_off + 2) { + WPRINTF("TSO hdrlen too small for IP fields (%d) " + "-- dropped\r\n", hdrlen); + goto done; + } + if (sc->esc_txctx.cmd_and_length & E1000_TXD_CMD_TCP) { + if (hdrlen < ckinfo[1].ck_start + 14 || + (ckinfo[1].ck_valid && + hdrlen < ckinfo[1].ck_off + 2)) { + WPRINTF("TSO hdrlen too small for TCP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } else { + if (hdrlen < ckinfo[1].ck_start + 8) { + WPRINTF("TSO hdrlen too small for UDP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } } /* Allocate, fill and prepend writable header vector. */ @@ -1242,7 +1305,8 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head iovcnt++; iov->iov_base = hdr; iov->iov_len = hdrlen; - } + } else + hdr = NULL; /* Insert VLAN tag. */ if (vlen != 0) { @@ -1284,7 +1348,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head DPRINTF("tx %s segmentation offload %d+%d/%d bytes %d iovs\r\n", tcp ? "TCP" : "UDP", hdrlen, paylen, mss, iovcnt); ipid = ntohs(*(uint16_t *)&hdr[ckinfo[0].ck_start + 4]); - tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); + tcpseq = 0; + if (tcp) + tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); ipcs = *(uint16_t *)&hdr[ckinfo[0].ck_off]; tcpcs = 0; if (ckinfo[1].ck_valid) /* Save partial pseudo-header checksum. */ Modified: releng/11.3/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- releng/11.3/usr.sbin/bhyve/pci_e82545.c Tue Aug 6 17:12:17 2019 (r350646) +++ releng/11.3/usr.sbin/bhyve/pci_e82545.c Tue Aug 6 17:13:17 2019 (r350647) @@ -1078,8 +1078,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head struct ck_info ckinfo[2]; struct iovec *iov; union e1000_tx_udesc *dsc; - int desc, dtype, len, ntype, iovcnt, tlen, hdrlen, vlen, tcp, tso; + int desc, dtype, len, ntype, iovcnt, tlen, tcp, tso; int mss, paylen, seg, tiovcnt, left, now, nleft, nnow, pv, pvoff; + unsigned hdrlen, vlen; uint32_t tcpsum, tcpseq; uint16_t ipcs, tcpcs, ipid, ohead; @@ -1223,6 +1224,68 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head } else { /* In case of TSO header length provided by software. */ hdrlen = sc->esc_txctx.tcp_seg_setup.fields.hdr_len; + + /* + * Cap the header length at 240 based on 7.2.4.5 of + * the Intel 82576EB (Rev 2.63) datasheet. + */ + if (hdrlen > 240) { + WPRINTF("TSO hdrlen too large: %d\r\n", hdrlen); + goto done; + } + + /* + * If VLAN insertion is requested, ensure the header + * at least holds the amount of data copied during + * VLAN insertion below. + * + * XXX: Realistic packets will include a full Ethernet + * header before the IP header at ckinfo[0].ck_start, + * but this check is sufficient to prevent + * out-of-bounds access below. + */ + if (vlen != 0 && hdrlen < ETHER_ADDR_LEN*2) { + WPRINTF("TSO hdrlen too small for vlan insertion " + "(%d vs %d) -- dropped\r\n", hdrlen, + ETHER_ADDR_LEN*2); + goto done; + } + + /* + * Ensure that the header length covers the used fields + * in the IP and TCP headers as well as the IP and TCP + * checksums. The following fields are accessed below: + * + * Header | Field | Offset | Length + * -------+-------+--------+------- + * IPv4 | len | 2 | 2 + * IPv4 | ID | 4 | 2 + * IPv6 | len | 4 | 2 + * TCP | seq # | 4 | 4 + * TCP | flags | 13 | 1 + * UDP | len | 4 | 4 + */ + if (hdrlen < ckinfo[0].ck_start + 6 || + hdrlen < ckinfo[0].ck_off + 2) { + WPRINTF("TSO hdrlen too small for IP fields (%d) " + "-- dropped\r\n", hdrlen); + goto done; + } + if (sc->esc_txctx.cmd_and_length & E1000_TXD_CMD_TCP) { + if (hdrlen < ckinfo[1].ck_start + 14 || + (ckinfo[1].ck_valid && + hdrlen < ckinfo[1].ck_off + 2)) { + WPRINTF("TSO hdrlen too small for TCP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } else { + if (hdrlen < ckinfo[1].ck_start + 8) { + WPRINTF("TSO hdrlen too small for UDP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } } /* Allocate, fill and prepend writable header vector. */ @@ -1244,7 +1307,8 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head iovcnt++; iov->iov_base = hdr; iov->iov_len = hdrlen; - } + } else + hdr = NULL; /* Insert VLAN tag. */ if (vlen != 0) { @@ -1286,7 +1350,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head DPRINTF("tx %s segmentation offload %d+%d/%d bytes %d iovs\r\n", tcp ? "TCP" : "UDP", hdrlen, paylen, mss, iovcnt); ipid = ntohs(*(uint16_t *)&hdr[ckinfo[0].ck_start + 4]); - tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); + tcpseq = 0; + if (tcp) + tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); ipcs = *(uint16_t *)&hdr[ckinfo[0].ck_off]; tcpcs = 0; if (ckinfo[1].ck_valid) /* Save partial pseudo-header checksum. */ Modified: releng/12.0/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- releng/12.0/usr.sbin/bhyve/pci_e82545.c Tue Aug 6 17:12:17 2019 (r350646) +++ releng/12.0/usr.sbin/bhyve/pci_e82545.c Tue Aug 6 17:13:17 2019 (r350647) @@ -1078,8 +1078,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head struct ck_info ckinfo[2]; struct iovec *iov; union e1000_tx_udesc *dsc; - int desc, dtype, len, ntype, iovcnt, tlen, hdrlen, vlen, tcp, tso; + int desc, dtype, len, ntype, iovcnt, tlen, tcp, tso; int mss, paylen, seg, tiovcnt, left, now, nleft, nnow, pv, pvoff; + unsigned hdrlen, vlen; uint32_t tcpsum, tcpseq; uint16_t ipcs, tcpcs, ipid, ohead; @@ -1223,6 +1224,68 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head } else { /* In case of TSO header length provided by software. */ hdrlen = sc->esc_txctx.tcp_seg_setup.fields.hdr_len; + + /* + * Cap the header length at 240 based on 7.2.4.5 of + * the Intel 82576EB (Rev 2.63) datasheet. + */ + if (hdrlen > 240) { + WPRINTF("TSO hdrlen too large: %d\r\n", hdrlen); + goto done; + } + + /* + * If VLAN insertion is requested, ensure the header + * at least holds the amount of data copied during + * VLAN insertion below. + * + * XXX: Realistic packets will include a full Ethernet + * header before the IP header at ckinfo[0].ck_start, + * but this check is sufficient to prevent + * out-of-bounds access below. + */ + if (vlen != 0 && hdrlen < ETHER_ADDR_LEN*2) { + WPRINTF("TSO hdrlen too small for vlan insertion " + "(%d vs %d) -- dropped\r\n", hdrlen, + ETHER_ADDR_LEN*2); + goto done; + } + + /* + * Ensure that the header length covers the used fields + * in the IP and TCP headers as well as the IP and TCP + * checksums. The following fields are accessed below: + * + * Header | Field | Offset | Length + * -------+-------+--------+------- + * IPv4 | len | 2 | 2 + * IPv4 | ID | 4 | 2 + * IPv6 | len | 4 | 2 + * TCP | seq # | 4 | 4 + * TCP | flags | 13 | 1 + * UDP | len | 4 | 4 + */ + if (hdrlen < ckinfo[0].ck_start + 6 || + hdrlen < ckinfo[0].ck_off + 2) { + WPRINTF("TSO hdrlen too small for IP fields (%d) " + "-- dropped\r\n", hdrlen); + goto done; + } + if (sc->esc_txctx.cmd_and_length & E1000_TXD_CMD_TCP) { + if (hdrlen < ckinfo[1].ck_start + 14 || + (ckinfo[1].ck_valid && + hdrlen < ckinfo[1].ck_off + 2)) { + WPRINTF("TSO hdrlen too small for TCP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } else { + if (hdrlen < ckinfo[1].ck_start + 8) { + WPRINTF("TSO hdrlen too small for UDP fields " + "(%d) -- dropped\r\n", hdrlen); + goto done; + } + } } /* Allocate, fill and prepend writable header vector. */ @@ -1244,7 +1307,8 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head iovcnt++; iov->iov_base = hdr; iov->iov_len = hdrlen; - } + } else + hdr = NULL; /* Insert VLAN tag. */ if (vlen != 0) { @@ -1286,7 +1350,9 @@ e82545_transmit(struct e82545_softc *sc, uint16_t head DPRINTF("tx %s segmentation offload %d+%d/%d bytes %d iovs\r\n", tcp ? "TCP" : "UDP", hdrlen, paylen, mss, iovcnt); ipid = ntohs(*(uint16_t *)&hdr[ckinfo[0].ck_start + 4]); - tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); + tcpseq = 0; + if (tcp) + tcpseq = ntohl(*(uint32_t *)&hdr[ckinfo[1].ck_start + 4]); ipcs = *(uint16_t *)&hdr[ckinfo[0].ck_off]; tcpcs = 0; if (ckinfo[1].ck_valid) /* Save partial pseudo-header checksum. */ From owner-svn-src-all@freebsd.org Tue Aug 6 18:15:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB5D9C75AE; Tue, 6 Aug 2019 18:15:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4632qg52HKz4K0D; Tue, 6 Aug 2019 18:15:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EFE92FDE5; Tue, 6 Aug 2019 18:15:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76IFRqe081461; Tue, 6 Aug 2019 18:15:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76IFRo2081459; Tue, 6 Aug 2019 18:15:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908061815.x76IFRo2081459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 6 Aug 2019 18:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350652 - head/sbin/nvmecontrol X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol X-SVN-Commit-Revision: 350652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 18:15:27 -0000 Author: imp Date: Tue Aug 6 18:15:26 2019 New Revision: 350652 URL: https://svnweb.freebsd.org/changeset/base/350652 Log: Fix mismerge. I merged passthru.c from the wrong branch (it was a branch that went further in a direction I wound up not taking). Fix the mismerge and turn passthru on. Modified: head/sbin/nvmecontrol/Makefile head/sbin/nvmecontrol/passthru.c Modified: head/sbin/nvmecontrol/Makefile ============================================================================== --- head/sbin/nvmecontrol/Makefile Tue Aug 6 18:10:34 2019 (r350651) +++ head/sbin/nvmecontrol/Makefile Tue Aug 6 18:15:26 2019 (r350652) @@ -5,7 +5,7 @@ PROG= nvmecontrol SRCS= comnd.c nvmecontrol.c SRCS+= devlist.c firmware.c format.c identify.c logpage.c ns.c nsid.c SRCS+= perftest.c power.c reset.c resv.c sanitize.c -#SRCS+= passthru.c +SRCS+= passthru.c SRCS+= identify_ext.c nvme_util.c nc_util.c MAN= nvmecontrol.8 LDFLAGS+= -rdynamic Modified: head/sbin/nvmecontrol/passthru.c ============================================================================== --- head/sbin/nvmecontrol/passthru.c Tue Aug 6 18:10:34 2019 (r350651) +++ head/sbin/nvmecontrol/passthru.c Tue Aug 6 18:15:26 2019 (r350652) @@ -101,7 +101,7 @@ static struct options { */ #define ARG(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc } -static const struct opts opts[] = { +static struct opts opts[] = { ARG("opcode", 'o', arg_uint8, opt, opcode, "NVMe command opcode (required)"), ARG("cdw2", '2', arg_uint32, opt, cdw2, @@ -267,7 +267,23 @@ io_passthru(const struct cmd *nf, int argc, char *argv passthru(nf, argc, argv); } -CMD_COMMAND(top, admin-passthru, admin_passthru, sizeof(struct options), opts, args, - "Send a pass through Admin command to the specified device"); -CMD_COMMAND(top, io-passthru, io_passthru, sizeof(struct options), opts, args, - "Send a pass through I/O command to the specified device"); +static struct cmd admin_pass_cmd = { + .name = "admin-passthru", + .fn = admin_passthru, + .ctx_size = sizeof(struct options), + .opts = opts, + .args = args, + .descr = "Send a pass through Admin command to the specified device", +}; + +static struct cmd io_pass_cmd = { + .name = "io-passthru", + .fn = io_passthru, + .ctx_size = sizeof(struct options), + .opts = opts, + .args = args, + .descr = "Send a pass through Admin command to the specified device", +}; + +CMD_COMMAND(admin_pass_cmd); +CMD_COMMAND(io_pass_cmd); From owner-svn-src-all@freebsd.org Tue Aug 6 20:08:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53B86C979F; Tue, 6 Aug 2019 20:08:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4635KZ1V2yz4Pjj; Tue, 6 Aug 2019 20:08:02 +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 11E22126D; Tue, 6 Aug 2019 20:08:02 +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 x76K81Ws046867; Tue, 6 Aug 2019 20:08:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76K81NL046866; Tue, 6 Aug 2019 20:08:01 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201908062008.x76K81NL046866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 6 Aug 2019 20:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350655 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 350655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 20:08:02 -0000 Author: tsoome Date: Tue Aug 6 20:08:01 2019 New Revision: 350655 URL: https://svnweb.freebsd.org/changeset/base/350655 Log: loader.efi: boot1.c was left out of 350654 Followup for 350654. Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Tue Aug 6 19:27:27 2019 (r350654) +++ head/stand/efi/boot1/boot1.c Tue Aug 6 20:08:01 2019 (r350655) @@ -137,8 +137,9 @@ try_boot(const boot_module_t *mod, dev_info_t *dev, vo goto errout; } - if ((status = BS->HandleProtocol(loaderhandle, &LoadedImageGUID, - (VOID**)&loaded_image)) != EFI_SUCCESS) { + status = OpenProtocolByHandle(loaderhandle, &LoadedImageGUID, + (void **)&loaded_image); + if (status != EFI_SUCCESS) { printf("Failed to query LoadedImage provided by %s (%lu)\n", mod->name, EFI_ERROR_CODE(status)); goto errout; @@ -242,7 +243,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) nhandles = hsize / sizeof(*handles); /* Determine the devpath of our image so we can prefer it. */ - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); + status = OpenProtocolByHandle(IH, &LoadedImageGUID, (void **)&img); imgpath = NULL; if (status == EFI_SUCCESS) { text = efi_devpath_name(img->FilePath); @@ -252,8 +253,8 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) efi_free_devpath_name(text); } - status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, - (void **)&imgpath); + status = OpenProtocolByHandle(img->DeviceHandle, + &DevicePathGUID, (void **)&imgpath); if (status != EFI_SUCCESS) { DPRINTF("Failed to get image DevicePath (%lu)\n", EFI_ERROR_CODE(status)); From owner-svn-src-all@freebsd.org Tue Aug 6 21:17:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC69DCA7DF; Tue, 6 Aug 2019 21:17:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4636sb5FJrz4VpQ; Tue, 6 Aug 2019 21:17:23 +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 90F121F2E; Tue, 6 Aug 2019 21:17:23 +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 x76LHNaY088276; Tue, 6 Aug 2019 21:17:23 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76LHNOI088274; Tue, 6 Aug 2019 21:17:23 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201908062117.x76LHNOI088274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 6 Aug 2019 21:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350658 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 21:17:23 -0000 Author: jilles Date: Tue Aug 6 21:17:22 2019 New Revision: 350658 URL: https://svnweb.freebsd.org/changeset/base/350658 Log: Add a test for kill() on a zombie Added: head/tests/sys/kern/kill_zombie.c (contents, props changed) Modified: head/tests/sys/kern/Makefile Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Tue Aug 6 20:21:57 2019 (r350657) +++ head/tests/sys/kern/Makefile Tue Aug 6 21:17:22 2019 (r350658) @@ -8,6 +8,7 @@ TESTSDIR= ${TESTSBASE}/sys/kern #ATF_TESTS_C+= kcov ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test +ATF_TESTS_C+= kill_zombie ATF_TESTS_C+= ptrace_test TEST_METADATA.ptrace_test+= timeout="15" ATF_TESTS_C+= reaper Added: head/tests/sys/kern/kill_zombie.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/kern/kill_zombie.c Tue Aug 6 21:17:22 2019 (r350658) @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2018 Jilles Tjoelker + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include + +ATF_TC_WITHOUT_HEAD(kill_zombie); +ATF_TC_BODY(kill_zombie, tc) +{ + pid_t child, pid; + int status, r; + + child = fork(); + ATF_REQUIRE(child != -1); + if (child == 0) { + _exit(42); + } + + r = waitid(P_PID, child, NULL, WEXITED | WNOWAIT); + ATF_REQUIRE(r == 0); + + r = kill(child, SIGTERM); + ATF_CHECK(r == 0); + + status = -1; + pid = waitpid(child, &status, 0); + ATF_REQUIRE(pid == child); + ATF_CHECK(WIFEXITED(status) && WEXITSTATUS(status) == 42); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, kill_zombie); + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Tue Aug 6 22:36:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 208B1B0389; Tue, 6 Aug 2019 22:36:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4638ct05B1z3HlL; Tue, 6 Aug 2019 22:36:30 +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 D8D5C2D80; Tue, 6 Aug 2019 22:36:29 +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 x76MaTjj036392; Tue, 6 Aug 2019 22:36:29 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76MaTUL036391; Tue, 6 Aug 2019 22:36:29 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201908062236.x76MaTUL036391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 6 Aug 2019 22:36: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: r350660 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 350660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 22:36:30 -0000 Author: gjb Date: Tue Aug 6 22:36:29 2019 New Revision: 350660 URL: https://svnweb.freebsd.org/changeset/base/350660 Log: Document EN-19:14, EN-19:15, SA-19:18-21. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Tue Aug 6 21:50:34 2019 (r350659) +++ stable/11/release/doc/share/xml/errata.xml Tue Aug 6 22:36:29 2019 (r350660) @@ -25,6 +25,13 @@ System crash from Intel CPU vulnerability mitigation + + + FreeBSD-EN-19:15.libunwind + 6 August 2019 + Incorrect exception handling + Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue Aug 6 21:50:34 2019 (r350659) +++ stable/11/release/doc/share/xml/security.xml Tue Aug 6 22:36:29 2019 (r350660) @@ -59,6 +59,36 @@ 24 July 2019 Reference count leak + + + FreeBSD-SA-19:18.bzip2 + 6 August 2019 + Multiple vulnerabilities + + + + FreeBSD-SA-19:19.mldv2 + 6 August 2019 + Out-of-bounds memory access + + + + FreeBSD-SA-19:20.bsnmp + 6 August 2019 + Insufficient message length + validation + + + + FreeBSD-SA-19:21.bhyve + 6 August 2019 + Insufficient validation of guest-supplied + data + From owner-svn-src-all@freebsd.org Tue Aug 6 23:05:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AA97B5137; Tue, 6 Aug 2019 23:05:00 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4639Fm2Q1Sz3NHn; Tue, 6 Aug 2019 23:05:00 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34B6832F6; Tue, 6 Aug 2019 23:05:00 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76N500K054107; Tue, 6 Aug 2019 23:05:00 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76N4xXh054091; Tue, 6 Aug 2019 23:04:59 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201908062304.x76N4xXh054091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 6 Aug 2019 23:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350661 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 350661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 23:05:00 -0000 Author: jeff Date: Tue Aug 6 23:04:59 2019 New Revision: 350661 URL: https://svnweb.freebsd.org/changeset/base/350661 Log: Implement a MINBUCKET zone flag so we can use minimal caching on zones that may be expensive to cache. Reviewed by: markj, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20930 Modified: head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Aug 6 22:36:29 2019 (r350660) +++ head/sys/vm/uma.h Tue Aug 6 23:04:59 2019 (r350661) @@ -274,6 +274,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * NUMA aware Zone. Implements a best * effort first-touch policy. */ +#define UMA_ZONE_MINBUCKET 0x20000 /* Use smallest buckets. */ /* * These flags are shared between the keg and zone. In zones wishing to add Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Aug 6 22:36:29 2019 (r350660) +++ head/sys/vm/uma_core.c Tue Aug 6 23:04:59 2019 (r350661) @@ -209,6 +209,7 @@ struct uma_bucket_zone { (((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *)) #define BUCKET_MAX BUCKET_SIZE(256) +#define BUCKET_MIN BUCKET_SIZE(4) struct uma_bucket_zone bucket_zones[] = { { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 }, @@ -1867,9 +1868,12 @@ out: KASSERT((arg->flags & (UMA_ZONE_MAXBUCKET | UMA_ZONE_NOBUCKET)) != (UMA_ZONE_MAXBUCKET | UMA_ZONE_NOBUCKET), ("Invalid zone flag combination")); - if ((arg->flags & UMA_ZONE_MAXBUCKET) != 0) + if ((arg->flags & UMA_ZONE_MAXBUCKET) != 0) { zone->uz_count = BUCKET_MAX; - else if ((arg->flags & UMA_ZONE_NOBUCKET) != 0) + } else if ((arg->flags & UMA_ZONE_MINBUCKET) != 0) { + zone->uz_count = BUCKET_MIN; + zone->uz_count_max = BUCKET_MIN; + } else if ((arg->flags & UMA_ZONE_NOBUCKET) != 0) zone->uz_count = 0; else zone->uz_count = bucket_select(zone->uz_size); From owner-svn-src-all@freebsd.org Tue Aug 6 23:15:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD4CDB54E4; Tue, 6 Aug 2019 23:15:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4639TP3ms6z3Nn2; Tue, 6 Aug 2019 23:15: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 62D0E34CF; Tue, 6 Aug 2019 23:15: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 x76NF5VA059984; Tue, 6 Aug 2019 23:15:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76NF59u059982; Tue, 6 Aug 2019 23:15:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908062315.x76NF59u059982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Aug 2019 23:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350662 - in head/sys: dev/acpica i386/pci X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: dev/acpica i386/pci X-SVN-Commit-Revision: 350662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 23:15:05 -0000 Author: jhb Date: Tue Aug 6 23:15:04 2019 New Revision: 350662 URL: https://svnweb.freebsd.org/changeset/base/350662 Log: Detect invalid PCI devices more correctly in PCI interrupt router drivers. - Check for an invalid device (vendor is invalid) before reading the header type register when examining function 0 of a possible device. - When iterating over functions of a device, reject any device whose 16-bit vendor is invalid rather than requiring the full 32-bit vendor+device to be all 1's. In practice the latter check is probably fine, but checking the vendor is what the PCI spec recommends. Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21147 Modified: head/sys/dev/acpica/acpi_pci_link.c head/sys/i386/pci/pci_pir.c Modified: head/sys/dev/acpica/acpi_pci_link.c ============================================================================== --- head/sys/dev/acpica/acpi_pci_link.c Tue Aug 6 23:04:59 2019 (r350661) +++ head/sys/dev/acpica/acpi_pci_link.c Tue Aug 6 23:15:04 2019 (r350662) @@ -580,6 +580,9 @@ acpi_pci_link_search_irq(int bus, int device, int pin) uint8_t func, maxfunc; /* See if we have a valid device at function 0. */ + value = pci_cfgregread(bus, device, 0, PCIR_VENDOR, 2); + if (value == PCIV_INVALID) + return (PCI_INVALID_IRQ); value = pci_cfgregread(bus, device, 0, PCIR_HDRTYPE, 1); if ((value & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) return (PCI_INVALID_IRQ); @@ -590,8 +593,8 @@ acpi_pci_link_search_irq(int bus, int device, int pin) /* Scan all possible functions at this device. */ for (func = 0; func <= maxfunc; func++) { - value = pci_cfgregread(bus, device, func, PCIR_DEVVENDOR, 4); - if (value == 0xffffffff) + value = pci_cfgregread(bus, device, func, PCIR_VENDOR, 2); + if (value == PCIV_INVALID) continue; value = pci_cfgregread(bus, device, func, PCIR_INTPIN, 1); Modified: head/sys/i386/pci/pci_pir.c ============================================================================== --- head/sys/i386/pci/pci_pir.c Tue Aug 6 23:04:59 2019 (r350661) +++ head/sys/i386/pci/pci_pir.c Tue Aug 6 23:15:04 2019 (r350662) @@ -257,8 +257,8 @@ pci_pir_create_links(struct PIR_entry *entry, struct P } /* - * Look to see if any of the function on the PCI device at bus/device have - * an interrupt routed to intpin 'pin' by the BIOS. + * Look to see if any of the functions on the PCI device at bus/device + * have an interrupt routed to intpin 'pin' by the BIOS. */ static uint8_t pci_pir_search_irq(int bus, int device, int pin) @@ -267,6 +267,9 @@ pci_pir_search_irq(int bus, int device, int pin) uint8_t func, maxfunc; /* See if we have a valid device at function 0. */ + value = pci_cfgregread(bus, device, 0, PCIR_VENDOR, 2); + if (value == PCIV_INVALID) + return (PCI_INVALID_IRQ); value = pci_cfgregread(bus, device, 0, PCIR_HDRTYPE, 1); if ((value & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) return (PCI_INVALID_IRQ); @@ -277,8 +280,8 @@ pci_pir_search_irq(int bus, int device, int pin) /* Scan all possible functions at this device. */ for (func = 0; func <= maxfunc; func++) { - value = pci_cfgregread(bus, device, func, PCIR_DEVVENDOR, 4); - if (value == 0xffffffff) + value = pci_cfgregread(bus, device, func, PCIR_VENDOR, 2); + if (value == PCIV_INVALID) continue; value = pci_cfgregread(bus, device, func, PCIR_INTPIN, 1); From owner-svn-src-all@freebsd.org Tue Aug 6 23:15:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC523B555E; Tue, 6 Aug 2019 23:15:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4639Tz3t6Kz3Nvs; Tue, 6 Aug 2019 23:15:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6688F34D2; Tue, 6 Aug 2019 23:15:35 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x76NFZvW060057; Tue, 6 Aug 2019 23:15:35 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76NFYeU060054; Tue, 6 Aug 2019 23:15:34 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201908062315.x76NFYeU060054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 6 Aug 2019 23:15:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350663 - in head/sys: ddb sys vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: ddb sys vm X-SVN-Commit-Revision: 350663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 23:15:35 -0000 Author: jeff Date: Tue Aug 6 23:15:34 2019 New Revision: 350663 URL: https://svnweb.freebsd.org/changeset/base/350663 Log: Cache kernel stacks in UMA. This gives us NUMA support, better concurrency, and more statistics. Reviewed by: kib, markj Tested by: pho Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20931 Deleted: head/sys/sys/_kstack_cache.h Modified: head/sys/ddb/db_ps.c head/sys/vm/vm_glue.c head/sys/vm/vm_param.h head/sys/vm/vm_swapout.c Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Tue Aug 6 23:15:04 2019 (r350662) +++ head/sys/ddb/db_ps.c Tue Aug 6 23:15:34 2019 (r350663) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -505,7 +504,6 @@ db_findstack_cmd(db_expr_t addr, bool have_addr, db_ex { struct proc *p; struct thread *td; - struct kstack_cache_entry *ks_ce; vm_offset_t saddr; if (have_addr) @@ -522,15 +520,6 @@ db_findstack_cmd(db_expr_t addr, bool have_addr, db_ex db_printf("Thread %p\n", td); return; } - } - } - - for (ks_ce = kstack_cache; ks_ce != NULL; - ks_ce = ks_ce->next_ks_entry) { - if ((vm_offset_t)ks_ce <= saddr && saddr < (vm_offset_t)ks_ce + - PAGE_SIZE * kstack_pages) { - db_printf("Cached stack %p\n", ks_ce); - return; } } } Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Tue Aug 6 23:15:04 2019 (r350662) +++ head/sys/vm/vm_glue.c Tue Aug 6 23:15:34 2019 (r350663) @@ -84,12 +84,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -282,52 +282,39 @@ vm_sync_icache(vm_map_t map, vm_offset_t va, vm_offset pmap_sync_icache(map->pmap, va, sz); } -struct kstack_cache_entry *kstack_cache; +static uma_zone_t kstack_cache; static int kstack_cache_size = 128; -static int kstacks, kstack_domain_iter; -static struct mtx kstack_cache_mtx; -MTX_SYSINIT(kstack_cache, &kstack_cache_mtx, "kstkch", MTX_DEF); +static int kstack_domain_iter; -SYSCTL_INT(_vm, OID_AUTO, kstack_cache_size, CTLFLAG_RW, &kstack_cache_size, 0, - ""); -SYSCTL_INT(_vm, OID_AUTO, kstacks, CTLFLAG_RD, &kstacks, 0, - ""); +static int +sysctl_kstack_cache_size(SYSCTL_HANDLER_ARGS) +{ + int error, newsize; + newsize = kstack_cache_size; + error = sysctl_handle_int(oidp, &newsize, 0, req); + if (error == 0 && req->newptr && newsize != kstack_cache_size) + kstack_cache_size = + uma_zone_set_maxcache(kstack_cache, newsize); + return (error); +} +SYSCTL_PROC(_vm, OID_AUTO, kstack_cache_size, CTLTYPE_INT|CTLFLAG_RW, + &kstack_cache_size, 0, sysctl_kstack_cache_size, "IU", + "Maximum number of cached kernel stacks"); + /* * Create the kernel stack (including pcb for i386) for a new thread. * This routine directly affects the fork perf for a process and * create performance for a thread. */ -int -vm_thread_new(struct thread *td, int pages) +static vm_offset_t +vm_thread_stack_create(struct domainset *ds, vm_object_t *ksobjp, int pages) { + vm_page_t ma[KSTACK_MAX_PAGES]; vm_object_t ksobj; vm_offset_t ks; - vm_page_t ma[KSTACK_MAX_PAGES]; - struct kstack_cache_entry *ks_ce; int i; - /* Bounds check */ - if (pages <= 1) - pages = kstack_pages; - else if (pages > KSTACK_MAX_PAGES) - pages = KSTACK_MAX_PAGES; - - if (pages == kstack_pages && kstack_cache != NULL) { - mtx_lock(&kstack_cache_mtx); - if (kstack_cache != NULL) { - ks_ce = kstack_cache; - kstack_cache = ks_ce->next_ks_entry; - mtx_unlock(&kstack_cache_mtx); - - td->td_kstack_obj = ks_ce->ksobj; - td->td_kstack = (vm_offset_t)ks_ce; - td->td_kstack_pages = kstack_pages; - return (1); - } - mtx_unlock(&kstack_cache_mtx); - } - /* * Allocate an object for the kstack. */ @@ -354,30 +341,17 @@ vm_thread_new(struct thread *td, int pages) vm_object_deallocate(ksobj); return (0); } - - /* - * Ensure that kstack objects can draw pages from any memory - * domain. Otherwise a local memory shortage can block a process - * swap-in. - */ if (vm_ndomains > 1) { - ksobj->domain.dr_policy = DOMAINSET_RR(); + ksobj->domain.dr_policy = ds; ksobj->domain.dr_iter = atomic_fetchadd_int(&kstack_domain_iter, 1); } - atomic_add_int(&kstacks, 1); if (KSTACK_GUARD_PAGES != 0) { pmap_qremove(ks, KSTACK_GUARD_PAGES); ks += KSTACK_GUARD_PAGES * PAGE_SIZE; } - td->td_kstack_obj = ksobj; - td->td_kstack = ks; - /* - * Knowing the number of pages allocated is useful when you - * want to deallocate them. - */ - td->td_kstack_pages = pages; + /* * For the length of the stack, link in a real page of ram for each * page of stack. @@ -389,7 +363,9 @@ vm_thread_new(struct thread *td, int pages) ma[i]->valid = VM_PAGE_BITS_ALL; VM_OBJECT_WUNLOCK(ksobj); pmap_qenter(ks, ma, pages); - return (1); + *ksobjp = ksobj; + + return (ks); } static void @@ -398,7 +374,6 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t vm_page_t m; int i; - atomic_add_int(&kstacks, -1); pmap_qremove(ks, pages); VM_OBJECT_WLOCK(ksobj); for (i = 0; i < pages; i++) { @@ -417,6 +392,45 @@ vm_thread_stack_dispose(vm_object_t ksobj, vm_offset_t } /* + * Allocate the kernel stack for a new thread. + */ +int +vm_thread_new(struct thread *td, int pages) +{ + vm_object_t ksobj; + vm_offset_t ks; + + /* Bounds check */ + if (pages <= 1) + pages = kstack_pages; + else if (pages > KSTACK_MAX_PAGES) + pages = KSTACK_MAX_PAGES; + + ks = 0; + ksobj = NULL; + if (pages == kstack_pages && kstack_cache != NULL) { + ks = (vm_offset_t)uma_zalloc(kstack_cache, M_NOWAIT); + if (ks != 0) + ksobj = PHYS_TO_VM_PAGE(pmap_kextract(ks))->object; + } + + /* + * Ensure that kstack objects can draw pages from any memory + * domain. Otherwise a local memory shortage can block a process + * swap-in. + */ + if (ks == 0) + ks = vm_thread_stack_create(DOMAINSET_PREF(PCPU_GET(domain)), + &ksobj, pages); + if (ks == 0) + return (0); + td->td_kstack_obj = ksobj; + td->td_kstack = ks; + td->td_kstack_pages = pages; + return (1); +} + +/* * Dispose of a thread's kernel stack. */ void @@ -424,7 +438,6 @@ vm_thread_dispose(struct thread *td) { vm_object_t ksobj; vm_offset_t ks; - struct kstack_cache_entry *ks_ce; int pages; pages = td->td_kstack_pages; @@ -432,43 +445,49 @@ vm_thread_dispose(struct thread *td) ks = td->td_kstack; td->td_kstack = 0; td->td_kstack_pages = 0; - if (pages == kstack_pages && kstacks <= kstack_cache_size) { - ks_ce = (struct kstack_cache_entry *)ks; - ks_ce->ksobj = ksobj; - mtx_lock(&kstack_cache_mtx); - ks_ce->next_ks_entry = kstack_cache; - kstack_cache = ks_ce; - mtx_unlock(&kstack_cache_mtx); - return; + if (pages == kstack_pages) + uma_zfree(kstack_cache, (void *)ks); + else + vm_thread_stack_dispose(ksobj, ks, pages); +} + +static int +kstack_import(void *arg, void **store, int cnt, int domain, int flags) +{ + vm_object_t ksobj; + int i; + + for (i = 0; i < cnt; i++) { + store[i] = (void *)vm_thread_stack_create( + DOMAINSET_PREF(domain), &ksobj, kstack_pages); + if (store[i] == NULL) + break; } - vm_thread_stack_dispose(ksobj, ks, pages); + return (i); } static void -vm_thread_stack_lowmem(void *nulll) +kstack_release(void *arg, void **store, int cnt) { - struct kstack_cache_entry *ks_ce, *ks_ce1; + vm_offset_t ks; + int i; - mtx_lock(&kstack_cache_mtx); - ks_ce = kstack_cache; - kstack_cache = NULL; - mtx_unlock(&kstack_cache_mtx); - - while (ks_ce != NULL) { - ks_ce1 = ks_ce; - ks_ce = ks_ce->next_ks_entry; - - vm_thread_stack_dispose(ks_ce1->ksobj, (vm_offset_t)ks_ce1, - kstack_pages); + for (i = 0; i < cnt; i++) { + ks = (vm_offset_t)store[i]; + vm_thread_stack_dispose( + PHYS_TO_VM_PAGE(pmap_kextract(ks))->object, + ks, kstack_pages); } } static void -kstack_cache_init(void *nulll) +kstack_cache_init(void *null) { - - EVENTHANDLER_REGISTER(vm_lowmem, vm_thread_stack_lowmem, NULL, - EVENTHANDLER_PRI_ANY); + kstack_cache = uma_zcache_create("kstack_cache", + kstack_pages * PAGE_SIZE, NULL, NULL, NULL, NULL, + kstack_import, kstack_release, NULL, + UMA_ZONE_NUMA|UMA_ZONE_MINBUCKET); + uma_zone_set_maxcache(kstack_cache, kstack_cache_size); } SYSINIT(vm_kstacks, SI_SUB_KTHREAD_INIT, SI_ORDER_ANY, kstack_cache_init, NULL); Modified: head/sys/vm/vm_param.h ============================================================================== --- head/sys/vm/vm_param.h Tue Aug 6 23:15:04 2019 (r350662) +++ head/sys/vm/vm_param.h Tue Aug 6 23:15:34 2019 (r350663) @@ -122,6 +122,10 @@ struct xswdev { #endif /* !SMP */ #endif /* !PA_LOCK_COUNT */ +#ifndef KSTACK_MAX_PAGES +#define KSTACK_MAX_PAGES 32 +#endif + #ifndef ASSEMBLER #ifdef _KERNEL #define num_pages(x) \ Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Tue Aug 6 23:15:04 2019 (r350662) +++ head/sys/vm/vm_swapout.c Tue Aug 6 23:15:34 2019 (r350663) @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Tue Aug 6 23:22:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B852CB5885; Tue, 6 Aug 2019 23:22:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4639ds4NkXz3PLP; Tue, 6 Aug 2019 23:22:25 +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 7941E3842; Tue, 6 Aug 2019 23:22:25 +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 x76NMP1G066018; Tue, 6 Aug 2019 23:22:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x76NMPko066017; Tue, 6 Aug 2019 23:22:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908062322.x76NMPko066017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Aug 2019 23:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350664 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 350664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 06 Aug 2019 23:22:25 -0000 Author: jhb Date: Tue Aug 6 23:22:25 2019 New Revision: 350664 URL: https://svnweb.freebsd.org/changeset/base/350664 Log: Fix LOCAL_MODULES and improve the make output. The exists() check guarding the invocation of ls was not working correctly as it was expanding '$L' to determine the path of the local modules directory. Fix by using {} around the variable name. Inline some of the logic from bsd.subdir.mk when invoking local module builds. This gives output in 'make buildkernel' the same as if there was a Makefile in /usr/local/sys/modules with SUBDIR = ${LOCAL_MODULES}. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D20991 Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Aug 6 23:15:34 2019 (r350663) +++ head/sys/conf/kern.post.mk Tue Aug 6 23:22:25 2019 (r350664) @@ -61,7 +61,7 @@ LOCAL_MODULES_DIR?= ${LOCALBASE}/sys/modules # Default to installing all modules installed by ports unless overridden # by the user. -.if !defined(LOCAL_MODULES) && exists($LOCAL_MODULES_DIR) +.if !defined(LOCAL_MODULES) && exists(${LOCAL_MODULES_DIR}) LOCAL_MODULES!= ls ${LOCAL_MODULES_DIR} .endif .endif @@ -77,7 +77,9 @@ modules-${target}: ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} .endif .for module in ${LOCAL_MODULES} - cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ + @${ECHODIR} "===> ${module} (${target:S/^reinstall$/install/:S/^clobber$/cleandir/})" + @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ + DIRPRFX="${module}/" \ ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} .endfor .endif From owner-svn-src-all@freebsd.org Wed Aug 7 00:38:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67CADB76D6; Wed, 7 Aug 2019 00:38:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463CKc2g55z3xYw; Wed, 7 Aug 2019 00:38:28 +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 1EB7545D3; Wed, 7 Aug 2019 00:38:28 +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 x770cSLY007722; Wed, 7 Aug 2019 00:38:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x770cQZE007711; Wed, 7 Aug 2019 00:38:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201908070038.x770cQZE007711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 7 Aug 2019 00:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350665 - in head: . etc/mtree sbin/mount_fusefs share/man/man5 sys/fs/fuse sys/sys tests/sys/fs tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: . etc/mtree sbin/mount_fusefs share/man/man5 sys/fs/fuse sys/sys tests/sys/fs tests/sys/fs/fusefs X-SVN-Commit-Revision: 350665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 00:38:28 -0000 Author: asomers Date: Wed Aug 7 00:38:26 2019 New Revision: 350665 URL: https://svnweb.freebsd.org/changeset/base/350665 Log: fusefs: merge from projects/fuse2 This commit imports the new fusefs driver. It raises the protocol level from 7.8 to 7.23, fixes many bugs, adds a test suite for the driver, and adds many new features. New features include: * Optional kernel-side permissions checks (-o default_permissions) * Implement VOP_MKNOD, VOP_BMAP, and VOP_ADVLOCK * Allow interrupting FUSE operations * Support named pipes and unix-domain sockets in fusefs file systems * Forward UTIME_NOW during utimensat(2) to the daemon * kqueue support for /dev/fuse * Allow updating mounts with "mount -u" * Allow exporting fusefs file systems over NFS * Server-initiated invalidation of the name cache or data cache * Respect RLIMIT_FSIZE * Try to support servers as old as protocol 7.4 Performance enhancements include: * Implement FUSE's FOPEN_KEEP_CACHE and FUSE_ASYNC_READ flags * Cache file attributes * Cache lookup entries, both positive and negative * Server-selectable cache modes: writethrough, writeback, or uncached * Write clustering * Readahead * Use counter(9) for statistical reporting PR: 199934 216391 233783 234581 235773 235774 235775 PR: 236226 236231 236236 236291 236329 236381 236405 PR: 236327 236466 236472 236473 236474 236530 236557 PR: 236560 236844 237052 237181 237588 238565 Reviewed by: bcr (man pages) Reviewed by: cem, ngie, rpokala, glebius, kib, bde, emaste (post-commit review on project branch) MFC after: 3 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Pull Request: https://reviews.freebsd.org/D21110 Added: head/tests/sys/fs/fusefs/ - copied from r350621, projects/fuse2/tests/sys/fs/fusefs/ Deleted: head/sys/fs/fuse/fuse_param.h Modified: head/MAINTAINERS (contents, props changed) head/UPDATING head/etc/mtree/BSD.tests.dist head/sbin/mount_fusefs/mount_fusefs.8 head/sbin/mount_fusefs/mount_fusefs.c head/share/man/man5/fusefs.5 head/sys/fs/fuse/fuse.h head/sys/fs/fuse/fuse_device.c head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_file.h head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_internal.h head/sys/fs/fuse/fuse_io.c head/sys/fs/fuse/fuse_io.h head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_ipc.h head/sys/fs/fuse/fuse_kernel.h head/sys/fs/fuse/fuse_main.c head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c head/sys/sys/param.h head/tests/sys/fs/Makefile Directory Properties: head/ (props changed) Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Tue Aug 6 23:22:25 2019 (r350664) +++ head/MAINTAINERS Wed Aug 7 00:38:26 2019 (r350665) @@ -53,6 +53,7 @@ contrib/pjdfstest asomers,ngie,pjd,#test Pre-commit re etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. etc/sendmail gshapiro Pre-commit review requested. Keep in sync with -STABLE. fetch des Pre-commit review requested, email only. +fusefs(5) asomers Pre-commit review requested. geli pjd Pre-commit review requested (both sys/geom/eli/ and sbin/geom/class/eli/). isci(4) jimharris Pre-commit review requested. iwm(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Aug 6 23:22:25 2019 (r350664) +++ head/UPDATING Wed Aug 7 00:38:26 2019 (r350665) @@ -26,6 +26,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20190727: + The vfs.fusefs.sync_unmount and vfs.fusefs.init_backgrounded sysctls + and the "-o sync_unmount" and "-o init_backgrounded" mount options have + been removed from mount_fusefs(8). You can safely remove them from + your scripts, because they had no effect. + + The vfs.fusefs.fix_broken_io, vfs.fusefs.sync_resize, + vfs.fusefs.refresh_size, vfs.fusefs.mmap_enable, + vfs.fusefs.reclaim_revoked, and vfs.fusefs.data_cache_invalidate + sysctls have been removed. If you felt the need to set any of them to + a non-default value, please tell asomers@FreeBSD.org why. + 20190713: Default permissions on the /var/account/acct file (and copies of it rotated by periodic daily scripts) are changed from 0644 to 0640 Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Aug 6 23:22:25 2019 (r350664) +++ head/etc/mtree/BSD.tests.dist Wed Aug 7 00:38:26 2019 (r350665) @@ -731,6 +731,8 @@ file .. fs + fusefs + .. tmpfs .. .. Modified: head/sbin/mount_fusefs/mount_fusefs.8 ============================================================================== --- head/sbin/mount_fusefs/mount_fusefs.8 Tue Aug 6 23:22:25 2019 (r350664) +++ head/sbin/mount_fusefs/mount_fusefs.8 Wed Aug 7 00:38:26 2019 (r350665) @@ -3,6 +3,11 @@ .\" Copyright (c) 2005, 2006 Csaba Henk .\" All rights reserved. .\" +.\" Copyright (c) 2019 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by BFF Storage Systems under +.\" sponsorship from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -29,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2018 +.Dd July 31, 2019 .Dt MOUNT_FUSEFS 8 .Os .Sh NAME @@ -108,27 +113,27 @@ Intended for use in scripts and the .Xr sudoers 5 file. .It Fl S , Ic --safe -Run in safe mode (i.e. reject invoking a filesystem daemon) +Run in safe mode (i.e., reject invoking a filesystem daemon). .It Fl v -Be verbose -.It Fl D, Ic --daemon Ar daemon +Be verbose. +.It Fl D , Ic --daemon Ar daemon Call the specified -.Ar daemon -.It Fl O, Ic --daemon_opts Ar opts +.Ar daemon . +.It Fl O , Ic --daemon_opts Ar opts Add .Ar opts -to the daemon's command line -.It Fl s, Ic --special Ar special +to the daemon's command line. +.It Fl s , Ic --special Ar special Use .Ar special -as special -.It Fl m, Ic --mountpath Ar node +as special. +.It Fl m , Ic --mountpath Ar node Mount on -.Ar node -.It Fl h, Ic --help -Show help -.It Fl V, Ic --version -Show version information +.Ar node . +.It Fl h , Ic --help +Show help. +.It Fl V , Ic --version +Show version information. .It Fl o Mount options are specified via .Fl o . @@ -136,23 +141,38 @@ The following options are available (and also their ne by prefixing them with .Dq no ) : .Bl -tag -width indent -.It Cm default_permissions -Enable traditional (file mode based) permission checking in kernel .It Cm allow_other Do not apply .Sx STRICT ACCESS POLICY . -Only root can use this option +Only root can use this option. +.It Cm async +I/O to the file system may be done asynchronously. +Writes may be delayed and/or reordered. +.It Cm default_permissions +Enable traditional (file mode based) permission checking in kernel. +.It Cm intr +Allow signals to interrupt operations that are blocked waiting for a reply from the server. +When this option is in use, system calls may fail with +.Er EINTR +whenever a signal is received. .It Cm max_read Ns = Ns Ar n Limit size of read requests to -.Ar n +.Ar n . +.It Cm neglect_shares +Do not refuse unmounting if there are secondary mounts. .It Cm private Refuse shared mounting of the daemon. This is the default behaviour, to allow sharing, expicitly use -.Fl o Cm noprivate -.It Cm neglect_shares -Do not refuse unmounting if there are secondary mounts +.Fl o Cm noprivate . .It Cm push_symlinks_in -Prefix absolute symlinks with the mountpoint +Prefix absolute symlinks with the mountpoint. +.It Cm subtype Ns = Ns Ar fsname +Suffix +.Ar fsname +to the file system name as reported by +.Xr statfs 2 . +This option can be used to identify the file system implemented by +.Ar fuse_daemon . .El .El .Pp @@ -167,11 +187,11 @@ However, there are some which do require in-kernel sup Currently the options supported by the kernel are: .Bl -tag -width indent .It Cm direct_io -Bypass the buffer cache system +Bypass the buffer cache system. .It Cm kernel_cache By default cached buffers of a given file are flushed at each .Xr open 2 . -This option disables this behaviour +This option disables this behaviour. .El .Sh DAEMON MOUNTS Usually users do not need to use @@ -194,7 +214,7 @@ only if the filesystem daemon has the same credentials real gid) as the user. .Pp This is applied for Fuse mounts by default and only root can mount without -the strict access policy (i.e. the +the strict access policy (i.e., the .Cm allow_other mount option). .Pp @@ -206,7 +226,7 @@ Users might opt to willingly relax strict access polic are concerned) by doing their own secondary mount (See .Sx SHARED MOUNTS ) . .Sh SHARED MOUNTS -A Fuse daemon can be shared (i.e. mounted multiple times). +A Fuse daemon can be shared (i.e., mounted multiple times). When doing the first (primary) mount, the spawner and the mounter of the daemon must have the same uid, or the mounter should be the superuser. .Pp @@ -225,7 +245,7 @@ is used or not. .Pp The device name of a secondary mount is the device name of the corresponding primary mount, followed by a '#' character and the index of the secondary -mount; e.g. +mount; e.g., .Pa /dev/fuse0#3 . .Sh SECURITY System administrators might want to use a custom mount policy (ie., one going @@ -239,7 +259,7 @@ However, given that is capable of invoking an arbitrary program, one must be careful when doing this. .Nm is designed in a way such that it makes that easy. -For this purpose, there are options which disable certain risky features (i.e. +For this purpose, there are options which disable certain risky features ( .Fl S and .Fl A ) , @@ -342,7 +362,7 @@ does not call any external utility and also provides a was written as the part of the .Fx implementation of the Fuse userspace filesystem framework (see -.Xr https://github.com/libfuse/libfuse ) +.Lk https://github.com/libfuse/libfuse ) and first appeared in the .Pa sysutils/fusefs-kmod port, supporting Modified: head/sbin/mount_fusefs/mount_fusefs.c ============================================================================== --- head/sbin/mount_fusefs/mount_fusefs.c Tue Aug 6 23:22:25 2019 (r350664) +++ head/sbin/mount_fusefs/mount_fusefs.c Wed Aug 7 00:38:26 2019 (r350665) @@ -5,6 +5,11 @@ * Copyright (c) 2005 Csaba Henk * All rights reserved. * + * Copyright (c) 2019 The FreeBSD Foundation + * + * Portions of this software were developed by BFF Storage Systems 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: @@ -60,7 +65,6 @@ void __usage_short(void); void usage(void); void helpmsg(void); void showversion(void); -int init_backgrounded(void); static struct mntopt mopts[] = { #define ALTF_PRIVATE 0x01 @@ -73,8 +77,6 @@ static struct mntopt mopts[] = { { "max_read=", 0, ALTF_MAXREAD, 1 }, #define ALTF_SUBTYPE 0x40 { "subtype=", 0, ALTF_SUBTYPE, 1 }, - #define ALTF_SYNC_UNMOUNT 0x80 - { "sync_unmount", 0, ALTF_SYNC_UNMOUNT, 1 }, /* * MOPT_AUTOMOUNTED, included by MOPT_STDOPTS, does not fit into * the 'flags' argument to nmount(2). We have to abuse altflags @@ -82,6 +84,8 @@ static struct mntopt mopts[] = { */ #define ALTF_AUTOMOUNTED 0x100 { "automounted", 0, ALTF_AUTOMOUNTED, 1 }, + #define ALTF_INTR 0x200 + { "intr", 0, ALTF_INTR, 1 }, /* Linux specific options, we silently ignore them */ { "fsname=", 0, 0x00, 1 }, { "fd=", 0, 0x00, 1 }, @@ -91,6 +95,8 @@ static struct mntopt mopts[] = { { "large_read", 0, 0x00, 1 }, /* "nonempty", just the first two chars are stripped off during parsing */ { "nempty", 0, 0x00, 1 }, + { "async", 0, MNT_ASYNC, 0}, + { "noasync", 1, MNT_ASYNC, 0}, MOPT_STDOPTS, MOPT_END }; @@ -107,7 +113,7 @@ static struct mntval mvals[] = { { 0, NULL, 0 } }; -#define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE | ALTF_SYNC_UNMOUNT +#define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE int main(int argc, char *argv[]) @@ -409,12 +415,6 @@ main(int argc, char *argv[]) } } - if (fd >= 0 && ! init_backgrounded() && close(fd) < 0) { - if (pid) - kill(pid, SIGKILL); - err(1, "failed to close fuse device"); - } - /* Prepare the options vector for nmount(). build_iovec() is declared * in mntopts.h. */ sprintf(fdstr, "%d", fd); @@ -471,6 +471,7 @@ helpmsg(void) " -o allow_other allow access to other users\n" /* " -o nonempty allow mounts over non-empty file/dir\n" */ " -o default_permissions enable permission checking by kernel\n" + " -o intr interruptible mount\n" /* " -o fsname=NAME set filesystem name\n" " -o large_read issue large read requests (2.4 only)\n" @@ -481,7 +482,6 @@ helpmsg(void) " -o neglect_shares don't report EBUSY when unmount attempted\n" " in presence of secondary mounts\n" " -o push_symlinks_in prefix absolute symlinks with mountpoint\n" - " -o sync_unmount do unmount synchronously\n" ); exit(EX_USAGE); } @@ -491,18 +491,4 @@ showversion(void) { puts("mount_fusefs [fuse4bsd] version: " FUSE4BSD_VERSION); exit(EX_USAGE); -} - -int -init_backgrounded(void) -{ - int ibg; - size_t len; - - len = sizeof(ibg); - - if (sysctlbyname("vfs.fusefs.init_backgrounded", &ibg, &len, NULL, 0)) - return (0); - - return (ibg); } Modified: head/share/man/man5/fusefs.5 ============================================================================== --- head/share/man/man5/fusefs.5 Tue Aug 6 23:22:25 2019 (r350664) +++ head/share/man/man5/fusefs.5 Wed Aug 7 00:38:26 2019 (r350665) @@ -3,8 +3,8 @@ .\" .\" Copyright (c) 2019 The FreeBSD Foundation .\" -.\" This software was developed by BFF Storage Systems, LLC under sponsorship -.\" from the FreeBSD Foundation. +.\" This documentation was written by BFF Storage Systems, LLC under +.\" sponsorship from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -28,7 +28,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 13, 2019 +.Dd July 31, 2019 .Dt FUSEFS 5 .Os .Sh NAME @@ -60,11 +60,9 @@ Finally, the API is portable. Many daemons can run on multiple operating systems with minimal modifications. .Sh SYSCTL VARIABLES -The following variables are available as both +The following .Xr sysctl 8 -variables and -.Xr loader 8 -tunables: +variables are available: .Bl -tag -width indent .It Va vfs.fusefs.kernelabi_major Major version of the FUSE kernel ABI supported by this driver. @@ -73,7 +71,7 @@ Minor version of the FUSE kernel ABI supported by this .It Va vfs.fusefs.data_cache_mode Controls how .Nm -will cache file data. +will cache file data for pre-7.23 file systems. A value of 0 will disable caching entirely. Every data access will be forwarded to the daemon. A value of 1 will select write-through caching. @@ -84,33 +82,26 @@ Reads and writes will both be cached, and writes will to the daemon by the page daemon. Write-back caching is usually unsafe, especially for FUSE file systems that require network access. -.It Va vfs.fusefs.lookup_cache_enable -Controls whether -.Nm -will cache lookup responses from the file system. -FUSE file systems indicate whether lookup responses should be cacheable, but -it may be useful to globally disable caching them if a file system is -misbehaving. +.Pp +FUSE file systems using protocol 7.23 or later specify their cache behavior +on a per-mountpoint basis, ignoring this sysctl. +.It Va vfs.fusefs.stats.filehandle_count +Current number of open FUSE file handles. +.It Va vfs.fusefs.stats.lookup_cache_hits +Total number of lookup cache hits. +.It Va vfs.fusefs.stats.lookup_cache_misses +Total number of lookup cache misses. +.It Va vfs.fusefs.stats.node_count +Current number of allocated FUSE vnodes. +.It Va vfs.fusefs.stats.ticket_count +Current number of allocated FUSE tickets, which is roughly equal to the number +of FUSE operations currently being processed by daemons. .\" Undocumented sysctls .\" ==================== -.\" Counters: I intend to rename to vfs.fusefs.stats.* for clarity -.\" vfs.fusefs.lookup_cache_{hits, misses} -.\" vfs.fusefs.filehandle_count -.\" vfs.fusefs.ticker_count -.\" vfs.fusefs.node_count -.\" -.\" vfs.fusefs.version - useless since the driver moved in-tree -.\" vfs.fusefs.reclaim_revoked: I don't understand it well-enough -.\" vfs.fusefs.sync_unmount: dead code .\" vfs.fusefs.enforce_dev_perms: I don't understand it well enough. -.\" vfs.fusefs.init_backgrounded: dead code .\" vfs.fusefs.iov_credit: I don't understand it well enough .\" vfs.fusefs.iov_permanent_bufsize: I don't understand it well enough -.\" vfs.fusefs.fix_broken_io: I don't understand it well enough -.\" vfs.fusefs.sync_resize: useless and should be removed -.\" vfs.fusefs.refresh_size: probably useless? -.\" vfs.fusefs.mmap_enable: why is this optional? -.\" vfs.fusefs.data_cache_invalidate: what is this needed for? +.El .Sh SEE ALSO .Xr mount_fusefs 8 .Sh HISTORY @@ -119,7 +110,7 @@ The driver was written as the part of the .Fx implementation of the FUSE userspace file system framework (see -.Xr https://github.com/libfuse/libfuse ) +.Lk https://github.com/libfuse/libfuse ) and first appeared in the .Pa sysutils/fusefs-kmod port, supporting Modified: head/sys/fs/fuse/fuse.h ============================================================================== --- head/sys/fs/fuse/fuse.h Tue Aug 6 23:22:25 2019 (r350664) +++ head/sys/fs/fuse/fuse.h Wed Aug 7 00:38:26 2019 (r350665) @@ -32,6 +32,11 @@ * * Copyright (C) 2005 Csaba Henk. * All rights reserved. + * + * Copyright (c) 2019 The FreeBSD Foundation + * + * Portions of this software were developed by BFF Storage Systems, LLC under + * sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -63,87 +68,10 @@ #define FUSE_MIN_DAEMON_TIMEOUT 0 /* s */ #define FUSE_MAX_DAEMON_TIMEOUT 600 /* s */ -#ifndef FUSE_FREEBSD_VERSION -#define FUSE_FREEBSD_VERSION "0.4.4" -#endif - -/* Mapping versions to features */ - -#define FUSE_KERNELABI_GEQ(maj, min) \ -(FUSE_KERNEL_VERSION > (maj) || (FUSE_KERNEL_VERSION == (maj) && FUSE_KERNEL_MINOR_VERSION >= (min))) - -/* - * Appearance of new FUSE operations is not always in par with version - * numbering... At least, 7.3 is a sufficient condition for having - * FUSE_{ACCESS,CREATE}. - */ -#if FUSE_KERNELABI_GEQ(7, 3) -#ifndef FUSE_HAS_ACCESS -#define FUSE_HAS_ACCESS 1 -#endif -#ifndef FUSE_HAS_CREATE -#define FUSE_HAS_CREATE 1 -#endif -#else /* FUSE_KERNELABI_GEQ(7, 3) */ -#ifndef FUSE_HAS_ACCESS -#define FUSE_HAS_ACCESS 0 -#endif -#ifndef FUSE_HAS_CREATE -#define FUSE_HAS_CREATE 0 -#endif -#endif - -#if FUSE_KERNELABI_GEQ(7, 7) -#ifndef FUSE_HAS_GETLK -#define FUSE_HAS_GETLK 1 -#endif -#ifndef FUSE_HAS_SETLK -#define FUSE_HAS_SETLK 1 -#endif -#ifndef FUSE_HAS_SETLKW -#define FUSE_HAS_SETLKW 1 -#endif -#ifndef FUSE_HAS_INTERRUPT -#define FUSE_HAS_INTERRUPT 1 -#endif -#else /* FUSE_KERNELABI_GEQ(7, 7) */ -#ifndef FUSE_HAS_GETLK -#define FUSE_HAS_GETLK 0 -#endif -#ifndef FUSE_HAS_SETLK -#define FUSE_HAS_SETLK 0 -#endif -#ifndef FUSE_HAS_SETLKW -#define FUSE_HAS_SETLKW 0 -#endif -#ifndef FUSE_HAS_INTERRUPT -#define FUSE_HAS_INTERRUPT 0 -#endif -#endif - -#if FUSE_KERNELABI_GEQ(7, 8) -#ifndef FUSE_HAS_FLUSH_RELEASE -#define FUSE_HAS_FLUSH_RELEASE 1 -/* - * "DESTROY" came in the middle of the 7.8 era, - * so this is not completely exact... - */ -#ifndef FUSE_HAS_DESTROY -#define FUSE_HAS_DESTROY 1 -#endif -#endif -#else /* FUSE_KERNELABI_GEQ(7, 8) */ -#ifndef FUSE_HAS_FLUSH_RELEASE -#define FUSE_HAS_FLUSH_RELEASE 0 -#ifndef FUSE_HAS_DESTROY -#define FUSE_HAS_DESTROY 0 -#endif -#endif -#endif - /* misc */ SYSCTL_DECL(_vfs_fusefs); +SYSCTL_DECL(_vfs_fusefs_stats); /* Fuse locking */ Modified: head/sys/fs/fuse/fuse_device.c ============================================================================== --- head/sys/fs/fuse/fuse_device.c Tue Aug 6 23:22:25 2019 (r350664) +++ head/sys/fs/fuse/fuse_device.c Wed Aug 7 00:38:26 2019 (r350665) @@ -33,6 +33,11 @@ * Copyright (C) 2005 Csaba Henk. * All rights reserved. * + * Copyright (c) 2019 The FreeBSD Foundation + * + * Portions of this software were developed by BFF Storage Systems, LLC under + * sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -81,27 +86,28 @@ __FBSDID("$FreeBSD$"); #include #include "fuse.h" +#include "fuse_internal.h" #include "fuse_ipc.h" -SDT_PROVIDER_DECLARE(fuse); +SDT_PROVIDER_DECLARE(fusefs); /* * Fuse trace probe: * arg0: verbosity. Higher numbers give more verbose messages * arg1: Textual message */ -SDT_PROBE_DEFINE2(fuse, , device, trace, "int", "char*"); +SDT_PROBE_DEFINE2(fusefs, , device, trace, "int", "char*"); static struct cdev *fuse_dev; +static d_kqfilter_t fuse_device_filter; static d_open_t fuse_device_open; -static d_close_t fuse_device_close; static d_poll_t fuse_device_poll; static d_read_t fuse_device_read; static d_write_t fuse_device_write; static struct cdevsw fuse_device_cdevsw = { + .d_kqfilter = fuse_device_filter, .d_open = fuse_device_open, - .d_close = fuse_device_close, .d_name = "fuse", .d_poll = fuse_device_poll, .d_read = fuse_device_read, @@ -109,6 +115,15 @@ static struct cdevsw fuse_device_cdevsw = { .d_version = D_VERSION, }; +static int fuse_device_filt_read(struct knote *kn, long hint); +static void fuse_device_filt_detach(struct knote *kn); + +struct filterops fuse_device_rfiltops = { + .f_isfd = 1, + .f_detach = fuse_device_filt_detach, + .f_event = fuse_device_filt_read, +}; + /**************************** * * >>> Fuse device op defs @@ -119,11 +134,100 @@ static void fdata_dtor(void *arg) { struct fuse_data *fdata; + struct fuse_ticket *tick; fdata = arg; + if (fdata == NULL) + return; + + fdata_set_dead(fdata); + + FUSE_LOCK(); + fuse_lck_mtx_lock(fdata->aw_mtx); + /* wakup poll()ers */ + selwakeuppri(&fdata->ks_rsel, PZERO + 1); + /* Don't let syscall handlers wait in vain */ + while ((tick = fuse_aw_pop(fdata))) { + fuse_lck_mtx_lock(tick->tk_aw_mtx); + fticket_set_answered(tick); + tick->tk_aw_errno = ENOTCONN; + wakeup(tick); + fuse_lck_mtx_unlock(tick->tk_aw_mtx); + FUSE_ASSERT_AW_DONE(tick); + fuse_ticket_drop(tick); + } + fuse_lck_mtx_unlock(fdata->aw_mtx); + + /* Cleanup unsent operations */ + fuse_lck_mtx_lock(fdata->ms_mtx); + while ((tick = fuse_ms_pop(fdata))) { + fuse_ticket_drop(tick); + } + fuse_lck_mtx_unlock(fdata->ms_mtx); + FUSE_UNLOCK(); + fdata_trydestroy(fdata); } +static int +fuse_device_filter(struct cdev *dev, struct knote *kn) +{ + struct fuse_data *data; + int error; + + error = devfs_get_cdevpriv((void **)&data); + + /* EVFILT_WRITE is not supported; the device is always ready to write */ + if (error == 0 && kn->kn_filter == EVFILT_READ) { + kn->kn_fop = &fuse_device_rfiltops; + kn->kn_hook = data; + knlist_add(&data->ks_rsel.si_note, kn, 0); + error = 0; + } else if (error == 0) { + error = EINVAL; + kn->kn_data = error; + } + + return (error); +} + +static void +fuse_device_filt_detach(struct knote *kn) +{ + struct fuse_data *data; + + data = (struct fuse_data*)kn->kn_hook; + MPASS(data != NULL); + knlist_remove(&data->ks_rsel.si_note, kn, 0); + kn->kn_hook = NULL; +} + +static int +fuse_device_filt_read(struct knote *kn, long hint) +{ + struct fuse_data *data; + int ready; + + data = (struct fuse_data*)kn->kn_hook; + MPASS(data != NULL); + + mtx_assert(&data->ms_mtx, MA_OWNED); + if (fdata_get_dead(data)) { + kn->kn_flags |= EV_EOF; + kn->kn_fflags = ENODEV; + kn->kn_data = 1; + ready = 1; + } else if (STAILQ_FIRST(&data->ms_head)) { + MPASS(data->ms_count >= 1); + kn->kn_data = data->ms_count; + ready = 1; + } else { + ready = 0; + } + + return (ready); +} + /* * Resources are set up on a per-open basis */ @@ -133,52 +237,17 @@ fuse_device_open(struct cdev *dev, int oflags, int dev struct fuse_data *fdata; int error; - SDT_PROBE2(fuse, , device, trace, 1, "device open"); + SDT_PROBE2(fusefs, , device, trace, 1, "device open"); fdata = fdata_alloc(dev, td->td_ucred); error = devfs_set_cdevpriv(fdata, fdata_dtor); if (error != 0) fdata_trydestroy(fdata); else - SDT_PROBE2(fuse, , device, trace, 1, "device open success"); + SDT_PROBE2(fusefs, , device, trace, 1, "device open success"); return (error); } -static int -fuse_device_close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - struct fuse_data *data; - struct fuse_ticket *tick; - int error; - - error = devfs_get_cdevpriv((void **)&data); - if (error != 0) - return (error); - if (!data) - panic("no fuse data upon fuse device close"); - fdata_set_dead(data); - - FUSE_LOCK(); - fuse_lck_mtx_lock(data->aw_mtx); - /* wakup poll()ers */ - selwakeuppri(&data->ks_rsel, PZERO + 1); - /* Don't let syscall handlers wait in vain */ - while ((tick = fuse_aw_pop(data))) { - fuse_lck_mtx_lock(tick->tk_aw_mtx); - fticket_set_answered(tick); - tick->tk_aw_errno = ENOTCONN; - wakeup(tick); - fuse_lck_mtx_unlock(tick->tk_aw_mtx); - FUSE_ASSERT_AW_DONE(tick); - fuse_ticket_drop(tick); - } - fuse_lck_mtx_unlock(data->aw_mtx); - FUSE_UNLOCK(); - - SDT_PROBE2(fuse, , device, trace, 1, "device close"); - return (0); -} - int fuse_device_poll(struct cdev *dev, int events, struct thread *td) { @@ -219,7 +288,7 @@ fuse_device_read(struct cdev *dev, struct uio *uio, in int buflen[3]; int i; - SDT_PROBE2(fuse, , device, trace, 1, "fuse device read"); + SDT_PROBE2(fusefs, , device, trace, 1, "fuse device read"); err = devfs_get_cdevpriv((void **)&data); if (err != 0) @@ -228,7 +297,7 @@ fuse_device_read(struct cdev *dev, struct uio *uio, in fuse_lck_mtx_lock(data->ms_mtx); again: if (fdata_get_dead(data)) { - SDT_PROBE2(fuse, , device, trace, 2, + SDT_PROBE2(fusefs, , device, trace, 2, "we know early on that reader should be kicked so we " "don't wait for news"); fuse_lck_mtx_unlock(data->ms_mtx); @@ -256,7 +325,7 @@ again: * -- and some other cases, too, tho not totally clear, when * (cv_signal/wakeup_one signals the whole process ?) */ - SDT_PROBE2(fuse, , device, trace, 1, "no message on thread"); + SDT_PROBE2(fusefs, , device, trace, 1, "no message on thread"); goto again; } fuse_lck_mtx_unlock(data->ms_mtx); @@ -266,9 +335,10 @@ again: * somebody somewhere -- eg., umount routine -- * wants this liaison finished off */ - SDT_PROBE2(fuse, , device, trace, 2, "reader is to be sacked"); + SDT_PROBE2(fusefs, , device, trace, 2, + "reader is to be sacked"); if (tick) { - SDT_PROBE2(fuse, , device, trace, 2, "weird -- " + SDT_PROBE2(fusefs, , device, trace, 2, "weird -- " "\"kick\" is set tho there is message"); FUSE_ASSERT_MS_DONE(tick); fuse_ticket_drop(tick); @@ -276,7 +346,7 @@ again: return (ENODEV); /* This should make the daemon get off * of us */ } - SDT_PROBE2(fuse, , device, trace, 1, + SDT_PROBE2(fusefs, , device, trace, 1, "fuse device read message successfully"); KASSERT(tick->tk_ms_bufdata || tick->tk_ms_bufsize == 0, @@ -311,7 +381,7 @@ again: */ if (uio->uio_resid < buflen[i]) { fdata_set_dead(data); - SDT_PROBE2(fuse, , device, trace, 2, + SDT_PROBE2(fusefs, , device, trace, 2, "daemon is stupid, kick it off..."); err = ENODEV; break; @@ -331,23 +401,26 @@ static inline int fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio) { if (uio->uio_resid + sizeof(struct fuse_out_header) != ohead->len) { - SDT_PROBE2(fuse, , device, trace, 1, "Format error: body size " + SDT_PROBE2(fusefs, , device, trace, 1, + "Format error: body size " "differs from size claimed by header"); return (EINVAL); } - if (uio->uio_resid && ohead->error) { - SDT_PROBE2(fuse, , device, trace, 1, + if (uio->uio_resid && ohead->unique != 0 && ohead->error) { + SDT_PROBE2(fusefs, , device, trace, 1, "Format error: non zero error but message had a body"); return (EINVAL); } - /* Sanitize the linuxism of negative errnos */ - ohead->error = -(ohead->error); return (0); } -SDT_PROBE_DEFINE1(fuse, , device, fuse_device_write_bumped_into_callback, - "uint64_t"); +SDT_PROBE_DEFINE1(fusefs, , device, fuse_device_write_notify, + "struct fuse_out_header*"); +SDT_PROBE_DEFINE1(fusefs, , device, fuse_device_write_missing_ticket, + "uint64_t"); +SDT_PROBE_DEFINE1(fusefs, , device, fuse_device_write_found, + "struct fuse_ticket*"); /* * fuse_device_write first reads the header sent by the daemon. * If that's OK, looks up ticket/callback node by the unique id seen in header. @@ -360,15 +433,17 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i struct fuse_out_header ohead; int err = 0; struct fuse_data *data; - struct fuse_ticket *tick, *x_tick; + struct mount *mp; + struct fuse_ticket *tick, *itick, *x_tick; int found = 0; err = devfs_get_cdevpriv((void **)&data); if (err != 0) return (err); + mp = data->mp; if (uio->uio_resid < sizeof(struct fuse_out_header)) { - SDT_PROBE2(fuse, , device, trace, 1, + SDT_PROBE2(fusefs, , device, trace, 1, "fuse_device_write got less than a header!"); fdata_set_dead(data); return (EINVAL); @@ -393,15 +468,29 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i fuse_lck_mtx_lock(data->aw_mtx); TAILQ_FOREACH_SAFE(tick, &data->aw_head, tk_aw_link, x_tick) { - SDT_PROBE1(fuse, , device, - fuse_device_write_bumped_into_callback, - tick->tk_unique); if (tick->tk_unique == ohead.unique) { + SDT_PROBE1(fusefs, , device, fuse_device_write_found, + tick); found = 1; fuse_aw_remove(tick); break; } } + if (found && tick->irq_unique > 0) { + /* + * Discard the FUSE_INTERRUPT ticket that tried to interrupt + * this operation + */ + TAILQ_FOREACH_SAFE(itick, &data->aw_head, tk_aw_link, + x_tick) { + if (itick->tk_unique == tick->irq_unique) { + fuse_aw_remove(itick); + fuse_ticket_drop(itick); + break; + } + } + tick->irq_unique = 0; + } fuse_lck_mtx_unlock(data->aw_mtx); if (found) { @@ -414,13 +503,15 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i * via ticket_drop(), so no manual mucking * around...) */ - SDT_PROBE2(fuse, , device, trace, 1, + SDT_PROBE2(fusefs, , device, trace, 1, "pass ticket to a callback"); + /* Sanitize the linuxism of negative errnos */ + ohead.error *= -1; memcpy(&tick->tk_aw_ohead, &ohead, sizeof(ohead)); err = tick->tk_aw_handler(tick, uio); } else { /* pretender doesn't wanna do anything with answer */ - SDT_PROBE2(fuse, , device, trace, 1, + SDT_PROBE2(fusefs, , device, trace, 1, "stuff devalidated, so we drop it"); } @@ -430,11 +521,51 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i * because fuse_ticket_drop() will deal with refcount anyway. */ fuse_ticket_drop(tick); + } else if (ohead.unique == 0){ + /* unique == 0 means asynchronous notification */ + SDT_PROBE1(fusefs, , device, fuse_device_write_notify, &ohead); + switch (ohead.error) { + case FUSE_NOTIFY_INVAL_ENTRY: + err = fuse_internal_invalidate_entry(mp, uio); + break; + case FUSE_NOTIFY_INVAL_INODE: + err = fuse_internal_invalidate_inode(mp, uio); + break; + case FUSE_NOTIFY_RETRIEVE: + case FUSE_NOTIFY_STORE: + /* + * Unimplemented. I don't know of any file systems + * that use them, and the protocol isn't sound anyway, + * since the notification messages don't include the + * inode's generation number. Without that, it's + * possible to manipulate the cache of the wrong vnode. + * Finally, it's not defined what this message should + * do for a file with dirty cache. + */ + case FUSE_NOTIFY_POLL: + /* Unimplemented. See comments in fuse_vnops */ + default: + /* Not implemented */ + err = ENOSYS; + } } else { /* no callback at all! */ - SDT_PROBE2(fuse, , device, trace, 1, - "erhm, no handler for this response"); - err = EINVAL; + SDT_PROBE1(fusefs, , device, fuse_device_write_missing_ticket, + ohead.unique); + if (ohead.error == -EAGAIN) { + /* + * This was probably a response to a FUSE_INTERRUPT + * operation whose original operation is already + * complete. We can't store FUSE_INTERRUPT tickets + * indefinitely because their responses are optional. + * So we delete them when the original operation + * completes. And sadly the fuse_header_out doesn't + * identify the opcode, so we have to guess. + */ + err = 0; + } else { + err = EINVAL; + } } return (err); @@ -445,7 +576,7 @@ fuse_device_init(void) { fuse_dev = make_dev(&fuse_device_cdevsw, 0, UID_ROOT, GID_OPERATOR, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, "fuse"); + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, "fuse"); if (fuse_dev == NULL) return (ENOMEM); return (0); Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Tue Aug 6 23:22:25 2019 (r350664) +++ head/sys/fs/fuse/fuse_file.c Wed Aug 7 00:38:26 2019 (r350665) @@ -33,6 +33,11 @@ * Copyright (C) 2005 Csaba Henk. * All rights reserved. * + * Copyright (c) 2019 The FreeBSD Foundation + * + * Portions of this software were developed by BFF Storage Systems, LLC under + * sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -59,8 +64,9 @@ __FBSDID("$FreeBSD$"); #include -#include #include +#include +#include #include #include #include @@ -79,52 +85,61 @@ __FBSDID("$FreeBSD$"); #include "fuse.h" #include "fuse_file.h" #include "fuse_internal.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 7 00:47:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2062CB8163; Wed, 7 Aug 2019 00:47:10 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463CWd6sDmz3yZQ; Wed, 7 Aug 2019 00:47:09 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [172.17.133.228] (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 31FB2E811; Wed, 7 Aug 2019 00:47:09 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/10.1b.0.190715 Date: Tue, 06 Aug 2019 17:47:05 -0700 Subject: Re: svn commit: r350665 - in head: . etc/mtree sbin/mount_fusefs share/man/man5 sys/fs/fuse sys/sys tests/sys/fs tests/sys/fs/fusefs From: Ravi Pokala To: Alan Somers , , , Message-ID: <04AB02BB-553E-4B63-80BB-07FA4364287D@panasas.com> Thread-Topic: svn commit: r350665 - in head: . etc/mtree sbin/mount_fusefs share/man/man5 sys/fs/fuse sys/sys tests/sys/fs tests/sys/fs/fusefs References: <201908070038.x770cQZE007711@repo.freebsd.org> In-Reply-To: <201908070038.x770cQZE007711@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.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 00:47:10 -0000 -----Original Message----- From: on behalf of Alan Somers Date: 2019-08-06, Tuesday at 17:38 To: , , Subject: svn commit: r350665 - in head: . etc/mtree sbin/mount_fusefs share/man/man5 sys/fs/fuse sys/sys tests/sys/fs tests/sys/fs/fusefs > Author: asomers > Date: Wed Aug 7 00:38:26 2019 > New Revision: 350665 > URL: https://svnweb.freebsd.org/changeset/base/350665 > > Log: > fusefs: merge from projects/fuse2 Thanks Alan! I've been watching this work with significant interest[*] for quite a while, and am glad this is finally landing. Thanks again, Ravi (rpokala@) [*] or as much interest as anyone who knows ~nothing about filesystems can muster ;-) > This commit imports the new fusefs driver. It raises the protocol level > from 7.8 to 7.23, fixes many bugs, adds a test suite for the driver, and > adds many new features. New features include: > > * Optional kernel-side permissions checks (-o default_permissions) > * Implement VOP_MKNOD, VOP_BMAP, and VOP_ADVLOCK > * Allow interrupting FUSE operations > * Support named pipes and unix-domain sockets in fusefs file systems > * Forward UTIME_NOW during utimensat(2) to the daemon > * kqueue support for /dev/fuse > * Allow updating mounts with "mount -u" > * Allow exporting fusefs file systems over NFS > * Server-initiated invalidation of the name cache or data cache > * Respect RLIMIT_FSIZE > * Try to support servers as old as protocol 7.4 > > Performance enhancements include: > > * Implement FUSE's FOPEN_KEEP_CACHE and FUSE_ASYNC_READ flags > * Cache file attributes > * Cache lookup entries, both positive and negative > * Server-selectable cache modes: writethrough, writeback, or uncached > * Write clustering > * Readahead > * Use counter(9) for statistical reporting > > PR: 199934 216391 233783 234581 235773 235774 235775 > PR: 236226 236231 236236 236291 236329 236381 236405 > PR: 236327 236466 236472 236473 236474 236530 236557 > PR: 236560 236844 237052 237181 237588 238565 > Reviewed by: bcr (man pages) > Reviewed by: cem, ngie, rpokala, glebius, kib, bde, emaste (post-commit > review on project branch) > MFC after: 3 weeks > Relnotes: yes > Sponsored by: The FreeBSD Foundation > Pull Request: https://reviews.freebsd.org/D21110 From owner-svn-src-all@freebsd.org Wed Aug 7 00:53:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23517B840A; Wed, 7 Aug 2019 00:53:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463Cfv70NVz3yyy; Wed, 7 Aug 2019 00:53:27 +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 D1F3D4A17; Wed, 7 Aug 2019 00:53:27 +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 x770rRaa019504; Wed, 7 Aug 2019 00:53:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x770rRd5019503; Wed, 7 Aug 2019 00:53:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201908070053.x770rRd5019503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 7 Aug 2019 00:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350666 - head/usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/netstat X-SVN-Commit-Revision: 350666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 00:53:28 -0000 Author: jhb Date: Wed Aug 7 00:53:27 2019 New Revision: 350666 URL: https://svnweb.freebsd.org/changeset/base/350666 Log: Tidy up the list of auth and encryption algorithms for IPsec stats. - Use keyed-md5 and keyed_sha1 instead of md5 and sha1 to match the names accepted by setkey and to also avoid confusion since these are not "plain" MD5 or SHA1. - Remove always-true #ifdef's to make the source a bit easier to read. - Add missing mappings for tcp-md5, camellia-cbc, and aes-gmac. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/usr.bin/netstat/ipsec.c Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Wed Aug 7 00:38:26 2019 (r350665) +++ head/usr.bin/netstat/ipsec.c Wed Aug 7 00:53:27 2019 (r350666) @@ -125,33 +125,18 @@ static struct val2str ipsec_ahnames[] = { { SADB_AALG_NONE, "none", }, { SADB_AALG_MD5HMAC, "hmac-md5", }, { SADB_AALG_SHA1HMAC, "hmac-sha1", }, - { SADB_X_AALG_MD5, "md5", }, - { SADB_X_AALG_SHA, "sha", }, + { SADB_X_AALG_MD5, "keyed-md5", }, + { SADB_X_AALG_SHA, "keyed-sha1", }, { SADB_X_AALG_NULL, "null", }, -#ifdef SADB_X_AALG_SHA2_256 { SADB_X_AALG_SHA2_256, "hmac-sha2-256", }, -#endif -#ifdef SADB_X_AALG_SHA2_384 { SADB_X_AALG_SHA2_384, "hmac-sha2-384", }, -#endif -#ifdef SADB_X_AALG_SHA2_512 { SADB_X_AALG_SHA2_512, "hmac-sha2-512", }, -#endif -#ifdef SADB_X_AALG_RIPEMD160HMAC { SADB_X_AALG_RIPEMD160HMAC, "hmac-ripemd160", }, -#endif -#ifdef SADB_X_AALG_AES_XCBC_MAC { SADB_X_AALG_AES_XCBC_MAC, "aes-xcbc-mac", }, -#endif -#ifdef SADB_X_AALG_AES128GMAC + { SADB_X_AALG_TCP_MD5, "tcp-md5", }, { SADB_X_AALG_AES128GMAC, "aes-gmac-128", }, -#endif -#ifdef SADB_X_AALG_AES192GMAC { SADB_X_AALG_AES192GMAC, "aes-gmac-192", }, -#endif -#ifdef SADB_X_AALG_AES256GMAC { SADB_X_AALG_AES256GMAC, "aes-gmac-256", }, -#endif { -1, NULL }, }; @@ -162,15 +147,11 @@ static struct val2str ipsec_espnames[] = { { SADB_EALG_NULL, "null", }, { SADB_X_EALG_CAST128CBC, "cast128-cbc", }, { SADB_X_EALG_BLOWFISHCBC, "blowfish-cbc", }, -#ifdef SADB_X_EALG_RIJNDAELCBC { SADB_X_EALG_RIJNDAELCBC, "rijndael-cbc", }, -#endif -#ifdef SADB_X_EALG_AESCTR + { SADB_X_EALG_CAMELLIACBC, "camellia-cbc", }, { SADB_X_EALG_AESCTR, "aes-ctr", }, -#endif -#ifdef SADB_X_EALG_AESGCM16 { SADB_X_EALG_AESGCM16, "aes-gcm-16", }, -#endif + { SADB_X_EALG_AESGMAC, "aes-gmac", }, { -1, NULL }, }; From owner-svn-src-all@freebsd.org Wed Aug 7 01:03:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A88D4B8B0B; Wed, 7 Aug 2019 01:03:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463Ctc3y1yz40ht; Wed, 7 Aug 2019 01:03: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 692FE4BE0; Wed, 7 Aug 2019 01:03: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 x7713aiK025484; Wed, 7 Aug 2019 01:03:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7713aY1025483; Wed, 7 Aug 2019 01:03:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908070103.x7713aY1025483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 7 Aug 2019 01:03: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: r350667 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 01:03:36 -0000 Author: cy Date: Wed Aug 7 01:03:35 2019 New Revision: 350667 URL: https://svnweb.freebsd.org/changeset/base/350667 Log: MFC r350567: Returning an uninitialized error is a bad thing. Modified: stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 00:53:27 2019 (r350666) +++ stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 01:03:35 2019 (r350667) @@ -307,7 +307,7 @@ ipf_modunload() printf("%s unloaded\n", ipfilter_version); - return error; + return (0); } From owner-svn-src-all@freebsd.org Wed Aug 7 01:03:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0898B8B0F; Wed, 7 Aug 2019 01:03:36 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463Ctc5g8bz40hv; Wed, 7 Aug 2019 01:03: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 A420B4BE1; Wed, 7 Aug 2019 01:03: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 x7713adB025490; Wed, 7 Aug 2019 01:03:36 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7713atP025489; Wed, 7 Aug 2019 01:03:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908070103.x7713atP025489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 7 Aug 2019 01:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350667 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 01:03:36 -0000 Author: cy Date: Wed Aug 7 01:03:35 2019 New Revision: 350667 URL: https://svnweb.freebsd.org/changeset/base/350667 Log: MFC r350567: Returning an uninitialized error is a bad thing. Modified: stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 00:53:27 2019 (r350666) +++ stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 01:03:35 2019 (r350667) @@ -310,7 +310,7 @@ ipf_modunload() printf("%s unloaded\n", ipfilter_version); - return error; + return (0); } From owner-svn-src-all@freebsd.org Wed Aug 7 01:08:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CBEDB8FE7; Wed, 7 Aug 2019 01:08:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463D0p1J0yz413h; Wed, 7 Aug 2019 01:08:58 +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 09F814BE5; Wed, 7 Aug 2019 01:08:58 +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 x7718vRv025800; Wed, 7 Aug 2019 01:08:57 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7718vpc025799; Wed, 7 Aug 2019 01:08:57 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908070108.x7718vpc025799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 7 Aug 2019 01:08:57 +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: r350668 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 01:08:58 -0000 Author: cy Date: Wed Aug 7 01:08:57 2019 New Revision: 350668 URL: https://svnweb.freebsd.org/changeset/base/350668 Log: MFC r350568: Resolve ipfilter kld unload issues related to VNET jails. When the ipfilter kld is loaded, used within VNET jail, and unloaded, then subsequent loading, use, and unloading of another packet filters will cause the subsequently loaded netpfil kld's to panic. The scenario is as follows: cd /usr/tests/sys/netpfil/common kldunload ipl kldunload pfsync kldunload ipfw kyua test pass_block kldload ipl kyua test pass_block kldunload ipl kldload pfsync kyua test pass_block kldunload pfsync -- page fault panic occurs here -- Reported by: "Ahsan Barkati" via kp@ Discussed with: kp@ Tested by: kp@ Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Aug 7 01:03:35 2019 (r350667) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Aug 7 01:08:57 2019 (r350668) @@ -98,7 +98,10 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { # include # include -static eventhandler_tag ipf_arrivetag, ipf_departtag; +VNET_DEFINE_STATIC(eventhandler_tag, ipf_arrivetag); +VNET_DEFINE_STATIC(eventhandler_tag, ipf_departtag); +#define V_ipf_arrivetag VNET(ipf_arrivetag) +#define V_ipf_departtag VNET(ipf_departtag) #if 0 /* * Disable the "cloner" event handler; we are getting interface @@ -108,7 +111,8 @@ static eventhandler_tag ipf_arrivetag, ipf_departtag; * If it turns out to be needed, well need a dedicated event handler * for it to deal with the ifc and the correct vnet. */ -static eventhandler_tag ipf_clonetag; +VNET_DEFINE_STATIC(eventhandler_tag, ipf_clonetag); +#define V_ipf_clonetag VNET(ipf_clonetag) #endif static void ipf_ifevent(void *arg, struct ifnet *ifp); @@ -1384,14 +1388,14 @@ int ipf_pfil_hook(void) { void ipf_event_reg(void) { - ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ + V_ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); - ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ + V_ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); #if 0 - ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ + V_ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ NULL, EVENTHANDLER_PRI_ANY); #endif } @@ -1399,15 +1403,15 @@ ipf_event_reg(void) void ipf_event_dereg(void) { - if (ipf_arrivetag != NULL) { - EVENTHANDLER_DEREGISTER(ifnet_arrival_event, ipf_arrivetag); + if (V_ipf_arrivetag != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, V_ipf_arrivetag); } - if (ipf_departtag != NULL) { - EVENTHANDLER_DEREGISTER(ifnet_departure_event, ipf_departtag); + if (V_ipf_departtag != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, V_ipf_departtag); } #if 0 - if (ipf_clonetag != NULL) { - EVENTHANDLER_DEREGISTER(if_clone_event, ipf_clonetag); + if (V_ipf_clonetag != NULL) { + EVENTHANDLER_DEREGISTER(if_clone_event, V_ipf_clonetag); } #endif } Modified: stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 01:03:35 2019 (r350667) +++ stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 01:08:57 2019 (r350668) @@ -280,6 +280,10 @@ vnet_ipf_uninit(void) V_ipfmain.ipf_running = -2; ipf_destroy_all(&V_ipfmain); + if (!IS_DEFAULT_VNET(curvnet)) { + ipf_event_dereg(); + (void)ipf_pfil_unhook(); + } } } VNET_SYSUNINIT(vnet_ipf_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, From owner-svn-src-all@freebsd.org Wed Aug 7 01:08:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E04BAB8FF4; Wed, 7 Aug 2019 01:08:58 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463D0p5h1xz413k; Wed, 7 Aug 2019 01:08:58 +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 8D2884BE6; Wed, 7 Aug 2019 01:08:58 +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 x7718w8U025808; Wed, 7 Aug 2019 01:08:58 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7718weo025805; Wed, 7 Aug 2019 01:08:58 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908070108.x7718weo025805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 7 Aug 2019 01:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350668 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 01:08:58 -0000 Author: cy Date: Wed Aug 7 01:08:57 2019 New Revision: 350668 URL: https://svnweb.freebsd.org/changeset/base/350668 Log: MFC r350568: Resolve ipfilter kld unload issues related to VNET jails. When the ipfilter kld is loaded, used within VNET jail, and unloaded, then subsequent loading, use, and unloading of another packet filters will cause the subsequently loaded netpfil kld's to panic. The scenario is as follows: cd /usr/tests/sys/netpfil/common kldunload ipl kldunload pfsync kldunload ipfw kyua test pass_block kldload ipl kyua test pass_block kldunload ipl kldload pfsync kyua test pass_block kldunload pfsync -- page fault panic occurs here -- Reported by: "Ahsan Barkati" via kp@ Discussed with: kp@ Tested by: kp@ Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Aug 7 01:03:35 2019 (r350667) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Aug 7 01:08:57 2019 (r350668) @@ -98,7 +98,10 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { # include # include -static eventhandler_tag ipf_arrivetag, ipf_departtag; +VNET_DEFINE_STATIC(eventhandler_tag, ipf_arrivetag); +VNET_DEFINE_STATIC(eventhandler_tag, ipf_departtag); +#define V_ipf_arrivetag VNET(ipf_arrivetag) +#define V_ipf_departtag VNET(ipf_departtag) #if 0 /* * Disable the "cloner" event handler; we are getting interface @@ -108,7 +111,8 @@ static eventhandler_tag ipf_arrivetag, ipf_departtag; * If it turns out to be needed, well need a dedicated event handler * for it to deal with the ifc and the correct vnet. */ -static eventhandler_tag ipf_clonetag; +VNET_DEFINE_STATIC(eventhandler_tag, ipf_clonetag); +#define V_ipf_clonetag VNET(ipf_clonetag) #endif static void ipf_ifevent(void *arg, struct ifnet *ifp); @@ -1384,14 +1388,14 @@ int ipf_pfil_hook(void) { void ipf_event_reg(void) { - ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ + V_ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); - ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ + V_ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); #if 0 - ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ + V_ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ NULL, EVENTHANDLER_PRI_ANY); #endif } @@ -1399,15 +1403,15 @@ ipf_event_reg(void) void ipf_event_dereg(void) { - if (ipf_arrivetag != NULL) { - EVENTHANDLER_DEREGISTER(ifnet_arrival_event, ipf_arrivetag); + if (V_ipf_arrivetag != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, V_ipf_arrivetag); } - if (ipf_departtag != NULL) { - EVENTHANDLER_DEREGISTER(ifnet_departure_event, ipf_departtag); + if (V_ipf_departtag != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, V_ipf_departtag); } #if 0 - if (ipf_clonetag != NULL) { - EVENTHANDLER_DEREGISTER(if_clone_event, ipf_clonetag); + if (V_ipf_clonetag != NULL) { + EVENTHANDLER_DEREGISTER(if_clone_event, V_ipf_clonetag); } #endif } Modified: stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 01:03:35 2019 (r350667) +++ stable/12/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 01:08:57 2019 (r350668) @@ -283,6 +283,10 @@ vnet_ipf_uninit(void) V_ipfmain.ipf_running = -2; ipf_destroy_all(&V_ipfmain); + if (!IS_DEFAULT_VNET(curvnet)) { + ipf_event_dereg(); + (void)ipf_pfil_unhook(); + } } } VNET_SYSUNINIT(vnet_ipf_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, From owner-svn-src-all@freebsd.org Wed Aug 7 01:34:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB62AB9CC0; Wed, 7 Aug 2019 01:34:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463DZT5zgBz42Zk; Wed, 7 Aug 2019 01:34:41 +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 C40325166; Wed, 7 Aug 2019 01:34:41 +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 x771Yfej043643; Wed, 7 Aug 2019 01:34:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x771YflI043640; Wed, 7 Aug 2019 01:34:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201908070134.x771YflI043640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 7 Aug 2019 01:34:41 +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: r350669 - stable/11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: stable/11/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 350669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 01:34:42 -0000 Author: cy Date: Wed Aug 7 01:34:41 2019 New Revision: 350669 URL: https://svnweb.freebsd.org/changeset/base/350669 Log: Revert 350668 from stable/11 only. It is not at the level of VNET support. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Aug 7 01:08:57 2019 (r350668) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Wed Aug 7 01:34:41 2019 (r350669) @@ -98,10 +98,7 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { # include # include -VNET_DEFINE_STATIC(eventhandler_tag, ipf_arrivetag); -VNET_DEFINE_STATIC(eventhandler_tag, ipf_departtag); -#define V_ipf_arrivetag VNET(ipf_arrivetag) -#define V_ipf_departtag VNET(ipf_departtag) +static eventhandler_tag ipf_arrivetag, ipf_departtag; #if 0 /* * Disable the "cloner" event handler; we are getting interface @@ -111,8 +108,7 @@ VNET_DEFINE_STATIC(eventhandler_tag, ipf_departtag); * If it turns out to be needed, well need a dedicated event handler * for it to deal with the ifc and the correct vnet. */ -VNET_DEFINE_STATIC(eventhandler_tag, ipf_clonetag); -#define V_ipf_clonetag VNET(ipf_clonetag) +static eventhandler_tag ipf_clonetag; #endif static void ipf_ifevent(void *arg, struct ifnet *ifp); @@ -1388,14 +1384,14 @@ int ipf_pfil_hook(void) { void ipf_event_reg(void) { - V_ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ + ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); - V_ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ + ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); #if 0 - V_ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ + ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ NULL, EVENTHANDLER_PRI_ANY); #endif } @@ -1403,15 +1399,15 @@ ipf_event_reg(void) void ipf_event_dereg(void) { - if (V_ipf_arrivetag != NULL) { - EVENTHANDLER_DEREGISTER(ifnet_arrival_event, V_ipf_arrivetag); + if (ipf_arrivetag != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, ipf_arrivetag); } - if (V_ipf_departtag != NULL) { - EVENTHANDLER_DEREGISTER(ifnet_departure_event, V_ipf_departtag); + if (ipf_departtag != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, ipf_departtag); } #if 0 - if (V_ipf_clonetag != NULL) { - EVENTHANDLER_DEREGISTER(if_clone_event, V_ipf_clonetag); + if (ipf_clonetag != NULL) { + EVENTHANDLER_DEREGISTER(if_clone_event, ipf_clonetag); } #endif } Modified: stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 01:08:57 2019 (r350668) +++ stable/11/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Aug 7 01:34:41 2019 (r350669) @@ -280,10 +280,6 @@ vnet_ipf_uninit(void) V_ipfmain.ipf_running = -2; ipf_destroy_all(&V_ipfmain); - if (!IS_DEFAULT_VNET(curvnet)) { - ipf_event_dereg(); - (void)ipf_pfil_unhook(); - } } } VNET_SYSUNINIT(vnet_ipf_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, From owner-svn-src-all@freebsd.org Wed Aug 7 01:41:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FB87BA303; Wed, 7 Aug 2019 01:41: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463Dk937w1z437y; Wed, 7 Aug 2019 01:41: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 4E1A952BF; Wed, 7 Aug 2019 01:41: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 x771fLge047909; Wed, 7 Aug 2019 01:41:21 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x771fIhQ047893; Wed, 7 Aug 2019 01:41:18 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908070141.x771fIhQ047893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 7 Aug 2019 01:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350670 - in head/sys: conf contrib/zlib dev/zlib modules/crypto modules/mxge/mxge modules/zfs modules/zlib X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head/sys: conf contrib/zlib dev/zlib modules/crypto modules/mxge/mxge modules/zfs modules/zlib X-SVN-Commit-Revision: 350670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 01:41:21 -0000 Author: delphij Date: Wed Aug 7 01:41:17 2019 New Revision: 350670 URL: https://svnweb.freebsd.org/changeset/base/350670 Log: Expose zlib's utility functions in Z_SOLO library when building kernel. This allows kernel code to reuse zlib's implementation. PR: 229763 Reviewed by: Yoshihiro Ota Relnotes: yes Differential Revision: https://reviews.freebsd.org/D21156 Modified: head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/contrib/zlib/deflate.c head/sys/contrib/zlib/infback.c head/sys/contrib/zlib/inflate.c head/sys/contrib/zlib/zconf.h head/sys/contrib/zlib/zlib.h head/sys/contrib/zlib/zutil.h head/sys/dev/zlib/zcalloc.c head/sys/dev/zlib/zcalloc.h head/sys/modules/crypto/Makefile head/sys/modules/mxge/mxge/Makefile head/sys/modules/zfs/Makefile head/sys/modules/zlib/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/conf/files Wed Aug 7 01:41:17 2019 (r350670) @@ -273,7 +273,7 @@ cddl/contrib/opensolaris/uts/common/os/callb.c opti cddl/contrib/opensolaris/uts/common/os/fm.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/os/list.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/os/nvpair_alloc_system.c optional zfs compile-with "${ZFS_C}" -cddl/contrib/opensolaris/uts/common/zmod/zmod.c optional zfs compile-with "${ZFS_C} ${ZLIB_CFLAGS}" +cddl/contrib/opensolaris/uts/common/zmod/zmod.c optional zfs compile-with "${ZFS_C}" # zfs lua support cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lapi.c optional zfs compile-with "${ZFS_C}" cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lauxlib.c optional zfs compile-with "${ZFS_C}" @@ -2443,8 +2443,7 @@ mwlboot.fw optional mwlfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "mwlboot.fw" -dev/mxge/if_mxge.c optional mxge pci \ - compile-with "${ZLIB_C}" +dev/mxge/if_mxge.c optional mxge pci dev/mxge/mxge_eth_z8e.c optional mxge pci dev/mxge/mxge_ethp_z8e.c optional mxge pci dev/mxge/mxge_rss_eth_z8e.c optional mxge pci @@ -3999,35 +3998,32 @@ libkern/timingsafe_bcmp.c standard libkern/zlib.c optional crypto | geom_uzip | ipsec | \ ipsec_support | mxge | netgraph_deflate | ddb_ctf | gzio contrib/zlib/adler32.c optional crypto | geom_uzip | ipsec | \ + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib +contrib/zlib/compress.c optional crypto | geom_uzip | ipsec | \ ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C}" + compile-with "${NORMAL_C} -Wno-cast-qual" contrib/zlib/crc32.c optional crypto | geom_uzip | ipsec | \ - ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C} -Wno-cast-qual" + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib contrib/zlib/deflate.c optional crypto | geom_uzip | ipsec | \ ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C} -Wno-cast-qual" + compile-with "${NORMAL_C} -Wno-cast-qual" contrib/zlib/inffast.c optional crypto | geom_uzip | ipsec | \ - ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C}" + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib contrib/zlib/inflate.c optional crypto | geom_uzip | ipsec | \ - ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C}" + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib contrib/zlib/inftrees.c optional crypto | geom_uzip | ipsec | \ - ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C}" + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib contrib/zlib/trees.c optional crypto | geom_uzip | ipsec | \ + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib +contrib/zlib/uncompr.c optional crypto | geom_uzip | ipsec | \ ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C}" + compile-with "${NORMAL_C} -Wno-cast-qual" contrib/zlib/zutil.c optional crypto | geom_uzip | ipsec | \ - ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C}" + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib dev/zlib/zlib_mod.c optional crypto | geom_uzip | ipsec | \ - ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C}" + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib dev/zlib/zcalloc.c optional crypto | geom_uzip | ipsec | \ - ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib \ - compile-with "${ZLIB_C}" + ipsec_support | mxge | ddb_ctf | gzio | zfs | zlib net/altq/altq_cbq.c optional altq net/altq/altq_codel.c optional altq net/altq/altq_hfsc.c optional altq @@ -4780,8 +4776,7 @@ opencrypto/crypto.c optional crypto | ipsec | ipsec_s opencrypto/cryptodev.c optional cryptodev opencrypto/cryptodev_if.m optional crypto | ipsec | ipsec_support opencrypto/cryptosoft.c optional crypto | ipsec | ipsec_support -opencrypto/cryptodeflate.c optional crypto | ipsec | ipsec_support \ - compile-with "${ZLIB_C}" +opencrypto/cryptodeflate.c optional crypto | ipsec | ipsec_support opencrypto/gmac.c optional crypto | ipsec | ipsec_support opencrypto/gfmult.c optional crypto | ipsec | ipsec_support opencrypto/rmd160.c optional crypto | ipsec | ipsec_support Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/conf/kern.pre.mk Wed Aug 7 01:41:17 2019 (r350670) @@ -173,10 +173,6 @@ NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \ -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw} -# for zlib in the kernel -ZLIB_CFLAGS+= -DZ_SOLO -ZLIB_C= ${CC} -c ${ZLIB_CFLAGS} ${CFLAGS} ${.IMPSRC} - # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ ${.IMPSRC} Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/conf/kmod.mk Wed Aug 7 01:41:17 2019 (r350670) @@ -104,8 +104,6 @@ __KLD_SHARED=yes __KLD_SHARED=no .endif -ZLIB_CFLAGS+= -DZ_SOLO - .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) CFLAGS+= -fno-strict-aliasing .endif Modified: head/sys/contrib/zlib/deflate.c ============================================================================== --- head/sys/contrib/zlib/deflate.c Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/contrib/zlib/deflate.c Wed Aug 7 01:41:17 2019 (r350670) @@ -266,7 +266,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowB strm->msg = Z_NULL; if (strm->zalloc == (alloc_func)0) { -#ifdef Z_SOLO +#if defined(Z_SOLO) && !defined(_KERNEL) return Z_STREAM_ERROR; #else strm->zalloc = zcalloc; @@ -274,7 +274,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowB #endif } if (strm->zfree == (free_func)0) -#ifdef Z_SOLO +#if defined(Z_SOLO) && !defined(_KERNEL) return Z_STREAM_ERROR; #else strm->zfree = zcfree; Modified: head/sys/contrib/zlib/infback.c ============================================================================== --- head/sys/contrib/zlib/infback.c Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/contrib/zlib/infback.c Wed Aug 7 01:41:17 2019 (r350670) @@ -42,7 +42,7 @@ int stream_size; return Z_STREAM_ERROR; strm->msg = Z_NULL; /* in case we return an error */ if (strm->zalloc == (alloc_func)0) { -#ifdef Z_SOLO +#if defined(Z_SOLO) && !defined(_KERNEL) return Z_STREAM_ERROR; #else strm->zalloc = zcalloc; @@ -50,7 +50,7 @@ int stream_size; #endif } if (strm->zfree == (free_func)0) -#ifdef Z_SOLO +#if defined(Z_SOLO) && !defined(_KERNEL) return Z_STREAM_ERROR; #else strm->zfree = zcfree; Modified: head/sys/contrib/zlib/inflate.c ============================================================================== --- head/sys/contrib/zlib/inflate.c Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/contrib/zlib/inflate.c Wed Aug 7 01:41:17 2019 (r350670) @@ -207,7 +207,7 @@ int stream_size; if (strm == Z_NULL) return Z_STREAM_ERROR; strm->msg = Z_NULL; /* in case we return an error */ if (strm->zalloc == (alloc_func)0) { -#ifdef Z_SOLO +#if defined(Z_SOLO) && !defined(_KERNEL) return Z_STREAM_ERROR; #else strm->zalloc = zcalloc; @@ -215,7 +215,7 @@ int stream_size; #endif } if (strm->zfree == (free_func)0) -#ifdef Z_SOLO +#if defined(Z_SOLO) && !defined(_KERNEL) return Z_STREAM_ERROR; #else strm->zfree = zcfree; Modified: head/sys/contrib/zlib/zconf.h ============================================================================== --- head/sys/contrib/zlib/zconf.h Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/contrib/zlib/zconf.h Wed Aug 7 01:41:17 2019 (r350670) @@ -8,6 +8,12 @@ #ifndef ZCONF_H #define ZCONF_H +#ifdef __FreeBSD__ +#ifdef _KERNEL +#define Z_SOLO +#endif +#endif + /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. @@ -30,7 +36,7 @@ # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 # define adler32_z z_adler32_z -# ifndef Z_SOLO +# if !defined(Z_SOLO) && !defined(_KERNEL) # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound @@ -125,12 +131,12 @@ # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table -# ifndef Z_SOLO +# if !defined(Z_SOLO) && !defined(_KERNEL) # define uncompress z_uncompress # define uncompress2 z_uncompress2 # endif # define zError z_zError -# ifndef Z_SOLO +# if !defined(Z_SOLO) && !defined(_KERNEL) # define zcalloc z_zcalloc # define zcfree z_zcfree # endif Modified: head/sys/contrib/zlib/zlib.h ============================================================================== --- head/sys/contrib/zlib/zlib.h Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/contrib/zlib/zlib.h Wed Aug 7 01:41:17 2019 (r350670) @@ -1213,7 +1213,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); 27-31: 0 (reserved) */ -#ifndef Z_SOLO +#if !defined(Z_SOLO) || defined(_KERNEL) /* utility functions */ @@ -1288,6 +1288,9 @@ ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLo length of the source is *sourceLen. On return, *sourceLen is the number of source bytes consumed. */ +#endif /* !Z_SOLO || _KERNEL */ + +#ifndef Z_SOLO /* gzip file access functions */ Modified: head/sys/contrib/zlib/zutil.h ============================================================================== --- head/sys/contrib/zlib/zutil.h Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/contrib/zlib/zutil.h Wed Aug 7 01:41:17 2019 (r350670) @@ -256,7 +256,7 @@ extern z_const char * const z_errmsg[10]; /* indexed b # define Tracecv(c,x) #endif -#ifndef Z_SOLO +#if !defined(Z_SOLO) || defined(_KERNEL) voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, unsigned size)); void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); Modified: head/sys/dev/zlib/zcalloc.c ============================================================================== --- head/sys/dev/zlib/zcalloc.c Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/dev/zlib/zcalloc.c Wed Aug 7 01:41:17 2019 (r350670) @@ -24,6 +24,13 @@ zcalloc_nowait(void *nil, u_int items, u_int size) return mallocarray(items, size, M_ZLIB, M_NOWAIT); } +void * +zcalloc(void *nil, u_int items, u_int size) +{ + + return zcalloc_nowait(nil, items, size); +} + void zcfree(void *nil, void *ptr) { Modified: head/sys/dev/zlib/zcalloc.h ============================================================================== --- head/sys/dev/zlib/zcalloc.h Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/dev/zlib/zcalloc.h Wed Aug 7 01:41:17 2019 (r350670) @@ -6,8 +6,9 @@ #ifndef _DEV_ZLIB_ZCALLOC_ #define _DEV_ZLIB_ZCALLOC_ -void * zcalloc_waitok(void *nil, u_int items, u_int size); -void * zcalloc_nowait(void *nil, u_int items, u_int size); -void zcfree(void *nil, void *ptr); +#include +#undef local +void *zcalloc_waitok(void *, u_int, u_int); +void *zcalloc_nowait(void *, u_int, u_int); #endif Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/modules/crypto/Makefile Wed Aug 7 01:41:17 2019 (r350670) @@ -23,7 +23,6 @@ KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c SRCS += cast.c cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c -CFLAGS.cryptodeflate.c += ${ZLIB_CFLAGS} SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c Modified: head/sys/modules/mxge/mxge/Makefile ============================================================================== --- head/sys/modules/mxge/mxge/Makefile Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/modules/mxge/mxge/Makefile Wed Aug 7 01:41:17 2019 (r350670) @@ -5,6 +5,4 @@ KMOD= if_mxge SRCS= if_mxge.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h -CFLAGS.if_mxge.c+= ${ZLIB_CFLAGS} - .include Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/modules/zfs/Makefile Wed Aug 7 01:41:17 2019 (r350670) @@ -56,7 +56,6 @@ SRCS+= nvpair_alloc_system.c .PATH: ${SUNW}/uts/common/zmod SRCS+= zmod.c -CFLAGS.zmod.c+= ${ZLIB_CFLAGS} .PATH: ${SYSDIR}/crypto/sha2 SRCS+= sha256c.c sha512c.c Modified: head/sys/modules/zlib/Makefile ============================================================================== --- head/sys/modules/zlib/Makefile Wed Aug 7 01:34:41 2019 (r350669) +++ head/sys/modules/zlib/Makefile Wed Aug 7 01:41:17 2019 (r350670) @@ -11,15 +11,15 @@ SRCS= zlib.c SRCS+= zcalloc.c SRCS+= zlib_mod.c SRCS+= adler32.c +SRCS+= compress.c SRCS+= crc32.c SRCS+= deflate.c SRCS+= inffast.c SRCS+= inflate.c SRCS+= inftrees.c SRCS+= trees.c +SRCS+= uncompr.c SRCS+= zutil.c - -CFLAGS+=${ZLIB_CFLAGS} CWARNFLAGS.compress.c+=-Wno-cast-qual # compress:49 CWARNFLAGS.deflate.c+=-Wno-cast-qual # deflate.c:415 From owner-svn-src-all@freebsd.org Wed Aug 7 03:14:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED39EBC2A5; Wed, 7 Aug 2019 03:14:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463Gnx5zD9z481t; Wed, 7 Aug 2019 03:14: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 AE9D963F2; Wed, 7 Aug 2019 03:14:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x773EjiQ003886; Wed, 7 Aug 2019 03:14:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x773Ejkw003885; Wed, 7 Aug 2019 03:14:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908070314.x773Ejkw003885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Aug 2019 03:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350671 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 350671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 03:14:46 -0000 Author: markj Date: Wed Aug 7 03:14:45 2019 New Revision: 350671 URL: https://svnweb.freebsd.org/changeset/base/350671 Log: readelf: Close input files when done with them. The low fd limit used by poudriere exposed an odd failure mode in cap_fileargs (used by readelf as of r350516). In particular, when the limit was hit, both the main process and casper service would block on their shared socket, waiting forever for the other to send a message. Reported by: zeising MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Aug 7 01:41:17 2019 (r350670) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Aug 7 03:14:45 2019 (r350671) @@ -7732,10 +7732,12 @@ main(int argc, char **argv) for (i = 0; i < argc; i++) { re->filename = argv[i]; fd = fileargs_open(fa, re->filename); - if (fd < 0) + if (fd < 0) { warn("open %s failed", re->filename); - else + } else { dump_object(re, fd); + close(fd); + } } exit(EXIT_SUCCESS); From owner-svn-src-all@freebsd.org Wed Aug 7 05:34:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 994DDBF520; Wed, 7 Aug 2019 05:34:10 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 463Ktn2yhCz4GBG; Wed, 7 Aug 2019 05:34:08 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id BC8561AF112; Wed, 7 Aug 2019 05:34:00 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id x775Y0DP063283 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 7 Aug 2019 05:34:00 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id x775Y0SF063282; Wed, 7 Aug 2019 05:34:00 GMT (envelope-from phk) To: Glen Barber cc: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: svn commit: r350550 - head/share/mk In-reply-to: <20190806165614.GA41295@FreeBSD.org> From: "Poul-Henning Kamp" References: <201908030106.x7316Ibx078529@repo.freebsd.org> <20190806165614.GA41295@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <63280.1565156040.1@critter.freebsd.dk> Date: Wed, 07 Aug 2019 05:34:00 +0000 Message-ID: <63281.1565156040@critter.freebsd.dk> X-Rspamd-Queue-Id: 463Ktn2yhCz4GBG X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of phk@critter.freebsd.dk designates 130.225.244.222 as permitted sender) smtp.mailfrom=phk@critter.freebsd.dk X-Spamd-Result: default: False [-0.66 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.76)[-0.757,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; NEURAL_HAM_LONG(-0.85)[-0.852,0]; NEURAL_SPAM_SHORT(0.90)[0.903,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(0.05)[ip: (0.09), ipnet: 130.225.0.0/16(0.04), asn: 1835(0.12), country: EU(-0.00)]; RCPT_COUNT_SEVEN(0.00)[7]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 05:34:10 -0000 -------- In message <20190806165614.GA41295@FreeBSD.org>, Glen Barber writes: >In my opinion, those that want the non-reproducible metadata included in >output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their >src.conf. Turning off a sane default for the benefit of what I suspect >is likely a short list of use cases feels like a step in the wrong >direction. Seconded. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@freebsd.org Wed Aug 7 13:11:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5AA8DAADF6; Wed, 7 Aug 2019 13:11:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463X2y1jlmz3DZB; Wed, 7 Aug 2019 13:11:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B296D23A; Wed, 7 Aug 2019 13:11:54 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77DBrT7057080; Wed, 7 Aug 2019 13:11:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77DBr8s057079; Wed, 7 Aug 2019 13:11:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908071311.x77DBr8s057079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 7 Aug 2019 13:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350673 - head/sys/gnu/dts/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/gnu/dts/arm X-SVN-Commit-Revision: 350673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 13:11:54 -0000 Author: manu Date: Wed Aug 7 13:11:53 2019 New Revision: 350673 URL: https://svnweb.freebsd.org/changeset/base/350673 Log: arm: dts: am33xx: Fix the region for uart0 The region for uart0 is declared to be 0x2000 in size but the parent node only declare 0x1000. As the parent only declare a size of 0x1000 in the ranges for it's children this cause the device to not be mappable. https://patchwork.kernel.org/patch/11056769/ Modified: head/sys/gnu/dts/arm/am33xx-l4.dtsi Modified: head/sys/gnu/dts/arm/am33xx-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx-l4.dtsi Wed Aug 7 04:08:50 2019 (r350672) +++ head/sys/gnu/dts/arm/am33xx-l4.dtsi Wed Aug 7 13:11:53 2019 (r350673) @@ -185,7 +185,7 @@ uart0: serial@0 { compatible = "ti,am3352-uart", "ti,omap3-uart"; clock-frequency = <48000000>; - reg = <0x0 0x2000>; + reg = <0x0 0x1000>; interrupts = <72>; status = "disabled"; dmas = <&edma 26 0>, <&edma 27 0>; From owner-svn-src-all@freebsd.org Wed Aug 7 13:13:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 907D9AB048; Wed, 7 Aug 2019 13:13:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463X4Y36P2z3DlK; Wed, 7 Aug 2019 13:13:17 +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 4C939D27E; Wed, 7 Aug 2019 13:13:17 +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 x77DDHVd057890; Wed, 7 Aug 2019 13:13:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77DDHXu057889; Wed, 7 Aug 2019 13:13:17 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908071313.x77DDHXu057889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 7 Aug 2019 13:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350674 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 350674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 13:13:17 -0000 Author: manu Date: Wed Aug 7 13:13:16 2019 New Revision: 350674 URL: https://svnweb.freebsd.org/changeset/base/350674 Log: ofw: ofw_reg_to_paddr: Use a 256 static array for the cell Some hardware needs more than 32, bump this value. We cannot use the _alloc for of getencprop as this function is called too early in the boot before pmap is initialized and we only have 2k of stack when cninit is called. Discussed with: ian Modified: head/sys/dev/ofw/ofw_subr.c Modified: head/sys/dev/ofw/ofw_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_subr.c Wed Aug 7 13:11:53 2019 (r350673) +++ head/sys/dev/ofw/ofw_subr.c Wed Aug 7 13:13:16 2019 (r350674) @@ -79,7 +79,8 @@ int ofw_reg_to_paddr(phandle_t dev, int regno, bus_addr_t *paddr, bus_size_t *psize, pcell_t *ppci_hi) { - pcell_t cell[32], pci_hi; + static pcell_t cell[256]; + pcell_t pci_hi; uint64_t addr, raddr, baddr; uint64_t size, rsize; uint32_t c, nbridge, naddr, nsize; From owner-svn-src-all@freebsd.org Wed Aug 7 13:35:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8977AB65F; Wed, 7 Aug 2019 13:35:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463XYs4VSrz3FkQ; Wed, 7 Aug 2019 13:35:13 +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 7D230D63D; Wed, 7 Aug 2019 13:35:13 +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 x77DZDMn069549; Wed, 7 Aug 2019 13:35:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77DZDjh069548; Wed, 7 Aug 2019 13:35:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201908071335.x77DZDjh069548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Aug 2019 13:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350675 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 350675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 13:35:13 -0000 Author: hselasky Date: Wed Aug 7 13:35:13 2019 New Revision: 350675 URL: https://svnweb.freebsd.org/changeset/base/350675 Log: Correct PCI device ID for XHCI USB controller. Submitted by: Dmitry Luhtionov MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Wed Aug 7 13:13:16 2019 (r350674) +++ head/sys/dev/usb/controller/xhci_pci.c Wed Aug 7 13:35:13 2019 (r350675) @@ -149,7 +149,7 @@ xhci_pci_match(device_t self) return ("Intel Lewisburg USB 3.0 controller"); case 0xa2af8086: return ("Intel Union Point USB 3.0 controller"); - case 0x36d88086: + case 0xa36d8086: return ("Intel Cannon Lake USB 3.1 controller"); case 0xa01b177d: From owner-svn-src-all@freebsd.org Wed Aug 7 14:45:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6754AACAF0; Wed, 7 Aug 2019 14:45:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463Z6c2psVz3JTd; Wed, 7 Aug 2019 14:45:12 +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 436F4E2DC; Wed, 7 Aug 2019 14:45:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77EjCpx010370; Wed, 7 Aug 2019 14:45:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77EjB95010365; Wed, 7 Aug 2019 14:45:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908071445.x77EjB95010365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 7 Aug 2019 14:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350676 - in head: sbin/camcontrol sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head: sbin/camcontrol sys/cam/scsi X-SVN-Commit-Revision: 350676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 14:45:12 -0000 Author: mav Date: Wed Aug 7 14:45:10 2019 New Revision: 350676 URL: https://svnweb.freebsd.org/changeset/base/350676 Log: Make `camcontrol modepage` support block descriptors. It allows to read and write block descriptors alike to mode page parameters. It allows to change block size or short-stroke HDDs or overprovision SSDs. Depenting on -P parameter the change can be either persistent or till reset. In case of block size change device may need reformat after the setting. In case of SSD overprovisioning format or sanitize may be needed to really free the flash. During implementation appeared that csio_encode_visit() can not handle integers of more then 4 bytes, that makes 8-byte LBA handling awkward. I had to split it into two 4-byte halves now. MFC after: 1 week Relnotes: yes Sponsored by: iXsystems, Inc. Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/camcontrol.h head/sbin/camcontrol/modeedit.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Wed Aug 7 13:35:13 2019 (r350675) +++ head/sbin/camcontrol/camcontrol.8 Wed Aug 7 14:45:10 2019 (r350676) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 30, 2019 +.Dd August 6, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -125,6 +125,8 @@ .Op Fl 6 .Aq Fl m Ar page[,subpage] | Fl l .Op Fl P Ar pgctl +.Op Fl D +.Op Fl L .Op Fl b | Fl e .Op Fl d .Nm @@ -733,6 +735,11 @@ If not specified, starts with 10 byte commands and falls back to 6 byte on error. .It Fl d Disable block descriptors for mode sense. +.It Fl D +Display/edit block descriptors instead of mode page. +.It Fl L +Use long LBA block descriptors. +Allows number of LBAs bigger then 2^^32. .It Fl b Displays mode page data in binary format. .It Fl e Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Wed Aug 7 13:35:13 2019 (r350675) +++ head/sbin/camcontrol/camcontrol.c Wed Aug 7 14:45:10 2019 (r350676) @@ -221,7 +221,7 @@ static struct camcontrol_opts option_table[] = { {"devlist", CAM_CMD_DEVTREE, CAM_ARG_NONE, "-b"}, {"devtype", CAM_CMD_DEVTYPE, CAM_ARG_NONE, ""}, {"periphlist", CAM_CMD_DEVLIST, CAM_ARG_NONE, NULL}, - {"modepage", CAM_CMD_MODE_PAGE, CAM_ARG_NONE, "6bdelm:P:"}, + {"modepage", CAM_CMD_MODE_PAGE, CAM_ARG_NONE, "6bdelm:DLP:"}, {"tags", CAM_CMD_TAG, CAM_ARG_NONE, "N:q"}, {"negotiate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, {"rate", CAM_CMD_RATE, CAM_ARG_NONE, negotiate_opts}, @@ -4586,9 +4586,9 @@ reassignblocks(struct cam_device *device, u_int32_t *b #endif void -mode_sense(struct cam_device *device, int *cdb_len, int dbd, int pc, int page, - int subpage, int task_attr, int retry_count, int timeout, u_int8_t *data, - int datalen) +mode_sense(struct cam_device *device, int *cdb_len, int dbd, int llbaa, int pc, + int page, int subpage, int task_attr, int retry_count, int timeout, + u_int8_t *data, int datalen) { union ccb *ccb; int error_code, sense_key, asc, ascq; @@ -4620,6 +4620,11 @@ retry: /* minimum_cmd_size */ *cdb_len, /* sense_len */ SSD_FULL_SIZE, /* timeout */ timeout ? timeout : 5000); + if (llbaa && ccb->csio.cdb_len == 10) { + struct scsi_mode_sense_10 *cdb = + (struct scsi_mode_sense_10 *)ccb->csio.cdb_io.cdb_bytes; + cdb->byte2 |= SMS10_LLBAA; + } /* Record what CDB size the above function really set. */ *cdb_len = ccb->csio.cdb_len; @@ -4711,8 +4716,8 @@ modepage(struct cam_device *device, int argc, char **a int task_attr, int retry_count, int timeout) { char *str_subpage; - int c, page = -1, subpage = -1, pc = 0; - int binary = 0, cdb_len = 10, dbd = 0, edit = 0, list = 0; + int c, page = -1, subpage = -1, pc = 0, llbaa = 0; + int binary = 0, cdb_len = 10, dbd = 0, desc = 0, edit = 0, list = 0; while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -4744,6 +4749,12 @@ modepage(struct cam_device *device, int argc, char **a if (subpage < 0) errx(1, "invalid mode subpage %d", subpage); break; + case 'D': + desc = 1; + break; + case 'L': + llbaa = 1; + break; case 'P': pc = strtol(optarg, NULL, 0); if ((pc < 0) || (pc > 3)) @@ -4754,15 +4765,21 @@ modepage(struct cam_device *device, int argc, char **a } } - if (page == -1 && list == 0) + if (page == -1 && desc == 0 && list == 0) errx(1, "you must specify a mode page!"); + if (dbd && desc) + errx(1, "-d and -D are incompatible!"); + + if (llbaa && cdb_len != 10) + errx(1, "LLBAA bit is not present in MODE SENSE(6)!"); + if (list != 0) { mode_list(device, cdb_len, dbd, pc, list > 1, task_attr, retry_count, timeout); } else { - mode_edit(device, cdb_len, dbd, pc, page, subpage, edit, - binary, task_attr, retry_count, timeout); + mode_edit(device, cdb_len, desc, dbd, llbaa, pc, page, subpage, + edit, binary, task_attr, retry_count, timeout); } } Modified: head/sbin/camcontrol/camcontrol.h ============================================================================== --- head/sbin/camcontrol/camcontrol.h Wed Aug 7 13:35:13 2019 (r350675) +++ head/sbin/camcontrol/camcontrol.h Wed Aug 7 14:45:10 2019 (r350676) @@ -88,15 +88,15 @@ int epc(struct cam_device *device, int argc, char **ar int timestamp(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout, int verbosemode); -void mode_sense(struct cam_device *device, int *cdb_len, int dbd, int pc, - int page, int subpage, int task_attr, int retry_count, +void mode_sense(struct cam_device *device, int *cdb_len, int dbd, int llbaa, + int pc, int page, int subpage, int task_attr, int retry_count, int timeout, uint8_t *data, int datalen); void mode_select(struct cam_device *device, int cdb_len, int save_pages, int task_attr, int retry_count, int timeout, u_int8_t *data, int datalen); -void mode_edit(struct cam_device *device, int cdb_len, int dbd, int pc, - int page, int subpage, int edit, int binary, int task_attr, - int retry_count, int timeout); +void mode_edit(struct cam_device *device, int cdb_len, int desc, int dbd, + int llbaa, int pc, int page, int subpage, int edit, int binary, + int task_attr, int retry_count, int timeout); void mode_list(struct cam_device *device, int cdb_len, int dbd, int pc, int subpages, int task_attr, int retry_count, int timeout); int scsidoinquiry(struct cam_device *device, int argc, char **argv, Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Wed Aug 7 13:35:13 2019 (r350675) +++ head/sbin/camcontrol/modeedit.c Wed Aug 7 14:45:10 2019 (r350676) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -96,6 +97,8 @@ static void editentry_create(void *hook, int letter, int count, char *name); static void editentry_update(void *hook, int letter, void *arg, int count, char *name); +static void editentry_create_desc(void *hook, int letter, void *arg, + int count, char *name); static int editentry_save(void *hook, char *name); static struct editentry *editentry_lookup(char *name); static int editentry_set(char *name, char *newvalue, @@ -103,9 +106,16 @@ static int editentry_set(char *name, char *newvalue, static void editlist_populate(struct cam_device *device, int cdb_len, int dbd, int pc, int page, int subpage, int task_attr, int retries, int timeout); +static void editlist_populate_desc(struct cam_device *device, + int cdb_len, int llbaa, int pc, int page, + int subpage, int task_attr, int retries, + int timeout); static void editlist_save(struct cam_device *device, int cdb_len, int dbd, int pc, int page, int subpage, int task_attr, int retries, int timeout); +static void editlist_save_desc(struct cam_device *device, int cdb_len, + int llbaa, int pc, int page, int subpage, + int task_attr, int retries, int timeout); static void nameentry_create(int page, int subpage, char *name); static struct pagename *nameentry_lookup(int page, int subpage); static int load_format(const char *pagedb_path, int lpage, @@ -116,6 +126,10 @@ static void modepage_edit(void); static void modepage_dump(struct cam_device *device, int cdb_len, int dbd, int pc, int page, int subpage, int task_attr, int retries, int timeout); +static void modepage_dump_desc(struct cam_device *device, + int cdb_len, int llbaa, int pc, int page, + int subpage, int task_attr, int retries, + int timeout); static void cleanup_editfile(void); @@ -182,6 +196,43 @@ editentry_update(void *hook __unused, int letter, void } } +static void +editentry_create_desc(void *hook __unused, int letter, void *arg, int count, + char *name) +{ + struct editentry *newentry; /* Buffer to hold new entry. */ + + /* Allocate memory for the new entry and a copy of the entry name. */ + if ((newentry = malloc(sizeof(struct editentry))) == NULL || + (newentry->name = strdup(name)) == NULL) + err(EX_OSERR, NULL); + + /* Trim any trailing whitespace for the entry name. */ + RTRIM(newentry->name); + + newentry->editable = 1; + newentry->type = letter; + newentry->size = count; + newentry->value.svalue = NULL; + + STAILQ_INSERT_TAIL(&editlist, newentry, link); + + switch (letter) { + case 'i': /* Byte-sized integral type. */ + case 'b': /* Bit-sized integral types. */ + case 't': + newentry->value.ivalue = (intptr_t)arg; + break; + + case 'c': /* Character array. */ + case 'z': /* Null-padded string. */ + editentry_set(name, (char *)arg, 0); + break; + default: + ; /* NOTREACHED */ + } +} + static int editentry_save(void *hook __unused, char *name) { @@ -238,7 +289,7 @@ editentry_set(char *name, char *newvalue, int editonly struct editentry *dest; /* Modepage entry to update. */ char *cval; /* Pointer to new string value. */ char *convertend; /* End-of-conversion pointer. */ - int ival; /* New integral value. */ + long long ival, newival; /* New integral value. */ int resolution; /* Resolution in bits for integer conversion. */ /* @@ -248,7 +299,7 @@ editentry_set(char *name, char *newvalue, int editonly * currently workaround it (even for int64's), so we have to kludge it. */ #define RESOLUTION_MAX(size) ((resolution * (size) == 32)? \ - INT_MAX: (1 << (resolution * (size))) - 1) + UINT_MAX: (1 << (resolution * (size))) - 1) assert(newvalue != NULL); if (*newvalue == '\0') @@ -265,13 +316,13 @@ editentry_set(char *name, char *newvalue, int editonly case 't': /* Convert the value string to an integer. */ resolution = (dest->type == 'i')? 8: 1; - ival = (int)strtol(newvalue, &convertend, 0); + ival = strtoll(newvalue, &convertend, 0); if (*convertend != '\0') returnerr(EINVAL); if (ival > RESOLUTION_MAX(dest->size) || ival < 0) { - int newival = (ival < 0)? 0: RESOLUTION_MAX(dest->size); - warnx("value %d is out of range for entry %s; clipping " - "to %d", ival, name, newival); + newival = (ival < 0) ? 0 : RESOLUTION_MAX(dest->size); + warnx("value %lld is out of range for entry %s; " + "clipping to %lld", ival, name, newival); ival = newival; } if (dest->value.ivalue != ival) @@ -548,7 +599,7 @@ static void editlist_populate(struct cam_device *device, int cdb_len, int dbd, int pc, int page, int subpage, int task_attr, int retries, int timeout) { - u_int8_t data[MAX_DATA_SIZE];/* Buffer to hold sense data. */ + u_int8_t data[MAX_DATA_SIZE]; /* Buffer to hold mode parameters. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; @@ -557,8 +608,8 @@ editlist_populate(struct cam_device *device, int cdb_l STAILQ_INIT(&editlist); /* Fetch changeable values; use to build initial editlist. */ - mode_sense(device, &cdb_len, dbd, 1, page, subpage, task_attr, retries, - timeout, data, sizeof(data)); + mode_sense(device, &cdb_len, dbd, 0, 1, page, subpage, task_attr, + retries, timeout, data, sizeof(data)); if (cdb_len == 6) { struct scsi_mode_header_6 *mh = @@ -583,16 +634,77 @@ editlist_populate(struct cam_device *device, int cdb_l buff_decode_visit(mode_pars, len, format, editentry_create, 0); /* Fetch the current/saved values; use to set editentry values. */ - mode_sense(device, &cdb_len, dbd, pc, page, subpage, task_attr, + mode_sense(device, &cdb_len, dbd, 0, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); buff_decode_visit(mode_pars, len, format, editentry_update, 0); } static void +editlist_populate_desc(struct cam_device *device, int cdb_len, int llbaa, int pc, + int page, int subpage, int task_attr, int retries, int timeout) +{ + uint8_t data[MAX_DATA_SIZE]; /* Buffer to hold mode parameters. */ + uint8_t *desc; /* Pointer to block descriptor. */ + char num[8]; + struct sbuf sb; + size_t len; + u_int longlba, dlen, i; + + STAILQ_INIT(&editlist); + + /* Fetch the current/saved values. */ + mode_sense(device, &cdb_len, 0, llbaa, pc, page, subpage, task_attr, + retries, timeout, data, sizeof(data)); + + if (cdb_len == 6) { + struct scsi_mode_header_6 *mh = + (struct scsi_mode_header_6 *)data; + desc = (uint8_t *)(mh + 1); + len = mh->blk_desc_len; + longlba = 0; + } else { + struct scsi_mode_header_10 *mh = + (struct scsi_mode_header_10 *)data; + desc = (uint8_t *)(mh + 1); + len = scsi_2btoul(mh->blk_desc_len); + longlba = (mh->flags & SMH_LONGLBA) != 0; + } + dlen = longlba ? 16 : 8; + len = MIN(len, sizeof(data) - (desc - data)); + + sbuf_new(&sb, format, sizeof(format), SBUF_FIXEDLEN); + num[0] = 0; + for (i = 0; i * dlen < len; i++) { + if (i > 0) + snprintf(num, sizeof(num), " %d", i + 1); + if (longlba) { + sbuf_printf(&sb, "{Number of Logical Blocks%s High} i4\n", num); + sbuf_printf(&sb, "{Number of Logical Blocks%s} i4\n", num); + sbuf_cat(&sb, "{Reserved} *i4\n"); + sbuf_printf(&sb, "{Logical Block Length%s} i4\n", num); + } else if (device->pd_type == T_DIRECT) { + sbuf_printf(&sb, "{Number of Logical Blocks%s} i4\n", num); + sbuf_cat(&sb, "{Reserved} *i1\n"); + sbuf_printf(&sb, "{Logical Block Length%s} i3\n", num); + } else { + sbuf_printf(&sb, "{Density Code%s} i1\n", num); + sbuf_printf(&sb, "{Number of Logical Blocks%s} i3\n", num); + sbuf_cat(&sb, "{Reserved} *i1\n"); + sbuf_printf(&sb, "{Logical Block Length%s} i3\n", num); + } + } + sbuf_finish(&sb); + sbuf_delete(&sb); + + /* Decode the value data, creating edit_entries for each value. */ + buff_decode_visit(desc, len, format, editentry_create_desc, 0); +} + +static void editlist_save(struct cam_device *device, int cdb_len, int dbd, int pc, int page, int subpage, int task_attr, int retries, int timeout) { - u_int8_t data[MAX_DATA_SIZE];/* Buffer to hold sense data. */ + u_int8_t data[MAX_DATA_SIZE]; /* Buffer to hold mode parameters. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; @@ -603,7 +715,7 @@ editlist_save(struct cam_device *device, int cdb_len, return; /* Preload the CDB buffer with the current mode page data. */ - mode_sense(device, &cdb_len, dbd, pc, page, subpage, task_attr, + mode_sense(device, &cdb_len, dbd, 0, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); /* Initial headers & offsets. */ @@ -676,6 +788,56 @@ editlist_save(struct cam_device *device, int cdb_len, task_attr, retries, timeout, data, hlen + mphlen + len); } +static void +editlist_save_desc(struct cam_device *device, int cdb_len, int llbaa, int pc, + int page, int subpage, int task_attr, int retries, int timeout) +{ + uint8_t data[MAX_DATA_SIZE]; /* Buffer to hold mode parameters. */ + uint8_t *desc; /* Pointer to block descriptor. */ + size_t len, hlen; + + /* Make sure that something changed before continuing. */ + if (! editlist_changed) + return; + + /* Preload the CDB buffer with the current mode page data. */ + mode_sense(device, &cdb_len, 0, llbaa, pc, page, subpage, task_attr, + retries, timeout, data, sizeof(data)); + + /* Initial headers & offsets. */ + if (cdb_len == 6) { + struct scsi_mode_header_6 *mh = + (struct scsi_mode_header_6 *)data; + hlen = sizeof(*mh); + desc = (uint8_t *)(mh + 1); + len = mh->blk_desc_len; + mh->data_length = 0; /* Reserved for MODE SELECT command. */ + if (device->pd_type != T_SEQUENTIAL) + mh->dev_spec = 0; /* See comment above */ + } else { + struct scsi_mode_header_10 *mh = + (struct scsi_mode_header_10 *)data; + hlen = sizeof(*mh); + desc = (uint8_t *)(mh + 1); + len = scsi_2btoul(mh->blk_desc_len); + scsi_ulto2b(0, mh->data_length); /* Reserved for MODE SELECT. */ + if (device->pd_type != T_SEQUENTIAL) + mh->dev_spec = 0; /* See comment above */ + } + len = MIN(len, sizeof(data) - (desc - data)); + + /* Encode the value data to be passed back to the device. */ + buff_encode_visit(desc, len, format, editentry_save, 0); + + /* + * Write the changes back to the device. If the user editted control + * page 3 (saved values) then request the changes be permanently + * recorded. + */ + mode_select(device, cdb_len, (pc << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), + task_attr, retries, timeout, data, hlen + len); +} + static int modepage_write(FILE *file, int editonly) { @@ -689,7 +851,7 @@ modepage_write(FILE *file, int editonly) fprintf(file, "%s: %s\n", scan->name, scan->value.svalue); } else { - fprintf(file, "%s: %d\n", scan->name, + fprintf(file, "%s: %u\n", scan->name, scan->value.ivalue); } } @@ -845,13 +1007,13 @@ static void modepage_dump(struct cam_device *device, int cdb_len, int dbd, int pc, int page, int subpage, int task_attr, int retries, int timeout) { - u_int8_t data[MAX_DATA_SIZE];/* Buffer to hold sense data. */ + u_int8_t data[MAX_DATA_SIZE]; /* Buffer to hold mode parameters. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; size_t indx, len; - mode_sense(device, &cdb_len, dbd, pc, page, subpage, task_attr, + mode_sense(device, &cdb_len, dbd, 0, pc, page, subpage, task_attr, retries, timeout, data, sizeof(data)); if (cdb_len == 6) { @@ -880,7 +1042,38 @@ modepage_dump(struct cam_device *device, int cdb_len, } putchar('\n'); } +static void +modepage_dump_desc(struct cam_device *device, int cdb_len, int llbaa, int pc, + int page, int subpage, int task_attr, int retries, int timeout) +{ + uint8_t data[MAX_DATA_SIZE]; /* Buffer to hold mode parameters. */ + uint8_t *desc; /* Pointer to block descriptor. */ + size_t indx, len; + mode_sense(device, &cdb_len, 0, llbaa, pc, page, subpage, task_attr, + retries, timeout, data, sizeof(data)); + + if (cdb_len == 6) { + struct scsi_mode_header_6 *mh = + (struct scsi_mode_header_6 *)data; + desc = (uint8_t *)(mh + 1); + len = mh->blk_desc_len; + } else { + struct scsi_mode_header_10 *mh = + (struct scsi_mode_header_10 *)data; + desc = (uint8_t *)(mh + 1); + len = scsi_2btoul(mh->blk_desc_len); + } + len = MIN(len, sizeof(data) - (desc - data)); + + /* Print the raw mode page data with newlines each 8 bytes. */ + for (indx = 0; indx < len; indx++) { + printf("%02x%c", desc[indx], + (((indx + 1) % 8) == 0) ? '\n' : ' '); + } + putchar('\n'); +} + static void cleanup_editfile(void) { @@ -892,16 +1085,19 @@ cleanup_editfile(void) } void -mode_edit(struct cam_device *device, int cdb_len, int dbd, int pc, int page, - int subpage, int edit, int binary, int task_attr, int retry_count, - int timeout) +mode_edit(struct cam_device *device, int cdb_len, int desc, int dbd, int llbaa, + int pc, int page, int subpage, int edit, int binary, int task_attr, + int retry_count, int timeout) { const char *pagedb_path; /* Path to modepage database. */ - if (edit && binary) - errx(EX_USAGE, "cannot edit in binary mode."); - - if (! binary) { + if (binary) { + if (edit) + errx(EX_USAGE, "cannot edit in binary mode."); + } else if (desc) { + editlist_populate_desc(device, cdb_len, llbaa, pc, page, + subpage, task_attr, retry_count, timeout); + } else { if ((pagedb_path = getenv("SCSI_MODES")) == NULL) pagedb_path = DEFAULT_SCSI_MODE_DB; @@ -935,12 +1131,22 @@ mode_edit(struct cam_device *device, int cdb_len, int errx(EX_USAGE, "it only makes sense to edit page 0 " "(current) or page 3 (saved values)"); modepage_edit(); - editlist_save(device, cdb_len, dbd, pc, page, subpage, - task_attr, retry_count, timeout); + if (desc) { + editlist_save_desc(device, cdb_len, llbaa, pc, page, + subpage, task_attr, retry_count, timeout); + } else { + editlist_save(device, cdb_len, dbd, pc, page, subpage, + task_attr, retry_count, timeout); + } } else if (binary || STAILQ_EMPTY(&editlist)) { /* Display without formatting information. */ - modepage_dump(device, cdb_len, dbd, pc, page, subpage, - task_attr, retry_count, timeout); + if (desc) { + modepage_dump_desc(device, cdb_len, llbaa, pc, page, + subpage, task_attr, retry_count, timeout); + } else { + modepage_dump(device, cdb_len, dbd, pc, page, subpage, + task_attr, retry_count, timeout); + } } else { /* Display with format. */ modepage_write(stdout, 0); @@ -951,7 +1157,7 @@ void mode_list(struct cam_device *device, int cdb_len, int dbd, int pc, int subpages, int task_attr, int retry_count, int timeout) { - u_int8_t data[MAX_DATA_SIZE];/* Buffer to hold sense data. */ + u_int8_t data[MAX_DATA_SIZE]; /* Buffer to hold mode parameters. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; struct pagename *nameentry; @@ -967,7 +1173,7 @@ mode_list(struct cam_device *device, int cdb_len, int } /* Build the list of all mode pages by querying the "all pages" page. */ - mode_sense(device, &cdb_len, dbd, pc, SMS_ALL_PAGES_PAGE, + mode_sense(device, &cdb_len, dbd, 0, pc, SMS_ALL_PAGES_PAGE, subpages ? SMS_SUBPAGE_ALL : 0, task_attr, retry_count, timeout, data, sizeof(data)); Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Aug 7 13:35:13 2019 (r350675) +++ head/sys/cam/scsi/scsi_all.c Wed Aug 7 14:45:10 2019 (r350676) @@ -2056,7 +2056,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x30, 0x13, SS_RDEF, /* XXX TBD */ "Cleaning volume expired") }, /* DT WRO BK */ - { SST(0x31, 0x00, SS_RDEF, + { SST(0x31, 0x00, SS_FATAL | ENXIO, "Medium format corrupted") }, /* D L RO B */ { SST(0x31, 0x01, SS_RDEF, Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Aug 7 13:35:13 2019 (r350675) +++ head/sys/cam/scsi/scsi_all.h Wed Aug 7 14:45:10 2019 (r350676) @@ -3622,7 +3622,9 @@ struct scsi_mode_header_10 u_int8_t data_length[2];/* Sense data length */ u_int8_t medium_type; u_int8_t dev_spec; - u_int8_t unused[2]; + u_int8_t flags; +#define SMH_LONGLBA 0x01 + u_int8_t unused; u_int8_t blk_desc_len[2]; }; From owner-svn-src-all@freebsd.org Wed Aug 7 15:05:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4F97AD071; Wed, 7 Aug 2019 15:05:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463ZYd3tzSz3KLG; Wed, 7 Aug 2019 15:05: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 66F25E678; Wed, 7 Aug 2019 15:05: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 x77F59bN022031; Wed, 7 Aug 2019 15:05:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77F591h022030; Wed, 7 Aug 2019 15:05:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908071505.x77F591h022030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 7 Aug 2019 15:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350677 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 350677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 15:05:09 -0000 Author: mav Date: Wed Aug 7 15:05:08 2019 New Revision: 350677 URL: https://svnweb.freebsd.org/changeset/base/350677 Log: Make GCC happy about math in r350676. MFC after: 1 week Modified: head/sbin/camcontrol/modeedit.c Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Wed Aug 7 14:45:10 2019 (r350676) +++ head/sbin/camcontrol/modeedit.c Wed Aug 7 15:05:08 2019 (r350677) @@ -295,11 +295,8 @@ editentry_set(char *name, char *newvalue, int editonly /* * Macro to determine the maximum value of the given size for the current * resolution. - * XXX Lovely x86's optimize out the case of shifting by 32 and gcc doesn't - * currently workaround it (even for int64's), so we have to kludge it. */ -#define RESOLUTION_MAX(size) ((resolution * (size) == 32)? \ - UINT_MAX: (1 << (resolution * (size))) - 1) +#define RESOLUTION_MAX(size) ((1LL << (resolution * (size))) - 1) assert(newvalue != NULL); if (*newvalue == '\0') From owner-svn-src-all@freebsd.org Wed Aug 7 15:49:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F1E7ADFA2; Wed, 7 Aug 2019 15:49:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463bXV2McTz3MFN; Wed, 7 Aug 2019 15:49:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 90E571524B; Wed, 7 Aug 2019 15:49:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r350665 - in head: . etc/mtree sbin/mount_fusefs share/man/man5 sys/fs/fuse sys/sys tests/sys/fs tests/sys/fs/fusefs To: Alan Somers , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201908070038.x770cQZE007711@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: <6c7f7b6f-c0e3-e99c-bd00-8c5a8f729c23@FreeBSD.org> Date: Wed, 7 Aug 2019 10:49:12 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201908070038.x770cQZE007711@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 15:49:14 -0000 Awesome work. Thanks! On 06/08/2019 19:38, Alan Somers wrote: > Author: asomers > Date: Wed Aug 7 00:38:26 2019 > New Revision: 350665 > URL: https://svnweb.freebsd.org/changeset/base/350665 > > Log: > fusefs: merge from projects/fuse2 > > This commit imports the new fusefs driver. It raises the protocol level > from 7.8 to 7.23, fixes many bugs, adds a test suite for the driver, and > adds many new features. New features include: > > * Optional kernel-side permissions checks (-o default_permissions) > * Implement VOP_MKNOD, VOP_BMAP, and VOP_ADVLOCK > * Allow interrupting FUSE operations > * Support named pipes and unix-domain sockets in fusefs file systems > * Forward UTIME_NOW during utimensat(2) to the daemon > * kqueue support for /dev/fuse > * Allow updating mounts with "mount -u" > * Allow exporting fusefs file systems over NFS > * Server-initiated invalidation of the name cache or data cache > * Respect RLIMIT_FSIZE > * Try to support servers as old as protocol 7.4 > > Performance enhancements include: > > * Implement FUSE's FOPEN_KEEP_CACHE and FUSE_ASYNC_READ flags > * Cache file attributes > * Cache lookup entries, both positive and negative > * Server-selectable cache modes: writethrough, writeback, or uncached > * Write clustering > * Readahead > * Use counter(9) for statistical reporting > > PR: 199934 216391 233783 234581 235773 235774 235775 > PR: 236226 236231 236236 236291 236329 236381 236405 > PR: 236327 236466 236472 236473 236474 236530 236557 > PR: 236560 236844 237052 237181 237588 238565 > Reviewed by: bcr (man pages) > Reviewed by: cem, ngie, rpokala, glebius, kib, bde, emaste (post-commit > review on project branch) > MFC after: 3 weeks > Relnotes: yes > Sponsored by: The FreeBSD Foundation > Pull Request: https://reviews.freebsd.org/D21110 > > Added: > head/tests/sys/fs/fusefs/ > - copied from r350621, projects/fuse2/tests/sys/fs/fusefs/ > Deleted: > head/sys/fs/fuse/fuse_param.h > Modified: > head/MAINTAINERS (contents, props changed) > head/UPDATING > head/etc/mtree/BSD.tests.dist > head/sbin/mount_fusefs/mount_fusefs.8 > head/sbin/mount_fusefs/mount_fusefs.c > head/share/man/man5/fusefs.5 > head/sys/fs/fuse/fuse.h > head/sys/fs/fuse/fuse_device.c > head/sys/fs/fuse/fuse_file.c > head/sys/fs/fuse/fuse_file.h > head/sys/fs/fuse/fuse_internal.c > head/sys/fs/fuse/fuse_internal.h > head/sys/fs/fuse/fuse_io.c > head/sys/fs/fuse/fuse_io.h > head/sys/fs/fuse/fuse_ipc.c > head/sys/fs/fuse/fuse_ipc.h > head/sys/fs/fuse/fuse_kernel.h > head/sys/fs/fuse/fuse_main.c > head/sys/fs/fuse/fuse_node.c > head/sys/fs/fuse/fuse_node.h > head/sys/fs/fuse/fuse_vfsops.c > head/sys/fs/fuse/fuse_vnops.c > head/sys/sys/param.h > head/tests/sys/fs/Makefile > Directory Properties: > head/ (props changed) > > Modified: head/MAINTAINERS > ============================================================================== > --- head/MAINTAINERS Tue Aug 6 23:22:25 2019 (r350664) > +++ head/MAINTAINERS Wed Aug 7 00:38:26 2019 (r350665) > @@ -53,6 +53,7 @@ contrib/pjdfstest asomers,ngie,pjd,#test Pre-commit re > etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. > etc/sendmail gshapiro Pre-commit review requested. Keep in sync with -STABLE. > fetch des Pre-commit review requested, email only. > +fusefs(5) asomers Pre-commit review requested. > geli pjd Pre-commit review requested (both sys/geom/eli/ and sbin/geom/class/eli/). > isci(4) jimharris Pre-commit review requested. > iwm(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Tue Aug 6 23:22:25 2019 (r350664) > +++ head/UPDATING Wed Aug 7 00:38:26 2019 (r350665) > @@ -26,6 +26,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20190727: > + The vfs.fusefs.sync_unmount and vfs.fusefs.init_backgrounded sysctls > + and the "-o sync_unmount" and "-o init_backgrounded" mount options have > + been removed from mount_fusefs(8). You can safely remove them from > + your scripts, because they had no effect. > + > + The vfs.fusefs.fix_broken_io, vfs.fusefs.sync_resize, > + vfs.fusefs.refresh_size, vfs.fusefs.mmap_enable, > + vfs.fusefs.reclaim_revoked, and vfs.fusefs.data_cache_invalidate > + sysctls have been removed. If you felt the need to set any of them to > + a non-default value, please tell asomers@FreeBSD.org why. > + > 20190713: > Default permissions on the /var/account/acct file (and copies of it > rotated by periodic daily scripts) are changed from 0644 to 0640 > > Modified: head/etc/mtree/BSD.tests.dist > ============================================================================== > --- head/etc/mtree/BSD.tests.dist Tue Aug 6 23:22:25 2019 (r350664) > +++ head/etc/mtree/BSD.tests.dist Wed Aug 7 00:38:26 2019 (r350665) > @@ -731,6 +731,8 @@ > file > .. > fs > + fusefs > + .. > tmpfs > .. > .. > > Modified: head/sbin/mount_fusefs/mount_fusefs.8 > ============================================================================== > --- head/sbin/mount_fusefs/mount_fusefs.8 Tue Aug 6 23:22:25 2019 (r350664) > +++ head/sbin/mount_fusefs/mount_fusefs.8 Wed Aug 7 00:38:26 2019 (r350665) > @@ -3,6 +3,11 @@ > .\" Copyright (c) 2005, 2006 Csaba Henk > .\" All rights reserved. > .\" > +.\" Copyright (c) 2019 The FreeBSD Foundation > +.\" > +.\" Portions of this documentation were written by BFF Storage Systems under > +.\" sponsorship from the FreeBSD Foundation. > +.\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > .\" are met: > @@ -29,7 +34,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd November 17, 2018 > +.Dd July 31, 2019 > .Dt MOUNT_FUSEFS 8 > .Os > .Sh NAME > @@ -108,27 +113,27 @@ Intended for use in scripts and the > .Xr sudoers 5 > file. > .It Fl S , Ic --safe > -Run in safe mode (i.e. reject invoking a filesystem daemon) > +Run in safe mode (i.e., reject invoking a filesystem daemon). > .It Fl v > -Be verbose > -.It Fl D, Ic --daemon Ar daemon > +Be verbose. > +.It Fl D , Ic --daemon Ar daemon > Call the specified > -.Ar daemon > -.It Fl O, Ic --daemon_opts Ar opts > +.Ar daemon . > +.It Fl O , Ic --daemon_opts Ar opts > Add > .Ar opts > -to the daemon's command line > -.It Fl s, Ic --special Ar special > +to the daemon's command line. > +.It Fl s , Ic --special Ar special > Use > .Ar special > -as special > -.It Fl m, Ic --mountpath Ar node > +as special. > +.It Fl m , Ic --mountpath Ar node > Mount on > -.Ar node > -.It Fl h, Ic --help > -Show help > -.It Fl V, Ic --version > -Show version information > +.Ar node . > +.It Fl h , Ic --help > +Show help. > +.It Fl V , Ic --version > +Show version information. > .It Fl o > Mount options are specified via > .Fl o . > @@ -136,23 +141,38 @@ The following options are available (and also their ne > by prefixing them with > .Dq no ) : > .Bl -tag -width indent > -.It Cm default_permissions > -Enable traditional (file mode based) permission checking in kernel > .It Cm allow_other > Do not apply > .Sx STRICT ACCESS POLICY . > -Only root can use this option > +Only root can use this option. > +.It Cm async > +I/O to the file system may be done asynchronously. > +Writes may be delayed and/or reordered. > +.It Cm default_permissions > +Enable traditional (file mode based) permission checking in kernel. > +.It Cm intr > +Allow signals to interrupt operations that are blocked waiting for a reply from the server. > +When this option is in use, system calls may fail with > +.Er EINTR > +whenever a signal is received. > .It Cm max_read Ns = Ns Ar n > Limit size of read requests to > -.Ar n > +.Ar n . > +.It Cm neglect_shares > +Do not refuse unmounting if there are secondary mounts. > .It Cm private > Refuse shared mounting of the daemon. > This is the default behaviour, to allow sharing, expicitly use > -.Fl o Cm noprivate > -.It Cm neglect_shares > -Do not refuse unmounting if there are secondary mounts > +.Fl o Cm noprivate . > .It Cm push_symlinks_in > -Prefix absolute symlinks with the mountpoint > +Prefix absolute symlinks with the mountpoint. > +.It Cm subtype Ns = Ns Ar fsname > +Suffix > +.Ar fsname > +to the file system name as reported by > +.Xr statfs 2 . > +This option can be used to identify the file system implemented by > +.Ar fuse_daemon . > .El > .El > .Pp > @@ -167,11 +187,11 @@ However, there are some which do require in-kernel sup > Currently the options supported by the kernel are: > .Bl -tag -width indent > .It Cm direct_io > -Bypass the buffer cache system > +Bypass the buffer cache system. > .It Cm kernel_cache > By default cached buffers of a given file are flushed at each > .Xr open 2 . > -This option disables this behaviour > +This option disables this behaviour. > .El > .Sh DAEMON MOUNTS > Usually users do not need to use > @@ -194,7 +214,7 @@ only if the filesystem daemon has the same credentials > real gid) as the user. > .Pp > This is applied for Fuse mounts by default and only root can mount without > -the strict access policy (i.e. the > +the strict access policy (i.e., the > .Cm allow_other > mount option). > .Pp > @@ -206,7 +226,7 @@ Users might opt to willingly relax strict access polic > are concerned) by doing their own secondary mount (See > .Sx SHARED MOUNTS ) . > .Sh SHARED MOUNTS > -A Fuse daemon can be shared (i.e. mounted multiple times). > +A Fuse daemon can be shared (i.e., mounted multiple times). > When doing the first (primary) mount, the spawner and the mounter of the daemon > must have the same uid, or the mounter should be the superuser. > .Pp > @@ -225,7 +245,7 @@ is used or not. > .Pp > The device name of a secondary mount is the device name of the corresponding > primary mount, followed by a '#' character and the index of the secondary > -mount; e.g. > +mount; e.g., > .Pa /dev/fuse0#3 . > .Sh SECURITY > System administrators might want to use a custom mount policy (ie., one going > @@ -239,7 +259,7 @@ However, given that > is capable of invoking an arbitrary program, one must be careful when doing this. > .Nm > is designed in a way such that it makes that easy. > -For this purpose, there are options which disable certain risky features (i.e. > +For this purpose, there are options which disable certain risky features ( > .Fl S > and > .Fl A ) , > @@ -342,7 +362,7 @@ does not call any external utility and also provides a > was written as the part of the > .Fx > implementation of the Fuse userspace filesystem framework (see > -.Xr https://github.com/libfuse/libfuse ) > +.Lk https://github.com/libfuse/libfuse ) > and first appeared in the > .Pa sysutils/fusefs-kmod > port, supporting > > Modified: head/sbin/mount_fusefs/mount_fusefs.c > ============================================================================== > --- head/sbin/mount_fusefs/mount_fusefs.c Tue Aug 6 23:22:25 2019 (r350664) > +++ head/sbin/mount_fusefs/mount_fusefs.c Wed Aug 7 00:38:26 2019 (r350665) > @@ -5,6 +5,11 @@ > * Copyright (c) 2005 Csaba Henk > * All rights reserved. > * > + * Copyright (c) 2019 The FreeBSD Foundation > + * > + * Portions of this software were developed by BFF Storage Systems 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: > @@ -60,7 +65,6 @@ void __usage_short(void); > void usage(void); > void helpmsg(void); > void showversion(void); > -int init_backgrounded(void); > > static struct mntopt mopts[] = { > #define ALTF_PRIVATE 0x01 > @@ -73,8 +77,6 @@ static struct mntopt mopts[] = { > { "max_read=", 0, ALTF_MAXREAD, 1 }, > #define ALTF_SUBTYPE 0x40 > { "subtype=", 0, ALTF_SUBTYPE, 1 }, > - #define ALTF_SYNC_UNMOUNT 0x80 > - { "sync_unmount", 0, ALTF_SYNC_UNMOUNT, 1 }, > /* > * MOPT_AUTOMOUNTED, included by MOPT_STDOPTS, does not fit into > * the 'flags' argument to nmount(2). We have to abuse altflags > @@ -82,6 +84,8 @@ static struct mntopt mopts[] = { > */ > #define ALTF_AUTOMOUNTED 0x100 > { "automounted", 0, ALTF_AUTOMOUNTED, 1 }, > + #define ALTF_INTR 0x200 > + { "intr", 0, ALTF_INTR, 1 }, > /* Linux specific options, we silently ignore them */ > { "fsname=", 0, 0x00, 1 }, > { "fd=", 0, 0x00, 1 }, > @@ -91,6 +95,8 @@ static struct mntopt mopts[] = { > { "large_read", 0, 0x00, 1 }, > /* "nonempty", just the first two chars are stripped off during parsing */ > { "nempty", 0, 0x00, 1 }, > + { "async", 0, MNT_ASYNC, 0}, > + { "noasync", 1, MNT_ASYNC, 0}, > MOPT_STDOPTS, > MOPT_END > }; > @@ -107,7 +113,7 @@ static struct mntval mvals[] = { > { 0, NULL, 0 } > }; > > -#define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE | ALTF_SYNC_UNMOUNT > +#define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE > > int > main(int argc, char *argv[]) > @@ -409,12 +415,6 @@ main(int argc, char *argv[]) > } > } > > - if (fd >= 0 && ! init_backgrounded() && close(fd) < 0) { > - if (pid) > - kill(pid, SIGKILL); > - err(1, "failed to close fuse device"); > - } > - > /* Prepare the options vector for nmount(). build_iovec() is declared > * in mntopts.h. */ > sprintf(fdstr, "%d", fd); > @@ -471,6 +471,7 @@ helpmsg(void) > " -o allow_other allow access to other users\n" > /* " -o nonempty allow mounts over non-empty file/dir\n" */ > " -o default_permissions enable permission checking by kernel\n" > + " -o intr interruptible mount\n" > /* > " -o fsname=NAME set filesystem name\n" > " -o large_read issue large read requests (2.4 only)\n" > @@ -481,7 +482,6 @@ helpmsg(void) > " -o neglect_shares don't report EBUSY when unmount attempted\n" > " in presence of secondary mounts\n" > " -o push_symlinks_in prefix absolute symlinks with mountpoint\n" > - " -o sync_unmount do unmount synchronously\n" > ); > exit(EX_USAGE); > } > @@ -491,18 +491,4 @@ showversion(void) > { > puts("mount_fusefs [fuse4bsd] version: " FUSE4BSD_VERSION); > exit(EX_USAGE); > -} > - > -int > -init_backgrounded(void) > -{ > - int ibg; > - size_t len; > - > - len = sizeof(ibg); > - > - if (sysctlbyname("vfs.fusefs.init_backgrounded", &ibg, &len, NULL, 0)) > - return (0); > - > - return (ibg); > } > > Modified: head/share/man/man5/fusefs.5 > ============================================================================== > --- head/share/man/man5/fusefs.5 Tue Aug 6 23:22:25 2019 (r350664) > +++ head/share/man/man5/fusefs.5 Wed Aug 7 00:38:26 2019 (r350665) > @@ -3,8 +3,8 @@ > .\" > .\" Copyright (c) 2019 The FreeBSD Foundation > .\" > -.\" This software was developed by BFF Storage Systems, LLC under sponsorship > -.\" from the FreeBSD Foundation. > +.\" This documentation was written by BFF Storage Systems, LLC under > +.\" sponsorship from the FreeBSD Foundation. > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > @@ -28,7 +28,7 @@ > .\" SUCH DAMAGE. > .\" > .\" $FreeBSD$ > -.Dd April 13, 2019 > +.Dd July 31, 2019 > .Dt FUSEFS 5 > .Os > .Sh NAME > @@ -60,11 +60,9 @@ Finally, the > API is portable. > Many daemons can run on multiple operating systems with minimal modifications. > .Sh SYSCTL VARIABLES > -The following variables are available as both > +The following > .Xr sysctl 8 > -variables and > -.Xr loader 8 > -tunables: > +variables are available: > .Bl -tag -width indent > .It Va vfs.fusefs.kernelabi_major > Major version of the FUSE kernel ABI supported by this driver. > @@ -73,7 +71,7 @@ Minor version of the FUSE kernel ABI supported by this > .It Va vfs.fusefs.data_cache_mode > Controls how > .Nm > -will cache file data. > +will cache file data for pre-7.23 file systems. > A value of 0 will disable caching entirely. > Every data access will be forwarded to the daemon. > A value of 1 will select write-through caching. > @@ -84,33 +82,26 @@ Reads and writes will both be cached, and writes will > to the daemon by the page daemon. > Write-back caching is usually unsafe, especially for FUSE file systems that > require network access. > -.It Va vfs.fusefs.lookup_cache_enable > -Controls whether > -.Nm > -will cache lookup responses from the file system. > -FUSE file systems indicate whether lookup responses should be cacheable, but > -it may be useful to globally disable caching them if a file system is > -misbehaving. > +.Pp > +FUSE file systems using protocol 7.23 or later specify their cache behavior > +on a per-mountpoint basis, ignoring this sysctl. > +.It Va vfs.fusefs.stats.filehandle_count > +Current number of open FUSE file handles. > +.It Va vfs.fusefs.stats.lookup_cache_hits > +Total number of lookup cache hits. > +.It Va vfs.fusefs.stats.lookup_cache_misses > +Total number of lookup cache misses. > +.It Va vfs.fusefs.stats.node_count > +Current number of allocated FUSE vnodes. > +.It Va vfs.fusefs.stats.ticket_count > +Current number of allocated FUSE tickets, which is roughly equal to the number > +of FUSE operations currently being processed by daemons. > .\" Undocumented sysctls > .\" ==================== > -.\" Counters: I intend to rename to vfs.fusefs.stats.* for clarity > -.\" vfs.fusefs.lookup_cache_{hits, misses} > -.\" vfs.fusefs.filehandle_count > -.\" vfs.fusefs.ticker_count > -.\" vfs.fusefs.node_count > -.\" > -.\" vfs.fusefs.version - useless since the driver moved in-tree > -.\" vfs.fusefs.reclaim_revoked: I don't understand it well-enough > -.\" vfs.fusefs.sync_unmount: dead code > .\" vfs.fusefs.enforce_dev_perms: I don't understand it well enough. > -.\" vfs.fusefs.init_backgrounded: dead code > .\" vfs.fusefs.iov_credit: I don't understand it well enough > .\" vfs.fusefs.iov_permanent_bufsize: I don't understand it well enough > -.\" vfs.fusefs.fix_broken_io: I don't understand it well enough > -.\" vfs.fusefs.sync_resize: useless and should be removed > -.\" vfs.fusefs.refresh_size: probably useless? > -.\" vfs.fusefs.mmap_enable: why is this optional? > -.\" vfs.fusefs.data_cache_invalidate: what is this needed for? > +.El > .Sh SEE ALSO > .Xr mount_fusefs 8 > .Sh HISTORY > @@ -119,7 +110,7 @@ The > driver was written as the part of the > .Fx > implementation of the FUSE userspace file system framework (see > -.Xr https://github.com/libfuse/libfuse ) > +.Lk https://github.com/libfuse/libfuse ) > and first appeared in the > .Pa sysutils/fusefs-kmod > port, supporting > > Modified: head/sys/fs/fuse/fuse.h > ============================================================================== > --- head/sys/fs/fuse/fuse.h Tue Aug 6 23:22:25 2019 (r350664) > +++ head/sys/fs/fuse/fuse.h Wed Aug 7 00:38:26 2019 (r350665) > @@ -32,6 +32,11 @@ > * > * Copyright (C) 2005 Csaba Henk. > * All rights reserved. > + * > + * Copyright (c) 2019 The FreeBSD Foundation > + * > + * Portions of this software were developed by BFF Storage Systems, LLC under > + * sponsorship from the FreeBSD Foundation. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -63,87 +68,10 @@ > #define FUSE_MIN_DAEMON_TIMEOUT 0 /* s */ > #define FUSE_MAX_DAEMON_TIMEOUT 600 /* s */ > > -#ifndef FUSE_FREEBSD_VERSION > -#define FUSE_FREEBSD_VERSION "0.4.4" > -#endif > - > -/* Mapping versions to features */ > - > -#define FUSE_KERNELABI_GEQ(maj, min) \ > -(FUSE_KERNEL_VERSION > (maj) || (FUSE_KERNEL_VERSION == (maj) && FUSE_KERNEL_MINOR_VERSION >= (min))) > - > -/* > - * Appearance of new FUSE operations is not always in par with version > - * numbering... At least, 7.3 is a sufficient condition for having > - * FUSE_{ACCESS,CREATE}. > - */ > -#if FUSE_KERNELABI_GEQ(7, 3) > -#ifndef FUSE_HAS_ACCESS > -#define FUSE_HAS_ACCESS 1 > -#endif > -#ifndef FUSE_HAS_CREATE > -#define FUSE_HAS_CREATE 1 > -#endif > -#else /* FUSE_KERNELABI_GEQ(7, 3) */ > -#ifndef FUSE_HAS_ACCESS > -#define FUSE_HAS_ACCESS 0 > -#endif > -#ifndef FUSE_HAS_CREATE > -#define FUSE_HAS_CREATE 0 > -#endif > -#endif > - > -#if FUSE_KERNELABI_GEQ(7, 7) > -#ifndef FUSE_HAS_GETLK > -#define FUSE_HAS_GETLK 1 > -#endif > -#ifndef FUSE_HAS_SETLK > -#define FUSE_HAS_SETLK 1 > -#endif > -#ifndef FUSE_HAS_SETLKW > -#define FUSE_HAS_SETLKW 1 > -#endif > -#ifndef FUSE_HAS_INTERRUPT > -#define FUSE_HAS_INTERRUPT 1 > -#endif > -#else /* FUSE_KERNELABI_GEQ(7, 7) */ > -#ifndef FUSE_HAS_GETLK > -#define FUSE_HAS_GETLK 0 > -#endif > -#ifndef FUSE_HAS_SETLK > -#define FUSE_HAS_SETLK 0 > -#endif > -#ifndef FUSE_HAS_SETLKW > -#define FUSE_HAS_SETLKW 0 > -#endif > -#ifndef FUSE_HAS_INTERRUPT > -#define FUSE_HAS_INTERRUPT 0 > -#endif > -#endif > - > -#if FUSE_KERNELABI_GEQ(7, 8) > -#ifndef FUSE_HAS_FLUSH_RELEASE > -#define FUSE_HAS_FLUSH_RELEASE 1 > -/* > - * "DESTROY" came in the middle of the 7.8 era, > - * so this is not completely exact... > - */ > -#ifndef FUSE_HAS_DESTROY > -#define FUSE_HAS_DESTROY 1 > -#endif > -#endif > -#else /* FUSE_KERNELABI_GEQ(7, 8) */ > -#ifndef FUSE_HAS_FLUSH_RELEASE > -#define FUSE_HAS_FLUSH_RELEASE 0 > -#ifndef FUSE_HAS_DESTROY > -#define FUSE_HAS_DESTROY 0 > -#endif > -#endif > -#endif > - > /* misc */ > > SYSCTL_DECL(_vfs_fusefs); > +SYSCTL_DECL(_vfs_fusefs_stats); > > /* Fuse locking */ > > > Modified: head/sys/fs/fuse/fuse_device.c > ============================================================================== > --- head/sys/fs/fuse/fuse_device.c Tue Aug 6 23:22:25 2019 (r350664) > +++ head/sys/fs/fuse/fuse_device.c Wed Aug 7 00:38:26 2019 (r350665) > @@ -33,6 +33,11 @@ > * Copyright (C) 2005 Csaba Henk. > * All rights reserved. > * > + * Copyright (c) 2019 The FreeBSD Foundation > + * > + * Portions of this software were developed by BFF Storage Systems, LLC under > + * sponsorship from the FreeBSD Foundation. > + * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > @@ -81,27 +86,28 @@ __FBSDID("$FreeBSD$"); > #include > > #include "fuse.h" > +#include "fuse_internal.h" > #include "fuse_ipc.h" > > -SDT_PROVIDER_DECLARE(fuse); > +SDT_PROVIDER_DECLARE(fusefs); > /* > * Fuse trace probe: > * arg0: verbosity. Higher numbers give more verbose messages > * arg1: Textual message > */ > -SDT_PROBE_DEFINE2(fuse, , device, trace, "int", "char*"); > +SDT_PROBE_DEFINE2(fusefs, , device, trace, "int", "char*"); > > static struct cdev *fuse_dev; > > +static d_kqfilter_t fuse_device_filter; > static d_open_t fuse_device_open; > -static d_close_t fuse_device_close; > static d_poll_t fuse_device_poll; > static d_read_t fuse_device_read; > static d_write_t fuse_device_write; > > static struct cdevsw fuse_device_cdevsw = { > + .d_kqfilter = fuse_device_filter, > .d_open = fuse_device_open, > - .d_close = fuse_device_close, > .d_name = "fuse", > .d_poll = fuse_device_poll, > .d_read = fuse_device_read, > @@ -109,6 +115,15 @@ static struct cdevsw fuse_device_cdevsw = { > .d_version = D_VERSION, > }; > > +static int fuse_device_filt_read(struct knote *kn, long hint); > +static void fuse_device_filt_detach(struct knote *kn); > + > +struct filterops fuse_device_rfiltops = { > + .f_isfd = 1, > + .f_detach = fuse_device_filt_detach, > + .f_event = fuse_device_filt_read, > +}; > + > /**************************** > * > * >>> Fuse device op defs > @@ -119,11 +134,100 @@ static void > fdata_dtor(void *arg) > { > struct fuse_data *fdata; > + struct fuse_ticket *tick; > > fdata = arg; > + if (fdata == NULL) > + return; > + > + fdata_set_dead(fdata); > + > + FUSE_LOCK(); > + fuse_lck_mtx_lock(fdata->aw_mtx); > + /* wakup poll()ers */ > + selwakeuppri(&fdata->ks_rsel, PZERO + 1); > + /* Don't let syscall handlers wait in vain */ > + while ((tick = fuse_aw_pop(fdata))) { > + fuse_lck_mtx_lock(tick->tk_aw_mtx); > + fticket_set_answered(tick); > + tick->tk_aw_errno = ENOTCONN; > + wakeup(tick); > + fuse_lck_mtx_unlock(tick->tk_aw_mtx); > + FUSE_ASSERT_AW_DONE(tick); > + fuse_ticket_drop(tick); > + } > + fuse_lck_mtx_unlock(fdata->aw_mtx); > + > + /* Cleanup unsent operations */ > + fuse_lck_mtx_lock(fdata->ms_mtx); > + while ((tick = fuse_ms_pop(fdata))) { > + fuse_ticket_drop(tick); > + } > + fuse_lck_mtx_unlock(fdata->ms_mtx); > + FUSE_UNLOCK(); > + > fdata_trydestroy(fdata); > } > > +static int > +fuse_device_filter(struct cdev *dev, struct knote *kn) > +{ > + struct fuse_data *data; > + int error; > + > + error = devfs_get_cdevpriv((void **)&data); > + > + /* EVFILT_WRITE is not supported; the device is always ready to write */ > + if (error == 0 && kn->kn_filter == EVFILT_READ) { > + kn->kn_fop = &fuse_device_rfiltops; > + kn->kn_hook = data; > + knlist_add(&data->ks_rsel.si_note, kn, 0); > + error = 0; > + } else if (error == 0) { > + error = EINVAL; > + kn->kn_data = error; > + } > + > + return (error); > +} > + > +static void > +fuse_device_filt_detach(struct knote *kn) > +{ > + struct fuse_data *data; > + > + data = (struct fuse_data*)kn->kn_hook; > + MPASS(data != NULL); > + knlist_remove(&data->ks_rsel.si_note, kn, 0); > + kn->kn_hook = NULL; > +} > + > +static int > +fuse_device_filt_read(struct knote *kn, long hint) > +{ > + struct fuse_data *data; > + int ready; > + > + data = (struct fuse_data*)kn->kn_hook; > + MPASS(data != NULL); > + > + mtx_assert(&data->ms_mtx, MA_OWNED); > + if (fdata_get_dead(data)) { > + kn->kn_flags |= EV_EOF; > + kn->kn_fflags = ENODEV; > + kn->kn_data = 1; > + ready = 1; > + } else if (STAILQ_FIRST(&data->ms_head)) { > + MPASS(data->ms_count >= 1); > + kn->kn_data = data->ms_count; > + ready = 1; > + } else { > + ready = 0; > + } > + > + return (ready); > +} > + > /* > * Resources are set up on a per-open basis > */ > @@ -133,52 +237,17 @@ fuse_device_open(struct cdev *dev, int oflags, int dev > struct fuse_data *fdata; > int error; > > - SDT_PROBE2(fuse, , device, trace, 1, "device open"); > + SDT_PROBE2(fusefs, , device, trace, 1, "device open"); > > fdata = fdata_alloc(dev, td->td_ucred); > error = devfs_set_cdevpriv(fdata, fdata_dtor); > if (error != 0) > fdata_trydestroy(fdata); > else > - SDT_PROBE2(fuse, , device, trace, 1, "device open success"); > + SDT_PROBE2(fusefs, , device, trace, 1, "device open success"); > return (error); > } > > -static int > -fuse_device_close(struct cdev *dev, int fflag, int devtype, struct thread *td) > -{ > - struct fuse_data *data; > - struct fuse_ticket *tick; > - int error; > - > - error = devfs_get_cdevpriv((void **)&data); > - if (error != 0) > - return (error); > - if (!data) > - panic("no fuse data upon fuse device close"); > - fdata_set_dead(data); > - > - FUSE_LOCK(); > - fuse_lck_mtx_lock(data->aw_mtx); > - /* wakup poll()ers */ > - selwakeuppri(&data->ks_rsel, PZERO + 1); > - /* Don't let syscall handlers wait in vain */ > - while ((tick = fuse_aw_pop(data))) { > - fuse_lck_mtx_lock(tick->tk_aw_mtx); > - fticket_set_answered(tick); > - tick->tk_aw_errno = ENOTCONN; > - wakeup(tick); > - fuse_lck_mtx_unlock(tick->tk_aw_mtx); > - FUSE_ASSERT_AW_DONE(tick); > - fuse_ticket_drop(tick); > - } > - fuse_lck_mtx_unlock(data->aw_mtx); > - FUSE_UNLOCK(); > - > - SDT_PROBE2(fuse, , device, trace, 1, "device close"); > - return (0); > -} > - > int > fuse_device_poll(struct cdev *dev, int events, struct thread *td) > { > @@ -219,7 +288,7 @@ fuse_device_read(struct cdev *dev, struct uio *uio, in > int buflen[3]; > int i; > > - SDT_PROBE2(fuse, , device, trace, 1, "fuse device read"); > + SDT_PROBE2(fusefs, , device, trace, 1, "fuse device read"); > > err = devfs_get_cdevpriv((void **)&data); > if (err != 0) > @@ -228,7 +297,7 @@ fuse_device_read(struct cdev *dev, struct uio *uio, in > fuse_lck_mtx_lock(data->ms_mtx); > again: > if (fdata_get_dead(data)) { > - SDT_PROBE2(fuse, , device, trace, 2, > + SDT_PROBE2(fusefs, , device, trace, 2, > "we know early on that reader should be kicked so we " > "don't wait for news"); > fuse_lck_mtx_unlock(data->ms_mtx); > @@ -256,7 +325,7 @@ again: > * -- and some other cases, too, tho not totally clear, when > * (cv_signal/wakeup_one signals the whole process ?) > */ > - SDT_PROBE2(fuse, , device, trace, 1, "no message on thread"); > + SDT_PROBE2(fusefs, , device, trace, 1, "no message on thread"); > goto again; > } > fuse_lck_mtx_unlock(data->ms_mtx); > @@ -266,9 +335,10 @@ again: > * somebody somewhere -- eg., umount routine -- > * wants this liaison finished off > */ > - SDT_PROBE2(fuse, , device, trace, 2, "reader is to be sacked"); > + SDT_PROBE2(fusefs, , device, trace, 2, > + "reader is to be sacked"); > if (tick) { > - SDT_PROBE2(fuse, , device, trace, 2, "weird -- " > + SDT_PROBE2(fusefs, , device, trace, 2, "weird -- " > "\"kick\" is set tho there is message"); > FUSE_ASSERT_MS_DONE(tick); > fuse_ticket_drop(tick); > @@ -276,7 +346,7 @@ again: > return (ENODEV); /* This should make the daemon get off > * of us */ > } > - SDT_PROBE2(fuse, , device, trace, 1, > + SDT_PROBE2(fusefs, , device, trace, 1, > "fuse device read message successfully"); > > KASSERT(tick->tk_ms_bufdata || tick->tk_ms_bufsize == 0, > @@ -311,7 +381,7 @@ again: > */ > if (uio->uio_resid < buflen[i]) { > fdata_set_dead(data); > - SDT_PROBE2(fuse, , device, trace, 2, > + SDT_PROBE2(fusefs, , device, trace, 2, > "daemon is stupid, kick it off..."); > err = ENODEV; > break; > @@ -331,23 +401,26 @@ static inline int > fuse_ohead_audit(struct fuse_out_header *ohead, struct uio *uio) > { > if (uio->uio_resid + sizeof(struct fuse_out_header) != ohead->len) { > - SDT_PROBE2(fuse, , device, trace, 1, "Format error: body size " > + SDT_PROBE2(fusefs, , device, trace, 1, > + "Format error: body size " > "differs from size claimed by header"); > return (EINVAL); > } > - if (uio->uio_resid && ohead->error) { > - SDT_PROBE2(fuse, , device, trace, 1, > + if (uio->uio_resid && ohead->unique != 0 && ohead->error) { > + SDT_PROBE2(fusefs, , device, trace, 1, > "Format error: non zero error but message had a body"); > return (EINVAL); > } > - /* Sanitize the linuxism of negative errnos */ > - ohead->error = -(ohead->error); > > return (0); > } > > -SDT_PROBE_DEFINE1(fuse, , device, fuse_device_write_bumped_into_callback, > - "uint64_t"); > +SDT_PROBE_DEFINE1(fusefs, , device, fuse_device_write_notify, > + "struct fuse_out_header*"); > +SDT_PROBE_DEFINE1(fusefs, , device, fuse_device_write_missing_ticket, > + "uint64_t"); > +SDT_PROBE_DEFINE1(fusefs, , device, fuse_device_write_found, > + "struct fuse_ticket*"); > /* > * fuse_device_write first reads the header sent by the daemon. > * If that's OK, looks up ticket/callback node by the unique id seen in header. > @@ -360,15 +433,17 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i > struct fuse_out_header ohead; > int err = 0; > struct fuse_data *data; > - struct fuse_ticket *tick, *x_tick; > + struct mount *mp; > + struct fuse_ticket *tick, *itick, *x_tick; > int found = 0; > > err = devfs_get_cdevpriv((void **)&data); > if (err != 0) > return (err); > + mp = data->mp; > > if (uio->uio_resid < sizeof(struct fuse_out_header)) { > - SDT_PROBE2(fuse, , device, trace, 1, > + SDT_PROBE2(fusefs, , device, trace, 1, > "fuse_device_write got less than a header!"); > fdata_set_dead(data); > return (EINVAL); > @@ -393,15 +468,29 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i > fuse_lck_mtx_lock(data->aw_mtx); > TAILQ_FOREACH_SAFE(tick, &data->aw_head, tk_aw_link, > x_tick) { > - SDT_PROBE1(fuse, , device, > - fuse_device_write_bumped_into_callback, > - tick->tk_unique); > if (tick->tk_unique == ohead.unique) { > + SDT_PROBE1(fusefs, , device, fuse_device_write_found, > + tick); > found = 1; > fuse_aw_remove(tick); > break; > } > } > + if (found && tick->irq_unique > 0) { > + /* > + * Discard the FUSE_INTERRUPT ticket that tried to interrupt > + * this operation > + */ > + TAILQ_FOREACH_SAFE(itick, &data->aw_head, tk_aw_link, > + x_tick) { > + if (itick->tk_unique == tick->irq_unique) { > + fuse_aw_remove(itick); > + fuse_ticket_drop(itick); > + break; > + } > + } > + tick->irq_unique = 0; > + } > fuse_lck_mtx_unlock(data->aw_mtx); > > if (found) { > @@ -414,13 +503,15 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i > * via ticket_drop(), so no manual mucking > * around...) > */ > - SDT_PROBE2(fuse, , device, trace, 1, > + SDT_PROBE2(fusefs, , device, trace, 1, > "pass ticket to a callback"); > + /* Sanitize the linuxism of negative errnos */ > + ohead.error *= -1; > memcpy(&tick->tk_aw_ohead, &ohead, sizeof(ohead)); > err = tick->tk_aw_handler(tick, uio); > } else { > /* pretender doesn't wanna do anything with answer */ > - SDT_PROBE2(fuse, , device, trace, 1, > + SDT_PROBE2(fusefs, , device, trace, 1, > "stuff devalidated, so we drop it"); > } > > @@ -430,11 +521,51 @@ fuse_device_write(struct cdev *dev, struct uio *uio, i > * because fuse_ticket_drop() will deal with refcount anyway. > */ > fuse_ticket_drop(tick); > + } else if (ohead.unique == 0){ > + /* unique == 0 means asynchronous notification */ > + SDT_PROBE1(fusefs, , device, fuse_device_write_notify, &ohead); > + switch (ohead.error) { > + case FUSE_NOTIFY_INVAL_ENTRY: > + err = fuse_internal_invalidate_entry(mp, uio); > + break; > + case FUSE_NOTIFY_INVAL_INODE: > + err = fuse_internal_invalidate_inode(mp, uio); > + break; > + case FUSE_NOTIFY_RETRIEVE: > + case FUSE_NOTIFY_STORE: > + /* > + * Unimplemented. I don't know of any file systems > + * that use them, and the protocol isn't sound anyway, > + * since the notification messages don't include the > + * inode's generation number. Without that, it's > + * possible to manipulate the cache of the wrong vnode. > + * Finally, it's not defined what this message should > + * do for a file with dirty cache. > + */ > + case FUSE_NOTIFY_POLL: > + /* Unimplemented. See comments in fuse_vnops */ > + default: > + /* Not implemented */ > + err = ENOSYS; > + } > } else { > /* no callback at all! */ > - SDT_PROBE2(fuse, , device, trace, 1, > - "erhm, no handler for this response"); > - err = EINVAL; > + SDT_PROBE1(fusefs, , device, fuse_device_write_missing_ticket, > + ohead.unique); > + if (ohead.error == -EAGAIN) { > + /* > + * This was probably a response to a FUSE_INTERRUPT > + * operation whose original operation is already > + * complete. We can't store FUSE_INTERRUPT tickets > + * indefinitely because their responses are optional. > + * So we delete them when the original operation > + * completes. And sadly the fuse_header_out doesn't > + * identify the opcode, so we have to guess. > + */ > + err = 0; > + } else { > + err = EINVAL; > + } > } > > return (err); > @@ -445,7 +576,7 @@ fuse_device_init(void) > { > > fuse_dev = make_dev(&fuse_device_cdevsw, 0, UID_ROOT, GID_OPERATOR, > - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP, "fuse"); > + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH, "fuse"); > if (fuse_dev == NULL) > return (ENOMEM); > return (0); > > Modified: head/sys/fs/fuse/fuse_file.c > ============================================================================== > --- head/sys/fs/fuse/fuse_file.c Tue Aug 6 23:22:25 2019 (r350664) > +++ head/sys/fs/fuse/fuse_file.c Wed Aug 7 00:38:26 2019 (r350665) > @@ -33,6 +33,11 @@ > * Copyright (C) 2005 Csaba Henk. > * All rights reserved. > * > + * Copyright (c) 2019 The FreeBSD Foundation > + * > + * Portions of this software were developed by BFF Storage Systems, LLC under > + * sponsorship from the FreeBSD Foundation. > + * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > * are met: > @@ -59,8 +64,9 @@ > __FBSDID("$FreeBSD$"); > > #include > -#include > #include > +#include > +#include > #include > #include > #include > @@ -79,52 +85,61 @@ __FBSDID("$FreeBSD$"); > #include "fuse.h" > #include "fuse_file.h" > #include "fuse_internal.h" > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@freebsd.org Wed Aug 7 16:01:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20E48AE3AE; Wed, 7 Aug 2019 16:01:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463bp506H1z3Mt2; Wed, 7 Aug 2019 16:01:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 30A0A15377; Wed, 7 Aug 2019 16:01:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r350550 - head/share/mk To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org References: <201908030106.x7316Ibx078529@repo.freebsd.org> <20190806165614.GA41295@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <4e4d30b2-4801-2e53-6f26-49cb350445ec@FreeBSD.org> Date: Wed, 7 Aug 2019 09:00:58 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <20190806165614.GA41295@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 16:01:01 -0000 On 8/6/19 9:56 AM, Glen Barber wrote: > On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: >> Author: jhb >> Date: Sat Aug 3 01:06:17 2019 >> New Revision: 350550 >> URL: https://svnweb.freebsd.org/changeset/base/350550 >> >> Log: >> Flip REPRODUCIBLE_BUILD back to off by default in head. >> >> Having the full uname output can be useful on head even with >> unmodified trees or trees that newvers.sh fails to recognize as >> modified. >> >> Reviewed by: emaste >> Differential Revision: https://reviews.freebsd.org/D20895 >> > > I would like to request this commit be reverted. While the original > commit message to enable this knob stated the commit would be reverted > after stable/12 branched, I have seen no public complaints about > enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see > the benefit of disabling it by default -- why wouldn't we want > reproducibility?). > > To me, this feels like a step backwards, with no tangible benefit. > Note, newvers.sh does properly detect a modified tree if it can find > the VCS metadata directory (i.e., .git, .svn) -- I know this because > I personally helped with it. > > In my opinion, those that want the non-reproducible metadata included in > output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their > src.conf. Turning off a sane default for the benefit of what I suspect > is likely a short list of use cases feels like a step in the wrong > direction. My arguments for flipping this in head (and head only) are that the data provided in uname -a when this is disabled is useful for development, and that in head we do tailor settings towards development (e.g. GENERIC in head vs GENERIC in stable). The logic to handle modified trees has an inherent assumption that I think is false, at least for my workflow and I suspect many others. I do builds and tests of kernels on separate machines (VMs or bare metal) from where I use VCS to manage sources so that a kernel crash doesn't toast my source tree. The trees are then shared to the build/test machines via NFS. As a result, the build/test machines are not always able to detect that the tree is modified either because a subset of the checkout is exported via NFS, or the VCS tool isn't installed on the build/test machines because they are generally barebones systems with only a base installed. This does mean that flipping the knob off doesn't provide all of the same info, but it does provide the path, and the path matters because 'kgdb -n last' uses it, and because if you use separate directories for separate projects (e.g. git worktrees), then the path tells you which test kernel you booted. (It is not uncommon for me to have several test projects in flight on a single test machine for different branches.) In the original discussion on arch, we collectively recognized that developer builds vs release builds were different and needed different defaults. The compromise reached at that time was to depend on the VCS to detect developer builds to choose the policy. What I have found is that in practice for at least my workflow that doesn't actually work. I posit that the majority of kernels built from head are developer builds, not releases, and that the default should cater to that. You could also always patch release.sh to set WITH_REPRODUCIBLE_BUILD in the environment which I think would give a more accurate sense of when builds are releases or not. However, I will yield to whatever the consensus is. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Aug 7 16:19:07 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54554AECCA; Wed, 7 Aug 2019 16:19:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463cBz1Sblz3P7T; Wed, 7 Aug 2019 16:19:07 +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 0F50DF3C7; Wed, 7 Aug 2019 16:19:07 +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 x77GJ6lW067925; Wed, 7 Aug 2019 16:19:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77GJ6qq067924; Wed, 7 Aug 2019 16:19:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908071619.x77GJ6qq067924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Aug 2019 16:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350678 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 350678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 16:19:07 -0000 Author: imp Date: Wed Aug 7 16:19:06 2019 New Revision: 350678 URL: https://svnweb.freebsd.org/changeset/base/350678 Log: Enable nvme on aarch64 Don't mark nvme as broken on aarch64. It compiles, at least, and people are testing it out. This only enables the userland parts of the nvme stack. Submitted by: greg at unrelenting technologies Differential Revision: https://reviews.freebsd.org/D21168 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Aug 7 15:05:08 2019 (r350677) +++ head/share/mk/src.opts.mk Wed Aug 7 16:19:06 2019 (r350678) @@ -389,8 +389,8 @@ BROKEN_OPTIONS+=MLX5TOOL BROKEN_OPTIONS+=HYPERV .endif -# NVME is only x86 and powerpc64 -.if ${__T} != "amd64" && ${__T} != "i386" && ${__T} != "powerpc64" +# NVME is only aarch64, x86 and powerpc64 +.if ${__T} != "aarch64" && ${__T} != "amd64" && ${__T} != "i386" && ${__T} != "powerpc64" BROKEN_OPTIONS+=NVME .endif From owner-svn-src-all@freebsd.org Wed Aug 7 16:22:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A825AAEF68; Wed, 7 Aug 2019 16:22:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463cGp3xxlz3Ph1; Wed, 7 Aug 2019 16:22:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 501EBF58B; Wed, 7 Aug 2019 16:22:26 +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 x77GMQuB072580; Wed, 7 Aug 2019 16:22:26 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77GMQl1072553; Wed, 7 Aug 2019 16:22:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908071622.x77GMQl1072553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Aug 2019 16:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350679 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 350679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 16:22:26 -0000 Author: markj Date: Wed Aug 7 16:22:25 2019 New Revision: 350679 URL: https://svnweb.freebsd.org/changeset/base/350679 Log: Merge r3780 from elftoolchain. Adjust argc and argv by optind before using them. This slightly simplifies the code. No functional change intended. MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21079 Modified: head/contrib/elftoolchain/elfcopy/main.c Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Wed Aug 7 16:19:06 2019 (r350678) +++ head/contrib/elftoolchain/elfcopy/main.c Wed Aug 7 16:22:25 2019 (r350679) @@ -1017,13 +1017,16 @@ elfcopy_main(struct elfcopy *ecp, int argc, char **arg } } - if (optind == argc || optind + 2 < argc) + argc -= optind; + argv += optind; + + if (argc == 0 || argc > 2) elfcopy_usage(); - infile = argv[optind]; + infile = argv[0]; outfile = NULL; - if (optind + 1 < argc) - outfile = argv[optind + 1]; + if (argc > 1) + outfile = argv[1]; create_file(ecp, infile, outfile); } @@ -1067,7 +1070,10 @@ mcs_main(struct elfcopy *ecp, int argc, char **argv) } } - if (optind == argc) + argc -= optind; + argv += optind; + + if (argc == 0) mcs_usage(); /* Must specify one operation at least. */ @@ -1104,7 +1110,7 @@ mcs_main(struct elfcopy *ecp, int argc, char **argv) sac->string = string; } - for (i = optind; i < argc; i++) { + for (i = 0; i < argc; i++) { /* If only -p is specified, output to /dev/null */ if (print && !append && !compress && !delete) create_file(ecp, argv[i], "/dev/null"); @@ -1180,21 +1186,24 @@ strip_main(struct elfcopy *ecp, int argc, char **argv) } } + argc -= optind; + argv += optind; + if (ecp->strip == 0 && ((ecp->flags & DISCARD_LOCAL) == 0) && ((ecp->flags & DISCARD_LLABEL) == 0) && lookup_symop_list(ecp, NULL, SYMOP_STRIP) == NULL) ecp->strip = STRIP_ALL; - if (optind == argc) + if (argc == 0) strip_usage(); /* * Only accept a single input file if an output file had been * specified. */ - if (outfile != NULL && argc != (optind + 1)) + if (outfile != NULL && argc != 1) strip_usage(); - for (i = optind; i < argc; i++) + for (i = 0; i < argc; i++) create_file(ecp, argv[i], outfile); } From owner-svn-src-all@freebsd.org Wed Aug 7 16:22:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE475AEF8A; Wed, 7 Aug 2019 16:22:31 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 463cGt3nxFz3Pj4; Wed, 7 Aug 2019 16:22:30 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5A42B21CDA; Wed, 7 Aug 2019 12:22:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 07 Aug 2019 12:22:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=i KFQjkuBDI01x/nvatWdFxQkbSkjjB/b93reEcOvOKo=; b=mPIyOKSIROezMjsRG d7RExHoTxjqVF8ykCvLFTM9aEdAwHQ02Lw99iqPDYRDqGEK9HoJbp9kHqKRyMS40 cQSh9LMLO9flzaj5UWGtye1vaOJ1Qdf0A08f4KgJb+YVFbDPMzXurZlWodoStH0n jXiKIuPDv/PXPPCovGlROquEzg/VNM0kTH1YHw95fOys5z9nl7yE0b2cmei7ASTW QFVrn4p5L/7Mm++dcCw0OM4n7VLwSmq88fPQhy+gzRj7nGLf7hFVLKXT47UMhw1N yQXgb8C/4V1O7b05v6qdjD1J9kjE+Vl3xJn6xLidi4nPLcPTg3BUD4JnMS4eIenL hUnRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=iKFQjkuBDI01x/nvatWdFxQkbSkjjB/b93reEcOvO Ko=; b=eXL16uIOjNVpKaj/wWzZEcTyWEiC3poFN/sUNTu6fFXRvXcDAaURHW6Kt ynxI/asTgE0gK81yUayh2Cq8Y1ukQ3IhtjFqJK6dZdrFsy565giqpVo+rlGiZsLO fZgAKJ4WWVGWiHA/rwBMvVPQlnYXPrQvvURyTLfRkvOCq2YhFcCJwssD1yjJp5XO 44y1opy7srmgrd1xPFLgVaBs6RljO15kAVkiCyiT0/lWPzXF9UV3+t52Hn3Gf0D9 OAhdsf96b84nVnGJPnGlpOOcivlUUKr/ibV8N+5RDFuOfm5OaeAmjwCCsLKQgKxd 2d6aMQXUptugKA9JBCfk8mD+1z5+A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudduvddguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesth hqmhdthhdtjeenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlsehsrghm shgtohdrohhrgheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecukfhppedule dvrdehhedrheegrdehkeenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehs rghmshgtohdrohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [10.178.24.14] (unknown [192.55.54.58]) by mail.messagingengine.com (Postfix) with ESMTPA id 6047580059; Wed, 7 Aug 2019 12:22:27 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r350550 - head/share/mk From: Scott Long In-Reply-To: <4e4d30b2-4801-2e53-6f26-49cb350445ec@FreeBSD.org> Date: Wed, 7 Aug 2019 10:22:24 -0600 Cc: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201908030106.x7316Ibx078529@repo.freebsd.org> <20190806165614.GA41295@FreeBSD.org> <4e4d30b2-4801-2e53-6f26-49cb350445ec@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 463cGt3nxFz3Pj4 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsco.org header.s=fm1 header.b=mPIyOKSI; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=eXL16uIO; dmarc=none; spf=pass (mx1.freebsd.org: domain of scottl@samsco.org designates 66.111.4.28 as permitted sender) smtp.mailfrom=scottl@samsco.org X-Spamd-Result: default: False [-0.78 / 15.00]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_XBL(5.00)[58.54.55.192.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.4]; R_DKIM_ALLOW(0.00)[samsco.org:s=fm1,messagingengine.com:s=fm3]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:66.111.4.28]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; DMARC_NA(0.00)[samsco.org]; BAD_REP_POLICIES(0.10)[]; NEURAL_HAM_LONG(-0.88)[-0.877,0]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[samsco.org:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.997,0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_MEDIUM(-0.84)[-0.841,0]; IP_SCORE(-3.47)[ip: (-9.81), ipnet: 66.111.4.0/24(-4.81), asn: 11403(-2.68), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[28.4.111.66.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 16:22:31 -0000 > On Aug 7, 2019, at 10:00 AM, John Baldwin wrote: >=20 > On 8/6/19 9:56 AM, Glen Barber wrote: >> On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: >>> Author: jhb >>> Date: Sat Aug 3 01:06:17 2019 >>> New Revision: 350550 >>> URL: https://svnweb.freebsd.org/changeset/base/350550 >>>=20 >>> Log: >>> Flip REPRODUCIBLE_BUILD back to off by default in head. >>>=20 >>> Having the full uname output can be useful on head even with >>> unmodified trees or trees that newvers.sh fails to recognize as >>> modified. >>>=20 >>> Reviewed by: emaste >>> Differential Revision: https://reviews.freebsd.org/D20895 >>>=20 >>=20 >> I would like to request this commit be reverted. While the original >> commit message to enable this knob stated the commit would be = reverted >> after stable/12 branched, I have seen no public complaints about >> enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not = see >> the benefit of disabling it by default -- why wouldn't we want >> reproducibility?). >>=20 >> To me, this feels like a step backwards, with no tangible benefit. >> Note, newvers.sh does properly detect a modified tree if it can find >> the VCS metadata directory (i.e., .git, .svn) -- I know this because >> I personally helped with it. >>=20 >> In my opinion, those that want the non-reproducible metadata included = in >> output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in = their >> src.conf. Turning off a sane default for the benefit of what I = suspect >> is likely a short list of use cases feels like a step in the wrong >> direction. >=20 > My arguments for flipping this in head (and head only) are that the = data > provided in uname -a when this is disabled is useful for development, = and > that in head we do tailor settings towards development (e.g. GENERIC = in > head vs GENERIC in stable). I=E2=80=99m in favor of how this works at the moment. It was a bit = jarring to me when the reproducible build flag was turned on and I lost all of the metadata = that I subconsciously use during development. I think that what John has = done is an appropriate compromise and is in line with how we=E2=80=99ve = treated similar development-facilitating features in the past, i.e. WITNESS/INVARIANTS, malloc-debug. Scott From owner-svn-src-all@freebsd.org Wed Aug 7 16:24:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9904AF165; Wed, 7 Aug 2019 16:24:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463cJm43NPz3Q8J; Wed, 7 Aug 2019 16:24:08 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 865EEF5A9; Wed, 7 Aug 2019 16:24:08 +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 x77GO899074120; Wed, 7 Aug 2019 16:24:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77GO8ih074119; Wed, 7 Aug 2019 16:24:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201908071624.x77GO8ih074119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 7 Aug 2019 16:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350680 - head X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 16:24:08 -0000 Author: asomers Date: Wed Aug 7 16:24:08 2019 New Revision: 350680 URL: https://svnweb.freebsd.org/changeset/base/350680 Log: RELNOTES: fix formatting from r350482 MFC after: Never Sponsored by: The FreeBSD Foundation Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Wed Aug 7 16:22:25 2019 (r350679) +++ head/RELNOTES Wed Aug 7 16:24:08 2019 (r350680) @@ -11,8 +11,8 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. r350471: - gnop(8) can now configure a delay to be applied to read and write - request delays. See the -d, -q and -x parameters. + gnop(8) can now configure a delay to be applied to read and write + request delays. See the -d, -q and -x parameters. r350315, r350316: Adds a Linux compatible copy_file_range(2) syscall. From owner-svn-src-all@freebsd.org Wed Aug 7 16:24:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3093EAF1D6 for ; Wed, 7 Aug 2019 16:24:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463cK73Mhmz3QH3 for ; Wed, 7 Aug 2019 16:24:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x841.google.com with SMTP id a15so88898991qtn.7 for ; Wed, 07 Aug 2019 09:24:27 -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=n/Fm0FCS2HN/Egvw1tVv9mTzTn+zuyiqDM0UJqSx95U=; b=KSwI6alfRd194gxkmaG1kk+I9U26/37IuXj5dRlnju7BtJ6UrZY8+lRHornhgVPL4o or6umLNauDh9MCLGjzTMq60mq5PxDu+JnqEa9Pddt5AuBjtv5Ti3cTY533Y0nKDF6G3o SC4xy3m/K0/gOKLY9ilKOCvfzVYba9XfO5f0/oMwF+uN2uJ2AjSnCHkvHZopRRg1IlOG C5TOi6uKPcNF0I1sErXlQh7ko+KC7vD6PysgiIXTxkQRZbx6HO53RHLPfggSu0kMT9dy 5UIWhqJsiUJLHqonyqLMNr0qTRdOP4semacgm4snwCy5/hBhjn82vr4BMprfg6IJmAt1 8oog== 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=n/Fm0FCS2HN/Egvw1tVv9mTzTn+zuyiqDM0UJqSx95U=; b=Wy8pJQL2a/C0OIsSvPBdPMOh60T4i9iigJgL2ClJpmpGc48tNQmXIuAYvcFk2saxRs P1QpyfwytcnLqRixBeQO0k5z9lOv7kwI7Jc7s2GfdncZ8wyS3YuzwdzzPSEzPl50Y6ud dEA160vmpAC3OnTFJ90Q1OPA5WWNBayqffM6oy75cTRXMbwaGhMe60AylyzKo8iGAzVU TfQLjUeNQQ1SkEH17qZFxPPzQcTutCqAFn1TACM0U2+4XYzGg8N6q2EVReK5EP6auXhP l9kSeOn3rMW5kUzhLHAGT18CDd8NFZJ9fdlk6V2UZs4kwHcik4GboPusFGA4hQxbheec 9yxg== X-Gm-Message-State: APjAAAXEIhmbt6kHQmvJ+eWiCDKsCm1KhqozGsyPQm3nwipt7Q/BxFJ4 vt7zTlE9e56o8SAFjfKasJstnUAsS7Jic2Mdje2yOg== X-Google-Smtp-Source: APXvYqwPIS5Fu8qMlm+LvPNDUCqwirihb14S3rYhnkP7sFwj7QAWzcdjATO32i8RnBDgu5xmXkNYSo0ZL3aVlVU9gd8= X-Received: by 2002:ac8:2baa:: with SMTP id m39mr9005043qtm.242.1565195066321; Wed, 07 Aug 2019 09:24:26 -0700 (PDT) MIME-Version: 1.0 References: <201908030106.x7316Ibx078529@repo.freebsd.org> <20190806165614.GA41295@FreeBSD.org> <4e4d30b2-4801-2e53-6f26-49cb350445ec@FreeBSD.org> In-Reply-To: <4e4d30b2-4801-2e53-6f26-49cb350445ec@FreeBSD.org> From: Warner Losh Date: Wed, 7 Aug 2019 10:24:15 -0600 Message-ID: Subject: Re: svn commit: r350550 - head/share/mk To: John Baldwin Cc: Glen Barber , svn-src-head , "freebsd-hackers@freebsd.org" , svn-src-all , src-committers , "freebsd-arch@freebsd.org" X-Rspamd-Queue-Id: 463cK73Mhmz3QH3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=KSwI6alf; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::841) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.58 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.981,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[9]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; RCVD_IN_DNSWL_NONE(0.00)[1.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.61)[ip: (2.45), ipnet: 2607:f8b0::/32(-3.03), asn: 15169(-2.43), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 16:24:28 -0000 On Wed, Aug 7, 2019 at 10:01 AM John Baldwin wrote: > On 8/6/19 9:56 AM, Glen Barber wrote: > > On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: > >> Author: jhb > >> Date: Sat Aug 3 01:06:17 2019 > >> New Revision: 350550 > >> URL: https://svnweb.freebsd.org/changeset/base/350550 > >> > >> Log: > >> Flip REPRODUCIBLE_BUILD back to off by default in head. > >> > >> Having the full uname output can be useful on head even with > >> unmodified trees or trees that newvers.sh fails to recognize as > >> modified. > >> > >> Reviewed by: emaste > >> Differential Revision: https://reviews.freebsd.org/D20895 > >> > > > > I would like to request this commit be reverted. While the original > > commit message to enable this knob stated the commit would be reverted > > after stable/12 branched, I have seen no public complaints about > > enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see > > the benefit of disabling it by default -- why wouldn't we want > > reproducibility?). > > > > To me, this feels like a step backwards, with no tangible benefit. > > Note, newvers.sh does properly detect a modified tree if it can find > > the VCS metadata directory (i.e., .git, .svn) -- I know this because > > I personally helped with it. > > > > In my opinion, those that want the non-reproducible metadata included in > > output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their > > src.conf. Turning off a sane default for the benefit of what I suspect > > is likely a short list of use cases feels like a step in the wrong > > direction. > > My arguments for flipping this in head (and head only) are that the data > provided in uname -a when this is disabled is useful for development, and > that in head we do tailor settings towards development (e.g. GENERIC in > head vs GENERIC in stable). > > The logic to handle modified trees has an inherent assumption that I think > is false, at least for my workflow and I suspect many others. I do builds > and tests of kernels on separate machines (VMs or bare metal) from where I > use VCS to manage sources so that a kernel crash doesn't toast my source > tree. The trees are then shared to the build/test machines via NFS. As > a result, the build/test machines are not always able to detect that the > tree is modified either because a subset of the checkout is exported via > NFS, or the VCS tool isn't installed on the build/test machines because > they are generally barebones systems with only a base installed. This > does mean that flipping the knob off doesn't provide all of the same info, > but it does provide the path, and the path matters because 'kgdb -n last' > uses it, and because if you use separate directories for separate projects > (e.g. git worktrees), then the path tells you which test kernel you booted. > (It is not uncommon for me to have several test projects in flight on a > single test machine for different branches.) > > In the original discussion on arch, we collectively recognized that > developer builds vs release builds were different and needed different > defaults. The compromise reached at that time was to depend on the VCS > to detect developer builds to choose the policy. What I have found is that > in practice for at least my workflow that doesn't actually work. I posit > that the majority of kernels built from head are developer builds, not > releases, and that the default should cater to that. You could also always > patch release.sh to set WITH_REPRODUCIBLE_BUILD in the environment which I > think would give a more accurate sense of when builds are releases or not. > > However, I will yield to whatever the consensus is. > I'm with John here: the dirty tree stuff is too fragile for the diversity of development environments that are typical on -current, but not typical on -stable. We should not revert this. Warner From owner-svn-src-all@freebsd.org Wed Aug 7 16:42:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75B11AFFAF; Wed, 7 Aug 2019 16:42:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463ck32cPvz3xB2; Wed, 7 Aug 2019 16:42:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3393BF95F; Wed, 7 Aug 2019 16:42:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77GgZul086331; Wed, 7 Aug 2019 16:42:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77GgZOE086330; Wed, 7 Aug 2019 16:42:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201908071642.x77GgZOE086330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 7 Aug 2019 16:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350681 - head X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 16:42:35 -0000 Author: asomers Date: Wed Aug 7 16:42:34 2019 New Revision: 350681 URL: https://svnweb.freebsd.org/changeset/base/350681 Log: Update RELNOTES for the fusefs rewrite MFC after: Never Sponsored by: The FreeBSD Foundation Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Wed Aug 7 16:24:08 2019 (r350680) +++ head/RELNOTES Wed Aug 7 16:42:34 2019 (r350681) @@ -10,6 +10,26 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r350665: + The fuse driver has been renamed to fusefs(5) and been substantially + rewritten. The new driver includes many bug fixes and performance + enhancements, as well as the following user-visible features: + * Optional kernel-side permissions checks (-o default_permissions) + * mknod(2), socket(2), and pipe(2) support + * server side locking with fcntl(2) + * FUSE operations are now interruptible when mounted with -o intr + * server side handling of UTIME_NOW during utimensat(2) + * mount options may be updated with "mount -u" + * fusefs file system may now be exported over NFS + * RLIMIT_FSIZE support + * support for fuse file systems using protocols as old as 7.4 + + FUSE file system developers should also take note of the following new + features: + * The protocol level has been raised from 7.8 to 7.23 + * kqueue support on /dev/fuse + * server-initiated cache invalidation via FUSE_NOTIFY_REPLY + r350471: gnop(8) can now configure a delay to be applied to read and write request delays. See the -d, -q and -x parameters. From owner-svn-src-all@freebsd.org Wed Aug 7 16:51:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9B86B070F; Wed, 7 Aug 2019 16:51:29 +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 463cwJ11Jdz40Dw; Wed, 7 Aug 2019 16:51:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id vP9nh4MQlIhW9vP9ohW99b; Wed, 07 Aug 2019 10:51:26 -0600 X-Authority-Analysis: v=2.3 cv=FcFJO626 c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=8nJEP1OIZ-IA:10 a=FmdZ9Uzk2mMA:10 a=-o65W9qwAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=N3yCi80q97NF-fv9y40A:9 a=wPNLvfGTeEIA:10 a=1tiFkAoI0pxFi1YEbzhn:22 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 32E1030D; Wed, 7 Aug 2019 09:51:22 -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 x77GpLho055590; Wed, 7 Aug 2019 09:51:21 -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 x77GpLBR055551; Wed, 7 Aug 2019 09:51:21 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201908071651.x77GpLBR055551@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Scott Long cc: John Baldwin , Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: svn commit: r350550 - head/share/mk In-reply-to: References: <201908030106.x7316Ibx078529@repo.freebsd.org> <20190806165614.GA41295@FreeBSD.org> <4e4d30b2-4801-2e53-6f26-49cb350445ec@FreeBSD.org> Comments: In-reply-to Scott Long message dated "Wed, 07 Aug 2019 10:22:24 -0600." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Wed, 07 Aug 2019 09:51:21 -0700 X-CMAE-Envelope: MS4wfD3GEMNYB235v89UuPrZvPA9ooszLwKhIXaveTtUWgl+RCuKVOeL/pE9e45rnZRgsgWD7g4Vag8Zu15QptSiER7CC9YU86hVxP4C1p05p6yOQY+FJs+L OYzvjmcQRTuIHCYZrECAI2PusblOheyxMT+Av9pKt2VygOcB4Lwh03mrJC26ocgCGAJlEow363Ir8uj7pOV0gQr8wxnqMdN8kHpPq6LKP1Iv6kqv3CWUtHsK 1RVTU4ImPrOsDiaCjHmpF9kYMq8wNlvNiuRa+Gq4XGQPHucaFvJIbk58XqQoKUZKkFeuQxXgcECrtY8vuz5devsZx3Dt2jkJm1kgZQcmpV8TF4LqpFirNuro KUWBf3Q/gBHttAZIFON7Z9vP2bmgiW8riW0zc5cKGeHpiJLwjYoz6RdZkSh9eTC8C6C1/ZEI X-Rspamd-Queue-Id: 463cwJ11Jdz40Dw X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 64.59.136.138) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-5.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; RCVD_IN_DNSWL_NONE(0.00)[138.136.59.64.list.dnswl.org : 127.0.5.0]; RCPT_COUNT_SEVEN(0.00)[8]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.42)[ip: (-6.37), ipnet: 64.59.128.0/20(-3.18), asn: 6327(-2.48), country: CA(-0.09)]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 16:51:29 -0000 In message , Scott Long writes : > > > > On Aug 7, 2019, at 10:00 AM, John Baldwin wrote: > > > > On 8/6/19 9:56 AM, Glen Barber wrote: > >> On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: > >>> Author: jhb > >>> Date: Sat Aug 3 01:06:17 2019 > >>> New Revision: 350550 > >>> URL: https://svnweb.freebsd.org/changeset/base/350550 > >>> > >>> Log: > >>> Flip REPRODUCIBLE_BUILD back to off by default in head. > >>> > >>> Having the full uname output can be useful on head even with > >>> unmodified trees or trees that newvers.sh fails to recognize as > >>> modified. > >>> > >>> Reviewed by: emaste > >>> Differential Revision: https://reviews.freebsd.org/D20895 > >>> > >> > >> I would like to request this commit be reverted. While the original > >> commit message to enable this knob stated the commit would be reverted > >> after stable/12 branched, I have seen no public complaints about > >> enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see > >> the benefit of disabling it by default -- why wouldn't we want > >> reproducibility?). > >> > >> To me, this feels like a step backwards, with no tangible benefit. > >> Note, newvers.sh does properly detect a modified tree if it can find > >> the VCS metadata directory (i.e., .git, .svn) -- I know this because > >> I personally helped with it. > >> > >> In my opinion, those that want the non-reproducible metadata included in > >> output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their > >> src.conf. Turning off a sane default for the benefit of what I suspect > >> is likely a short list of use cases feels like a step in the wrong > >> direction. > > > > My arguments for flipping this in head (and head only) are that the data > > provided in uname -a when this is disabled is useful for development, and > > that in head we do tailor settings towards development (e.g. GENERIC in > > head vs GENERIC in stable). > > I’m in favor of how this works at the moment. It was a bit jarring to me w > hen > the reproducible build flag was turned on and I lost all of the metadata that > I subconsciously use during development. I think that what John has done > is an appropriate compromise and is in line with how we’ve treated similar > development-facilitating features in the past, i.e. WITNESS/INVARIANTS, > malloc-debug. Agreed. As with John, I have a combination of git and svn trees on various machines. Some install to different partitions on physical hardware while others are tested in VMs. The extra information is handy in keeping track of what is installed where. End users who are concerned about reproducible builds in what we might call pseudo-production will probably not use WITNESS or INVARIANTS either. -- 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 Wed Aug 7 16:56:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8ED0EB0CA9; Wed, 7 Aug 2019 16:56: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463d1Y3G5zz40nl; Wed, 7 Aug 2019 16:56: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 4CE52FB60; Wed, 7 Aug 2019 16:56: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 x77Gu1tj094474; Wed, 7 Aug 2019 16:56:01 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77Gu0wZ094472; Wed, 7 Aug 2019 16:56:00 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201908071656.x77Gu0wZ094472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 7 Aug 2019 16:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350682 - in head/sbin: fsck_ffs newfs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sbin: fsck_ffs newfs X-SVN-Commit-Revision: 350682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 16:56:01 -0000 Author: mckusick Date: Wed Aug 7 16:56:00 2019 New Revision: 350682 URL: https://svnweb.freebsd.org/changeset/base/350682 Log: Correct the location of the first backup superblock in fsck_ffs.8. Make a note in the newfs.8 manual page to update the first backup superblock location when changing the default fragment size for the filesystem. Reported by: O. Hartmann Modified: head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/newfs/newfs.8 Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Wed Aug 7 16:42:34 2019 (r350681) +++ head/sbin/fsck_ffs/fsck_ffs.8 Wed Aug 7 16:56:00 2019 (r350682) @@ -153,7 +153,7 @@ exits without attempting any further cleaning. Use the block specified immediately after the flag as the super block for the file system. An alternate super block is usually located at block 32 for UFS1, -and block 160 for UFS2. +and block 192 for UFS2. .Pp See the .Fl N Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Wed Aug 7 16:42:34 2019 (r350681) +++ head/sbin/newfs/newfs.8 Wed Aug 7 16:56:00 2019 (r350682) @@ -111,6 +111,9 @@ for more details on how to set this option. .It Fl b Ar block-size The block size of the file system, in bytes. It must be a power of 2. +.\" If changing the default block size and it causes the default +.\" fragment size to change, be sure to update the location of +.\" the first backup superblock on the fsck_ffs.8 manual page. The default size is 32768 bytes, and the smallest allowable size is 4096 bytes. The optimal block:fragment ratio is 8:1. @@ -143,6 +146,9 @@ ranging in value between .Ar blocksize Ns /8 and .Ar blocksize . +.\" If changing the default fragment size or it changes because of a +.\" change to the default block size, be sure to update the location +.\" of the first backup superblock on the fsck_ffs.8 manual page. The default is 4096 bytes. .It Fl g Ar avgfilesize The expected average file size for the file system. From owner-svn-src-all@freebsd.org Wed Aug 7 16:58:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AC9FB0D77; Wed, 7 Aug 2019 16:58:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463d4239F0z40xL; Wed, 7 Aug 2019 16:58:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id C031315A91; Wed, 7 Aug 2019 16:58:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r350550 - head/share/mk To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org References: <201908030106.x7316Ibx078529@repo.freebsd.org> <20190806165614.GA41295@FreeBSD.org> <4e4d30b2-4801-2e53-6f26-49cb350445ec@FreeBSD.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: <86621ce5-3a8d-2e22-f146-3b0cc8252124@FreeBSD.org> Date: Wed, 7 Aug 2019 11:58:08 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <4e4d30b2-4801-2e53-6f26-49cb350445ec@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 16:58:10 -0000 On 07/08/2019 11:00, John Baldwin wrote: > On 8/6/19 9:56 AM, Glen Barber wrote: >> On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: >>> Author: jhb >>> Date: Sat Aug 3 01:06:17 2019 >>> New Revision: 350550 >>> URL: https://svnweb.freebsd.org/changeset/base/350550 >>> >>> Log: >>> Flip REPRODUCIBLE_BUILD back to off by default in head. >>> >>> Having the full uname output can be useful on head even with >>> unmodified trees or trees that newvers.sh fails to recognize as >>> modified. >>> >>> Reviewed by: emaste >>> Differential Revision: https://reviews.freebsd.org/D20895 >>> >> I would like to request this commit be reverted. While the original >> commit message to enable this knob stated the commit would be reverted >> after stable/12 branched, I have seen no public complaints about >> enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see >> the benefit of disabling it by default -- why wouldn't we want >> reproducibility?). >> >> To me, this feels like a step backwards, with no tangible benefit. >> Note, newvers.sh does properly detect a modified tree if it can find >> the VCS metadata directory (i.e., .git, .svn) -- I know this because >> I personally helped with it. >> >> In my opinion, those that want the non-reproducible metadata included in >> output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their >> src.conf. Turning off a sane default for the benefit of what I suspect >> is likely a short list of use cases feels like a step in the wrong >> direction. > My arguments for flipping this in head (and head only) are that the data > provided in uname -a when this is disabled is useful for development, and > that in head we do tailor settings towards development (e.g. GENERIC in > head vs GENERIC in stable). > > The logic to handle modified trees has an inherent assumption that I think > is false, at least for my workflow and I suspect many others. I do builds > and tests of kernels on separate machines (VMs or bare metal) from where I > use VCS to manage sources so that a kernel crash doesn't toast my source > tree. The trees are then shared to the build/test machines via NFS. As > a result, the build/test machines are not always able to detect that the > tree is modified either because a subset of the checkout is exported via > NFS, or the VCS tool isn't installed on the build/test machines because > they are generally barebones systems with only a base installed. This > does mean that flipping the knob off doesn't provide all of the same info, > but it does provide the path, and the path matters because 'kgdb -n last' > uses it, and because if you use separate directories for separate projects > (e.g. git worktrees), then the path tells you which test kernel you booted. > (It is not uncommon for me to have several test projects in flight on a > single test machine for different branches.) > > In the original discussion on arch, we collectively recognized that > developer builds vs release builds were different and needed different > defaults. The compromise reached at that time was to depend on the VCS > to detect developer builds to choose the policy. What I have found is that > in practice for at least my workflow that doesn't actually work. I posit > that the majority of kernels built from head are developer builds, not > releases, and that the default should cater to that. You could also always > patch release.sh to set WITH_REPRODUCIBLE_BUILD in the environment which I > think would give a more accurate sense of when builds are releases or not. > > However, I will yield to whatever the consensus is. +1 keeping metadata in head. From owner-svn-src-all@freebsd.org Wed Aug 7 17:46:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D7C2B27C5; Wed, 7 Aug 2019 17:46:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463f7M74gzz44BT; Wed, 7 Aug 2019 17:46: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 D4A7E1847C; Wed, 7 Aug 2019 17:46: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 x77Hk708024169; Wed, 7 Aug 2019 17:46:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77Hk7t2024168; Wed, 7 Aug 2019 17:46:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908071746.x77Hk7t2024168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 7 Aug 2019 17:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350683 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 350683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 17:46:08 -0000 Author: kib Date: Wed Aug 7 17:46:07 2019 New Revision: 350683 URL: https://svnweb.freebsd.org/changeset/base/350683 Log: Clarify the robustness guarantees. Wording submitted by: Martin Simmons MFC after: 3 days Modified: head/share/man/man3/pthread_mutex_lock.3 head/share/man/man3/pthread_mutex_trylock.3 Modified: head/share/man/man3/pthread_mutex_lock.3 ============================================================================== --- head/share/man/man3/pthread_mutex_lock.3 Wed Aug 7 16:56:00 2019 (r350682) +++ head/share/man/man3/pthread_mutex_lock.3 Wed Aug 7 17:46:07 2019 (r350683) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_LOCK 3 .Os .Sh NAME @@ -66,8 +66,8 @@ A deadlock would occur if the thread blocked waiting f .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE Modified: head/share/man/man3/pthread_mutex_trylock.3 ============================================================================== --- head/share/man/man3/pthread_mutex_trylock.3 Wed Aug 7 16:56:00 2019 (r350682) +++ head/share/man/man3/pthread_mutex_trylock.3 Wed Aug 7 17:46:07 2019 (r350683) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_TRYLOCK 3 .Os .Sh NAME @@ -67,8 +67,8 @@ is already locked. .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE From owner-svn-src-all@freebsd.org Wed Aug 7 17:51:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34D14B29EE; Wed, 7 Aug 2019 17:51:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463fFn0dFnz44Zr; Wed, 7 Aug 2019 17:51:41 +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 EAACD185F5; Wed, 7 Aug 2019 17:51:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77HpeOL027631; Wed, 7 Aug 2019 17:51:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77HpeLg027268; Wed, 7 Aug 2019 17:51:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908071751.x77HpeLg027268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 7 Aug 2019 17:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350684 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 350684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 17:51:41 -0000 Author: kib Date: Wed Aug 7 17:51:40 2019 New Revision: 350684 URL: https://svnweb.freebsd.org/changeset/base/350684 Log: More places to clarify the robustness guarantees. Wording submitted by: Martin Simmons MFC after: 3 days Modified: head/share/man/man3/pthread_cond_wait.3 head/share/man/man3/pthread_mutex_consistent.3 head/share/man/man3/pthread_mutex_timedlock.3 Modified: head/share/man/man3/pthread_cond_wait.3 ============================================================================== --- head/share/man/man3/pthread_cond_wait.3 Wed Aug 7 17:46:07 2019 (r350683) +++ head/share/man/man3/pthread_cond_wait.3 Wed Aug 7 17:51:40 2019 (r350684) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2018 +.Dd August 7, 2019 .Dt PTHREAD_COND_WAIT 3 .Os .Sh NAME @@ -78,8 +78,8 @@ was not locked by the calling thread. .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE Modified: head/share/man/man3/pthread_mutex_consistent.3 ============================================================================== --- head/share/man/man3/pthread_mutex_consistent.3 Wed Aug 7 17:46:07 2019 (r350683) +++ head/share/man/man3/pthread_mutex_consistent.3 Wed Aug 7 17:51:40 2019 (r350684) @@ -41,9 +41,9 @@ .Ft int .Fn pthread_mutex_consistent "pthread_mutex_t *mutex" .Sh DESCRIPTION -If the thread owning a robust mutex terminates while holding the -mutex, the mutex becomes inconsistent and the next thread that -acquires the mutex lock is notified of the state by the return value +If the process containing the thread owning a robust mutex terminates +while holding the mutex, the mutex becomes inconsistent and the next thread +that acquires the mutex lock is notified of the state by the return value .Er EOWNERDEAD . In this case, the mutex does not become normally usable again until the state is marked consistent. Modified: head/share/man/man3/pthread_mutex_timedlock.3 ============================================================================== --- head/share/man/man3/pthread_mutex_timedlock.3 Wed Aug 7 17:46:07 2019 (r350683) +++ head/share/man/man3/pthread_mutex_timedlock.3 Wed Aug 7 17:51:40 2019 (r350684) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2018 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_TIMEDLOCK 3 .Os .Sh NAME @@ -92,8 +92,8 @@ The current thread already owns the .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE From owner-svn-src-all@freebsd.org Wed Aug 7 18:14:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0432B362C; Wed, 7 Aug 2019 18:14:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463fmR4N4Rz46QN; Wed, 7 Aug 2019 18:14:47 +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 72AD8189FD; Wed, 7 Aug 2019 18:14:47 +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 x77IElcT042389; Wed, 7 Aug 2019 18:14:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77IEjMh042379; Wed, 7 Aug 2019 18:14:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201908071814.x77IEjMh042379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 7 Aug 2019 18:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350685 - in head: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/net sys/dev/usb/template sys/modules/usb sys/modules/usb/cdceem sys/modules/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/net sys/dev/usb/template sys/modules/usb sys/modules/usb/cdceem sys/modules/usb/template X-SVN-Commit-Revision: 350685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 18:14:47 -0000 Author: trasz Date: Wed Aug 7 18:14:45 2019 New Revision: 350685 URL: https://svnweb.freebsd.org/changeset/base/350685 Log: Add cdceem(4) driver, for virtual ethernet devices compliant with Communication Device Class Ethernet Emulation Model (CDC EEM). The driver supports both the device, and host side operation; there is a new USB template (#11) for the former. This enables communication with virtual USB NIC provided by iLO 5, as found in new HPE Proliant servers. Reviewed by: hselasky MFC after: 2 weeks Relnotes: yes Sponsored by: Hewlett Packard Enterprise Added: head/share/man/man4/cdceem.4 (contents, props changed) head/sys/dev/usb/net/if_cdceem.c (contents, props changed) head/sys/dev/usb/template/usb_template_cdceem.c (contents, props changed) head/sys/modules/usb/cdceem/ head/sys/modules/usb/cdceem/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/cdce.4 head/share/man/man4/ipheth.4 head/share/man/man4/urndis.4 head/share/man/man4/usb_template.4 head/sys/conf/files head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/usb.h head/sys/dev/usb/usb_ioctl.h head/sys/modules/usb/Makefile head/sys/modules/usb/template/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Aug 7 17:51:40 2019 (r350684) +++ head/share/man/man4/Makefile Wed Aug 7 18:14:45 2019 (r350685) @@ -103,6 +103,7 @@ MAN= aac.4 \ ccr.4 \ cd.4 \ cdce.4 \ + cdceem.4 \ cfi.4 \ cfumass.4 \ ch.4 \ Modified: head/share/man/man4/cdce.4 ============================================================================== --- head/share/man/man4/cdce.4 Wed Aug 7 17:51:40 2019 (r350684) +++ head/share/man/man4/cdce.4 Wed Aug 7 18:14:45 2019 (r350685) @@ -121,6 +121,7 @@ is running low on mbufs. .El .Sh SEE ALSO .Xr arp 4 , +.Xr cdceem 4 , .Xr intro 4 , .Xr ipheth 4 , .Xr netintro 4 , Added: head/share/man/man4/cdceem.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/cdceem.4 Wed Aug 7 18:14:45 2019 (r350685) @@ -0,0 +1,119 @@ +.\" Copyright (c) 2019 Edward Tomasz Napierala +.\" +.\" 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 7, 2019 +.Dt CDCEEM 4 +.Os +.Sh NAME +.Nm cdceem +.Nd "USB Communication Device Class Ethernet Emulation Model (CDC EEM) driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device uhci" +.Cd "device ohci" +.Cd "device usb" +.Cd "device miibus" +.Cd "device uether" +.Cd "device cdceem" +.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 +if_cdceem_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for USB devices based on the USB Communication +Device Class Ethernet Emulation Model (CDC EEM) specification. +.Pp +The driver works on both host, and device-side; see +.Xr usb_template 4 +for details. +.Pp +The USB device appears as a regular network interface on both sides, +transporting Ethernet frames. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Pp +The +.Nm +driver does not support different media types or options. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width indent +.It Va hw.usb.cdceem.debug +Verbosity level for log messages from the +.Nm +driver. +Set to 0 to disable logging or 1 to warn about potential problems. +Larger values enable debugging output. +Defaults to 1. +.It Va hw.usb.cdceem.send_echoes +If set to 1, the driver will send an Echo EEM packet when the +interface is brought up. +While responding to Echo is mandatory, some devices cannot handle it. +Only use for debugging. +Defaults to 0. +.It Va hw.usb.cdceem.send_fake_crc +If set to 1, the driver will use 0xdeadbeef as the CRC value +for outgoing Data EEM packets. +Only use for debugging. +Defaults to 0. +.El +.Sh SEE ALSO +.Xr arp 4 , +.Xr cdce 4 , +.Xr intro 4 , +.Xr ipheth 4 , +.Xr netintro 4 , +.Xr urndis 4 , +.Xr usb 4 , +.Xr usb_template 4 , +.Xr ifconfig 8 +.Rs +.%T "Universal Serial Bus Communications Class Subclass Specification for Ethernet Emulation Model Devices" +.%U https://usb.org/sites/default/files/CDC_EEM10.pdf +.Re +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 13.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org +under sponsorship from Hewlett Packard Enterprise. Modified: head/share/man/man4/ipheth.4 ============================================================================== --- head/share/man/man4/ipheth.4 Wed Aug 7 17:51:40 2019 (r350684) +++ head/share/man/man4/ipheth.4 Wed Aug 7 18:14:45 2019 (r350685) @@ -159,6 +159,7 @@ The machine should now be connected to the network via .Sh SEE ALSO .Xr arp 4 , .Xr cdce 4 , +.Xr cdceem 4 , .Xr intro 4 , .Xr netintro 4 , .Xr urndis 4 , Modified: head/share/man/man4/urndis.4 ============================================================================== --- head/share/man/man4/urndis.4 Wed Aug 7 17:51:40 2019 (r350684) +++ head/share/man/man4/urndis.4 Wed Aug 7 18:14:45 2019 (r350685) @@ -79,6 +79,7 @@ functionality of many Android devices. .Sh SEE ALSO .Xr arp 4 , .Xr cdce 4 , +.Xr cdceem 4 , .Xr ipheth 4 , .Xr netintro 4 , .Xr usb 4 , Modified: head/share/man/man4/usb_template.4 ============================================================================== --- head/share/man/man4/usb_template.4 Wed Aug 7 17:51:40 2019 (r350684) +++ head/share/man/man4/usb_template.4 Wed Aug 7 18:14:45 2019 (r350685) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 24, 2018 +.Dd August 7, 2019 .Dt USB_TEMPLATE 4 .Os . @@ -88,6 +88,8 @@ Available templates are: .It Dv 8 Ta CDC Ethernet and serial port .It Dv 9 Ta USB MIDI .It Dv 10 Ta CDC Ethernet, serial port, and storage +.It Dv 11 Ta CDC Ethernet Emulation Model, see +.Xr cdceem 4 .El . .Sh SYSCTL VARIABLES Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Aug 7 17:51:40 2019 (r350684) +++ head/sys/conf/files Wed Aug 7 18:14:45 2019 (r350685) @@ -3231,6 +3231,7 @@ dev/usb/net/if_aue.c optional aue dev/usb/net/if_axe.c optional axe dev/usb/net/if_axge.c optional axge dev/usb/net/if_cdce.c optional cdce +dev/usb/net/if_cdceem.c optional cdceem dev/usb/net/if_cue.c optional cue dev/usb/net/if_ipheth.c optional ipheth dev/usb/net/if_kue.c optional kue @@ -3244,8 +3245,8 @@ dev/usb/net/if_usie.c optional usie dev/usb/net/if_urndis.c optional urndis dev/usb/net/ruephy.c optional rue dev/usb/net/usb_ethernet.c optional uether | aue | axe | axge | cdce | \ - cue | ipheth | kue | mos | rue | \ - smsc | udav | ure | urndis | muge + cdceem | cue | ipheth | kue | mos | \ + rue | smsc | udav | ure | urndis | muge dev/usb/net/uhso.c optional uhso # # USB WLAN drivers @@ -3350,6 +3351,7 @@ dev/usb/template/usb_template_phone.c optional usb_tem dev/usb/template/usb_template_serialnet.c optional usb_template dev/usb/template/usb_template_midi.c optional usb_template dev/usb/template/usb_template_multi.c optional usb_template +dev/usb/template/usb_template_cdceem.c optional usb_template # # USB video drivers # Added: head/sys/dev/usb/net/if_cdceem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/if_cdceem.c Wed Aug 7 18:14:45 2019 (r350685) @@ -0,0 +1,870 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2012 Ben Gray . + * Copyright (C) 2018 The FreeBSD Foundation. + * Copyright (c) 2019 Edward Tomasz Napierala + * + * This software was developed by Arshan Khanifar + * 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. + */ + +/* + * Universal Serial Bus Communications Class Subclass Specification + * for Ethernet Emulation Model Devices: + * + * https://usb.org/sites/default/files/CDC_EEM10.pdf + */ + +#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 +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR cdceem_debug +#include +#include +#include +#include "usb_if.h" + +#include + +#define CDCEEM_FRAMES_MAX 1 +#define CDCEEM_ECHO_MAX 1024 + +#define CDCEEM_ECHO_PAYLOAD \ + "ICH DALEKOPIS FALSZUJE GDY PROBY XQV NIE WYTRZYMUJE 1234567890" + +enum { + CDCEEM_BULK_RX, + CDCEEM_BULK_TX, + CDCEEM_N_TRANSFER, +}; + +struct cdceem_softc { + struct usb_ether sc_ue; + struct mtx sc_mtx; + int sc_flags; + struct usb_xfer *sc_xfer[CDCEEM_N_TRANSFER]; + size_t sc_echo_len; + char sc_echo_buffer[CDCEEM_ECHO_MAX]; +}; + +#define CDCEEM_SC_FLAGS_ECHO_RESPONSE_PENDING 0x1 +#define CDCEEM_SC_FLAGS_ECHO_PENDING 0x2 + +static SYSCTL_NODE(_hw_usb, OID_AUTO, cdceem, CTLFLAG_RW, 0, "USB CDC EEM"); +static int cdceem_debug = 1; +SYSCTL_INT(_hw_usb_cdceem, OID_AUTO, debug, CTLFLAG_RWTUN, + &cdceem_debug, 0, "Debug level"); +static int cdceem_send_echoes = 0; +SYSCTL_INT(_hw_usb_cdceem, OID_AUTO, send_echoes, CTLFLAG_RWTUN, + &cdceem_send_echoes, 0, "Send an Echo command"); +static int cdceem_send_fake_crc = 0; +SYSCTL_INT(_hw_usb_cdceem, OID_AUTO, send_fake_crc, CTLFLAG_RWTUN, + &cdceem_send_fake_crc, 0, "Use 0xdeadbeef instead of CRC"); + +#define CDCEEM_DEBUG(S, X, ...) \ + do { \ + if (cdceem_debug > 1) { \ + device_printf(S->sc_ue.ue_dev, "%s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ + } while (0) + +#define CDCEEM_WARN(S, X, ...) \ + do { \ + if (cdceem_debug > 0) { \ + device_printf(S->sc_ue.ue_dev, \ + "WARNING: %s: " X "\n", \ + __func__, ## __VA_ARGS__); \ + } \ + } while (0) + +#define CDCEEM_LOCK(X) mtx_lock(&(X)->sc_mtx) +#define CDCEEM_UNLOCK(X) mtx_unlock(&(X)->sc_mtx) + +#define CDCEEM_TYPE_CMD (0x1 << 15) + +#define CDCEEM_CMD_MASK (0x7 << 11) + +#define CDCEEM_CMD_ECHO (0x0 << 11) +#define CDCEEM_CMD_ECHO_RESPONSE (0x1 << 11) +#define CDCEEM_CMD_SUSPEND_HINT (0x2 << 11) +#define CDCEEM_CMD_RESPONSE_HINT (0x3 << 11) +#define CDCEEM_CMD_RESPONSE_COMPLETE_HINT (0x4 << 11) +#define CDCEEM_CMD_TICKLE (0x5 << 11) + +#define CDCEEM_CMD_RESERVED (0x1 << 14) + +#define CDCEEM_ECHO_LEN_MASK 0x3ff + +#define CDCEEM_DATA_CRC (0x1 << 14) +#define CDCEEM_DATA_LEN_MASK 0x3fff + +static device_probe_t cdceem_probe; +static device_attach_t cdceem_attach; +static device_detach_t cdceem_detach; +static device_suspend_t cdceem_suspend; +static device_resume_t cdceem_resume; + +static usb_callback_t cdceem_bulk_write_callback; +static usb_callback_t cdceem_bulk_read_callback; + +static uether_fn_t cdceem_attach_post; +static uether_fn_t cdceem_init; +static uether_fn_t cdceem_stop; +static uether_fn_t cdceem_start; +static uether_fn_t cdceem_setmulti; +static uether_fn_t cdceem_setpromisc; + +static uint32_t cdceem_m_crc32(struct mbuf *, uint32_t, uint32_t); + +static const struct usb_config cdceem_config[CDCEEM_N_TRANSFER] = { + [CDCEEM_BULK_TX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .bufsize = 16 * (MCLBYTES + 16), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = cdceem_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + .usb_mode = USB_MODE_DUAL, + }, + + [CDCEEM_BULK_RX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .bufsize = 20480, /* bytes */ + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = cdceem_bulk_read_callback, + .timeout = 0, /* no timeout */ + .usb_mode = USB_MODE_DUAL, + }, +}; + +static device_method_t cdceem_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, cdceem_probe), + DEVMETHOD(device_attach, cdceem_attach), + DEVMETHOD(device_detach, cdceem_detach), + DEVMETHOD(device_suspend, cdceem_suspend), + DEVMETHOD(device_resume, cdceem_resume), + + DEVMETHOD_END +}; + +static driver_t cdceem_driver = { + .name = "cdceem", + .methods = cdceem_methods, + .size = sizeof(struct cdceem_softc), +}; + +static devclass_t cdceem_devclass; + +static const STRUCT_USB_DUAL_ID cdceem_dual_devs[] = { + {USB_IFACE_CLASS(UICLASS_CDC), + USB_IFACE_SUBCLASS(UISUBCLASS_ETHERNET_EMULATION_MODEL), + 0}, +}; + +DRIVER_MODULE(cdceem, uhub, cdceem_driver, cdceem_devclass, NULL, NULL); +MODULE_VERSION(cdceem, 1); +MODULE_DEPEND(cdceem, uether, 1, 1, 1); +MODULE_DEPEND(cdceem, usb, 1, 1, 1); +MODULE_DEPEND(cdceem, ether, 1, 1, 1); +USB_PNP_DUAL_INFO(cdceem_dual_devs); + +static const struct usb_ether_methods cdceem_ue_methods = { + .ue_attach_post = cdceem_attach_post, + .ue_start = cdceem_start, + .ue_init = cdceem_init, + .ue_stop = cdceem_stop, + .ue_setmulti = cdceem_setmulti, + .ue_setpromisc = cdceem_setpromisc, +}; + +static int +cdceem_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + int error; + + uaa = device_get_ivars(dev); + error = usbd_lookup_id_by_uaa(cdceem_dual_devs, + sizeof(cdceem_dual_devs), uaa); + + return (error); +} + +static void +cdceem_attach_post(struct usb_ether *ue) +{ + + return; +} + +static int +cdceem_attach(device_t dev) +{ + struct cdceem_softc *sc; + struct usb_ether *ue; + struct usb_attach_arg *uaa; + int error; + uint8_t iface_index; + + sc = device_get_softc(dev); + ue = &sc->sc_ue; + uaa = device_get_ivars(dev); + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + /* Setup the endpoints. */ + iface_index = 0; + error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, + cdceem_config, CDCEEM_N_TRANSFER, sc, &sc->sc_mtx); + if (error != 0) { + CDCEEM_WARN(sc, + "allocating USB transfers failed, error %d", error); + mtx_destroy(&sc->sc_mtx); + return (error); + } + + /* Random MAC address. */ + arc4rand(ue->ue_eaddr, ETHER_ADDR_LEN, 0); + ue->ue_eaddr[0] &= ~0x01; /* unicast */ + ue->ue_eaddr[0] |= 0x02; /* locally administered */ + + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &cdceem_ue_methods; + + error = uether_ifattach(ue); + if (error != 0) { + CDCEEM_WARN(sc, "could not attach interface, error %d", error); + usbd_transfer_unsetup(sc->sc_xfer, CDCEEM_N_TRANSFER); + mtx_destroy(&sc->sc_mtx); + return (error); + } + + return (0); +} + +static int +cdceem_detach(device_t dev) +{ + struct cdceem_softc *sc = device_get_softc(dev); + struct usb_ether *ue = &sc->sc_ue; + + /* Stop all USB transfers first. */ + usbd_transfer_unsetup(sc->sc_xfer, CDCEEM_N_TRANSFER); + uether_ifdetach(ue); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +cdceem_handle_cmd(struct usb_xfer *xfer, uint16_t hdr, int *offp) +{ + struct cdceem_softc *sc; + struct usb_page_cache *pc; + int actlen, off; + uint16_t pktlen; + + off = *offp; + sc = usbd_xfer_softc(xfer); + pc = usbd_xfer_get_frame(xfer, 0); + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + if (hdr & CDCEEM_CMD_RESERVED) { + CDCEEM_WARN(sc, "received command header %#x " + "with Reserved bit set; ignoring", hdr); + return; + } + + switch (hdr & CDCEEM_CMD_MASK) { + case CDCEEM_CMD_ECHO: + pktlen = hdr & CDCEEM_ECHO_LEN_MASK; + CDCEEM_DEBUG(sc, "received Echo, length %d", pktlen); + + if (pktlen > (actlen - off)) { + CDCEEM_WARN(sc, + "bad Echo length %d, should be at most %d", + pktlen, actlen - off); + break; + } + + if (pktlen > sizeof(sc->sc_echo_buffer)) { + CDCEEM_WARN(sc, + "Echo length %u too big, must be less than %zd", + pktlen, sizeof(sc->sc_echo_buffer)); + break; + } + + sc->sc_flags |= CDCEEM_SC_FLAGS_ECHO_RESPONSE_PENDING; + sc->sc_echo_len = pktlen; + usbd_copy_out(pc, off, sc->sc_echo_buffer, pktlen); + off += pktlen; + break; + + case CDCEEM_CMD_ECHO_RESPONSE: + pktlen = hdr & CDCEEM_ECHO_LEN_MASK; + CDCEEM_DEBUG(sc, "received Echo Response, length %d", pktlen); + + if (pktlen > (actlen - off)) { + CDCEEM_WARN(sc, + "bad Echo Response length %d, " + "should be at most %d", + pktlen, actlen - off); + break; + } + + if (pktlen != sizeof(CDCEEM_ECHO_PAYLOAD)) { + CDCEEM_WARN(sc, "received Echo Response with bad " + "length %hu, should be %zd", + pktlen, sizeof(CDCEEM_ECHO_PAYLOAD)); + break; + } + + usbd_copy_out(pc, off, sc->sc_echo_buffer, pktlen); + off += pktlen; + + if (memcmp(sc->sc_echo_buffer, CDCEEM_ECHO_PAYLOAD, + sizeof(CDCEEM_ECHO_PAYLOAD)) != 0) { + CDCEEM_WARN(sc, + "received Echo Response payload does not match"); + } else { + CDCEEM_DEBUG(sc, "received Echo Response is valid"); + } + break; + + case CDCEEM_CMD_SUSPEND_HINT: + CDCEEM_DEBUG(sc, "received SuspendHint; ignoring"); + break; + + case CDCEEM_CMD_RESPONSE_HINT: + CDCEEM_DEBUG(sc, "received ResponseHint; ignoring"); + break; + + case CDCEEM_CMD_RESPONSE_COMPLETE_HINT: + CDCEEM_DEBUG(sc, "received ResponseCompleteHint; ignoring"); + break; + + case CDCEEM_CMD_TICKLE: + CDCEEM_DEBUG(sc, "received Tickle; ignoring"); + break; + + default: + CDCEEM_WARN(sc, + "received unknown command %u, header %#x; ignoring", + (hdr & CDCEEM_CMD_MASK >> 11), hdr); + break; + } + + *offp = off; +} + +static void +cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr, int *offp) +{ + struct cdceem_softc *sc; + struct usb_page_cache *pc; + struct usb_ether *ue; + struct ifnet *ifp; + struct mbuf *m; + int actlen, off; + uint32_t computed_crc, received_crc; + uint16_t pktlen; + + off = *offp; + sc = usbd_xfer_softc(xfer); + pc = usbd_xfer_get_frame(xfer, 0); + ue = &sc->sc_ue; + ifp = uether_getifp(ue); + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + pktlen = hdr & CDCEEM_DATA_LEN_MASK; + CDCEEM_DEBUG(sc, "received Data, CRC %s, length %d", + (hdr & CDCEEM_DATA_CRC) ? "valid" : "absent", + pktlen); + + if (pktlen < ETHER_HDR_LEN) { + CDCEEM_WARN(sc, + "bad ethernet frame length %d, should be at least %d", + pktlen, ETHER_HDR_LEN); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + return; + } + + if (pktlen > (actlen - off)) { + CDCEEM_WARN(sc, + "bad ethernet frame length %d, should be at most %d", + pktlen, actlen - off); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + return; + } + + m = uether_newbuf(); + if (m == NULL) { + CDCEEM_WARN(sc, "uether_newbuf() failed"); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + return; + } + + pktlen -= 4; /* Subtract the CRC. */ + usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); + off += pktlen; + + usbd_copy_out(pc, off, &received_crc, sizeof(received_crc)); + off += sizeof(received_crc); + + if (hdr & CDCEEM_DATA_CRC) { + computed_crc = cdceem_m_crc32(m, 0, pktlen); + } else { + computed_crc = be32toh(0xdeadbeef); + } + + if (received_crc != computed_crc) { + CDCEEM_WARN(sc, + "received Data packet with wrong CRC %#x, expected %#x", + received_crc, computed_crc); + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + m_freem(m); + return; + } else { + CDCEEM_DEBUG(sc, "received correct CRC %#x", received_crc); + } + + uether_rxmbuf(ue, m, pktlen); + *offp = off; +} + +static void +cdceem_bulk_read_callback(struct usb_xfer *xfer, usb_error_t usb_error) +{ + struct cdceem_softc *sc; + struct usb_page_cache *pc; + int actlen, aframes, off; + uint16_t hdr; + + sc = usbd_xfer_softc(xfer); + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + CDCEEM_DEBUG(sc, + "received %u bytes in %u frames", actlen, aframes); + + pc = usbd_xfer_get_frame(xfer, 0); + off = 0; + + while (off < actlen) { + usbd_copy_out(pc, off, &hdr, sizeof(hdr)); + CDCEEM_DEBUG(sc, "hdr = %#x", hdr); + off += sizeof(hdr); + + if (hdr == 0) { + CDCEEM_DEBUG(sc, "received Zero Length EEM"); + continue; + } + + hdr = le16toh(hdr); + + if ((hdr & CDCEEM_TYPE_CMD) != 0) { + cdceem_handle_cmd(xfer, hdr, &off); + } else { + cdceem_handle_data(xfer, hdr, &off); + } + + KASSERT(off <= actlen, + ("%s: went past the buffer, off %d, actlen %d", + __func__, off, actlen)); + } + + /* FALLTHROUGH */ + case USB_ST_SETUP: + CDCEEM_DEBUG(sc, "setup"); +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + uether_rxflush(&sc->sc_ue); + break; + + default: + CDCEEM_WARN(sc, "USB_ST_ERROR: %s", usbd_errstr(usb_error)); + + if (usb_error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static void +cdceem_send_echo(struct usb_xfer *xfer, int *offp) +{ + struct cdceem_softc *sc; + struct usb_page_cache *pc; + int maxlen, off; + uint16_t hdr; + + off = *offp; + sc = usbd_xfer_softc(xfer); + pc = usbd_xfer_get_frame(xfer, 0); + maxlen = usbd_xfer_max_len(xfer); + + CDCEEM_DEBUG(sc, "sending Echo, length %zd", + sizeof(CDCEEM_ECHO_PAYLOAD)); + + KASSERT(off + sizeof(hdr) + sizeof(CDCEEM_ECHO_PAYLOAD) < maxlen, + ("%s: out of space; have %d, need %zd", __func__, maxlen, + off + sizeof(hdr) + sizeof(CDCEEM_ECHO_PAYLOAD))); + + hdr = 0; + hdr |= CDCEEM_TYPE_CMD; + hdr |= CDCEEM_CMD_ECHO; + hdr |= sizeof(CDCEEM_ECHO_PAYLOAD); + CDCEEM_DEBUG(sc, "hdr = %#x", hdr); + hdr = htole16(hdr); + + usbd_copy_in(pc, off, &hdr, sizeof(hdr)); + off += sizeof(hdr); + + usbd_copy_in(pc, off, CDCEEM_ECHO_PAYLOAD, + sizeof(CDCEEM_ECHO_PAYLOAD)); + off += sizeof(CDCEEM_ECHO_PAYLOAD); + + sc->sc_flags &= ~CDCEEM_SC_FLAGS_ECHO_PENDING; + + *offp = off; +} + +static void +cdceem_send_echo_response(struct usb_xfer *xfer, int *offp) +{ + struct cdceem_softc *sc; + struct usb_page_cache *pc; + int maxlen, off; + uint16_t hdr; + + off = *offp; + sc = usbd_xfer_softc(xfer); + pc = usbd_xfer_get_frame(xfer, 0); + maxlen = usbd_xfer_max_len(xfer); + + KASSERT(off + sizeof(hdr) + sc->sc_echo_len < maxlen, + ("%s: out of space; have %d, need %zd", __func__, maxlen, + off + sizeof(hdr) + sc->sc_echo_len)); + + CDCEEM_DEBUG(sc, "sending Echo Response, length %zd", sc->sc_echo_len); + + hdr = 0; + hdr |= CDCEEM_TYPE_CMD; + hdr |= CDCEEM_CMD_ECHO_RESPONSE; + hdr |= sc->sc_echo_len; + CDCEEM_DEBUG(sc, "hdr = %#x", hdr); + hdr = htole16(hdr); + + usbd_copy_in(pc, off, &hdr, sizeof(hdr)); + off += sizeof(hdr); + + usbd_copy_in(pc, off, sc->sc_echo_buffer, sc->sc_echo_len); + off += sc->sc_echo_len; + + sc->sc_flags &= ~CDCEEM_SC_FLAGS_ECHO_RESPONSE_PENDING; + sc->sc_echo_len = 0; + + *offp = off; +} + +static void +cdceem_send_data(struct usb_xfer *xfer, int *offp) +{ + struct cdceem_softc *sc; + struct usb_page_cache *pc; + struct ifnet *ifp; + struct mbuf *m; + int maxlen, off; + uint32_t crc; + uint16_t hdr; + + off = *offp; + sc = usbd_xfer_softc(xfer); + pc = usbd_xfer_get_frame(xfer, 0); + ifp = uether_getifp(&sc->sc_ue); + maxlen = usbd_xfer_max_len(xfer); + + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) { + CDCEEM_DEBUG(sc, "no Data packets to send"); + return; + } + + KASSERT((m->m_pkthdr.len & CDCEEM_DATA_LEN_MASK) == m->m_pkthdr.len, + ("%s: packet too long: %d, should be %d\n", __func__, + m->m_pkthdr.len, m->m_pkthdr.len & CDCEEM_DATA_LEN_MASK)); + KASSERT(off + sizeof(hdr) + m->m_pkthdr.len + 4 < maxlen, + ("%s: out of space; have %d, need %zd", __func__, maxlen, + off + sizeof(hdr) + m->m_pkthdr.len + 4)); + + CDCEEM_DEBUG(sc, "sending Data, length %d + 4", m->m_pkthdr.len); + + hdr = 0; + if (!cdceem_send_fake_crc) + hdr |= CDCEEM_DATA_CRC; + hdr |= (m->m_pkthdr.len + 4); /* +4 for CRC */ + CDCEEM_DEBUG(sc, "hdr = %#x", hdr); + hdr = htole16(hdr); + + usbd_copy_in(pc, off, &hdr, sizeof(hdr)); + off += sizeof(hdr); + + usbd_m_copy_in(pc, off, m, 0, m->m_pkthdr.len); + off += m->m_pkthdr.len; + + if (cdceem_send_fake_crc) { + crc = htobe32(0xdeadbeef); + } else { + crc = cdceem_m_crc32(m, 0, m->m_pkthdr.len); + } + CDCEEM_DEBUG(sc, "CRC = %#x", crc); + + usbd_copy_in(pc, off, &crc, sizeof(crc)); + off += sizeof(crc); + + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + + /* + * If there's a BPF listener, bounce a copy of this frame to it. + */ + BPF_MTAP(ifp, m); + m_freem(m); + + *offp = off; +} + +static void +cdceem_bulk_write_callback(struct usb_xfer *xfer, usb_error_t usb_error) +{ + struct cdceem_softc *sc; + struct ifnet *ifp; + int actlen, aframes, maxlen, off; + + sc = usbd_xfer_softc(xfer); + maxlen = usbd_xfer_max_len(xfer); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + CDCEEM_DEBUG(sc, "transferred %u bytes in %u frames", + actlen, aframes); + + /* FALLTHROUGH */ + case USB_ST_SETUP: + CDCEEM_DEBUG(sc, "setup"); +tr_setup: + + off = 0; + usbd_xfer_set_frame_offset(xfer, 0, 0); + + if (sc->sc_flags & CDCEEM_SC_FLAGS_ECHO_PENDING) { + cdceem_send_echo(xfer, &off); + } else if (sc->sc_flags & CDCEEM_SC_FLAGS_ECHO_RESPONSE_PENDING) { + cdceem_send_echo_response(xfer, &off); + } else { + cdceem_send_data(xfer, &off); + } + + KASSERT(off <= maxlen, + ("%s: went past the buffer, off %d, maxlen %d", + __func__, off, maxlen)); + + if (off > 0) { + CDCEEM_DEBUG(sc, "starting transfer, length %d", off); + usbd_xfer_set_frame_len(xfer, 0, off); + usbd_transfer_submit(xfer); + } else { + CDCEEM_DEBUG(sc, "nothing to transfer"); + } + + break; + + default: + CDCEEM_WARN(sc, "USB_ST_ERROR: %s", usbd_errstr(usb_error)); + + ifp = uether_getifp(&sc->sc_ue); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + + if (usb_error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static int32_t +cdceem_m_crc32_cb(void *arg, void *src, uint32_t count) +{ + uint32_t *p_crc = arg; + + *p_crc = crc32_raw(src, count, *p_crc); + return (0); +} + +static uint32_t +cdceem_m_crc32(struct mbuf *m, uint32_t src_offset, uint32_t src_len) +{ + uint32_t crc = 0xFFFFFFFF; + int error; + + error = m_apply(m, src_offset, src_len, cdceem_m_crc32_cb, &crc); + return (crc ^ 0xFFFFFFFF); +} + +static void +cdceem_start(struct usb_ether *ue) +{ + struct cdceem_softc *sc; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 7 18:16:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84A17B36BB; Wed, 7 Aug 2019 18:16:30 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463fpQ3fJWz46Yp; Wed, 7 Aug 2019 18:16:30 +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 5A469189FE; Wed, 7 Aug 2019 18:16:30 +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 x77IGUb7042537; Wed, 7 Aug 2019 18:16:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77IGTD4042531; Wed, 7 Aug 2019 18:16:29 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908071816.x77IGTD4042531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 7 Aug 2019 18:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350686 - in stable/12/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf modules/rockchip modules/rockchip/rk805 X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf modules/rockchip modules/rockchip/rk805 X-SVN-Commit-Revision: 350686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 18:16:30 -0000 Author: manu Date: Wed Aug 7 18:16:28 2019 New Revision: 350686 URL: https://svnweb.freebsd.org/changeset/base/350686 Log: MFC r341141-r341143, r341255 r341141: rk_clk_composite: Fix set_mux Pointy Hat: manu r341142: Add RK805 PMIC Support RK805 is the companion PMIC for RK3328 SoC. Add a driver for it with most of it's regulators supported. r341143: arm64: Add rk_i2c and rk805 to GENERIC r341255: arm64: rockchip: armclk: Do not change parent freq if CLK_SET_DRYRUN is set Added: stable/12/sys/arm64/rockchip/rk805.c - copied unchanged from r341143, head/sys/arm64/rockchip/rk805.c stable/12/sys/arm64/rockchip/rk805reg.h - copied unchanged from r341143, head/sys/arm64/rockchip/rk805reg.h stable/12/sys/modules/rockchip/rk805/ - copied from r341143, head/sys/modules/rockchip/rk805/ Modified: stable/12/sys/arm64/conf/GENERIC stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.c stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c stable/12/sys/conf/files.arm64 stable/12/sys/modules/rockchip/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Wed Aug 7 18:14:45 2019 (r350685) +++ stable/12/sys/arm64/conf/GENERIC Wed Aug 7 18:16:28 2019 (r350686) @@ -214,6 +214,7 @@ device iicbus device iic device twsi # Allwinner I2C controller device syr827 # Silergy SYR827 PMIC +device rk_i2c # RockChip I2C controller # Clock and reset controllers device aw_ccu # Allwinner clock controller @@ -232,6 +233,7 @@ device aw_wdog # Allwinner Watchdog # Power management controllers device axp81x # X-Powers AXP81x PMIC +device rk805 # RockChip RK805 PMIC # EFUSE device aw_sid # Allwinner Secure ID EFUSE Modified: stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.c ============================================================================== --- stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.c Wed Aug 7 18:14:45 2019 (r350685) +++ stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.c Wed Aug 7 18:16:28 2019 (r350686) @@ -163,17 +163,17 @@ rk_clk_armclk_set_freq(struct clknode *clk, uint64_t f if (rate == sc->nrates) return (0); - err = clknode_set_freq(p_main, best_p, 0, 1); - if (err != 0) - printf("Cannot set %s to %lu\n", - clknode_get_name(p_main), - best_p); - if ((flags & CLK_SET_DRYRUN) != 0) { *fout = best; *stop = 1; return (0); } + + err = clknode_set_freq(p_main, best_p, 0, 1); + if (err != 0) + printf("Cannot set %s to %lu\n", + clknode_get_name(p_main), + best_p); DEVICE_LOCK(clk); READ4(clk, sc->muxdiv_offset, &val); Modified: stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c ============================================================================== --- stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c Wed Aug 7 18:14:45 2019 (r350685) +++ stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c Wed Aug 7 18:16:28 2019 (r350686) @@ -126,7 +126,7 @@ rk_clk_composite_set_mux(struct clknode *clk, int inde DEVICE_LOCK(clk); READ4(clk, sc->muxdiv_offset, &val); - val &= ~(sc->mux_mask >> sc->mux_shift); + val &= ~sc->mux_mask; val |= index << sc->mux_shift; WRITE4(clk, sc->muxdiv_offset, val); DEVICE_UNLOCK(clk); Copied: stable/12/sys/arm64/rockchip/rk805.c (from r341143, head/sys/arm64/rockchip/rk805.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm64/rockchip/rk805.c Wed Aug 7 18:16:28 2019 (r350686, copy of r341143, head/sys/arm64/rockchip/rk805.c) @@ -0,0 +1,422 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include + +#include "regdev_if.h" + +MALLOC_DEFINE(M_RK805_REG, "RK805 regulator", "RK805 power regulator"); + +static struct ofw_compat_data compat_data[] = { + {"rockchip,rk805", 1}, + {NULL, 0} +}; + +struct rk805_regdef { + intptr_t id; + char *name; + uint8_t enable_reg; + uint8_t enable_mask; + uint8_t voltage_reg; + uint8_t voltage_mask; + int voltage_min; + int voltage_max; + int voltage_step; + int voltage_nstep; +}; + +struct rk805_reg_sc { + struct regnode *regnode; + device_t base_dev; + struct rk805_regdef *def; + phandle_t xref; + struct regnode_std_param *param; +}; + +struct rk805_softc { + device_t dev; + struct mtx mtx; + struct resource * res[1]; + void * intrcookie; + struct intr_config_hook intr_hook; + + struct rk805_reg_sc **regs; + int nregs; +}; + +static struct rk805_regdef rk805_regdefs[] = { + { + .id = RK805_DCDC1, + .name = "DCDC_REG1", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x11, + .voltage_reg = RK805_DCDC1_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 712500, + .voltage_max = 1450000, + .voltage_step = 12500, + .voltage_nstep = 64, + }, + { + .id = RK805_DCDC2, + .name = "DCDC_REG2", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x22, + .voltage_reg = RK805_DCDC2_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 712500, + .voltage_max = 1450000, + .voltage_step = 12500, + .voltage_nstep = 64, + }, + { + .id = RK805_DCDC3, + .name = "DCDC_REG3", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x44, + }, + { + .id = RK805_DCDC4, + .name = "DCDC_REG4", + .enable_reg = RK805_DCDC_EN, + .enable_mask = 0x88, + .voltage_reg = RK805_DCDC4_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 800000, + .voltage_max = 3500000, + .voltage_step = 100000, + .voltage_nstep = 28, + }, +}; + +static int +rk805_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +{ + + return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT)); +} + +static int +rk805_write(device_t dev, uint8_t reg, uint8_t data) +{ + struct iic_msg msg; + uint8_t buf[2]; + + buf[0] = reg; + buf[1] = data; + msg.slave = iicbus_get_addr(dev); + msg.flags = IIC_M_WR; + msg.buf = buf; + msg.len = sizeof(buf); + + return (iicbus_transfer_excl(dev, &msg, 1, IIC_INTRWAIT)); +} + +static int +rk805_regnode_init(struct regnode *regnode) +{ + return (0); +} + +static int +rk805_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct rk805_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + rk805_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (enable) + val |= sc->def->enable_mask; + else + val &= ~sc->def->enable_mask; + rk805_write(sc->base_dev, sc->def->enable_reg, val); + + *udelay = 0; + + return (0); +} + +static void +rk805_regnode_reg_to_voltage(struct rk805_reg_sc *sc, uint8_t val, int *uv) +{ + if (val < sc->def->voltage_nstep) + *uv = sc->def->voltage_min + val * sc->def->voltage_step; + else + *uv = sc->def->voltage_min + + (sc->def->voltage_nstep * sc->def->voltage_step); +} + +static int +rk805_regnode_voltage_to_reg(struct rk805_reg_sc *sc, int min_uvolt, + int max_uvolt, uint8_t *val) +{ + uint8_t nval; + int nstep, uvolt; + + nval = 0; + uvolt = sc->def->voltage_min; + + for (nstep = 0; nstep < sc->def->voltage_nstep && uvolt < min_uvolt; + nstep++) { + ++nval; + uvolt += sc->def->voltage_step; + } + if (uvolt > max_uvolt) + return (EINVAL); + + *val = nval; + return (0); +} + +static int +rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + struct rk805_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + if (rk805_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) + return (ERANGE); + + rk805_write(sc->base_dev, sc->def->voltage_reg, val); + + *udelay = 0; + + return (0); +} + +static int +rk805_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct rk805_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + rk805_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); + + return (0); +} + +static regnode_method_t rk805_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, rk805_regnode_init), + REGNODEMETHOD(regnode_enable, rk805_regnode_enable), + REGNODEMETHOD(regnode_set_voltage, rk805_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, rk805_regnode_get_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(rk805_regnode, rk805_regnode_class, rk805_regnode_methods, + sizeof(struct rk805_reg_sc), regnode_class); + +static struct rk805_reg_sc * +rk805_reg_attach(device_t dev, phandle_t node, + struct rk805_regdef *def) +{ + struct rk805_reg_sc *reg_sc; + struct regnode_init_def initdef; + struct regnode *regnode; + + memset(&initdef, 0, sizeof(initdef)); + if (regulator_parse_ofw_stdparam(dev, node, &initdef) != 0) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + if (initdef.std_param.min_uvolt == 0) + initdef.std_param.min_uvolt = def->voltage_min; + if (initdef.std_param.max_uvolt == 0) + initdef.std_param.max_uvolt = def->voltage_max; + initdef.id = def->id; + initdef.ofw_node = node; + regnode = regnode_create(dev, &rk805_regnode_class, &initdef); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + + reg_sc = regnode_get_softc(regnode); + reg_sc->regnode = regnode; + reg_sc->base_dev = dev; + reg_sc->def = def; + reg_sc->xref = OF_xref_from_node(node); + reg_sc->param = regnode_get_stdparam(regnode); + + regnode_register(regnode); + + return (reg_sc); +} + +static int +rk805_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "RockChip RK805 PMIC"); + return (BUS_PROBE_DEFAULT); +} + +static void +rk805_start(void *pdev) +{ + struct rk805_softc *sc; + device_t dev; + uint8_t data[2]; + int err; + + dev = pdev; + sc = device_get_softc(dev); + sc->dev = dev; + + if (bootverbose) { + err = rk805_read(dev, 0x17, data, 1); + if (err != 0) { + device_printf(dev, "Cannot read chip name reg\n"); + return; + } + err = rk805_read(dev, 0x18, data + 1, 1); + if (err != 0) { + device_printf(dev, "Cannot read chip version reg\n"); + return; + } + device_printf(dev, "Chip Name: %x\n", + data[0] << 4 | ((data[1] >> 4) & 0xf)); + device_printf(dev, "Chip Version: %x\n", data[1] & 0xf); + } + + config_intrhook_disestablish(&sc->intr_hook); +} + +static int +rk805_attach(device_t dev) +{ + struct rk805_softc *sc; + struct rk805_reg_sc *reg; + struct rk805_regdef *regdefs; + phandle_t rnode, child; + int i; + + sc = device_get_softc(dev); + + sc->intr_hook.ich_func = rk805_start; + sc->intr_hook.ich_arg = dev; + + if (config_intrhook_establish(&sc->intr_hook) != 0) + return (ENOMEM); + + sc->regs = malloc(sizeof(struct rk805_reg_sc *) * sc->nregs, + M_RK805_REG, M_WAITOK | M_ZERO); + + regdefs = rk805_regdefs; + sc->nregs = nitems(rk805_regdefs); + + rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); + if (rnode > 0) { + for (i = 0; i < sc->nregs; i++) { + child = ofw_bus_find_child(rnode, + regdefs[i].name); + if (child == 0) + continue; + reg = rk805_reg_attach(dev, child, ®defs[i]); + if (reg == NULL) { + device_printf(dev, + "cannot attach regulator %s\n", + regdefs[i].name); + continue; + } + sc->regs[i] = reg; + if (bootverbose) + device_printf(dev, "Regulator %s attached\n", + regdefs[i].name); + } + } + + return (0); +} + +static int +rk805_detach(device_t dev) +{ + + /* We cannot detach regulators */ + return (EBUSY); +} + +static device_method_t rk805_methods[] = { + DEVMETHOD(device_probe, rk805_probe), + DEVMETHOD(device_attach, rk805_attach), + DEVMETHOD(device_detach, rk805_detach), + + DEVMETHOD_END +}; + +static driver_t rk805_driver = { + "rk805_pmu", + rk805_methods, + sizeof(struct rk805_softc), +}; + +static devclass_t rk805_devclass; + +EARLY_DRIVER_MODULE(rk805, iicbus, rk805_driver, rk805_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +MODULE_DEPEND(rk805, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(rk805, 1); Copied: stable/12/sys/arm64/rockchip/rk805reg.h (from r341143, head/sys/arm64/rockchip/rk805reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm64/rockchip/rk805reg.h Wed Aug 7 18:16:28 2019 (r350686, copy of r341143, head/sys/arm64/rockchip/rk805reg.h) @@ -0,0 +1,72 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#ifndef _RK805REG_H_ +#define _RK805REG_H_ + +#define RK805_CHIP_NAME 0x17 +#define RK805_CHIP_VER 0x18 +#define RK805_OTP_VER 0x19 + +#define RK805_DCDC_EN 0x23 +#define RK805_SLEEP_DCDC_EN 0x25 +#define RK805_SLEEP_LDO_EN 0x26 +#define RK805_LDO_EN 0x27 +#define RK805_SLEEP_LDO_LP_EN 0x2A + +#define RK805_DCDC1_CONFIG 0x2E +#define RK805_DCDC1_ON_VSEL 0x2F +#define RK805_DCDC1_SLEEP_VSEL 0x30 +#define RK805_DCDC2_CONFIG 0x32 +#define RK805_DCDC2_ON_VSEL 0x33 +#define RK805_DCDC2_SLEEP_VSEL 0x34 +#define RK805_DCDC3_CONFIG 0x36 +#define RK805_DCDC4_CONFIG 0x37 +#define RK805_DCDC4_ON_VSEL 0x38 +#define RK805_DCDC4_SLEEP_VSEL 0x39 +#define RK805_LDO1_ON_VSEL 0x3B +#define RK805_LDO1_SLEEP_VSEL 0x3C +#define RK805_LDO2_ON_VSEL 0x3D +#define RK805_LDO2_SLEEP_VSEL 0x3E +#define RK805_LDO3_ON_VSEL 0x3F +#define RK805_LDO3_SLEEP_VSEL 0x40 + +enum rk805_regulator { + RK805_DCDC1, + RK805_DCDC2, + RK805_DCDC3, + RK805_DCDC4, + RK805_LDO1, + RK805_LDO2, + RK805_LDO3, +}; + +#endif /* _RK805REG_H_ */ Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Wed Aug 7 18:14:45 2019 (r350685) +++ stable/12/sys/conf/files.arm64 Wed Aug 7 18:16:28 2019 (r350686) @@ -269,6 +269,7 @@ cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrac cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" arm64/rockchip/rk_i2c.c optional rk_i2c fdt soc_rockchip_rk3328 +arm64/rockchip/rk805.c optional rk805 fdt soc_rockchip_rk3328 arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 arm64/rockchip/rk_pinctrl.c optional fdt soc_rockchip_rk3328 arm64/rockchip/rk_gpio.c optional fdt soc_rockchip_rk3328 Modified: stable/12/sys/modules/rockchip/Makefile ============================================================================== --- stable/12/sys/modules/rockchip/Makefile Wed Aug 7 18:14:45 2019 (r350685) +++ stable/12/sys/modules/rockchip/Makefile Wed Aug 7 18:16:28 2019 (r350686) @@ -3,5 +3,6 @@ SUBDIR = \ rk_i2c \ + rk805 .include From owner-svn-src-all@freebsd.org Wed Aug 7 18:26:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29A0BB3900; Wed, 7 Aug 2019 18:26:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463g2113zpz46yb; Wed, 7 Aug 2019 18:26:33 +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 071A618BBF; Wed, 7 Aug 2019 18:26:33 +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 x77IQXIu048160; Wed, 7 Aug 2019 18:26:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77IQW1A048156; Wed, 7 Aug 2019 18:26:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908071826.x77IQW1A048156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 7 Aug 2019 18:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350687 - in stable/12/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf dev/mmc/host X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm64/conf arm64/rockchip arm64/rockchip/clk conf dev/mmc/host X-SVN-Commit-Revision: 350687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 18:26:33 -0000 Author: manu Date: Wed Aug 7 18:26:32 2019 New Revision: 350687 URL: https://svnweb.freebsd.org/changeset/base/350687 Log: MFC r341381-r341383, r341385, r343950, r344527, r344576-r344580, r344585, r344589-r344590, r344623, r344626-r344627 r341381: arm64: rockchip: Add RK3399_CLK_PLL PLLs on the RK3399 are different than the ones on the RK3328. Add a new type and some dedicated recalc and set_freq functions. Rename the RK3328 dedicated rk_clk_pll function with rk3328_ prefix. r341382: arm64/rockchip: add RK3399 support Add CRU (Clock and Reset Unit) driver for RK3399. Add support in rk_pinctrl driver. Submitted by: Greg V (Original version) Differential Revision: https://reviews.freebsd.org/D16732 r341383: arm64: rockchip: rk_i2c: Use correct clock While here add RK3399 support and call clk_set_assigned to set the correct clock set in the DTS. r341385: arm64: rockchip: rk805: Add basic support for RK808 PMIC RK808 PMIC is the companion chip for RK3399 SoC. Add basic regulator support in RK805 since they are similar. r343950: arm64: Fix compile when removing SOC_ROCKCHIP_* options Make every rockchip file depend on the multiple soc_rockchip options While here make rk_i2c and rk_gpio depend on their device options. Reported by: sbruno r344527: arm64: rockchip: clk: Set the write mask when setting the clock mux RockChip clocks have a write mask in the upper 16bits of the mux register which wasn't set in the set_mux function. Also the wrong parent was tested instead of the real current one, when switch parent, test with the current one before. Pointy Hat: manu r344576: arm64: rockchip: clk: rk_clk_composite: Properly use the mask bits RockChip clocks register have a write mask in the upper 16 bits, if a 1 is present the corresponding bit in the lower 16 ones is set. Use this instead of always setting the mask to 0xFFFF0000. This avoids a read of the register. While here add some debug printf useful for debuging clock problems r344577: arm64: rockchip: clk: ARM CLK improvement RockChip clocks register have a write mask in the upper 16 bits, if a 1 is present the corresponding bit in the lower 16 ones is set. Use this instead of always setting the mask to 0xFFFF0000. This avoids a read of the register. While here set the parent after changing its freqeuncy, this reduce the time between changing the parent and changing the divider for the arm clock. r344578: arm64: rockchip: rk3328_pll: Multiple improvement RockChip clocks register have a write mask in the upper 16 bits, if a 1 is present the corresponding bit in the lower 16 ones is set. Use this instead of always setting the mask to 0xFFFF0000. This avoids a read of the register. While here, when switching PLL frequency, first switch it to slow mode. When set to slow mode the PLL clock will be the external oscillator. Changing the PLL parameters while its output is used can cause hang (sometimes). r344579: arm64: rockchip: rk805: Add LDO regulators Add the 3 LDO regulator found in the RK805 Power Management IC. r344580: arm64: rockchip: rk805: Map the regulator No map function was provided before so every regulator lookup resolved the regulator with id 1, as it uses the default mapper, which is wrong. Correctly map the regulators. While here remove some debug printfs and make them disable by default. r344585: arm64: rockchip: rk_pinctrl: Fix two banks in RK3328 The last two banks don't have 3 bits for the pin function but only 2. This fixes eMMC on the Rock64. r344589: arm64: rockchip: rk3399_pll: Switch to slow mode when changing the freq Like r344578 but for RK3399. This solve some hangs when switching between frequency. r344590: arm64: rockchip: rk3399_pll: Fix copy paste RK3399 PLLs don't have mode_reg, use the correct register. r344623: arm64: rockchip: clk_pll: Multiple improvement Remove the mode_val from the clock definition as it's a bit unreadable. Use mode_shift to represent which bit control the mode in the register. Simplify some case where we can avoid a register read before changing it. Set the PLL back to normal mode after the PLL have stabilized. Discussed with: mmel r344626: arm64: rockchip: rk3399_clk: Add sd clock definitions r344627: mmc: dwmmc: Match on "rockchip,rk3288-dw-mshc" compatible This is the common denominator for rockchip compatible from RK3288 to RK3399. The other compatible are generally present in the DTS but the controllers are the same. Added: stable/12/sys/arm64/rockchip/clk/rk3399_cru.c - copied, changed from r341383, head/sys/arm64/rockchip/clk/rk3399_cru.c stable/12/sys/arm64/rockchip/clk/rk3399_pmucru.c - copied unchanged from r341383, head/sys/arm64/rockchip/clk/rk3399_pmucru.c Modified: stable/12/sys/arm64/conf/GENERIC stable/12/sys/arm64/rockchip/clk/rk3328_cru.c stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.c stable/12/sys/arm64/rockchip/clk/rk_clk_armclk.h stable/12/sys/arm64/rockchip/clk/rk_clk_composite.c stable/12/sys/arm64/rockchip/clk/rk_clk_composite.h stable/12/sys/arm64/rockchip/clk/rk_clk_pll.c stable/12/sys/arm64/rockchip/clk/rk_clk_pll.h stable/12/sys/arm64/rockchip/clk/rk_cru.c stable/12/sys/arm64/rockchip/clk/rk_cru.h stable/12/sys/arm64/rockchip/if_dwc_rk.c stable/12/sys/arm64/rockchip/rk805.c stable/12/sys/arm64/rockchip/rk805reg.h stable/12/sys/arm64/rockchip/rk_grf.c stable/12/sys/arm64/rockchip/rk_i2c.c stable/12/sys/arm64/rockchip/rk_pinctrl.c stable/12/sys/conf/files.arm64 stable/12/sys/conf/options.arm64 stable/12/sys/dev/mmc/host/dwmmc_rockchip.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Wed Aug 7 18:16:28 2019 (r350686) +++ stable/12/sys/arm64/conf/GENERIC Wed Aug 7 18:26:32 2019 (r350687) @@ -95,6 +95,7 @@ options SOC_HISI_HI6220 options SOC_BRCM_BCM2837 options SOC_MARVELL_8K options SOC_ROCKCHIP_RK3328 +options SOC_ROCKCHIP_RK3399 options SOC_XILINX_ZYNQ # Timer drivers @@ -206,6 +207,8 @@ device fdt_pinctrl device gpioregulator device mv_gpio # Marvell GPIO controller device mvebu_pinctrl # Marvell Pinmux Controller +device rk_gpio # RockChip GPIO Controller +device rk_pinctrl # RockChip Pinmux Controller # I2C device aw_rsb # Allwinner Reduced Serial Bus Modified: stable/12/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- stable/12/sys/arm64/rockchip/clk/rk3328_cru.c Wed Aug 7 18:16:28 2019 (r350686) +++ stable/12/sys/arm64/rockchip/clk/rk3328_cru.c Wed Aug 7 18:26:32 2019 (r350687) @@ -523,7 +523,7 @@ static struct rk_clk_pll_def apll = { .gate_offset = 0x200, .gate_shift = 0, .mode_reg = 0x80, - .mode_val = 0x1, + .mode_shift = 1, .flags = RK_CLK_PLL_HAVE_GATE, .frac_rates = rk3328_pll_frac_rates, }; @@ -539,7 +539,7 @@ static struct rk_clk_pll_def dpll = { .gate_offset = 0x200, .gate_shift = 1, .mode_reg = 0x80, - .mode_val = 0x8, + .mode_shift = 4, .flags = RK_CLK_PLL_HAVE_GATE, }; @@ -552,7 +552,7 @@ static struct rk_clk_pll_def cpll = { }, .base_offset = 0x40, .mode_reg = 0x80, - .mode_val = 0x80, + .mode_shift = 8, .rates = rk3328_pll_rates, }; @@ -567,7 +567,7 @@ static struct rk_clk_pll_def gpll = { .gate_offset = 0x200, .gate_shift = 2, .mode_reg = 0x80, - .mode_val = 0x800, + .mode_shift = 12, .flags = RK_CLK_PLL_HAVE_GATE, .frac_rates = rk3328_pll_frac_rates, }; @@ -583,7 +583,7 @@ static struct rk_clk_pll_def npll = { .gate_offset = 0x200, .gate_shift = 12, .mode_reg = 0x80, - .mode_val = 0x2, + .mode_shift = 1, .flags = RK_CLK_PLL_HAVE_GATE, .rates = rk3328_pll_rates, }; @@ -973,23 +973,23 @@ static struct rk_clk_composite_def i2c3 = { static struct rk_clk rk3328_clks[] = { { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &apll }, { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &dpll }, { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &cpll }, { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &gpll }, { - .type = RK_CLK_PLL, + .type = RK3328_CLK_PLL, .clk.pll = &npll }, Copied and modified: stable/12/sys/arm64/rockchip/clk/rk3399_cru.c (from r341383, head/sys/arm64/rockchip/clk/rk3399_cru.c) ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_cru.c Sat Dec 1 20:29:42 2018 (r341383, copy source) +++ stable/12/sys/arm64/rockchip/clk/rk3399_cru.c Wed Aug 7 18:26:32 2019 (r350687) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #define PCLK_I2C5 344 #define PCLK_I2C6 345 #define PCLK_I2C7 346 +#define HCLK_SDMMC 462 static struct rk_cru_gate rk3399_gates[] = { /* CRU_CLKGATE_CON0 */ @@ -99,6 +100,9 @@ static struct rk_cru_gate rk3399_gates[] = { CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_alive", 0x37c, 3) CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive", 0x37c, 4) CRU_GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive", 0x37c, 5) + + /* CRU_CLKGATE_CON33 */ + CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 0x384, 8) }; @@ -1385,6 +1389,60 @@ static struct rk_clk_armclk_def armclk_b = { .nrates = nitems(rk3399_armclkb_rates), }; +/* + * sdmmc + */ + +#define HCLK_SD 461 + +static const char *hclk_sd_parents[] = {"cpll", "gpll"}; + +static struct rk_clk_composite_def hclk_sd = { + .clkdef = { + .id = HCLK_SD, + .name = "hclk_sd", + .parent_names = hclk_sd_parents, + .parent_cnt = nitems(hclk_sd_parents), + }, + + .muxdiv_offset = 0x134, + .mux_shift = 15, + .mux_width = 1, + + .div_shift = 8, + .div_width = 5, + + .gate_offset = 0x330, + .gate_shift = 13, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +#define SCLK_SDMMC 76 + +static const char *sclk_sdmmc_parents[] = {"cpll", "gpll", "npll", "ppll"}; + +static struct rk_clk_composite_def sclk_sdmmc = { + .clkdef = { + .id = SCLK_SDMMC, + .name = "sclk_sdmmc", + .parent_names = sclk_sdmmc_parents, + .parent_cnt = nitems(sclk_sdmmc_parents), + }, + + .muxdiv_offset = 0x140, + .mux_shift = 8, + .mux_width = 3, + + .div_shift = 0, + .div_width = 7, + + .gate_offset = 0x318, + .gate_shift = 1, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + static struct rk_clk rk3399_clks[] = { { .type = RK3399_CLK_PLL, @@ -1483,6 +1541,15 @@ static struct rk_clk rk3399_clks[] = { { .type = RK_CLK_ARMCLK, .clk.armclk = &armclk_b, + }, + + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &hclk_sd, + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &sclk_sdmmc, }, }; Copied: stable/12/sys/arm64/rockchip/clk/rk3399_pmucru.c (from r341383, head/sys/arm64/rockchip/clk/rk3399_pmucru.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm64/rockchip/clk/rk3399_pmucru.c Wed Aug 7 18:26:32 2019 (r350687, copy of r341383, head/sys/arm64/rockchip/clk/rk3399_pmucru.c) @@ -0,0 +1,866 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot + * Copyright (c) 2018 Greg V + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include + +/* GATES */ + +#define PCLK_PMU 20 +#define PCLK_GPIO0_PMU 23 +#define PCLK_GPIO1_PMU 24 +#define PCLK_I2C0_PMU 27 +#define PCLK_I2C4_PMU 28 +#define PCLK_I2C8_PMU 29 + +static struct rk_cru_gate rk3399_pmu_gates[] = { + /* PMUCRU_CLKGATE_CON1 */ + CRU_GATE(PCLK_PMU, "pclk_pmu", "pclk_pmu_src", 0x104, 0) + CRU_GATE(PCLK_GPIO0_PMU, "pclk_gpio0_pmu", "pclk_pmu_src", 0x104, 3) + CRU_GATE(PCLK_GPIO1_PMU, "pclk_gpio1_pmu", "pclk_pmu_src", 0x104, 4) + CRU_GATE(PCLK_I2C0_PMU, "pclk_i2c0_pmu", "pclk_pmu_src", 0x104, 7) + CRU_GATE(PCLK_I2C4_PMU, "pclk_i2c4_pmu", "pclk_pmu_src", 0x104, 8) + CRU_GATE(PCLK_I2C8_PMU, "pclk_i2c8_pmu", "pclk_pmu_src", 0x104, 9) +}; + + +/* + * PLLs + */ + +#define PLL_PPLL 1 + +static struct rk_clk_pll_rate rk3399_pll_rates[] = { + { + .freq = 2208000000, + .refdiv = 1, + .fbdiv = 92, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2184000000, + .refdiv = 1, + .fbdiv = 91, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2160000000, + .refdiv = 1, + .fbdiv = 90, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2136000000, + .refdiv = 1, + .fbdiv = 89, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2112000000, + .refdiv = 1, + .fbdiv = 88, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2088000000, + .refdiv = 1, + .fbdiv = 87, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2064000000, + .refdiv = 1, + .fbdiv = 86, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2040000000, + .refdiv = 1, + .fbdiv = 85, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 2016000000, + .refdiv = 1, + .fbdiv = 84, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1992000000, + .refdiv = 1, + .fbdiv = 83, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1968000000, + .refdiv = 1, + .fbdiv = 82, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1944000000, + .refdiv = 1, + .fbdiv = 81, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1920000000, + .refdiv = 1, + .fbdiv = 80, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1896000000, + .refdiv = 1, + .fbdiv = 79, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1872000000, + .refdiv = 1, + .fbdiv = 78, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1848000000, + .refdiv = 1, + .fbdiv = 77, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1824000000, + .refdiv = 1, + .fbdiv = 76, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1800000000, + .refdiv = 1, + .fbdiv = 75, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1776000000, + .refdiv = 1, + .fbdiv = 74, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1752000000, + .refdiv = 1, + .fbdiv = 73, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1728000000, + .refdiv = 1, + .fbdiv = 72, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1704000000, + .refdiv = 1, + .fbdiv = 71, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1680000000, + .refdiv = 1, + .fbdiv = 70, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1656000000, + .refdiv = 1, + .fbdiv = 69, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1632000000, + .refdiv = 1, + .fbdiv = 68, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1608000000, + .refdiv = 1, + .fbdiv = 67, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1600000000, + .refdiv = 3, + .fbdiv = 200, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1584000000, + .refdiv = 1, + .fbdiv = 66, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1560000000, + .refdiv = 1, + .fbdiv = 65, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1536000000, + .refdiv = 1, + .fbdiv = 64, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1512000000, + .refdiv = 1, + .fbdiv = 63, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1488000000, + .refdiv = 1, + .fbdiv = 62, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1464000000, + .refdiv = 1, + .fbdiv = 61, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1440000000, + .refdiv = 1, + .fbdiv = 60, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1416000000, + .refdiv = 1, + .fbdiv = 59, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1392000000, + .refdiv = 1, + .fbdiv = 58, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1368000000, + .refdiv = 1, + .fbdiv = 57, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1344000000, + .refdiv = 1, + .fbdiv = 56, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1320000000, + .refdiv = 1, + .fbdiv = 55, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1296000000, + .refdiv = 1, + .fbdiv = 54, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1272000000, + .refdiv = 1, + .fbdiv = 53, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1248000000, + .refdiv = 1, + .fbdiv = 52, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1200000000, + .refdiv = 1, + .fbdiv = 50, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1188000000, + .refdiv = 2, + .fbdiv = 99, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1104000000, + .refdiv = 1, + .fbdiv = 46, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1100000000, + .refdiv = 12, + .fbdiv = 550, + .postdiv1 = 1, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1008000000, + .refdiv = 1, + .fbdiv = 84, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 1000000000, + .refdiv = 1, + .fbdiv = 125, + .postdiv1 = 3, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 984000000, + .refdiv = 1, + .fbdiv = 82, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 960000000, + .refdiv = 1, + .fbdiv = 80, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 936000000, + .refdiv = 1, + .fbdiv = 78, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 912000000, + .refdiv = 1, + .fbdiv = 76, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 900000000, + .refdiv = 4, + .fbdiv = 300, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 888000000, + .refdiv = 1, + .fbdiv = 74, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 864000000, + .refdiv = 1, + .fbdiv = 72, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 840000000, + .refdiv = 1, + .fbdiv = 70, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 816000000, + .refdiv = 1, + .fbdiv = 68, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 800000000, + .refdiv = 1, + .fbdiv = 100, + .postdiv1 = 3, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 700000000, + .refdiv = 6, + .fbdiv = 350, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 696000000, + .refdiv = 1, + .fbdiv = 58, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 676000000, + .refdiv = 3, + .fbdiv = 169, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 600000000, + .refdiv = 1, + .fbdiv = 75, + .postdiv1 = 3, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 594000000, + .refdiv = 1, + .fbdiv = 99, + .postdiv1 = 4, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 533250000, + .refdiv = 8, + .fbdiv = 711, + .postdiv1 = 4, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 504000000, + .refdiv = 1, + .fbdiv = 63, + .postdiv1 = 3, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 500000000, + .refdiv = 6, + .fbdiv = 250, + .postdiv1 = 2, + .postdiv2 = 1, + .dsmpd = 1, + }, + { + .freq = 408000000, + .refdiv = 1, + .fbdiv = 68, + .postdiv1 = 2, + .postdiv2 = 2, + .dsmpd = 1, + }, + { + .freq = 312000000, + .refdiv = 1, + .fbdiv = 52, + .postdiv1 = 2, + .postdiv2 = 2, + .dsmpd = 1, + }, + { + .freq = 297000000, + .refdiv = 1, + .fbdiv = 99, + .postdiv1 = 4, + .postdiv2 = 2, + .dsmpd = 1, + }, + { + .freq = 216000000, + .refdiv = 1, + .fbdiv = 72, + .postdiv1 = 4, + .postdiv2 = 2, + .dsmpd = 1, + }, + { + .freq = 148500000, + .refdiv = 1, + .fbdiv = 99, + .postdiv1 = 4, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 106500000, + .refdiv = 1, + .fbdiv = 71, + .postdiv1 = 4, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 96000000, + .refdiv = 1, + .fbdiv = 64, + .postdiv1 = 4, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 74250000, + .refdiv = 2, + .fbdiv = 99, + .postdiv1 = 4, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 65000000, + .refdiv = 1, + .fbdiv = 65, + .postdiv1 = 6, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 54000000, + .refdiv = 1, + .fbdiv = 54, + .postdiv1 = 6, + .postdiv2 = 4, + .dsmpd = 1, + }, + { + .freq = 27000000, + .refdiv = 1, + .fbdiv = 27, + .postdiv1 = 6, + .postdiv2 = 4, + .dsmpd = 1, + }, + {}, +}; + +static const char *pll_parents[] = {"xin24m"}; + +static struct rk_clk_pll_def ppll = { + .clkdef = { + .id = PLL_PPLL, + .name = "ppll", + .parent_names = pll_parents, + .parent_cnt = nitems(pll_parents), + }, + .base_offset = 0x00, + + .rates = rk3399_pll_rates, +}; + +static const char *pmu_parents[] = {"ppll"}; + +#define PCLK_PMU_SRC 19 + +static struct rk_clk_composite_def pclk_pmu_src = { + .clkdef = { + .id = PCLK_PMU_SRC, + .name = "pclk_pmu_src", + .parent_names = pmu_parents, + .parent_cnt = nitems(pmu_parents), + }, + /* PMUCRU_CLKSEL_CON0 */ + .muxdiv_offset = 0x80, + + .div_shift = 0, + .div_width = 5, +}; + + +#define SCLK_I2C0_PMU 9 +#define SCLK_I2C4_PMU 10 +#define SCLK_I2C8_PMU 11 + +static struct rk_clk_composite_def i2c0 = { + .clkdef = { + .id = SCLK_I2C0_PMU, + .name = "clk_i2c0_pmu", + .parent_names = pmu_parents, + .parent_cnt = nitems(pmu_parents), + }, + /* PMUCRU_CLKSEL_CON2 */ + .muxdiv_offset = 0x88, + + .div_shift = 0, + .div_width = 7, + + /* PMUCRU_CLKGATE_CON0 */ + .gate_offset = 0x100, + .gate_shift = 9, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk_composite_def i2c8 = { + .clkdef = { + .id = SCLK_I2C8_PMU, + .name = "clk_i2c8_pmu", + .parent_names = pmu_parents, + .parent_cnt = nitems(pmu_parents), + }, + /* PMUCRU_CLKSEL_CON2 */ + .muxdiv_offset = 0x88, + + .div_shift = 8, + .div_width = 7, + + /* PMUCRU_CLKGATE_CON0 */ + .gate_offset = 0x100, + .gate_shift = 11, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk_composite_def i2c4 = { + .clkdef = { + .id = SCLK_I2C4_PMU, + .name = "clk_i2c4_pmu", + .parent_names = pmu_parents, + .parent_cnt = nitems(pmu_parents), + }, + /* PMUCRU_CLKSEL_CON3 */ + .muxdiv_offset = 0x8c, + + .div_shift = 0, + .div_width = 7, + + /* PMUCRU_CLKGATE_CON0 */ + .gate_offset = 0x100, + .gate_shift = 10, + + .flags = RK_CLK_COMPOSITE_HAVE_GATE, +}; + +static struct rk_clk rk3399_pmu_clks[] = { + { + .type = RK3399_CLK_PLL, + .clk.pll = &ppll + }, + + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &pclk_pmu_src + }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 7 18:32:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4060B3CAE; Wed, 7 Aug 2019 18:32:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463g8K4Lzvz47YP; Wed, 7 Aug 2019 18:32:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7708918C6D; Wed, 7 Aug 2019 18:32:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77IW1dp053162; Wed, 7 Aug 2019 18:32:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77IW1Xa053161; Wed, 7 Aug 2019 18:32:01 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201908071832.x77IW1Xa053161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 7 Aug 2019 18:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350688 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 350688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 18:32:01 -0000 Author: glebius Date: Wed Aug 7 18:32:01 2019 New Revision: 350688 URL: https://svnweb.freebsd.org/changeset/base/350688 Log: resource.h is sufficient here, no need for resoursevar.h. Modified: head/usr.bin/procstat/procstat_rlimit.c Modified: head/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- head/usr.bin/procstat/procstat_rlimit.c Wed Aug 7 18:26:32 2019 (r350687) +++ head/usr.bin/procstat/procstat_rlimit.c Wed Aug 7 18:32:01 2019 (r350688) @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include From owner-svn-src-all@freebsd.org Wed Aug 7 18:36:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25751B3E9A; Wed, 7 Aug 2019 18:36:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463gDx0G29z47tj; Wed, 7 Aug 2019 18:36: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 DA41F18DBE; Wed, 7 Aug 2019 18:36:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77Ia0PG054341; Wed, 7 Aug 2019 18:36:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77IZxP0054333; Wed, 7 Aug 2019 18:35:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908071835.x77IZxP0054333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 7 Aug 2019 18:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350689 - in stable/12/sys: arm64/conf arm64/rockchip/clk modules/dtb/rockchip X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm64/conf arm64/rockchip/clk modules/dtb/rockchip X-SVN-Commit-Revision: 350689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 18:36:01 -0000 Author: manu Date: Wed Aug 7 18:35:59 2019 New Revision: 350689 URL: https://svnweb.freebsd.org/changeset/base/350689 Log: MFC r341404-r341405, r344699, r347024, r347442 r341404 by andreast: Add rule to build the dtb for the rock64 board. Reviewed by: manu@ r341405 by andreast: Build the dtb for the rock64 board. Reviewed by: manu@ r344699: arm64: rockchip: rk3399_pll: Fix the recalc function The plls frequency are now correctly calculated in fractional mode and integer mode. While here add some debug printfs (disabled by default) Tested with powerd on the little cluster on a RockPro64. r347024: dtb: Include RK3399 RockPro64 DTS in kernel build The DTS for this board is already present in sys/gnu/dts/arm64/rockchip/ and just needs to be enabled. Submitted by: alex@wied.io Differential Revision: https://reviews.freebsd.org/D19823 r347442: arm64: rockchip: Don't always put PLL to normal mode We used to put every PLL in normal mode (meaning that the output would be the result of the PLL configuration) instead of slow mode (the output is equal to the external oscillator frequency, 24-26Mhz) but this doesn't work for most of the PLLs as when we put them into normal mode the registers configuring the output frequency haven't been set. Add a normal_mode member in clk_pll_def/clk_pll_sc struct and if it's true we then set the PLL to normal mode. For now only set it to the LPLL and BPLL (Little cluster PLL and Big cluster PLL respectively). Reviewed by: ganbold Differential Revision: https://reviews.freebsd.org/D20174 Added: stable/12/sys/modules/dtb/rockchip/ - copied from r341405, head/sys/modules/dtb/rockchip/ Modified: stable/12/sys/arm64/conf/GENERIC stable/12/sys/arm64/rockchip/clk/rk3399_cru.c stable/12/sys/arm64/rockchip/clk/rk_clk_pll.c stable/12/sys/arm64/rockchip/clk/rk_clk_pll.h stable/12/sys/modules/dtb/rockchip/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Wed Aug 7 18:32:01 2019 (r350688) +++ stable/12/sys/arm64/conf/GENERIC Wed Aug 7 18:35:59 2019 (r350689) @@ -298,4 +298,4 @@ options FDT device acpi # DTBs -makeoptions MODULES_EXTRA="dtb/allwinner dtb/rpi" +makeoptions MODULES_EXTRA="dtb/allwinner dtb/rockchip dtb/rpi" Modified: stable/12/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- stable/12/sys/arm64/rockchip/clk/rk3399_cru.c Wed Aug 7 18:32:01 2019 (r350688) +++ stable/12/sys/arm64/rockchip/clk/rk3399_cru.c Wed Aug 7 18:35:59 2019 (r350689) @@ -752,6 +752,7 @@ static struct rk_clk_pll_def lpll = { .gate_shift = 0, .flags = RK_CLK_PLL_HAVE_GATE, .rates = rk3399_pll_rates, + .normal_mode = true, }; static struct rk_clk_pll_def bpll = { @@ -766,6 +767,7 @@ static struct rk_clk_pll_def bpll = { .gate_shift = 1, .flags = RK_CLK_PLL_HAVE_GATE, .rates = rk3399_pll_rates, + .normal_mode = true, }; static struct rk_clk_pll_def dpll = { Modified: stable/12/sys/arm64/rockchip/clk/rk_clk_pll.c ============================================================================== --- stable/12/sys/arm64/rockchip/clk/rk_clk_pll.c Wed Aug 7 18:32:01 2019 (r350688) +++ stable/12/sys/arm64/rockchip/clk/rk_clk_pll.c Wed Aug 7 18:35:59 2019 (r350689) @@ -54,6 +54,8 @@ struct rk_clk_pll_sc { struct rk_clk_pll_rate *rates; struct rk_clk_pll_rate *frac_rates; + + bool normal_mode; }; #define WRITE4(_clk, off, val) \ @@ -344,11 +346,13 @@ rk3399_clk_pll_init(struct clknode *clk, device_t dev) sc = clknode_get_softc(clk); - /* Setting to normal mode */ - reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; - reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; - WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET, - reg | RK3399_CLK_PLL_WRITE_MASK); + if (sc->normal_mode) { + /* Setting to normal mode */ + reg = RK3399_CLK_PLL_MODE_NORMAL << RK3399_CLK_PLL_MODE_SHIFT; + reg |= RK3399_CLK_PLL_MODE_MASK << RK_CLK_PLL_MASK_SHIFT; + WRITE4(clk, sc->base_offset + RK3399_CLK_PLL_MODE_OFFSET, + reg | RK3399_CLK_PLL_WRITE_MASK); + } clknode_init_parent_idx(clk, 0); @@ -359,44 +363,57 @@ static int rk3399_clk_pll_recalc(struct clknode *clk, uint64_t *freq) { struct rk_clk_pll_sc *sc; - uint64_t rate; uint32_t dsmpd, refdiv, fbdiv; - uint32_t postdiv1, postdiv2, frac; - uint32_t raw1, raw2, raw3, raw4; + uint32_t postdiv1, postdiv2, fracdiv; + uint32_t con1, con2, con3, con4; + uint64_t foutvco; sc = clknode_get_softc(clk); DEVICE_LOCK(clk); - READ4(clk, sc->base_offset, &raw1); - READ4(clk, sc->base_offset + 4, &raw2); - READ4(clk, sc->base_offset + 8, &raw3); - READ4(clk, sc->base_offset + 0xC, &raw4); + READ4(clk, sc->base_offset, &con1); + READ4(clk, sc->base_offset + 4, &con2); + READ4(clk, sc->base_offset + 8, &con3); + READ4(clk, sc->base_offset + 0xC, &con4); DEVICE_UNLOCK(clk); - fbdiv = (raw1 & RK3399_CLK_PLL_FBDIV_MASK) >> RK3399_CLK_PLL_FBDIV_SHIFT; + dprintf("con0: %x\n", con1); + dprintf("con1: %x\n", con2); + dprintf("con2: %x\n", con3); + dprintf("con3: %x\n", con4); - postdiv1 = (raw2 & RK3399_CLK_PLL_POSTDIV1_MASK) >> RK3399_CLK_PLL_POSTDIV1_SHIFT; - postdiv2 = (raw2 & RK3399_CLK_PLL_POSTDIV2_MASK) >> RK3399_CLK_PLL_POSTDIV2_SHIFT; - refdiv = (raw2 & RK3399_CLK_PLL_REFDIV_MASK) >> RK3399_CLK_PLL_REFDIV_SHIFT; + fbdiv = (con1 & RK3399_CLK_PLL_FBDIV_MASK) >> RK3399_CLK_PLL_FBDIV_SHIFT; - frac = (raw3 & RK3399_CLK_PLL_FRAC_MASK) >> RK3399_CLK_PLL_FRAC_SHIFT; + postdiv1 = (con2 & RK3399_CLK_PLL_POSTDIV1_MASK) >> RK3399_CLK_PLL_POSTDIV1_SHIFT; + postdiv2 = (con2 & RK3399_CLK_PLL_POSTDIV2_MASK) >> RK3399_CLK_PLL_POSTDIV2_SHIFT; + refdiv = (con2 & RK3399_CLK_PLL_REFDIV_MASK) >> RK3399_CLK_PLL_REFDIV_SHIFT; - dsmpd = (raw4 & RK3399_CLK_PLL_DSMPD_MASK) >> RK3399_CLK_PLL_DSMPD_SHIFT; + fracdiv = (con3 & RK3399_CLK_PLL_FRAC_MASK) >> RK3399_CLK_PLL_FRAC_SHIFT; + fracdiv >>= 24; - rate = *freq * fbdiv / refdiv; + dsmpd = (con4 & RK3399_CLK_PLL_DSMPD_MASK) >> RK3399_CLK_PLL_DSMPD_SHIFT; + + dprintf("fbdiv: %d\n", fbdiv); + dprintf("postdiv1: %d\n", postdiv1); + dprintf("postdiv2: %d\n", postdiv2); + dprintf("refdiv: %d\n", refdiv); + dprintf("fracdiv: %d\n", fracdiv); + dprintf("dsmpd: %d\n", dsmpd); + + dprintf("parent freq=%lu\n", *freq); + if (dsmpd == 0) { /* Fractional mode */ - uint64_t frac_rate; - - frac_rate = *freq * frac / refdiv; - rate += frac_rate >> 24; + foutvco = *freq / refdiv * (fbdiv + fracdiv); + } else { + /* Integer mode */ + foutvco = *freq / refdiv * fbdiv; } + dprintf("foutvco: %lu\n", foutvco); - *freq = rate / postdiv1 / postdiv2; + *freq = foutvco / postdiv1 / postdiv2; + dprintf("freq: %lu\n", *freq); - if (*freq % 2) - *freq = *freq + 1; - return (0); } @@ -508,6 +525,7 @@ rk3399_clk_pll_register(struct clkdom *clkdom, struct sc->flags = clkdef->flags; sc->rates = clkdef->rates; sc->frac_rates = clkdef->frac_rates; + sc->normal_mode = clkdef->normal_mode; clknode_register(clkdom, clk); Modified: stable/12/sys/arm64/rockchip/clk/rk_clk_pll.h ============================================================================== --- stable/12/sys/arm64/rockchip/clk/rk_clk_pll.h Wed Aug 7 18:32:01 2019 (r350688) +++ stable/12/sys/arm64/rockchip/clk/rk_clk_pll.h Wed Aug 7 18:35:59 2019 (r350689) @@ -57,6 +57,8 @@ struct rk_clk_pll_def { struct rk_clk_pll_rate *rates; struct rk_clk_pll_rate *frac_rates; + + bool normal_mode; }; #define RK_CLK_PLL_HAVE_GATE 0x1 Modified: stable/12/sys/modules/dtb/rockchip/Makefile ============================================================================== --- head/sys/modules/dtb/rockchip/Makefile Sun Dec 2 19:36:20 2018 (r341405) +++ stable/12/sys/modules/dtb/rockchip/Makefile Wed Aug 7 18:35:59 2019 (r350689) @@ -1,7 +1,7 @@ # $FreeBSD$ -# For now only for rk3328-rock64 dts file. DTS= \ - rockchip/rk3328-rock64.dts + rockchip/rk3328-rock64.dts \ + rockchip/rk3399-rockpro64.dts .include From owner-svn-src-all@freebsd.org Wed Aug 7 19:18:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5689BB4DDA; Wed, 7 Aug 2019 19:18:38 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463hB62L3Hz4BLR; Wed, 7 Aug 2019 19:18:38 +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 2F82919528; Wed, 7 Aug 2019 19:18:38 +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 x77JIcI4078029; Wed, 7 Aug 2019 19:18:38 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77JIYt5078008; Wed, 7 Aug 2019 19:18:34 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908071918.x77JIYt5078008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 7 Aug 2019 19:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350690 - in stable/12/sys/gnu/dts: arm arm64/actions arm64/al arm64/allwinner arm64/altera arm64/amd arm64/amlogic arm64/apm arm64/arm arm64/bitmain arm64/broadcom arm64/broadcom/north... X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys/gnu/dts: arm arm64/actions arm64/al arm64/allwinner arm64/altera arm64/amd arm64/amlogic arm64/apm arm64/arm arm64/bitmain arm64/broadcom arm64/broadcom/northstar2 arm64/broadcom/stin... X-SVN-Commit-Revision: 350690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 19:18:38 -0000 Author: manu Date: Wed Aug 7 19:18:32 2019 New Revision: 350690 URL: https://svnweb.freebsd.org/changeset/base/350690 Log: MFC r347366: dts: Import files from Linux 5.1 Added: stable/12/sys/gnu/dts/arm/am335x-guardian.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/am335x-guardian.dts stable/12/sys/gnu/dts/arm/am3874-iceboard.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/am3874-iceboard.dts stable/12/sys/gnu/dts/arm/aspeed-bmc-inspur-on5263m5.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/aspeed-bmc-inspur-on5263m5.dts stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-a-plus.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/bcm2837-rpi-3-a-plus.dts stable/12/sys/gnu/dts/arm/bcm47094-phicomm-k3.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/bcm47094-phicomm-k3.dts stable/12/sys/gnu/dts/arm/imx6-logicpd-baseboard.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6-logicpd-baseboard.dtsi stable/12/sys/gnu/dts/arm/imx6-logicpd-som.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6-logicpd-som.dtsi stable/12/sys/gnu/dts/arm/imx6dl-yapp4-common.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6dl-yapp4-common.dtsi stable/12/sys/gnu/dts/arm/imx6dl-yapp4-draco.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6dl-yapp4-draco.dts stable/12/sys/gnu/dts/arm/imx6dl-yapp4-hydra.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6dl-yapp4-hydra.dts stable/12/sys/gnu/dts/arm/imx6dl-yapp4-ursa.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6dl-yapp4-ursa.dts stable/12/sys/gnu/dts/arm/imx6q-logicpd.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6q-logicpd.dts stable/12/sys/gnu/dts/arm/imx6ul-phytec-pcl063.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6ul-phytec-pcl063.dtsi stable/12/sys/gnu/dts/arm/imx6ul-phytec-peb-eval-01.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6ul-phytec-peb-eval-01.dtsi stable/12/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin-full.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin-full.dts stable/12/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm/imx6ul-phytec-phyboard-segin.dtsi stable/12/sys/gnu/dts/arm/lpc4357-myd-lpc4357.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/lpc4357-myd-lpc4357.dts stable/12/sys/gnu/dts/arm/milbeaut-m10v-evb.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/milbeaut-m10v-evb.dts stable/12/sys/gnu/dts/arm/milbeaut-m10v.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm/milbeaut-m10v.dtsi stable/12/sys/gnu/dts/arm/r7s9210-rza2mevb.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/r7s9210-rza2mevb.dts stable/12/sys/gnu/dts/arm/r7s9210.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm/r7s9210.dtsi stable/12/sys/gnu/dts/arm/rv1108-elgin-r1.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/rv1108-elgin-r1.dts stable/12/sys/gnu/dts/arm/socfpga_cyclone5_chameleon96.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/socfpga_cyclone5_chameleon96.dts stable/12/sys/gnu/dts/arm/vf610-zii-ssmb-dtu.dts - copied unchanged from r347366, head/sys/gnu/dts/arm/vf610-zii-ssmb-dtu.dts stable/12/sys/gnu/dts/arm64/amlogic/meson-g12a-x96-max.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/amlogic/meson-g12a-x96-max.dts stable/12/sys/gnu/dts/arm64/arm/fvp-base-revc.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/arm/fvp-base-revc.dts stable/12/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard-rs2.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard-rs2.dtsi stable/12/sys/gnu/dts/arm64/bitmain/ - copied from r347366, head/sys/gnu/dts/arm64/bitmain/ stable/12/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-3-a-plus.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-3-a-plus.dts stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a-oxalis.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-oxalis.dts stable/12/sys/gnu/dts/arm64/freescale/imx8mm-pinfunc.h - copied unchanged from r347366, head/sys/gnu/dts/arm64/freescale/imx8mm-pinfunc.h stable/12/sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts stable/12/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi stable/12/sys/gnu/dts/arm64/marvell/armada-3720-uDPU.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/marvell/armada-3720-uDPU.dts stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2894-0050-a08.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/nvidia/tegra210-p2894-0050-a08.dts stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2894.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm64/nvidia/tegra210-p2894.dtsi stable/12/sys/gnu/dts/arm64/renesas/cat875.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm64/renesas/cat875.dtsi stable/12/sys/gnu/dts/arm64/renesas/r8a774c0-cat874.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/renesas/r8a774c0-cat874.dts stable/12/sys/gnu/dts/arm64/renesas/r8a774c0-ek874.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/renesas/r8a774c0-ek874.dts stable/12/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-nanopc-t4.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/rockchip/rk3399-nanopc-t4.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-nanopi-m4.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi-m4.dts stable/12/sys/gnu/dts/arm64/rockchip/rk3399-nanopi4.dtsi - copied unchanged from r347366, head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi4.dtsi stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rock-pi-4.dts - copied unchanged from r347366, head/sys/gnu/dts/arm64/rockchip/rk3399-rock-pi-4.dts stable/12/sys/gnu/dts/include/dt-bindings/clk/lochnagar.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/clk/lochnagar.h stable/12/sys/gnu/dts/include/dt-bindings/clock/actions,s500-cmu.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/clock/actions,s500-cmu.h stable/12/sys/gnu/dts/include/dt-bindings/clock/g12a-aoclkc.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/clock/g12a-aoclkc.h stable/12/sys/gnu/dts/include/dt-bindings/clock/g12a-clkc.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/clock/g12a-clkc.h stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8mm-clock.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/clock/imx8mm-clock.h stable/12/sys/gnu/dts/include/dt-bindings/clock/sifive-fu540-prci.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/clock/sifive-fu540-prci.h stable/12/sys/gnu/dts/include/dt-bindings/iio/adc/ingenic,adc.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/iio/adc/ingenic,adc.h stable/12/sys/gnu/dts/include/dt-bindings/interconnect/ - copied from r347366, head/sys/gnu/dts/include/dt-bindings/interconnect/ stable/12/sys/gnu/dts/include/dt-bindings/mfd/st,stpmic1.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/mfd/st,stpmic1.h stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/lochnagar.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/pinctrl/lochnagar.h stable/12/sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h stable/12/sys/gnu/dts/include/dt-bindings/power/xlnx-zynqmp-power.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/power/xlnx-zynqmp-power.h stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-g12a-reset.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-g12a-reset.h stable/12/sys/gnu/dts/include/dt-bindings/reset/g12a-aoclkc.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/reset/g12a-aoclkc.h stable/12/sys/gnu/dts/include/dt-bindings/reset/imx8mq-reset.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/reset/imx8mq-reset.h stable/12/sys/gnu/dts/include/dt-bindings/reset/xlnx-zynqmp-resets.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/reset/xlnx-zynqmp-resets.h stable/12/sys/gnu/dts/include/dt-bindings/soc/bcm2835-pm.h - copied unchanged from r347366, head/sys/gnu/dts/include/dt-bindings/soc/bcm2835-pm.h Deleted: stable/12/sys/gnu/dts/arm/skeleton.dtsi stable/12/sys/gnu/dts/arm/skeleton64.dtsi Modified: stable/12/sys/gnu/dts/arm/alphascale-asm9260.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/alpine.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-baltos-ir2110.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-baltos-ir3220.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-baltos-ir5221.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-evm.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-evmsk.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-icev2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-lxm.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-phycore-som.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/am335x-shc.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/am437x-gp-evm.dts (contents, props changed) stable/12/sys/gnu/dts/arm/am437x-l4.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/am43x-epos-evm.dts (contents, props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/arm-realview-pb1176.dts (contents, props changed) stable/12/sys/gnu/dts/arm/arm-realview-pb11mp.dts (contents, props changed) stable/12/sys/gnu/dts/arm/arm-realview-pbx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/armada-370-rd.dts (contents, props changed) stable/12/sys/gnu/dts/arm/armada-388-clearfog.dts (contents, props changed) stable/12/sys/gnu/dts/arm/armada-388-clearfog.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/armada-38x.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/armada-39x.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/armada-xp-linksys-mamba.dts (contents, props changed) stable/12/sys/gnu/dts/arm/artpec6.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-arm-stardragon4800-rep2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-quanta-q71l.dts (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-g4.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/aspeed-g5.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91-nattis-2-natte-2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/at91-sama5d27_som1.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts (contents, props changed) stable/12/sys/gnu/dts/arm/at91-wb45n.dts (contents, props changed) stable/12/sys/gnu/dts/arm/at91-wb50n.dts (contents, props changed) stable/12/sys/gnu/dts/arm/at91rm9200.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91sam9260.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91sam9261.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91sam9263.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91sam9g45.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91sam9n12.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91sam9rl.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/at91sam9x5.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/atlas6-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/atlas6.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/atlas7.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/axm55xx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm-cygnus.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm-nsp.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm11351.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm21664-garnet.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm21664.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm23550-sparrow.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm23550.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm28155-ap.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-a-plus.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-b-plus.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-b-rev2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-zero-w.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-zero.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2836-rpi-2-b.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-b-plus.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm2837-rpi-cm3.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm283x.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47081-asus-rt-n18u.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47081-buffalo-wzr-600dhp2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47081-buffalo-wzr-900dhp.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47081-luxul-xap-1410.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47081-luxul-xwr-1200.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47081-tplink-archer-c5-v2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47094-dlink-dir-885l.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47094-linksys-panamera.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47094-luxul-abr-4500.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47094-luxul-xap-1610.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47094-luxul-xbr-4500.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47094-luxul-xwr-3100.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47094-luxul-xwr-3150-v1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47094-netgear-r8500.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47189-luxul-xap-1440.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47189-luxul-xap-810.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm47189-tenda-ac9.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm5301x.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm53340-ubnt-unifi-switch8.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm53573.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm63138.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm7445.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/bcm947189acdbmr.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm953012er.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm953012hr.dts (contents, props changed) stable/12/sys/gnu/dts/arm/bcm953012k.dts (contents, props changed) stable/12/sys/gnu/dts/arm/cx92755.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/da850-lcdk.dts (contents, props changed) stable/12/sys/gnu/dts/arm/dm814x.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/dove.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/dra7-l4.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/ep7209.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/ep7211-edb7211.dts (contents, props changed) stable/12/sys/gnu/dts/arm/exynos3250.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/exynos4412-odroidx.dts (contents, props changed) stable/12/sys/gnu/dts/arm/exynos5250-arndale.dts (contents, props changed) stable/12/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3-lite.dts (contents, props changed) stable/12/sys/gnu/dts/arm/exynos5422-odroidxu4.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx27.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx28-cfa10036.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx51-digi-connectcore-jsk.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx51-digi-connectcore-som.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx6q-tbs2910.dts (contents, props changed) stable/12/sys/gnu/dts/arm/imx6qdl-apalis.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6qdl-colibri.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6qdl-icore-rqs.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6qdl-phytec-pfla02.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6sl.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6sx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6ull-colibri.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx6ull-pinfunc-snvs.h (contents, props changed) stable/12/sys/gnu/dts/arm/imx6ull.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx7d.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/imx7ulp.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/integrator.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/integratorcp.dts (contents, props changed) stable/12/sys/gnu/dts/arm/kirkwood-dir665.dts (contents, props changed) stable/12/sys/gnu/dts/arm/kirkwood-linksys-viper.dts (contents, props changed) stable/12/sys/gnu/dts/arm/kirkwood-mv88f6281gtw-ge.dts (contents, props changed) stable/12/sys/gnu/dts/arm/kirkwood-rd88f6281-z0.dts (contents, props changed) stable/12/sys/gnu/dts/arm/kirkwood-rd88f6281.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/kirkwood.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/lpc3250-ea3250.dts (contents, props changed) stable/12/sys/gnu/dts/arm/lpc3250-phy3250.dts (contents, props changed) stable/12/sys/gnu/dts/arm/lpc32xx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/lpc4350-hitex-eval.dts (contents, props changed) stable/12/sys/gnu/dts/arm/lpc4357-ea4357-devkit.dts (contents, props changed) stable/12/sys/gnu/dts/arm/ls1021a-moxa-uc-8410a.dts (contents, props changed) stable/12/sys/gnu/dts/arm/ls1021a-qds.dts (contents, props changed) stable/12/sys/gnu/dts/arm/ls1021a-twr.dts (contents, props changed) stable/12/sys/gnu/dts/arm/ls1021a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/meson.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/meson6-atv1200.dts (contents, props changed) stable/12/sys/gnu/dts/arm/meson6.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/meson8-minix-neo-x8.dts (contents, props changed) stable/12/sys/gnu/dts/arm/meson8.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/meson8b-ec100.dts (contents, props changed) stable/12/sys/gnu/dts/arm/meson8b-mxq.dts (contents, props changed) stable/12/sys/gnu/dts/arm/meson8b-odroidc1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/meson8b.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/meson8m2-mxiii-plus.dts (contents, props changed) stable/12/sys/gnu/dts/arm/meson8m2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mmp2-brownstone.dts (contents, props changed) stable/12/sys/gnu/dts/arm/mmp2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/moxart.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mps2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mt2701-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/mt2701.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mt6580-evbp1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/mt6580.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mt6589-aquaris5.dts (contents, props changed) stable/12/sys/gnu/dts/arm/mt6589.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mt6592-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/mt6592.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mt7623.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mt8127-moose.dts (contents, props changed) stable/12/sys/gnu/dts/arm/mt8127.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/mt8135-evbp1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/mt8135.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/nspire.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/omap3-evm-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/omap3-evm-processor-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/omap3-gta04.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/omap3-gta04a5.dts (contents, props changed) stable/12/sys/gnu/dts/arm/omap4-droid4-xt894.dts (contents, props changed) stable/12/sys/gnu/dts/arm/omap4-panda-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/omap4-sdp.dts (contents, props changed) stable/12/sys/gnu/dts/arm/orion5x-lacie-d2-network.dts (contents, props changed) stable/12/sys/gnu/dts/arm/orion5x-lacie-ethernet-disk-mini-v2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/orion5x-lswsgl.dts (contents, props changed) stable/12/sys/gnu/dts/arm/orion5x-maxtor-shared-storage-2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/orion5x-netgear-wnr854t.dts (contents, props changed) stable/12/sys/gnu/dts/arm/orion5x-rd88f5182-nas.dts (contents, props changed) stable/12/sys/gnu/dts/arm/orion5x.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/ox810se.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/ox820.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/picoxcell-pc3x2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/picoxcell-pc3x3.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/prima2-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/prima2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/pxa168.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/pxa2xx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/pxa910.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-apq8060-dragonboard.dts (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-apq8084.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-ipq8064.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-mdm9615-wp8548.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-mdm9615.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-msm8660.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-msm8960.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-msm8974-lge-nexus5-hammerhead.dts (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-msm8974.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-pm8941.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/qcom-pma8084.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/r8a7743.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/r8a7744.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/r8a77470-iwg23s-sbc.dts (contents, props changed) stable/12/sys/gnu/dts/arm/r8a7778.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/r8a7779.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/r8a7790-stout.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3036-kylin.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3036.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/rk3066a-bqcurie2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3066a-mk808.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3066a-rayeager.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3066a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/rk3188-bqedison2qc.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3188-px3-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3229-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-fennec.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-firefly-reload.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-miqi.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-popmetal.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-rock2-square.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-tinker-s.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-tinker.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288-vyasa.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rk3288.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/rv1108-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm/rv1108.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/s3c2416-smdk2416.dts (contents, props changed) stable/12/sys/gnu/dts/arm/s5pv210-aries.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/s5pv210-fascinate4g.dts (contents, props changed) stable/12/sys/gnu/dts/arm/s5pv210-galaxys.dts (contents, props changed) stable/12/sys/gnu/dts/arm/s5pv210.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sama5d2-pinfunc.h (contents, props changed) stable/12/sys/gnu/dts/arm/sama5d2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sama5d3.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sama5d4.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/socfpga.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/socfpga_arria10.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/spear13xx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/spear3xx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/spear600.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/ste-nomadik-nhk15.dts (contents, props changed) stable/12/sys/gnu/dts/arm/ste-nomadik-stn8815.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/ste-u300.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32429i-eval.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32746g-eval.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32f429-disco.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32f429.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/stm32f469-disco.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32f746-disco.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32f746.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/stm32f769-disco.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/stm32h743.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/stm32h743i-disco.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32h743i-eval.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32mp157-pinctrl.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/stm32mp157c-ed1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32mp157c-ev1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/stm32mp157c.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sun4i-a10.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-q8-tablet.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun5i-reference-design-tablet.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-bananapi.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-a33.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v1.2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-ippo-q8h-v5.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-q8-tablet.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a23.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a33.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a83t-allwinner-h8homlet-v2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-nanopi-m1-plus.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-q8-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-r40-bananapi-m2-ultra.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun8i-r40.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun9i-a80-optimus.dts (contents, props changed) stable/12/sys/gnu/dts/arm/sun9i-a80.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sunxi-bananapi-m2-plus.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/sunxi-h3-h5.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/tegra114-dalmore.dts (contents, props changed) stable/12/sys/gnu/dts/arm/tegra124-jetson-tk1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/tegra124-nyan.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/tegra124-venice2.dts (contents, props changed) stable/12/sys/gnu/dts/arm/tegra20-trimslice.dts (contents, props changed) stable/12/sys/gnu/dts/arm/tegra20.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/tegra30-beaver.dts (contents, props changed) stable/12/sys/gnu/dts/arm/tegra30-cardhu.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/versatile-ab.dts (contents, props changed) stable/12/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/vexpress-v2m.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/vexpress-v2p-ca15_a7.dts (contents, props changed) stable/12/sys/gnu/dts/arm/vf610-bk4.dts (contents, props changed) stable/12/sys/gnu/dts/arm/vf610-zii-cfu1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/vf610-zii-ssmb-spu3.dts (contents, props changed) stable/12/sys/gnu/dts/arm/vt8500.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/wm8505.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/wm8650.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/wm8750.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/wm8850.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/zx296702-ad1.dts (contents, props changed) stable/12/sys/gnu/dts/arm/zx296702.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm/zynq-zturn.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/actions/s700-cubieboard7.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/actions/s700.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/actions/s900.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/al/alpine-v2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-bananapi-m64.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-nanopi-a64.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-orangepi-win.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-teres-i.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-libretech-all-h3-cc.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-axg-s400.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-g12a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/apm/apm-shadowcat.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/apm/apm-storm.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8-gicv2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8-gicv3.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/juno-base.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/juno-r1.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/juno-r2.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/juno.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/rtsm_ve-aemv8a.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/arm/vexpress-v2m-rs1.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/broadcom/northstar2/ns2.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/cavium/thunder-88xx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/cavium/thunder2-99xx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos5433.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos7.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a-rdb.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a-qds.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a-qds.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a-rdb.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1088a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls208xa.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-rdb.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mq-evk.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mq.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi3660-hikey960.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi3660.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi3670.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi3798cv200-poplar.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi3798cv200.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi6220-hikey.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi6220.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hip05.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hip06.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hip07.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/lg/lg1312.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/lg/lg1313.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-372x.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-37xx.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-7040-db.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8040-db.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-ap806-dual.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-ap806-quad.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-ap806.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-ap810-ap0-octa-core.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-cp110.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt2712-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt2712e.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6797-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6797-x20-dev.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6797.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt7622.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt8173.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra132.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra186-p2771-0000.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra186.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra194-p2972-0000.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra194.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2371-2180.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210-smaug.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/apq8016-sbc.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/ipq8074.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8916.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8992.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8994.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8996-pins.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8996.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8998-mtp.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8998.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8005.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8916.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8998.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/pmi8994.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/pmi8998.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/pms405.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/qcs404.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/qcom/sdm845.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/realtek/rtd1295.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7796-salvator-xs.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7796.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77965.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77970-v3msk.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77970.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77980.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77990-ebisu.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77990.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77995-draak.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77995.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/salvator-common.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/ulcb-kf.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/renesas/ulcb.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/px30.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3328.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368-evb.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368-geekbox.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368-lion.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368-orion-r68-meta.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368-px5-evb.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368-r88.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-chromebook.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-sapphire-excavator.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld11.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld20-global.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-pxs3-ref.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-pxs3.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/sprd/sc2731.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/sprd/sc9836.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/sprd/sc9860.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/sprd/sp9860g-1h10.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/synaptics/as370.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/synaptics/berlin4ct.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am654-base-board.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am654.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu100-revC.dts (contents, props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp.dtsi (contents, props changed) stable/12/sys/gnu/dts/arm64/zte/zx296718.dtsi (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/ath79-clk.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/axg-aoclkc.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5433.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/gxbb-aoclkc.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx5-clock.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8mq-clock.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mt2712-clk.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mt8173-clk.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmcc.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmh.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a774a1-cpg-mssr.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a774c0-cpg-mssr.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7778-clock.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stm32mp1-clks.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/gpio.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/at91.h (contents, props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/mt8173-power.h (contents, props changed) Directory Properties: stable/12/ (props changed) stable/12/sys/gnu/dts/arm/aks-cdu.dts (props changed) stable/12/sys/gnu/dts/arm/alphascale-asm9260-devkit.dts (props changed) stable/12/sys/gnu/dts/arm/alpine-db.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-baltos-leds.dtsi (props changed) stable/12/sys/gnu/dts/arm/am335x-baltos.dtsi (props changed) stable/12/sys/gnu/dts/arm/am335x-base0033.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-bone-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/am335x-bone.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-boneblack-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/am335x-boneblack-wireless.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-boneblack.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-boneblue.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-bonegreen-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-bonegreen.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-chilisom.dtsi (props changed) stable/12/sys/gnu/dts/arm/am335x-cm-t335.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2101.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-nano.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-osd3358-sm-red.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-osd335x-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/am335x-pcm-953.dtsi (props changed) stable/12/sys/gnu/dts/arm/am335x-pdu001.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-pepper.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-phycore-rdk.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-pocketbeagle.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-sancloud-bbe.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-sbc-t335.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-sl50.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-wega-rdk.dts (props changed) stable/12/sys/gnu/dts/arm/am335x-wega.dtsi (props changed) stable/12/sys/gnu/dts/arm/am33xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/am33xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/am3517-craneboard.dts (props changed) stable/12/sys/gnu/dts/arm/am3517-evm-ui.dtsi (props changed) stable/12/sys/gnu/dts/arm/am3517-evm.dts (props changed) stable/12/sys/gnu/dts/arm/am3517-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/am3517.dtsi (props changed) stable/12/sys/gnu/dts/arm/am3517_mt_ventoux.dts (props changed) stable/12/sys/gnu/dts/arm/am35xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/am4372.dtsi (props changed) stable/12/sys/gnu/dts/arm/am437x-cm-t43.dts (props changed) stable/12/sys/gnu/dts/arm/am437x-idk-evm.dts (props changed) stable/12/sys/gnu/dts/arm/am437x-sbc-t43.dts (props changed) stable/12/sys/gnu/dts/arm/am437x-sk-evm.dts (props changed) stable/12/sys/gnu/dts/arm/am43xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/am571x-idk.dts (props changed) stable/12/sys/gnu/dts/arm/am572x-idk-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/am572x-idk.dts (props changed) stable/12/sys/gnu/dts/arm/am574x-idk.dts (props changed) stable/12/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/am57xx-beagle-x15-revb1.dts (props changed) stable/12/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts (props changed) stable/12/sys/gnu/dts/arm/am57xx-beagle-x15.dts (props changed) stable/12/sys/gnu/dts/arm/am57xx-cl-som-am57x.dts (props changed) stable/12/sys/gnu/dts/arm/am57xx-commercial-grade.dtsi (props changed) stable/12/sys/gnu/dts/arm/am57xx-idk-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/am57xx-industrial-grade.dtsi (props changed) stable/12/sys/gnu/dts/arm/am57xx-sbc-am57x.dts (props changed) stable/12/sys/gnu/dts/arm/animeo_ip.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-11mp-bbrevd-ctrevb.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-11mp-bbrevd.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-11mp-ctrevb.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-11mp-revb.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-11mp.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-a9mp-bbrevd.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-a9mp.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-bbrevd.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-bbrevd.dtsi (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb-mp.dtsi (props changed) stable/12/sys/gnu/dts/arm/arm-realview-eb.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-pba8.dts (props changed) stable/12/sys/gnu/dts/arm/arm-realview-pbx-a9.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-db.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-dlink-dns327l.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-mirabox.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-netgear-rn102.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-netgear-rn104.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-seagate-nas-2bay.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-seagate-nas-4bay.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-seagate-nas-xbay.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-370-seagate-personal-cloud-2bay.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-seagate-personal-cloud.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-370-synology-ds213j.dts (props changed) stable/12/sys/gnu/dts/arm/armada-370-xp.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-370.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-375-db.dts (props changed) stable/12/sys/gnu/dts/arm/armada-375.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-380.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-385-db-88f6820-amc.dts (props changed) stable/12/sys/gnu/dts/arm/armada-385-db-ap.dts (props changed) stable/12/sys/gnu/dts/arm/armada-385-linksys-caiman.dts (props changed) stable/12/sys/gnu/dts/arm/armada-385-linksys-cobra.dts (props changed) stable/12/sys/gnu/dts/arm/armada-385-linksys-rango.dts (props changed) stable/12/sys/gnu/dts/arm/armada-385-linksys-shelby.dts (props changed) stable/12/sys/gnu/dts/arm/armada-385-linksys.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-385-synology-ds116.dts (props changed) stable/12/sys/gnu/dts/arm/armada-385-turris-omnia.dts (props changed) stable/12/sys/gnu/dts/arm/armada-385.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-388-clearfog-base.dts (props changed) stable/12/sys/gnu/dts/arm/armada-388-clearfog-pro.dts (props changed) stable/12/sys/gnu/dts/arm/armada-388-db.dts (props changed) stable/12/sys/gnu/dts/arm/armada-388-gp.dts (props changed) stable/12/sys/gnu/dts/arm/armada-388-helios4.dts (props changed) stable/12/sys/gnu/dts/arm/armada-388-rd.dts (props changed) stable/12/sys/gnu/dts/arm/armada-388.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-38x-solidrun-microsom.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-390-db.dts (props changed) stable/12/sys/gnu/dts/arm/armada-390.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-395-gp.dts (props changed) stable/12/sys/gnu/dts/arm/armada-395.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-398-db.dts (props changed) stable/12/sys/gnu/dts/arm/armada-398.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-xp-98dx3236.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-xp-98dx3336.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-xp-98dx4251.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-xp-axpwifiap.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-db-dxbc2.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-db-xc3-24g4xg.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-db.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-gp.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-lenovo-ix4-300d.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-matrix.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-mv78230.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-xp-mv78260.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-xp-mv78460.dtsi (props changed) stable/12/sys/gnu/dts/arm/armada-xp-netgear-rn2120.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-openblocks-ax3-4.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp-synology-ds414.dts (props changed) stable/12/sys/gnu/dts/arm/armada-xp.dtsi (props changed) stable/12/sys/gnu/dts/arm/armv7-m.dtsi (props changed) stable/12/sys/gnu/dts/arm/artpec6-devboard.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-ast2500-evb.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-arm-centriq2400-rep.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-facebook-cmm.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-intel-s2600wf.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-lanyang.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts (props changed) stable/12/sys/gnu/dts/arm/aspeed-bmc-portwell-neptune.dts (props changed) stable/12/sys/gnu/dts/arm/at91-ariag25.dts (props changed) stable/12/sys/gnu/dts/arm/at91-ariettag25.dts (props changed) stable/12/sys/gnu/dts/arm/at91-cosino.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-cosino_mega2560.dts (props changed) stable/12/sys/gnu/dts/arm/at91-dvk_som60.dts (props changed) stable/12/sys/gnu/dts/arm/at91-dvk_su60_somc.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-dvk_su60_somc_lcm.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-foxg20.dts (props changed) stable/12/sys/gnu/dts/arm/at91-gatwick.dts (props changed) stable/12/sys/gnu/dts/arm/at91-kizbox.dts (props changed) stable/12/sys/gnu/dts/arm/at91-kizbox2.dts (props changed) stable/12/sys/gnu/dts/arm/at91-kizboxmini.dts (props changed) stable/12/sys/gnu/dts/arm/at91-linea.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-natte.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-qil_a9260.dts (props changed) stable/12/sys/gnu/dts/arm/at91-sam9_l9260.dts (props changed) stable/12/sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91-sama5d2_xplained.dts (props changed) stable/12/sys/gnu/dts/arm/at91-sama5d3_xplained.dts (props changed) stable/12/sys/gnu/dts/arm/at91-sama5d4_ma5d4.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-sama5d4_ma5d4evk.dts (props changed) stable/12/sys/gnu/dts/arm/at91-sama5d4_xplained.dts (props changed) stable/12/sys/gnu/dts/arm/at91-sama5d4ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91-som60.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-tse850-3.dts (props changed) stable/12/sys/gnu/dts/arm/at91-vinco.dts (props changed) stable/12/sys/gnu/dts/arm/at91-wb45n.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91-wb50n.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91rm9200_pqfp.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91rm9200ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9260ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9261ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9263ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9g15.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9g15ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9g20.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9g20ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9g20ek_2mmc.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9g20ek_common.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9g25.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9g25ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9g35.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9g35ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9m10g45ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9n12ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9rlek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9x25.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x25ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9x35.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x35ek.dts (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5_can.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5_isi.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5_lcd.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5_macb0.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5_macb1.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5_usart3.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5cm.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5dm.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9x5ek.dtsi (props changed) stable/12/sys/gnu/dts/arm/at91sam9xe.dtsi (props changed) stable/12/sys/gnu/dts/arm/atlas7-evb.dts (props changed) stable/12/sys/gnu/dts/arm/axm5516-amarillo.dts (props changed) stable/12/sys/gnu/dts/arm/axm5516-cpus.dtsi (props changed) stable/12/sys/gnu/dts/arm/axp152.dtsi (props changed) stable/12/sys/gnu/dts/arm/axp209.dtsi (props changed) stable/12/sys/gnu/dts/arm/axp223.dtsi (props changed) stable/12/sys/gnu/dts/arm/axp22x.dtsi (props changed) stable/12/sys/gnu/dts/arm/axp809.dtsi (props changed) stable/12/sys/gnu/dts/arm/axp81x.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm-cygnus-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm-hr2.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-a.dts (props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-b.dts (props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-cm1-io1.dts (props changed) stable/12/sys/gnu/dts/arm/bcm2835-rpi-cm1.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm2835.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm2836-rpi.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm2836.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm2837-rpi-cm3-io3.dts (props changed) stable/12/sys/gnu/dts/arm/bcm2837.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm283x-rpi-lan7515.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm283x-rpi-smsc9512.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm283x-rpi-smsc9514.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm283x-rpi-usb-host.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm283x-rpi-usb-otg.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm4708-asus-rt-ac56u.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-asus-rt-ac68u.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-buffalo-wzr-1750dhp.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-linksys-ea6300-v1.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-linksys-ea6500-v2.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-luxul-xap-1510.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-luxul-xwc-1000.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-netgear-r6250.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-netgear-r6300-v2.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708-smartrg-sr400ac.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4708.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm47081.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm4709-asus-rt-ac87u.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4709-buffalo-wxr-1900dhp.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4709-linksys-ea9200.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4709-netgear-r7000.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4709-netgear-r8000.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4709-tplink-archer-c9-v1.dts (props changed) stable/12/sys/gnu/dts/arm/bcm4709.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm47094.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch1.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch4.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm5301x-nand-cs0-bch8.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm5301x-nand-cs0.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm59056.dtsi (props changed) stable/12/sys/gnu/dts/arm/bcm7445-bcm97445svmb.dts (props changed) stable/12/sys/gnu/dts/arm/bcm911360_entphn.dts (props changed) stable/12/sys/gnu/dts/arm/bcm911360k.dts (props changed) stable/12/sys/gnu/dts/arm/bcm94708.dts (props changed) stable/12/sys/gnu/dts/arm/bcm94709.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958300k.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958305k.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958522er.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958525er.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958525xmc.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958622hr.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958623hr.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958625hr.dts (props changed) stable/12/sys/gnu/dts/arm/bcm958625k.dts (props changed) stable/12/sys/gnu/dts/arm/bcm963138dvt.dts (props changed) stable/12/sys/gnu/dts/arm/bcm988312hr.dts (props changed) stable/12/sys/gnu/dts/arm/bcm9hmidc.dtsi (props changed) stable/12/sys/gnu/dts/arm/berlin2-sony-nsz-gs7.dts (props changed) stable/12/sys/gnu/dts/arm/berlin2.dtsi (props changed) stable/12/sys/gnu/dts/arm/berlin2cd-google-chromecast.dts (props changed) stable/12/sys/gnu/dts/arm/berlin2cd-valve-steamlink.dts (props changed) stable/12/sys/gnu/dts/arm/berlin2cd.dtsi (props changed) stable/12/sys/gnu/dts/arm/berlin2q-marvell-dmp.dts (props changed) stable/12/sys/gnu/dts/arm/berlin2q.dtsi (props changed) stable/12/sys/gnu/dts/arm/compulab-sb-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/cros-adc-thermistors.dtsi (props changed) stable/12/sys/gnu/dts/arm/cros-ec-keyboard.dtsi (props changed) stable/12/sys/gnu/dts/arm/cros-ec-sbs.dtsi (props changed) stable/12/sys/gnu/dts/arm/cx92755_equinox.dts (props changed) stable/12/sys/gnu/dts/arm/da850-enbw-cmc.dts (props changed) stable/12/sys/gnu/dts/arm/da850-evm.dts (props changed) stable/12/sys/gnu/dts/arm/da850-lego-ev3.dts (props changed) stable/12/sys/gnu/dts/arm/da850.dtsi (props changed) stable/12/sys/gnu/dts/arm/dm8148-evm.dts (props changed) stable/12/sys/gnu/dts/arm/dm8148-t410.dts (props changed) stable/12/sys/gnu/dts/arm/dm814x-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/dm8168-evm.dts (props changed) stable/12/sys/gnu/dts/arm/dm816x-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/dm816x.dtsi (props changed) stable/12/sys/gnu/dts/arm/dove-cm-a510.dtsi (props changed) stable/12/sys/gnu/dts/arm/dove-cubox-es.dts (props changed) stable/12/sys/gnu/dts/arm/dove-cubox.dts (props changed) stable/12/sys/gnu/dts/arm/dove-d2plug.dts (props changed) stable/12/sys/gnu/dts/arm/dove-d3plug.dts (props changed) stable/12/sys/gnu/dts/arm/dove-dove-db.dts (props changed) stable/12/sys/gnu/dts/arm/dove-sbc-a510.dts (props changed) stable/12/sys/gnu/dts/arm/dra62x-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra62x-j5eco-evm.dts (props changed) stable/12/sys/gnu/dts/arm/dra62x.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra7-dspeve-thermal.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra7-evm-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra7-evm.dts (props changed) stable/12/sys/gnu/dts/arm/dra7-iva-thermal.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra7-mmc-iodelay.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra7.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra71-evm.dts (props changed) stable/12/sys/gnu/dts/arm/dra72-evm-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra72-evm-revc.dts (props changed) stable/12/sys/gnu/dts/arm/dra72-evm-tps65917.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra72-evm.dts (props changed) stable/12/sys/gnu/dts/arm/dra72x-mmc-iodelay.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra72x.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra74x-mmc-iodelay.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra74x.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra76-evm.dts (props changed) stable/12/sys/gnu/dts/arm/dra76x-mmc-iodelay.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra76x.dtsi (props changed) stable/12/sys/gnu/dts/arm/dra7xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/ecx-2000.dts (props changed) stable/12/sys/gnu/dts/arm/ecx-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/efm32gg-dk3750.dts (props changed) stable/12/sys/gnu/dts/arm/efm32gg.dtsi (props changed) stable/12/sys/gnu/dts/arm/elpida_ecb240abacn.dtsi (props changed) stable/12/sys/gnu/dts/arm/emev2-kzm9d.dts (props changed) stable/12/sys/gnu/dts/arm/emev2.dtsi (props changed) stable/12/sys/gnu/dts/arm/ep7211.dtsi (props changed) stable/12/sys/gnu/dts/arm/ethernut5.dts (props changed) stable/12/sys/gnu/dts/arm/evk-pro3.dts (props changed) stable/12/sys/gnu/dts/arm/exynos-mfc-reserved-memory.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos-syscon-restart.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos3250-artik5-eval.dts (props changed) stable/12/sys/gnu/dts/arm/exynos3250-artik5.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos3250-monk.dts (props changed) stable/12/sys/gnu/dts/arm/exynos3250-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos3250-rinato.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4-cpu-thermal.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4210-origen.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4210-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4210-smdkv310.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4210-trats.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4210-universal_c210.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4210.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4212.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4412-i9300.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-i9305.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-itop-elite.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4412-midas.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4412-n710x.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-odroidu3.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-odroidx2.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-origen.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4412-ppmu-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4412-prime.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4412-smdk4412.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-tiny4412.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412-trats2.dts (props changed) stable/12/sys/gnu/dts/arm/exynos4412.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4415-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4415.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4x12-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos4x12.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5250-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5250-smdk5250.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5250-snow-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5250-snow-rev5.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5250-snow.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5250-spring.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5250.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5260-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5260-xyref5260.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5260.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5410-odroidxu.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5410-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5410-smdk5410.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5410.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5420-arndale-octa.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5420-cpus.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5420-peach-pit.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5420-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5420-smdk5420.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5420-trip-points.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5420.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5422-cpu-thermal.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5422-cpus.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5422-odroidhc1.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5422-odroidxu3.dts (props changed) stable/12/sys/gnu/dts/arm/exynos54xx-odroidxu-leds.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos54xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/exynos5800-peach-pi.dts (props changed) stable/12/sys/gnu/dts/arm/exynos5800.dtsi (props changed) stable/12/sys/gnu/dts/arm/facebook-bmc-flash-layout.dtsi (props changed) stable/12/sys/gnu/dts/arm/ge863-pro3.dtsi (props changed) stable/12/sys/gnu/dts/arm/gemini-dlink-dir-685.dts (props changed) stable/12/sys/gnu/dts/arm/gemini-dlink-dns-313.dts (props changed) stable/12/sys/gnu/dts/arm/gemini-nas4220b.dts (props changed) stable/12/sys/gnu/dts/arm/gemini-rut1xx.dts (props changed) stable/12/sys/gnu/dts/arm/gemini-sl93512r.dts (props changed) stable/12/sys/gnu/dts/arm/gemini-sq201.dts (props changed) stable/12/sys/gnu/dts/arm/gemini-wbd111.dts (props changed) stable/12/sys/gnu/dts/arm/gemini-wbd222.dts (props changed) stable/12/sys/gnu/dts/arm/gemini.dtsi (props changed) stable/12/sys/gnu/dts/arm/gr-peach-audiocamerashield.dtsi (props changed) stable/12/sys/gnu/dts/arm/hi3519-demb.dts (props changed) stable/12/sys/gnu/dts/arm/hi3519.dtsi (props changed) stable/12/sys/gnu/dts/arm/hi3620-hi4511.dts (props changed) stable/12/sys/gnu/dts/arm/hi3620.dtsi (props changed) stable/12/sys/gnu/dts/arm/highbank.dts (props changed) stable/12/sys/gnu/dts/arm/hip01-ca9x2.dts (props changed) stable/12/sys/gnu/dts/arm/hip01.dtsi (props changed) stable/12/sys/gnu/dts/arm/hip04-d01.dts (props changed) stable/12/sys/gnu/dts/arm/hip04.dtsi (props changed) stable/12/sys/gnu/dts/arm/hisi-x5hd2-dkb.dts (props changed) stable/12/sys/gnu/dts/arm/hisi-x5hd2.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx1-ads.dts (props changed) stable/12/sys/gnu/dts/arm/imx1-apf9328.dts (props changed) stable/12/sys/gnu/dts/arm/imx1-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx1.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx23-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx23-olinuxino.dts (props changed) stable/12/sys/gnu/dts/arm/imx23-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx23-sansa.dts (props changed) stable/12/sys/gnu/dts/arm/imx23-stmp378x_devb.dts (props changed) stable/12/sys/gnu/dts/arm/imx23-xfi3.dts (props changed) stable/12/sys/gnu/dts/arm/imx23.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx25-eukrea-cpuimx25.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts (props changed) stable/12/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts (props changed) stable/12/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts (props changed) stable/12/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx25-karo-tx25.dts (props changed) stable/12/sys/gnu/dts/arm/imx25-pdk.dts (props changed) stable/12/sys/gnu/dts/arm/imx25-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx25.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx27-apf27.dts (props changed) stable/12/sys/gnu/dts/arm/imx27-apf27dev.dts (props changed) stable/12/sys/gnu/dts/arm/imx27-eukrea-cpuimx27.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx27-eukrea-mbimxsd27-baseboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx27-pdk.dts (props changed) stable/12/sys/gnu/dts/arm/imx27-phytec-phycard-s-rdk.dts (props changed) stable/12/sys/gnu/dts/arm/imx27-phytec-phycard-s-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx27-phytec-phycore-rdk.dts (props changed) stable/12/sys/gnu/dts/arm/imx27-phytec-phycore-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx27-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx28-apf28.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-apf28dev.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-apx4devkit.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-cfa10037.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-cfa10049.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-cfa10055.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-cfa10056.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-cfa10057.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-cfa10058.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-duckbill-2-485.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-duckbill-2-enocean.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-duckbill-2-spi.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-duckbill-2.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-duckbill.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-eukrea-mbmx283lc.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-eukrea-mbmx287lc.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-eukrea-mbmx28lc.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx28-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-m28.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx28-m28cu3.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-m28evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx28-sps1.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-ts4600.dts (props changed) stable/12/sys/gnu/dts/arm/imx28-tx28.dts (props changed) stable/12/sys/gnu/dts/arm/imx28.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx31-bug.dts (props changed) stable/12/sys/gnu/dts/arm/imx31-lite.dts (props changed) stable/12/sys/gnu/dts/arm/imx31.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx35-eukrea-cpuimx35.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx35-eukrea-mbimxsd35-baseboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx35-pdk.dts (props changed) stable/12/sys/gnu/dts/arm/imx35-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx35.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx50-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx50-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx50.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx51-apf51.dts (props changed) stable/12/sys/gnu/dts/arm/imx51-apf51dev.dts (props changed) stable/12/sys/gnu/dts/arm/imx51-babbage.dts (props changed) stable/12/sys/gnu/dts/arm/imx51-eukrea-cpuimx51.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx51-eukrea-mbimxsd51-baseboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx51-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx51-ts4800.dts (props changed) stable/12/sys/gnu/dts/arm/imx51-zii-rdu1.dts (props changed) stable/12/sys/gnu/dts/arm/imx51-zii-scu2-mezz.dts (props changed) stable/12/sys/gnu/dts/arm/imx51-zii-scu3-esb.dts (props changed) stable/12/sys/gnu/dts/arm/imx51.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx53-ard.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-cx9020.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-kp-ddc.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-kp-hsc.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-kp.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx53-m53.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx53-m53evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-mba53.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx53-ppd.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-qsb-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx53-qsb.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-qsrb.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-smd.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-tqma53.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx53-tx53-x03x.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-tx53-x13x.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-tx53.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx53-usbarmory.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-voipac-bsb.dts (props changed) stable/12/sys/gnu/dts/arm/imx53-voipac-dmm-668.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx53.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6dl-apf6dev.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-aristainetos2_4.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-aristainetos2_7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-cubox-i-emmc-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-cubox-i-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-cubox-i.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-dfi-fs700-m60.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-emcon-avari.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw51xx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw52xx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw53xx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw54xx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw551x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw552x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw553x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw560x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw5903.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-gw5904.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-hummingboard-emmc-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-hummingboard-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-hummingboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-hummingboard2-emmc-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-hummingboard2-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-hummingboard2.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-icore-mipi.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-icore-rqs.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-icore.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-mamoj.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-nit6xlite.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-nitrogen6x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-phytec-mira-rdk-nand.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-phytec-pbab01.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-phytec-pfla02.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6dl-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx6dl-rex-basic.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-riotboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-sabreauto.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-sabrelite.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-sabresd.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-savageboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-ts4900.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-ts7970.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6dl-comtft.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6s-8034-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6s-8034.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6s-8035-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6s-8035.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6u-801x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6u-8033-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6u-8033.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6u-80xx-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6u-811x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-tx6u-81xx-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-udoo.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-wandboard-revb1.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-wandboard-revd1.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl-wandboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6dl.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6q-apalis-eval.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-apalis-ixora-v1.1.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-apalis-ixora.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-apf6dev.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-arm2.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-b450v3.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-b650v3.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-b850v3.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-ba16.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6q-bx50v3.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6q-cm-fx6.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-cubox-i-emmc-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-cubox-i-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-cubox-i.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-dfi-fs700-m60.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-dhcom-pdk2.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-dhcom-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6q-display5-tianma-tm070-1280x768.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-display5.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-dms-ba16.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-emcon-avari.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-evi.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gk802.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw51xx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw52xx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw53xx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw5400-a.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw54xx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw551x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw552x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw553x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw560x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw5903.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-gw5904.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-h100.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-hummingboard-emmc-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-hummingboard-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-hummingboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-hummingboard2-emmc-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-hummingboard2-som-v15.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-hummingboard2.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-icore-mipi.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-icore-ofcap10.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-icore-ofcap12.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-icore-rqs.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-icore.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-kp-tpc.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-kp.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6q-marsboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-mccmon6.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-nitrogen6_max.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-nitrogen6_som2.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-nitrogen6x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-novena.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-phytec-mira-rdk-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-phytec-mira-rdk-nand.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-phytec-pbab01.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-phytec-pfla02.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6q-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx6q-pistachio.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-rex-pro.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-sabreauto.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-sabrelite.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-sabresd.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-savageboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-sbc6x.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-ts4900.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-ts7970.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-1010-comtft.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-1010.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-1020-comtft.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-1020.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-1036-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-1036.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-10x0-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-1110.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-tx6q-11x0-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-udoo.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-utilite-pro.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-var-dt6customboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-wandboard-revb1.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-wandboard-revd1.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-wandboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q-zii-rdu2.dts (props changed) stable/12/sys/gnu/dts/arm/imx6q.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-apf6.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-apf6dev.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-aristainetos.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-aristainetos2.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-cubox-i.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-dfi-fs700-m60.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-emcon-avari.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-emcon.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw51xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw52xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw553x.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw560x.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw5903.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-hummingboard2-emmc.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-hummingboard2.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-icore-1.5.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-icore.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-nit6xlite.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-nitrogen6_som2.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-phytec-mira.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-phytec-pbab01.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-phytec-phycore-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-rex.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-savageboard.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-sr-som-brcm.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-sr-som-emmc.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-sr-som-ti.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-sr-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-ts4900.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-ts7970.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-tx6-lcd.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-tx6-lvds.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-tx6-mb7.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-tx6.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-udoo.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-var-dart.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-wandboard-revb1.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-wandboard-revc1.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-wandboard-revd1.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qdl.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6qp-nitrogen6_max.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-nitrogen6_som2.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-phytec-mira-rdk-nand.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-sabreauto.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-sabresd.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-tx6qp-8037-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-tx6qp-8037.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-tx6qp-8137-mb7.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-tx6qp-8137.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-wandboard-revd1.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp-zii-rdu2.dts (props changed) stable/12/sys/gnu/dts/arm/imx6qp.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6sl-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sl-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx6sl-warp.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sll-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sll-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx6sll.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6sx-nitrogen6sx.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx6sx-sabreauto.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-sdb-reva.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-sdb-sai.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-sdb.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-sdb.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6sx-softing-vining-2000.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-udoo-neo-basic.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-udoo-neo-extended.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-udoo-neo-full.dts (props changed) stable/12/sys/gnu/dts/arm/imx6sx-udoo-neo.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul-14x14-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-14x14-evk.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul-ccimx6ulsbcexpress.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-ccimx6ulsbcpro.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-ccimx6ulsom.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul-geam.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-isiot-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-isiot-nand.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-isiot.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul-liteboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-litesom.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul-opos6ul.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul-opos6uldev.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-pico-hobbit.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-pico-pi.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-pico.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx6ul-tx6ul-0010.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-tx6ul-0011.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-tx6ul-mainboard.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ul-tx6ul.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ul.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ull-14x14-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ull-colibri-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ull-colibri-eval-v3.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ull-colibri-nonwifi.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ull-colibri-wifi-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ull-colibri-wifi.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx6ull-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx6ulz-14x14-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx6ulz.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7-colibri-eval-v3.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7-colibri.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-colibri-emmc-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-colibri-emmc.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7d-colibri-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-colibri.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7d-nitrogen7.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-pico-hobbit.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-pico-pi.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-pico.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7d-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/imx7d-sbc-imx7.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-sdb-reva.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-sdb-sht11.dts (props changed) stable/12/sys/gnu/dts/arm/imx7d-sdb.dts (props changed) stable/12/sys/gnu/dts/arm/imx7s-colibri-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/imx7s-colibri.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7s-warp.dts (props changed) stable/12/sys/gnu/dts/arm/imx7s.dtsi (props changed) stable/12/sys/gnu/dts/arm/imx7ulp-evk.dts (props changed) stable/12/sys/gnu/dts/arm/imx7ulp-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/integratorap.dts (props changed) stable/12/sys/gnu/dts/arm/iwg20d-q7-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/iwg20d-q7-dbcm-ca.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2e-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2e-evm.dts (props changed) stable/12/sys/gnu/dts/arm/keystone-k2e-netcp.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2e.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2g-evm.dts (props changed) stable/12/sys/gnu/dts/arm/keystone-k2g-ice.dts (props changed) stable/12/sys/gnu/dts/arm/keystone-k2g-netcp.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2g.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2hk-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2hk-evm.dts (props changed) stable/12/sys/gnu/dts/arm/keystone-k2hk-netcp.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2hk.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2l-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2l-evm.dts (props changed) stable/12/sys/gnu/dts/arm/keystone-k2l-netcp.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone-k2l.dtsi (props changed) stable/12/sys/gnu/dts/arm/keystone.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-6192.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-6281.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-6282.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-98dx4122.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-b3.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-blackarmor-nas220.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-cloudbox.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-d2net.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-db-88f6281.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-db-88f6282.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-db.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-dns320.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-dns325.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-dnskw.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-dockstar.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-dreamplug.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds109.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds110jv10.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds111.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds112.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds209.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds210.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds212.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds212j.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds409.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds409slim.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds411.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds411j.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ds411slim.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-goflexnet.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-guruplug-server-plus.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ib62x0.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-iconnect.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-iomega_ix2_200.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-is2.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-km_common.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-km_fixedeth.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-km_kirkwood.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-laplug.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-linkstation-6282.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-linkstation-duo-6281.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-linkstation-lsqvl.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-linkstation-lsvl.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-linkstation-lswsxl.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-linkstation-lswvl.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-linkstation-lswxl.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-linkstation.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-lschlv2.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-lsxhl.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-lsxl.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-mplcec4.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-nas2big.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-net2big.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-net5big.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-netgear_readynas_duo_v2.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-netgear_readynas_nv+_v2.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-netxbig.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ns2-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ns2.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ns2lite.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ns2max.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ns2mini.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-nsa310.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-nsa310a.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-nsa320.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-nsa325.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-nsa3x0-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-openblocks_a6.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-openblocks_a7.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-openrd-base.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-openrd-client.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-openrd-ultimate.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-openrd.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-pogo_e02.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-pogoplug-series-4.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-rd88f6192.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-rd88f6281-a.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-rs212.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-rs409.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-rs411.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-sheevaplug-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-sheevaplug-esata.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-sheevaplug.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-synology.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-t5325.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-topkick.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ts219-6281.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ts219-6282.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ts219.dtsi (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ts419-6281.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ts419-6282.dts (props changed) stable/12/sys/gnu/dts/arm/kirkwood-ts419.dtsi (props changed) stable/12/sys/gnu/dts/arm/logicpd-som-lv-35xx-devkit.dts (props changed) stable/12/sys/gnu/dts/arm/logicpd-som-lv-37xx-devkit.dts (props changed) stable/12/sys/gnu/dts/arm/logicpd-som-lv-baseboard.dtsi (props changed) stable/12/sys/gnu/dts/arm/logicpd-som-lv.dtsi (props changed) stable/12/sys/gnu/dts/arm/logicpd-torpedo-35xx-devkit.dts (props changed) stable/12/sys/gnu/dts/arm/logicpd-torpedo-37xx-devkit.dts (props changed) stable/12/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi (props changed) stable/12/sys/gnu/dts/arm/logicpd-torpedo-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/lpc18xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/lpc4337-ciaa.dts (props changed) stable/12/sys/gnu/dts/arm/lpc4350.dtsi (props changed) stable/12/sys/gnu/dts/arm/lpc4357.dtsi (props changed) stable/12/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi (props changed) stable/12/sys/gnu/dts/arm/moxart-uc7112lx.dts (props changed) stable/12/sys/gnu/dts/arm/mpa1600.dts (props changed) stable/12/sys/gnu/dts/arm/mps2-an385.dts (props changed) stable/12/sys/gnu/dts/arm/mps2-an399.dts (props changed) stable/12/sys/gnu/dts/arm/mt2701-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/mt6323.dtsi (props changed) stable/12/sys/gnu/dts/arm/mt7623a-rfb-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/mt7623a-rfb-nand.dts (props changed) stable/12/sys/gnu/dts/arm/mt7623a.dtsi (props changed) stable/12/sys/gnu/dts/arm/mt7623n-bananapi-bpi-r2.dts (props changed) stable/12/sys/gnu/dts/arm/mt7623n-rfb-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/mt8135-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/mvebu-linkstation-fan.dtsi (props changed) stable/12/sys/gnu/dts/arm/mvebu-linkstation-gpio-simple.dtsi (props changed) stable/12/sys/gnu/dts/arm/mxs-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/nspire-classic.dtsi (props changed) stable/12/sys/gnu/dts/arm/nspire-clp.dts (props changed) stable/12/sys/gnu/dts/arm/nspire-cx.dts (props changed) stable/12/sys/gnu/dts/arm/nspire-tp.dts (props changed) stable/12/sys/gnu/dts/arm/nuvoton-common-npcm7xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/nuvoton-npcm750-evb.dts (props changed) stable/12/sys/gnu/dts/arm/nuvoton-npcm750.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap-gpmc-smsc911x.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap-gpmc-smsc9221.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap-zoom-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap2.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap2420-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap2420-h4.dts (props changed) stable/12/sys/gnu/dts/arm/omap2420-n800.dts (props changed) stable/12/sys/gnu/dts/arm/omap2420-n810-wimax.dts (props changed) stable/12/sys/gnu/dts/arm/omap2420-n810.dts (props changed) stable/12/sys/gnu/dts/arm/omap2420-n8x0-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap2420.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap2430-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap2430-sdp.dts (props changed) stable/12/sys/gnu/dts/arm/omap2430.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap24xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-beagle-xm-ab.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-beagle-xm.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-beagle.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-cm-t3517.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-cm-t3530.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-cm-t3730.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-cm-t3x.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-cm-t3x30.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-cpu-thermal.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-devkit8000-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-devkit8000-lcd-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-devkit8000-lcd43.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-devkit8000-lcd70.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-devkit8000.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-evm-37xx.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-evm.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-gta04a3.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-gta04a4.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-gta04a5one.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-ha-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-ha-lcd.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-ha.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-igep.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-igep0020-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-igep0020-rev-f.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-igep0020.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-igep0030-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-igep0030-rev-g.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-igep0030.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-ldp.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-lilly-a83x.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-lilly-dbb056.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-n9.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-n900.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-n950-n9.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-n950.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-alto35-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-alto35.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-base.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-chestnut43-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-chestnut43.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-common-dvi.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-common-lcd35.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-common-lcd43.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-common-peripherals.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-gallop43-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-gallop43.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-palo35-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-palo35.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-palo43-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-palo43.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm-alto35.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm-chestnut43.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm-gallop43.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm-palo35.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm-palo43.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm-summit.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm-tobi.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm-tobiduo.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-storm.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-summit-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-summit.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-tobi-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-tobi.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-tobiduo-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-overo-tobiduo.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-overo.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-pandora-1ghz.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-pandora-600mhz.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-pandora-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-panel-sharp-ls037v7dw01.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-sb-t35.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-sbc-t3517.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-sbc-t3530.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-sbc-t3730.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-sniper.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-tao3530.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3-thunder.dts (props changed) stable/12/sys/gnu/dts/arm/omap3-zoom3.dts (props changed) stable/12/sys/gnu/dts/arm/omap3.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3430-sdp.dts (props changed) stable/12/sys/gnu/dts/arm/omap3430es1-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap34xx-omap36xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap34xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap36xx-am35xx-omap3430es2plus-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap36xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap36xx-omap3430es2plus-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap36xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap3xxx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4-cpu-thermal.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4-duovero-parlor.dts (props changed) stable/12/sys/gnu/dts/arm/omap4-duovero.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4-kc1.dts (props changed) stable/12/sys/gnu/dts/arm/omap4-l4.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4-panda-a4.dts (props changed) stable/12/sys/gnu/dts/arm/omap4-panda-es.dts (props changed) stable/12/sys/gnu/dts/arm/omap4-panda.dts (props changed) stable/12/sys/gnu/dts/arm/omap4-sdp-es23plus.dts (props changed) stable/12/sys/gnu/dts/arm/omap4-var-dvk-om44.dts (props changed) stable/12/sys/gnu/dts/arm/omap4-var-om44customboard.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4-var-som-om44-wlan.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4-var-som-om44.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4-var-stk-om44.dts (props changed) stable/12/sys/gnu/dts/arm/omap4.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap443x-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap443x.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap4460.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap446x-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap44xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap5-board-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap5-cm-t54.dts (props changed) stable/12/sys/gnu/dts/arm/omap5-core-thermal.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap5-gpu-thermal.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap5-igep0050.dts (props changed) stable/12/sys/gnu/dts/arm/omap5-l4.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap5-sbc-t54.dts (props changed) stable/12/sys/gnu/dts/arm/omap5-uevm.dts (props changed) stable/12/sys/gnu/dts/arm/omap5.dtsi (props changed) stable/12/sys/gnu/dts/arm/omap54xx-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm/openbmc-flash-layout.dtsi (props changed) stable/12/sys/gnu/dts/arm/orion5x-kuroboxpro.dts (props changed) stable/12/sys/gnu/dts/arm/orion5x-linkstation-lschl.dts (props changed) stable/12/sys/gnu/dts/arm/orion5x-linkstation-lsgl.dts (props changed) stable/12/sys/gnu/dts/arm/orion5x-linkstation-lswtgl.dts (props changed) stable/12/sys/gnu/dts/arm/orion5x-linkstation.dtsi (props changed) stable/12/sys/gnu/dts/arm/orion5x-mv88f5181.dtsi (props changed) stable/12/sys/gnu/dts/arm/orion5x-mv88f5182.dtsi (props changed) stable/12/sys/gnu/dts/arm/owl-s500-cubieboard6.dts (props changed) stable/12/sys/gnu/dts/arm/owl-s500-guitar-bb-rev-b.dts (props changed) stable/12/sys/gnu/dts/arm/owl-s500-guitar.dtsi (props changed) stable/12/sys/gnu/dts/arm/owl-s500-sparky.dts (props changed) stable/12/sys/gnu/dts/arm/owl-s500.dtsi (props changed) stable/12/sys/gnu/dts/arm/ox810se-wd-mbwe.dts (props changed) stable/12/sys/gnu/dts/arm/ox820-cloudengines-pogoplug-series-3.dts (props changed) stable/12/sys/gnu/dts/arm/picoxcell-pc7302-pc3x2.dts (props changed) stable/12/sys/gnu/dts/arm/picoxcell-pc7302-pc3x3.dts (props changed) stable/12/sys/gnu/dts/arm/pm9g45.dts (props changed) stable/12/sys/gnu/dts/arm/pxa168-aspenite.dts (props changed) stable/12/sys/gnu/dts/arm/pxa25x.dtsi (props changed) stable/12/sys/gnu/dts/arm/pxa27x.dtsi (props changed) stable/12/sys/gnu/dts/arm/pxa300-raumfeld-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/pxa300-raumfeld-connector.dts (props changed) stable/12/sys/gnu/dts/arm/pxa300-raumfeld-controller.dts (props changed) stable/12/sys/gnu/dts/arm/pxa300-raumfeld-speaker-l.dts (props changed) stable/12/sys/gnu/dts/arm/pxa300-raumfeld-speaker-m.dts (props changed) stable/12/sys/gnu/dts/arm/pxa300-raumfeld-speaker-one.dts (props changed) stable/12/sys/gnu/dts/arm/pxa300-raumfeld-speaker-s.dts (props changed) stable/12/sys/gnu/dts/arm/pxa300-raumfeld-tuneable-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm/pxa3xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/pxa910-dkb.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064-arrow-db600c-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064-arrow-db600c.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064-asus-nexus7-flo.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064-cm-qs600.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064-ifc6410.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064-sony-xperia-yuga.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8064-v2.0.dtsi (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8074-dragonboard.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8084-ifc6540.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-apq8084-mtp.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019-ap.dk01.1-c1.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019-ap.dk01.1.dtsi (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1-c1.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1-c3.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019-ap.dk04.1.dtsi (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1-c1.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1-c2.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq4019-ap.dk07.1.dtsi (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq8064-ap148.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-ipq8064-v1.0.dtsi (props changed) stable/12/sys/gnu/dts/arm/qcom-mdm9615-wp8548-mangoh-green.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-msm8660-surf.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-msm8960-cdp.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-msm8974-fairphone-fp2.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-msm8974-samsung-klte.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-amami.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-castor.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-honami.dts (props changed) stable/12/sys/gnu/dts/arm/qcom-msm8974pro.dtsi (props changed) stable/12/sys/gnu/dts/arm/qcom-pm8841.dtsi (props changed) stable/12/sys/gnu/dts/arm/r7s72100-genmai.dts (props changed) stable/12/sys/gnu/dts/arm/r7s72100-gr-peach.dts (props changed) stable/12/sys/gnu/dts/arm/r7s72100-rskrza1.dts (props changed) stable/12/sys/gnu/dts/arm/r7s72100.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a73a4-ape6evm.dts (props changed) stable/12/sys/gnu/dts/arm/r8a73a4.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7740-armadillo800eva.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7740.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7743-iwg20d-q7-dbcm-ca.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7743-iwg20d-q7.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7743-iwg20m.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7743-sk-rzg1m.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7744-iwg20d-q7-dbcm-ca.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7744-iwg20d-q7.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7744-iwg20m.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm-dbhd-ca.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7745-iwg22m.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7745-sk-rzg1e.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7745.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a77470.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7778-bockw.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7779-marzen.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7790-lager.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7790.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7791-koelsch.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7791-porter.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7791.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7792-blanche.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7792-wheat.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7792.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7793-gose.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7793.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a7794-alt.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7794-silk.dts (props changed) stable/12/sys/gnu/dts/arm/r8a7794.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a77xx-aa104xd12-panel.dtsi (props changed) stable/12/sys/gnu/dts/arm/r8a77xx-aa121td01-panel.dtsi (props changed) stable/12/sys/gnu/dts/arm/r9a06g032-rzn1d400-db.dts (props changed) stable/12/sys/gnu/dts/arm/r9a06g032.dtsi (props changed) stable/12/sys/gnu/dts/arm/rda8810pl-orangepi-2g-iot.dts (props changed) stable/12/sys/gnu/dts/arm/rda8810pl-orangepi-i96.dts (props changed) stable/12/sys/gnu/dts/arm/rda8810pl.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk1108-evb.dts (props changed) stable/12/sys/gnu/dts/arm/rk1108.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3036-evb.dts (props changed) stable/12/sys/gnu/dts/arm/rk3066a-marsboard.dts (props changed) stable/12/sys/gnu/dts/arm/rk3188-radxarock.dts (props changed) stable/12/sys/gnu/dts/arm/rk3188.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3228-evb.dts (props changed) stable/12/sys/gnu/dts/arm/rk3228.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3229.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk322x.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-evb-act8846.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-evb-rk808.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-evb.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-firefly-beta.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-firefly-reload-core.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-firefly.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-firefly.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-phycore-rdk.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-phycore-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-r89.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-rock2-som.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-tinker.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-analog-audio.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-brain.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-chromebook.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-jaq.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-jerry.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-mickey.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-minnie.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-pinky.dts (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-sdmmc.dtsi (props changed) stable/12/sys/gnu/dts/arm/rk3288-veyron-speedy.dts (props changed) stable/12/sys/gnu/dts/arm/rk3xxx.dtsi (props changed) stable/12/sys/gnu/dts/arm/s3c2416-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/s3c2416.dtsi (props changed) stable/12/sys/gnu/dts/arm/s3c24xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/s3c6400.dtsi (props changed) stable/12/sys/gnu/dts/arm/s3c6410-mini6410.dts (props changed) stable/12/sys/gnu/dts/arm/s3c6410-smdk6410.dts (props changed) stable/12/sys/gnu/dts/arm/s3c6410.dtsi (props changed) stable/12/sys/gnu/dts/arm/s3c64xx-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/s3c64xx.dtsi (props changed) stable/12/sys/gnu/dts/arm/s5pv210-aquila.dts (props changed) stable/12/sys/gnu/dts/arm/s5pv210-goni.dts (props changed) stable/12/sys/gnu/dts/arm/s5pv210-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/s5pv210-smdkc110.dts (props changed) stable/12/sys/gnu/dts/arm/s5pv210-smdkv210.dts (props changed) stable/12/sys/gnu/dts/arm/s5pv210-torbreck.dts (props changed) stable/12/sys/gnu/dts/arm/sama5d31.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d31ek.dts (props changed) stable/12/sys/gnu/dts/arm/sama5d33.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d33ek.dts (props changed) stable/12/sys/gnu/dts/arm/sama5d34.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d34ek.dts (props changed) stable/12/sys/gnu/dts/arm/sama5d35.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d35ek.dts (props changed) stable/12/sys/gnu/dts/arm/sama5d36.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d36ek.dts (props changed) stable/12/sys/gnu/dts/arm/sama5d36ek_cmp.dts (props changed) stable/12/sys/gnu/dts/arm/sama5d3_can.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3_emac.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3_gmac.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3_lcd.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3_mci2.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3_tcb1.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3_uart.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3xcm.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3xcm_cmp.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3xdm.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3xmb.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3xmb_emac.dtsi (props changed) stable/12/sys/gnu/dts/arm/sama5d3xmb_gmac.dtsi (props changed) stable/12/sys/gnu/dts/arm/sh73a0-kzm9g.dts (props changed) stable/12/sys/gnu/dts/arm/sh73a0.dtsi (props changed) stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk.dtsi (props changed) stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk_nand.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk_qspi.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_arria10_socdk_sdmmc.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_arria5.dtsi (props changed) stable/12/sys/gnu/dts/arm/socfpga_arria5_socdk.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5.dtsi (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5_de0_nano_soc.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5_mcv.dtsi (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5_mcvevk.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5_socdk.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5_sockit.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5_socrates.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5_sodia.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_cyclone5_vining_fpga.dts (props changed) stable/12/sys/gnu/dts/arm/socfpga_vt.dts (props changed) stable/12/sys/gnu/dts/arm/spear1310-evb.dts (props changed) stable/12/sys/gnu/dts/arm/spear1310.dtsi (props changed) stable/12/sys/gnu/dts/arm/spear1340-evb.dts (props changed) stable/12/sys/gnu/dts/arm/spear1340.dtsi (props changed) stable/12/sys/gnu/dts/arm/spear300-evb.dts (props changed) stable/12/sys/gnu/dts/arm/spear300.dtsi (props changed) stable/12/sys/gnu/dts/arm/spear310-evb.dts (props changed) stable/12/sys/gnu/dts/arm/spear310.dtsi (props changed) stable/12/sys/gnu/dts/arm/spear320-evb.dts (props changed) stable/12/sys/gnu/dts/arm/spear320-hmi.dts (props changed) stable/12/sys/gnu/dts/arm/spear320.dtsi (props changed) stable/12/sys/gnu/dts/arm/spear600-evb.dts (props changed) stable/12/sys/gnu/dts/arm/st-pincfg.h (props changed) stable/12/sys/gnu/dts/arm/ste-dbx5x0.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-href-ab8500.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-href-ab8505.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-href-family-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-href-stuib.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-href-tvk1281618.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-href.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-hrefprev60-stuib.dts (props changed) stable/12/sys/gnu/dts/arm/ste-hrefprev60-tvk.dts (props changed) stable/12/sys/gnu/dts/arm/ste-hrefprev60.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-hrefv60plus-stuib.dts (props changed) stable/12/sys/gnu/dts/arm/ste-hrefv60plus-tvk.dts (props changed) stable/12/sys/gnu/dts/arm/ste-hrefv60plus.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-nomadik-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/ste-nomadik-s8815.dts (props changed) stable/12/sys/gnu/dts/arm/ste-snowball.dts (props changed) stable/12/sys/gnu/dts/arm/stih407-b2120.dts (props changed) stable/12/sys/gnu/dts/arm/stih407-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih407-family.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih407-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih407.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih410-b2120.dts (props changed) stable/12/sys/gnu/dts/arm/stih410-b2260.dts (props changed) stable/12/sys/gnu/dts/arm/stih410-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih410-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih410.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih415-b2000.dts (props changed) stable/12/sys/gnu/dts/arm/stih415-b2020.dts (props changed) stable/12/sys/gnu/dts/arm/stih415-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih415-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih415.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih416-b2000.dts (props changed) stable/12/sys/gnu/dts/arm/stih416-b2020.dts (props changed) stable/12/sys/gnu/dts/arm/stih416-b2020e.dts (props changed) stable/12/sys/gnu/dts/arm/stih416-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih416-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih416.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih418-b2199.dts (props changed) stable/12/sys/gnu/dts/arm/stih418-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih418.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih41x-b2000.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih41x-b2020.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih41x-b2020x.dtsi (props changed) stable/12/sys/gnu/dts/arm/stih41x.dtsi (props changed) stable/12/sys/gnu/dts/arm/stihxxx-b2120.dtsi (props changed) stable/12/sys/gnu/dts/arm/stm32f4-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stm32f429-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stm32f469-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stm32f469.dtsi (props changed) stable/12/sys/gnu/dts/arm/stm32f7-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stm32f746-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/stm32f769-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-a1000.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-ba10-tvbox.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-chuwi-v7-cw0825.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-dserve-dsrv9703c.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-gemei-g9.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-hackberry.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-hyundai-a7hd.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-inet1.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-inet97fv2.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-itead-iteaduino-plus.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-marsboard.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-mini-xplus.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-mk802.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-mk802ii.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-pcduino.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-pcduino2.dts (props changed) stable/12/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a10s-auxtek-t003.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a10s-auxtek-t004.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a10s-mk802.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a10s-olinuxino-micro.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a10s-r7-tv-dongle.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a10s-wobo-i5.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a10s.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-difrnce-dit4350.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-empire-electronix-d709.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-empire-electronix-m712.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-hsg-h702.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-inet-98v-rev2.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-licheepi-one.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-olinuxino-micro.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-olinuxino.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13-utoo-p66.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-a13.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun5i-gr8-chip-pro.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-gr8-evb.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-gr8.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun5i-q8-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun5i-r8-chip.dts (props changed) stable/12/sys/gnu/dts/arm/sun5i-r8.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun5i.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31-app4-evb1.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31-colombus.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31-i7.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31-m9.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31-mele-a1000g-quad.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s-colorfly-e708-q1.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s-cs908.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s-inet-q972.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s-primo81.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s-sina31s-core.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s-sinovoip-bpi-m2.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s-yones-toptech-bs1078-v2.dts (props changed) stable/12/sys/gnu/dts/arm/sun6i-a31s.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun6i-reference-design-tablet.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-bananapi-m1-plus.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-bananapro.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-hummingbird.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-i12-tvbox.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-icnova-swac.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-itead-ibox.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-m3.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-mk808c.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olimex-som-evb.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olimex-som204-evb.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro-emmc.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-orangepi-mini.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-orangepi.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-pcduino3-nano.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-pcduino3.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-wexler-tab7200.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20-wits-pro-a20-dkt.dts (props changed) stable/12/sys/gnu/dts/arm/sun7i-a20.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-evb.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-gt90h-v4.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-inet86dz.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-polaroid-mid2407pxe03.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a23-polaroid-mid2809pxe04.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a33-et-q8-v1.6.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a33-ga10h-v1.1.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a33-inet-d978-rev2.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a33-ippo-q8h-v1.2.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a33-olinuxino.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a33-q8-tablet.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a33-sinlinx-sina33.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-a83t.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun8i-h2-plus-bananapi-m2-zero.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h2-plus-libretech-all-h3-cc.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-r1.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus-v1.2.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-beelink-x2.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-libretech-all-h3-cc.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-mapleboard-mp130.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-nanopi-m1.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-nanopi-neo-air.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-nanopi-neo.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-nanopi.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-2.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-lite.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-pc-plus.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-plus2e.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3-orangepi-zero-plus2.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-h3.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun8i-r16-bananapi-m2m.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-r16-nintendo-nes-classic.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-r16-nintendo-super-nes-classic.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-r16-parrot.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-reference-design-tablet.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun8i-t3-cqa3t-bv3.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero-dock.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-v3s-licheepi-zero.dts (props changed) stable/12/sys/gnu/dts/arm/sun8i-v3s.dtsi (props changed) stable/12/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts (props changed) stable/12/sys/gnu/dts/arm/suniv-f1c100s-licheepi-nano.dts (props changed) stable/12/sys/gnu/dts/arm/suniv-f1c100s.dtsi (props changed) stable/12/sys/gnu/dts/arm/sunxi-bananapi-m2-plus-v1.2.dtsi (props changed) stable/12/sys/gnu/dts/arm/sunxi-common-regulators.dtsi (props changed) stable/12/sys/gnu/dts/arm/sunxi-itead-core-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/sunxi-libretech-all-h3-cc.dtsi (props changed) stable/12/sys/gnu/dts/arm/sunxi-q8-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/sunxi-reference-design-tablet.dtsi (props changed) stable/12/sys/gnu/dts/arm/tango4-common.dtsi (props changed) stable/12/sys/gnu/dts/arm/tango4-smp8758.dtsi (props changed) stable/12/sys/gnu/dts/arm/tango4-vantage-1172.dts (props changed) stable/12/sys/gnu/dts/arm/tegra114-roth.dts (props changed) stable/12/sys/gnu/dts/arm/tegra114-tn7.dts (props changed) stable/12/sys/gnu/dts/arm/tegra114.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra124-apalis-emc.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra124-apalis-eval.dts (props changed) stable/12/sys/gnu/dts/arm/tegra124-apalis-v1.2-eval.dts (props changed) stable/12/sys/gnu/dts/arm/tegra124-apalis-v1.2.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra124-apalis.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra124-jetson-tk1-emc.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra124-nyan-big-emc.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra124-nyan-big.dts (props changed) stable/12/sys/gnu/dts/arm/tegra124-nyan-blaze-emc.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra124-nyan-blaze.dts (props changed) stable/12/sys/gnu/dts/arm/tegra124.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra20-colibri-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-colibri-iris.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-colibri.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra20-harmony.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-medcom-wide.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-paz00.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-plutux.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-seaboard.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-tamonten.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra20-tec.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-ventana.dts (props changed) stable/12/sys/gnu/dts/arm/tegra20-whistler.dts (props changed) stable/12/sys/gnu/dts/arm/tegra30-apalis-eval.dts (props changed) stable/12/sys/gnu/dts/arm/tegra30-apalis-v1.1-eval.dts (props changed) stable/12/sys/gnu/dts/arm/tegra30-apalis-v1.1.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra30-apalis.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra30-cardhu-a02.dts (props changed) stable/12/sys/gnu/dts/arm/tegra30-cardhu-a04.dts (props changed) stable/12/sys/gnu/dts/arm/tegra30-colibri-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/tegra30-colibri.dtsi (props changed) stable/12/sys/gnu/dts/arm/tegra30.dtsi (props changed) stable/12/sys/gnu/dts/arm/tny_a9260.dts (props changed) stable/12/sys/gnu/dts/arm/tny_a9260_common.dtsi (props changed) stable/12/sys/gnu/dts/arm/tny_a9263.dts (props changed) stable/12/sys/gnu/dts/arm/tny_a9g20.dts (props changed) stable/12/sys/gnu/dts/arm/tps6507x.dtsi (props changed) stable/12/sys/gnu/dts/arm/tps65217.dtsi (props changed) stable/12/sys/gnu/dts/arm/tps65910.dtsi (props changed) stable/12/sys/gnu/dts/arm/twl4030.dtsi (props changed) stable/12/sys/gnu/dts/arm/twl4030_omap3.dtsi (props changed) stable/12/sys/gnu/dts/arm/twl6030.dtsi (props changed) stable/12/sys/gnu/dts/arm/twl6030_omap4.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-common32.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ld4-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ld4.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ld6b-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ld6b.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-ld4-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-ld4.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-ld6b-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-ld6b.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-pro4-ace.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-pro4-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-pro4-sanji.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-pro4.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-pro5.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-sld3-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-sld3.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-sld8-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-ph1-sld8.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-pro4-ace.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-pro4-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-pro4-sanji.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-pro4.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-pro5.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-proxstream2-gentil.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-proxstream2-vodka.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-proxstream2.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-pxs2-gentil.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-pxs2-vodka.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-pxs2.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-ref-daughter.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-sld8-ref.dts (props changed) stable/12/sys/gnu/dts/arm/uniphier-sld8.dtsi (props changed) stable/12/sys/gnu/dts/arm/uniphier-support-card.dtsi (props changed) stable/12/sys/gnu/dts/arm/usb_a9260.dts (props changed) stable/12/sys/gnu/dts/arm/usb_a9260_common.dtsi (props changed) stable/12/sys/gnu/dts/arm/usb_a9263.dts (props changed) stable/12/sys/gnu/dts/arm/usb_a9g20-dab-mmx.dtsi (props changed) stable/12/sys/gnu/dts/arm/usb_a9g20.dts (props changed) stable/12/sys/gnu/dts/arm/usb_a9g20_common.dtsi (props changed) stable/12/sys/gnu/dts/arm/usb_a9g20_lpw.dts (props changed) stable/12/sys/gnu/dts/arm/versatile-ab-ib2.dts (props changed) stable/12/sys/gnu/dts/arm/versatile-pb.dts (props changed) stable/12/sys/gnu/dts/arm/vexpress-v2p-ca15-tc1.dts (props changed) stable/12/sys/gnu/dts/arm/vexpress-v2p-ca5s.dts (props changed) stable/12/sys/gnu/dts/arm/vexpress-v2p-ca9.dts (props changed) stable/12/sys/gnu/dts/arm/vf-colibri-eval-v3.dtsi (props changed) stable/12/sys/gnu/dts/arm/vf-colibri.dtsi (props changed) stable/12/sys/gnu/dts/arm/vf500-colibri-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/vf500-colibri.dtsi (props changed) stable/12/sys/gnu/dts/arm/vf500.dtsi (props changed) stable/12/sys/gnu/dts/arm/vf610-colibri-eval-v3.dts (props changed) stable/12/sys/gnu/dts/arm/vf610-colibri.dtsi (props changed) stable/12/sys/gnu/dts/arm/vf610-cosmic.dts (props changed) stable/12/sys/gnu/dts/arm/vf610-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm/vf610-twr.dts (props changed) stable/12/sys/gnu/dts/arm/vf610-zii-dev-rev-b.dts (props changed) stable/12/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts (props changed) stable/12/sys/gnu/dts/arm/vf610-zii-dev.dtsi (props changed) stable/12/sys/gnu/dts/arm/vf610-zii-scu4-aib.dts (props changed) stable/12/sys/gnu/dts/arm/vf610.dtsi (props changed) stable/12/sys/gnu/dts/arm/vf610m4-colibri.dts (props changed) stable/12/sys/gnu/dts/arm/vf610m4-cosmic.dts (props changed) stable/12/sys/gnu/dts/arm/vf610m4.dtsi (props changed) stable/12/sys/gnu/dts/arm/vfxxx.dtsi (props changed) stable/12/sys/gnu/dts/arm/vt8500-bv07.dts (props changed) stable/12/sys/gnu/dts/arm/wm8505-ref.dts (props changed) stable/12/sys/gnu/dts/arm/wm8650-mid.dts (props changed) stable/12/sys/gnu/dts/arm/wm8750-apc8750.dts (props changed) stable/12/sys/gnu/dts/arm/wm8850-w70v2.dts (props changed) stable/12/sys/gnu/dts/arm/xenvm-4.2.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-7000.dtsi (props changed) stable/12/sys/gnu/dts/arm/zynq-cc108.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-microzed.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-parallella.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zc702.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zc706.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zc770-xm010.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zc770-xm011.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zc770-xm012.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zc770-xm013.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zed.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zybo-z7.dts (props changed) stable/12/sys/gnu/dts/arm/zynq-zybo.dts (props changed) stable/12/sys/gnu/dts/arm64/actions/s900-bubblegum-96.dts (props changed) stable/12/sys/gnu/dts/arm64/al/alpine-v2-evp.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/axp803.dtsi (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-amarula-relic.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-lts.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-plus.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-pinebook.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine-baseboard.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine.dtsi (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-bananapi-m2-plus-v1.2.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-bananapi-m2-plus.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5-devboard.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-emlid-neutis-n5.dtsi (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo-plus2.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo2.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-pc2.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-prime.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus2.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-lite2.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-one-plus.dts (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi (props changed) stable/12/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts (props changed) stable/12/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts (props changed) stable/12/sys/gnu/dts/arm64/amd/amd-overdrive-rev-b0.dts (props changed) stable/12/sys/gnu/dts/arm64/amd/amd-overdrive-rev-b1.dts (props changed) stable/12/sys/gnu/dts/arm64/amd/amd-overdrive.dts (props changed) stable/12/sys/gnu/dts/arm64/amd/amd-seattle-clks.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amd/amd-seattle-soc.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amd/amd-seattle-xgbe-b.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amd/husky.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-g12a-u200.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gx-p23x-q20x.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-p200.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-p201.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-p20x.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95-meta.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95-pro.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95-telos.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-hub.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-play2.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-mali.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-p241.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-p230.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-p231.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-p281.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-tx3-mini.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x.dtsi (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-nexbox-a1.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-q200.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-q201.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-rbox-pro.dts (props changed) stable/12/sys/gnu/dts/arm64/amlogic/meson-gxm-vega-s96.dts (props changed) stable/12/sys/gnu/dts/arm64/apm/apm-merlin.dts (props changed) stable/12/sys/gnu/dts/arm64/apm/apm-mustang.dts (props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8-gicv3-psci.dts (props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8-gicv3.dts (props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8-psci.dts (props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8-psci.dtsi (props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8-spin-table.dtsi (props changed) stable/12/sys/gnu/dts/arm64/arm/foundation-v8.dts (props changed) stable/12/sys/gnu/dts/arm64/arm/juno-clocks.dtsi (props changed) stable/12/sys/gnu/dts/arm64/arm/juno-cs-r1r2.dtsi (props changed) stable/12/sys/gnu/dts/arm64/arm/juno-motherboard.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-3-b-plus.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-3-b.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/bcm2837-rpi-cm3-io3.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/northstar2/ns2-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/northstar2/ns2-svk.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/northstar2/ns2-xmc.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/bcm958742-base.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/bcm958742k.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/bcm958742t.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/bcm958802a802x.dts (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray-board-base.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray-clock.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray-fs4.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray-pcie.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm64/broadcom/stingray/stingray-sata.dtsi (props changed) stable/12/sys/gnu/dts/arm64/cavium/thunder-88xx.dts (props changed) stable/12/sys/gnu/dts/arm64/cavium/thunder2-99xx.dts (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos5433-bus.dtsi (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos5433-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tm2-common.dtsi (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tm2.dts (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tm2e.dts (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos5433-tmu.dtsi (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos7-espresso.dts (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos7-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm64/exynos/exynos7-trip-points.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frdm.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frwy.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a-qds.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1012a-rdb.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1028a-qds.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043-post.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1043a-rdb.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1046-post.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1088a-qds.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls1088a-rdb.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls2080a-qds.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls2080a-rdb.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls2080a-simu.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls2080a.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls2088a-qds.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls2088a-rdb.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls2088a.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls208xa-qds.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-ls208xa-rdb.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/fsl-lx2160a-qds.dts (props changed) stable/12/sys/gnu/dts/arm64/freescale/imx8mq-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-bman-portals.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-10g-0.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-10g-1.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-0.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-1.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-2.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-3.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-4.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0-1g-5.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-fman3-0.dtsi (props changed) stable/12/sys/gnu/dts/arm64/freescale/qoriq-qman-portals.dtsi (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi3670-hikey970.dts (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hi6220-coresight.dtsi (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hikey-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hikey960-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hikey970-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hip05-d02.dts (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hip06-d03.dts (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/hip07-d05.dts (props changed) stable/12/sys/gnu/dts/arm64/hisilicon/poplar-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm64/lg/lg1312-ref.dts (props changed) stable/12/sys/gnu/dts/arm64/lg/lg1313-ref.dts (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-371x.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-3720-db.dts (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-7020.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-7040.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-70x0.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8020.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8040-mcbin-singleshot.dts (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dts (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8040.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8080-db.dts (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-8080.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-80x0.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-ap810-ap0.dtsi (props changed) stable/12/sys/gnu/dts/arm64/marvell/armada-common.dtsi (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt2712-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6380.dtsi (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6755-evb.dts (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6755.dtsi (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6795-evb.dts (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt6795.dtsi (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt7622-bananapi-bpi-r64.dts (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt7622-rfb1.dts (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt8173-evb.dts (props changed) stable/12/sys/gnu/dts/arm64/mediatek/mt8173-pinfunc.h (props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra132-norrin.dts (props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi (props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2371-0000.dts (props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2530.dtsi (props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2571.dts (props changed) stable/12/sys/gnu/dts/arm64/nvidia/tegra210-p2595.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/apq8016-sbc-pmic-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/apq8016-sbc-soc-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/apq8016-sbc.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c-pmic-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/ipq8074-hk01.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8916-mtp.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8916-mtp.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8916-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8992-bullhead-rev-101.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8992-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8994-angler-rev-101.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8994-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8994-smd-rpm.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8996-mtp.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8996-mtp.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8998-mtp.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/msm8998-pins.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8004.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/pm8994.dtsi (props changed) stable/12/sys/gnu/dts/arm64/qcom/qcs404-evb-1000.dts (props changed) stable/12/sys/gnu/dts/arm64/qcom/qcs404-evb-4000.dts (props changed) stable/12/sys/gnu/dts/arm64/realtek/rtd1295-mele-v9.dts (props changed) stable/12/sys/gnu/dts/arm64/realtek/rtd1295-probox2-ava.dts (props changed) stable/12/sys/gnu/dts/arm64/realtek/rtd1295-zidoo-x9s.dts (props changed) stable/12/sys/gnu/dts/arm64/realtek/rtd129x.dtsi (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1-h3ulcb-kf.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1-h3ulcb.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1-salvator-x.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795-es1.dtsi (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795-h3ulcb-kf.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795-h3ulcb.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795-salvator-x.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7795-salvator-xs.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7796-m3ulcb-kf.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7796-m3ulcb.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a7796-salvator-x.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb-kf.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77965-m3nulcb.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77965-salvator-x.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77965-salvator-xs.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77970-eagle.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77980-condor.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/r8a77980-v3hsk.dts (props changed) stable/12/sys/gnu/dts/arm64/renesas/salvator-x.dtsi (props changed) stable/12/sys/gnu/dts/arm64/renesas/salvator-xs.dtsi (props changed) stable/12/sys/gnu/dts/arm64/rockchip/px30-evb.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3328-evb.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368-evb-act8846.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3368-lion-haikou.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-evb.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-firefly.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-bob.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-kevin.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet-inx.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-gru-scarlet-kd.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-op1-opp.dtsi (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-opp.dtsi (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-puma-haikou.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-puma.dtsi (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-roc-pc.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-sapphire.dts (props changed) stable/12/sys/gnu/dts/arm64/rockchip/rk3399-sapphire.dtsi (props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld11-global.dts (props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld11-ref.dts (props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-ld20-ref.dts (props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-pinctrl.dtsi (props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-ref-daughter.dtsi (props changed) stable/12/sys/gnu/dts/arm64/socionext/uniphier-support-card.dtsi (props changed) stable/12/sys/gnu/dts/arm64/sprd/sc9836-openphone.dts (props changed) stable/12/sys/gnu/dts/arm64/sprd/sharkl64.dtsi (props changed) stable/12/sys/gnu/dts/arm64/sprd/whale2.dtsi (props changed) stable/12/sys/gnu/dts/arm64/synaptics/berlin4ct-dmp.dts (props changed) stable/12/sys/gnu/dts/arm64/synaptics/berlin4ct-stb.dts (props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi (props changed) stable/12/sys/gnu/dts/arm64/ti/k3-am65.dtsi (props changed) stable/12/sys/gnu/dts/arm64/xilinx/avnet-ultra96-rev1.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-clk.dtsi (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1232-revA.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1254-revA.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1275-revA.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm015-dc1.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm016-dc2.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm017-dc3.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm018-dc4.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zc1751-xm019-dc5.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-rev1.0.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revA.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu102-revB.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu104-revA.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu106-revA.dts (props changed) stable/12/sys/gnu/dts/arm64/xilinx/zynqmp-zcu111-revA.dts (props changed) stable/12/sys/gnu/dts/arm64/zte/zx296718-evb.dts (props changed) stable/12/sys/gnu/dts/arm64/zte/zx296718-pcbox.dts (props changed) stable/12/sys/gnu/dts/include/dt-bindings/arm/ux500_pm_domains.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/bus/ti-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clk/ti-dra7-atl.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/actions,s700-cmu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/actions,s900-cmu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/alphascale,asm9260.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/am3.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/am4.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/aspeed-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/at91.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/axg-audio-clkc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/axg-clkc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/axis,artpec6-clkctrl.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm-cygnus.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm-ns2.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm-nsp.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm-sr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm21664.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm281xx.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm2835-aux.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/bcm2835.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/berlin2.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/berlin2q.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/boston-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/clps711x-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/cortina,gemini-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/dm814.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/dm816.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/dra7.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/efm32-cmu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos-audss-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos3250.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos4.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos4415.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5250.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5260-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5410.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos5420.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/exynos7-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/gxbb-clkc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/hi3516cv300-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/hi3519-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/hi3620-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/hi3660-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/hi3670-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/hi6220-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/hip04-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/histb-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/hix5hd2-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx1-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx21-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx27-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6qdl-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6sl-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6sll-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6sx-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx6ul-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/imx8-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/jz4725b-cgu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/jz4740-cgu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/jz4770-cgu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/jz4780-cgu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/lpc18xx-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/lpc18xx-cgu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/lpc32xx-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/lsi,axm5516-clks.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa168.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa1928.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/marvell,pxa910.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/maxim,max77620.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/maxim,max77686.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/maxim,max77802.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/maxim,max9485.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/microchip,pic32-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mpc512x-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mt2701-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mt6797-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mt7622-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mt7629-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/mt8135-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/nuvoton,npcm7xx-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/omap4.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/omap5.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/oxsemi,ox810se.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/oxsemi,ox820.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/pistachio-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/px30-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/pxa-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,camcc-sdm845.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,dispcc-sdm845.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-apq8084.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq4019.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq806x.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-ipq8074.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-mdm9615.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8660.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8916.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8960.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8974.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8994.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8996.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-qcs404.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm660.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sdm845.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,gpucc-sdm845.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-ipq806x.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-mdm9615.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,lcc-msm8960.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,lpass-sdm845.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-apq8084.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8960.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8974.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,mmcc-msm8996.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/qcom,videocc-sdm845.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r7s9210-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a73a4-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7740-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7743-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7744-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7745-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77470-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7779-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7790-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7790-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7791-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7791-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7792-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7792-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7793-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7793-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7794-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7794-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7795-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a7796-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77965-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77970-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77980-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77990-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r8a77995-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/r9a06g032-sysctrl.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/renesas-cpg-mssr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3036-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3066a-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3128-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3228-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3288-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3328-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3368-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3399-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rk3399-ddr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rockchip,rk808.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/rv1108-cru.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/s3c2410.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/s3c2412.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/s3c2443.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/s5pv210-audss.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/s5pv210.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/samsung,s2mps11.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/samsung,s3c64xx-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sh73a0-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sprd,sc9860-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/ste-ab8500.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stih407-clks.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stih410-clks.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stih415-clks.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stih416-clks.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stih418-clks.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stm32fx-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stm32h7-clks.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/stratix10-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun4i-a10-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun4i-a10-pll2.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun50i-a64-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun50i-h6-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun50i-h6-r-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun5i-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun6i-a31-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun7i-a20-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-a23-a33-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-a83t-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-de2.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-h3-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-r-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-r40-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-tcon-top.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun8i-v3s-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun9i-a80-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun9i-a80-de.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/sun9i-a80-usb.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/suniv-ccu-f1c100s.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra114-car.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra124-car.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra186-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra194-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra20-car.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/tegra30-car.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/vf610-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/xlnx,zynqmp-clk.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/zx296702-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/clock/zx296718-clock.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/display/tda998x.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/dma/at91.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/dma/axi-dmac.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/dma/dw-dmac.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/dma/jz4780-dma.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/dma/nbpfaxi.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/dma/sun4i-a10.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/firmware/imx/rsrc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gce/mt8173-gce.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/aspeed-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/meson-axg-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/meson-g12a-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/meson-gxbb-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/meson-gxl-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/meson8-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/meson8b-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/tegra-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/tegra186-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/tegra194-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/gpio/uniphier-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/i2c/i2c.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/iio/adc/at91-sama5d2_adc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/iio/adc/fsl-imx25-gcq.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/iio/adi,ad5592r.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/iio/qcom,spmi-vadc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/input/gpio-keys.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/input/input.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/input/ti-drv260x.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/interrupt-controller/arm-gic.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq-st.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/interrupt-controller/irq.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/interrupt-controller/mips-gic.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/interrupt-controller/mvebu-icu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/leds/common.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/leds/leds-netxbig.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/leds/leds-ns2.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/leds/leds-pca9532.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/leds/leds-pca955x.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mailbox/tegra186-hsp.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/media/c8sectpfe.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/media/omap3-isp.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/media/tda1997x.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/media/tvp5150.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/media/xilinx-vip.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/mt2701-larb-port.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/mt2712-larb-port.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/mt8173-larb-port.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/tegra114-mc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/tegra124-mc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/tegra186-mc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/tegra20-mc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/tegra210-mc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/memory/tegra30-mc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/arizona.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/as3722.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/at91-usart.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/atmel-flexcom.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/dbx500-prcmu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/max77620.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/palmas.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/qcom-rpm.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/st-lpc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/stm32f4-rcc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/stm32f7-rcc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mfd/stm32h7-rcc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mips/lantiq_rcu_gphy.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/mux/mux.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/net/microchip-lan78xx.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/net/mscc-phy-vsc8531.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/net/rfkill-regulator.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/net/ti-dp83867.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/phy/phy-ocelot-serdes.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/phy/phy-pistachio-usb.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/phy/phy-qcom-qusb2.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/phy/phy.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/am33xx.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/am43xx.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/bcm2835.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/brcm,pinctrl-stingray.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/dm814x.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/dra.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/hisi.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/k3.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/keystone.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/mt6397-pinfunc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/mt65xx.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/mt6797-pinfunc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/mt7623-pinfunc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/nomadik.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/omap.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8qm.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8qxp.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-io-pad.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/pinctrl-tegra.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-gpio.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/qcom,pmic-mpp.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/r7s72100-pinctrl.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/r7s9210-pinctrl.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/rzn1-pinctrl.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/samsung.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/stm32-pinfunc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/stm32f429-pinfunc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/stm32f746-pinfunc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/stm32h7-pinfunc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pinctrl/sun4i-a10.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/imx7-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/imx8mq-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/mt2701-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/mt2712-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/mt6797-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/mt7622-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/mt7623a-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/owl-s500-powergate.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/owl-s700-powergate.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/owl-s900-powergate.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/px30-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7743-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7744-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7745-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77470-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a774a1-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a774c0-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7779-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7790-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7791-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7792-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7793-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7794-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7795-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a7796-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77965-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77970-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77980-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77990-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/r8a77995-sysc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/raspberrypi-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3036-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3066-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3128-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3188-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3228-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3288-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3328-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3366-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3368-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/rk3399-power.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/tegra186-powergate.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/power/tegra194-powergate.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/pwm/pwm.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/regulator/active-semi,8945a-regulator.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/regulator/maxim,max77802.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/regulator/qcom,rpmh-regulator.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/actions,s700-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/actions,s900-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-a10.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-a10sr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr-s10.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/altr,rst-mgr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-axg-audio-arb.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-axg-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson8b-clkc-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson8b-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/axg-aoclkc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/cortina,gemini-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/gxbb-aoclkc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/hisi,hi6220-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/imx7-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/mt2701-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/mt7622-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/mt8135-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/mt8173-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/oxsemi,ox810se.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/oxsemi,ox820.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/pistachio-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-apq8084.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-ipq806x.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-mdm9615.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8660.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8916.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8960.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8974.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-apq8084.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8960.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,mmcc-msm8974.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,sdm845-aoss.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/qcom,sdm845-pdc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/snps,hsdk-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/stih407-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/stih415-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/stih416-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/stm32mp1-resets.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun4i-a10-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun50i-a64-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun50i-h6-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun50i-h6-r-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun5i-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun6i-a31-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun8i-a23-a33-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun8i-a83t-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun8i-de2.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun8i-h3-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun8i-r-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun8i-r40-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun8i-v3s-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun9i-a80-ccu.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun9i-a80-de.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/sun9i-a80-usb.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/suniv-ccu-f1c100s.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/tegra124-car.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/tegra186-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/tegra194-reset.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/tegra210-car.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/reset/ti-syscon.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/soc/qcom,apr.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/soc/qcom,gsbi.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/soc/qcom,rpmh-rsc.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/soc/rockchip,boot-mode.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/soc/zte,pm_domains.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/apq8016-lpass.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/audio-jack-events.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/cs35l32.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/cs42l42.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/fsl-imx-audmux.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/qcom,q6afe.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/qcom,q6asm.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/rt5640.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/rt5651.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/samsung-i2s.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/tas2552.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/sound/tlv320aic31xx-micbias.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/spmi/spmi.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/thermal/lm90.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/thermal/tegra124-soctherm.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/thermal/tegra186-bpmp-thermal.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/thermal/tegra194-bpmp-thermal.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/thermal/thermal.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/thermal/thermal_exynos.h (props changed) stable/12/sys/gnu/dts/include/dt-bindings/usb/pd.h (props changed) stable/12/sys/gnu/dts/mips/3G-6200N.dts (props changed) stable/12/sys/gnu/dts/mips/3G-6200NL.dts (props changed) stable/12/sys/gnu/dts/mips/3G150B.dts (props changed) stable/12/sys/gnu/dts/mips/3G300M.dts (props changed) stable/12/sys/gnu/dts/mips/A5-V11.dts (props changed) stable/12/sys/gnu/dts/mips/AI-BR100.dts (props changed) stable/12/sys/gnu/dts/mips/AIR3GII.dts (props changed) stable/12/sys/gnu/dts/mips/ALL0239-3G.dts (props changed) stable/12/sys/gnu/dts/mips/ALL0256N-4M.dts (props changed) stable/12/sys/gnu/dts/mips/ALL0256N-8M.dts (props changed) stable/12/sys/gnu/dts/mips/ALL5002.dts (props changed) stable/12/sys/gnu/dts/mips/ALL5003.dts (props changed) stable/12/sys/gnu/dts/mips/AR670W.dts (props changed) stable/12/sys/gnu/dts/mips/AR725W.dts (props changed) stable/12/sys/gnu/dts/mips/ASL26555-16M.dts (props changed) stable/12/sys/gnu/dts/mips/ASL26555-8M.dts (props changed) stable/12/sys/gnu/dts/mips/ATP-52B.dts (props changed) stable/12/sys/gnu/dts/mips/AWAPN2403.dts (props changed) stable/12/sys/gnu/dts/mips/AWM002-4M.dtsi (props changed) stable/12/sys/gnu/dts/mips/AWM002-8M.dtsi (props changed) stable/12/sys/gnu/dts/mips/AWM002-EVB-4M.dts (props changed) stable/12/sys/gnu/dts/mips/AWM002-EVB-8M.dts (props changed) stable/12/sys/gnu/dts/mips/AWM002.dtsi (props changed) stable/12/sys/gnu/dts/mips/AWM003-EVB.dts (props changed) stable/12/sys/gnu/dts/mips/ArcherC20i.dts (props changed) stable/12/sys/gnu/dts/mips/BC2.dts (props changed) stable/12/sys/gnu/dts/mips/BR-6425.dts (props changed) stable/12/sys/gnu/dts/mips/BR-6475ND.dts (props changed) stable/12/sys/gnu/dts/mips/BROADWAY.dts (props changed) stable/12/sys/gnu/dts/mips/CARAMBOLA.dts (props changed) stable/12/sys/gnu/dts/mips/CF-WR800N.dts (props changed) stable/12/sys/gnu/dts/mips/CS-QR10.dts (props changed) stable/12/sys/gnu/dts/mips/CY-SWR1100.dts (props changed) stable/12/sys/gnu/dts/mips/D105.dts (props changed) stable/12/sys/gnu/dts/mips/DAP-1350.dts (props changed) stable/12/sys/gnu/dts/mips/DB-WRT01.dts (props changed) stable/12/sys/gnu/dts/mips/DCS-930.dts (props changed) stable/12/sys/gnu/dts/mips/DCS-930L-B1.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-300-B1.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-300-B7.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-320-B1.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-600-B1.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-600-B2.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-610-A1.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-615-D.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-615-H1.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-620-A1.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-620-D1.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-645.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-810L.dts (props changed) stable/12/sys/gnu/dts/mips/DIR-860L-B1.dts (props changed) stable/12/sys/gnu/dts/mips/E1700.dts (props changed) stable/12/sys/gnu/dts/mips/ESR-9753.dts (props changed) stable/12/sys/gnu/dts/mips/EX2700.dts (props changed) stable/12/sys/gnu/dts/mips/F5D8235_V1.dts (props changed) stable/12/sys/gnu/dts/mips/F5D8235_V2.dts (props changed) stable/12/sys/gnu/dts/mips/F7C027.dts (props changed) stable/12/sys/gnu/dts/mips/FIREWRT.dts (props changed) stable/12/sys/gnu/dts/mips/FONERA20N.dts (props changed) stable/12/sys/gnu/dts/mips/FREESTATION5.dts (props changed) stable/12/sys/gnu/dts/mips/GL-MT300A.dts (props changed) stable/12/sys/gnu/dts/mips/GL-MT300N.dts (props changed) stable/12/sys/gnu/dts/mips/GL-MT750.dts (props changed) stable/12/sys/gnu/dts/mips/HC5661.dts (props changed) stable/12/sys/gnu/dts/mips/HC5761.dts (props changed) stable/12/sys/gnu/dts/mips/HC5861.dts (props changed) stable/12/sys/gnu/dts/mips/HC5XXX.dtsi (props changed) stable/12/sys/gnu/dts/mips/HG255D.dts (props changed) stable/12/sys/gnu/dts/mips/HLKRM04.dts (props changed) stable/12/sys/gnu/dts/mips/HPM.dts (props changed) stable/12/sys/gnu/dts/mips/HT-TM02.dts (props changed) stable/12/sys/gnu/dts/mips/HW550-3G.dts (props changed) stable/12/sys/gnu/dts/mips/IP2202.dts (props changed) stable/12/sys/gnu/dts/mips/JHR-N805R.dts (props changed) stable/12/sys/gnu/dts/mips/JHR-N825R.dts (props changed) stable/12/sys/gnu/dts/mips/JHR-N926R.dts (props changed) stable/12/sys/gnu/dts/mips/LINKIT7688.dts (props changed) stable/12/sys/gnu/dts/mips/M2M.dts (props changed) stable/12/sys/gnu/dts/mips/M3.dts (props changed) stable/12/sys/gnu/dts/mips/M4-4M.dts (props changed) stable/12/sys/gnu/dts/mips/M4-8M.dts (props changed) stable/12/sys/gnu/dts/mips/MINIEMBPLUG.dts (props changed) stable/12/sys/gnu/dts/mips/MINIEMBWIFI.dts (props changed) stable/12/sys/gnu/dts/mips/MIWIFI-MINI.dts (props changed) stable/12/sys/gnu/dts/mips/MIWIFI-NANO.dts (props changed) stable/12/sys/gnu/dts/mips/MLW221.dts (props changed) stable/12/sys/gnu/dts/mips/MLWG2.dts (props changed) stable/12/sys/gnu/dts/mips/MOFI3500-3GN.dts (props changed) stable/12/sys/gnu/dts/mips/MPRA1.dts (props changed) stable/12/sys/gnu/dts/mips/MPRA2.dts (props changed) stable/12/sys/gnu/dts/mips/MR-102N.dts (props changed) stable/12/sys/gnu/dts/mips/MT7620a.dts (props changed) stable/12/sys/gnu/dts/mips/MT7620a_MT7530.dts (props changed) stable/12/sys/gnu/dts/mips/MT7620a_MT7610e.dts (props changed) stable/12/sys/gnu/dts/mips/MT7620a_V22SG.dts (props changed) stable/12/sys/gnu/dts/mips/MT7621.dts (props changed) stable/12/sys/gnu/dts/mips/MT7628.dts (props changed) stable/12/sys/gnu/dts/mips/MZK-750DHP.dts (props changed) stable/12/sys/gnu/dts/mips/MZK-DP150N.dts (props changed) stable/12/sys/gnu/dts/mips/MZK-EX300NP.dts (props changed) stable/12/sys/gnu/dts/mips/MZK-EX750NP.dts (props changed) stable/12/sys/gnu/dts/mips/MZK-W04N-XX.dts (props changed) stable/12/sys/gnu/dts/mips/MZK-W300NH2.dts (props changed) stable/12/sys/gnu/dts/mips/MZK-WDPR.dts (props changed) stable/12/sys/gnu/dts/mips/MicroWRT.dts (props changed) stable/12/sys/gnu/dts/mips/NA930.dts (props changed) stable/12/sys/gnu/dts/mips/NBG-419N.dts (props changed) stable/12/sys/gnu/dts/mips/NCS601W.dts (props changed) stable/12/sys/gnu/dts/mips/NW718.dts (props changed) stable/12/sys/gnu/dts/mips/OY-0001.dts (props changed) stable/12/sys/gnu/dts/mips/PBR-M1.dts (props changed) stable/12/sys/gnu/dts/mips/PSG1208.dts (props changed) stable/12/sys/gnu/dts/mips/PSR-680W.dts (props changed) stable/12/sys/gnu/dts/mips/PWH2004.dts (props changed) stable/12/sys/gnu/dts/mips/PX-4885-4M.dts (props changed) stable/12/sys/gnu/dts/mips/PX-4885-8M.dts (props changed) stable/12/sys/gnu/dts/mips/PX-4885.dtsi (props changed) stable/12/sys/gnu/dts/mips/RE6500.dts (props changed) stable/12/sys/gnu/dts/mips/RP-N53.dts (props changed) stable/12/sys/gnu/dts/mips/RT-G32-B1.dts (props changed) stable/12/sys/gnu/dts/mips/RT-N10-PLUS.dts (props changed) stable/12/sys/gnu/dts/mips/RT-N13U.dts (props changed) stable/12/sys/gnu/dts/mips/RT-N14U.dts (props changed) stable/12/sys/gnu/dts/mips/RT-N15.dts (props changed) stable/12/sys/gnu/dts/mips/RT-N56U.dts (props changed) stable/12/sys/gnu/dts/mips/RT5350F-OLINUXINO-EVB.dts (props changed) stable/12/sys/gnu/dts/mips/RT5350F-OLINUXINO.dts (props changed) stable/12/sys/gnu/dts/mips/RUT5XX.dts (props changed) stable/12/sys/gnu/dts/mips/SAP-G3200U3.dts (props changed) stable/12/sys/gnu/dts/mips/SK-WB8.dts (props changed) stable/12/sys/gnu/dts/mips/SL-R7205.dts (props changed) stable/12/sys/gnu/dts/mips/TEW-691GR.dts (props changed) stable/12/sys/gnu/dts/mips/TEW-692GR.dts (props changed) stable/12/sys/gnu/dts/mips/TINY-AC.dts (props changed) stable/12/sys/gnu/dts/mips/UBNT-ERX.dts (props changed) stable/12/sys/gnu/dts/mips/UR-326N4G.dts (props changed) stable/12/sys/gnu/dts/mips/UR-336UN.dts (props changed) stable/12/sys/gnu/dts/mips/V11STFE.dts (props changed) stable/12/sys/gnu/dts/mips/V22RW-2X2.dts (props changed) stable/12/sys/gnu/dts/mips/VOCORE-16M.dts (props changed) stable/12/sys/gnu/dts/mips/VOCORE-8M.dts (props changed) stable/12/sys/gnu/dts/mips/VOCORE.dtsi (props changed) stable/12/sys/gnu/dts/mips/W150M.dts (props changed) stable/12/sys/gnu/dts/mips/W306R_V20.dts (props changed) stable/12/sys/gnu/dts/mips/W502U.dts (props changed) stable/12/sys/gnu/dts/mips/WCR150GN.dts (props changed) stable/12/sys/gnu/dts/mips/WF-2881.dts (props changed) stable/12/sys/gnu/dts/mips/WHR-1166D.dts (props changed) stable/12/sys/gnu/dts/mips/WHR-300HP2.dts (props changed) stable/12/sys/gnu/dts/mips/WHR-600D.dts (props changed) stable/12/sys/gnu/dts/mips/WHR-G300N.dts (props changed) stable/12/sys/gnu/dts/mips/WITI.dts (props changed) stable/12/sys/gnu/dts/mips/WIZARD8800.dts (props changed) stable/12/sys/gnu/dts/mips/WIZFI630A.dts (props changed) stable/12/sys/gnu/dts/mips/WL-330N.dts (props changed) stable/12/sys/gnu/dts/mips/WL-330N3G.dts (props changed) stable/12/sys/gnu/dts/mips/WL-341V3.dts (props changed) stable/12/sys/gnu/dts/mips/WL-351.dts (props changed) stable/12/sys/gnu/dts/mips/WLI-TX4-AG300N.dts (props changed) stable/12/sys/gnu/dts/mips/WMR-300.dts (props changed) stable/12/sys/gnu/dts/mips/WNCE2001.dts (props changed) stable/12/sys/gnu/dts/mips/WNDR3700V5.dts (props changed) stable/12/sys/gnu/dts/mips/WR512-3GN-4M.dts (props changed) stable/12/sys/gnu/dts/mips/WR512-3GN-8M.dts (props changed) stable/12/sys/gnu/dts/mips/WR6202.dts (props changed) stable/12/sys/gnu/dts/mips/WRH-300CR.dts (props changed) stable/12/sys/gnu/dts/mips/WRTNODE.dts (props changed) stable/12/sys/gnu/dts/mips/WRTNODE2.dtsi (props changed) stable/12/sys/gnu/dts/mips/WRTNODE2P.dts (props changed) stable/12/sys/gnu/dts/mips/WRTNODE2R.dts (props changed) stable/12/sys/gnu/dts/mips/WSR-1166.dts (props changed) stable/12/sys/gnu/dts/mips/WSR-600.dts (props changed) stable/12/sys/gnu/dts/mips/WT1520-4M.dts (props changed) stable/12/sys/gnu/dts/mips/WT1520-8M.dts (props changed) stable/12/sys/gnu/dts/mips/WT1520.dtsi (props changed) stable/12/sys/gnu/dts/mips/WT3020-4M.dts (props changed) stable/12/sys/gnu/dts/mips/WT3020-8M.dts (props changed) stable/12/sys/gnu/dts/mips/WZR-AGL300NH.dts (props changed) stable/12/sys/gnu/dts/mips/X5.dts (props changed) stable/12/sys/gnu/dts/mips/X8.dts (props changed) stable/12/sys/gnu/dts/mips/XDXRN502J.dts (props changed) stable/12/sys/gnu/dts/mips/Y1.dts (props changed) stable/12/sys/gnu/dts/mips/Y1.dtsi (props changed) stable/12/sys/gnu/dts/mips/Y1S.dts (props changed) stable/12/sys/gnu/dts/mips/YOUKU-YK1.dts (props changed) stable/12/sys/gnu/dts/mips/ZBT-WA05.dts (props changed) stable/12/sys/gnu/dts/mips/ZBT-WE826.dts (props changed) stable/12/sys/gnu/dts/mips/ZBT-WG2626.dts (props changed) stable/12/sys/gnu/dts/mips/ZBT-WG3526.dts (props changed) stable/12/sys/gnu/dts/mips/ZBT-WR8305RT.dts (props changed) stable/12/sys/gnu/dts/mips/ZTE-Q7.dts (props changed) stable/12/sys/gnu/dts/mips/ingenic/canna.dts (props changed) stable/12/sys/gnu/dts/mips/ingenic/ci20.dts (props changed) stable/12/sys/gnu/dts/mips/ingenic/jz4780.dtsi (props changed) stable/12/sys/gnu/dts/mips/ingenic/x1000.dtsi (props changed) stable/12/sys/gnu/dts/mips/mt7620a.dtsi (props changed) stable/12/sys/gnu/dts/mips/mt7620n.dtsi (props changed) stable/12/sys/gnu/dts/mips/mt7621.dtsi (props changed) stable/12/sys/gnu/dts/mips/mt7628an.dtsi (props changed) stable/12/sys/gnu/dts/mips/rt2880.dtsi (props changed) stable/12/sys/gnu/dts/mips/rt3050.dtsi (props changed) stable/12/sys/gnu/dts/mips/rt3352.dtsi (props changed) stable/12/sys/gnu/dts/mips/rt3883.dtsi (props changed) stable/12/sys/gnu/dts/mips/rt5350.dtsi (props changed) Modified: stable/12/sys/gnu/dts/arm/alphascale-asm9260.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/alphascale-asm9260.dtsi Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/alphascale-asm9260.dtsi Wed Aug 7 19:18:32 2019 (r350690) @@ -4,10 +4,11 @@ * Licensed under the X11 license or the GPL v2 (or later) */ -#include "skeleton.dtsi" #include / { + #address-cells = <1>; + #size-cells = <1>; interrupt-parent = <&icoll>; memory { Modified: stable/12/sys/gnu/dts/arm/alpine.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/alpine.dtsi Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/alpine.dtsi Wed Aug 7 19:18:32 2019 (r350690) @@ -25,11 +25,17 @@ */ #include -#include "skeleton64.dtsi" / { + #address-cells = <2>; + #size-cells = <2>; /* SOC compatibility */ compatible = "al,alpine"; + + memory { + device_type = "memory"; + reg = <0 0 0 0>; + }; /* CPU Configuration */ cpus { Modified: stable/12/sys/gnu/dts/arm/am335x-baltos-ir2110.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-baltos-ir2110.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -72,7 +72,3 @@ dual_emac_res_vlan = <2>; phy-handle = <&phy1>; }; - -&phy_sel { - rmii-clock-ext = <1>; -}; Modified: stable/12/sys/gnu/dts/arm/am335x-baltos-ir3220.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-baltos-ir3220.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -114,7 +114,3 @@ dual_emac_res_vlan = <2>; phy-handle = <&phy1>; }; - -&phy_sel { - rmii-clock-ext = <1>; -}; Modified: stable/12/sys/gnu/dts/arm/am335x-baltos-ir5221.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-baltos-ir5221.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -133,10 +133,6 @@ phy-handle = <&phy1>; }; -&phy_sel { - rmii-clock-ext = <1>; -}; - &dcan1 { pinctrl-names = "default"; pinctrl-0 = <&dcan1_pins>; Modified: stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-chiliboard.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -14,6 +14,10 @@ compatible = "grinn,am335x-chiliboard", "grinn,am335x-chilisom", "ti,am33xx"; + chosen { + stdout-path = &uart0; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default"; @@ -149,10 +153,6 @@ &cpsw_emac0 { phy-handle = <ðphy0>; phy-mode = "rmii"; -}; - -&phy_sel { - rmii-clock-ext; }; /* USB */ Modified: stable/12/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-evm.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-evm.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -57,6 +57,24 @@ enable-active-high; }; + /* TPS79501 */ + v1_8d_reg: fixedregulator-v1_8d { + compatible = "regulator-fixed"; + regulator-name = "v1_8d"; + vin-supply = <&vbat>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + /* TPS79501 */ + v3_3d_reg: fixedregulator-v3_3d { + compatible = "regulator-fixed"; + regulator-name = "v3_3d"; + vin-supply = <&vbat>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + matrix_keypad: matrix_keypad0 { compatible = "gpio-matrix-keypad"; debounce-delay-ms = <5>; @@ -499,10 +517,10 @@ status = "okay"; /* Regulators */ - AVDD-supply = <&vaux2_reg>; - IOVDD-supply = <&vaux2_reg>; - DRVDD-supply = <&vaux2_reg>; - DVDD-supply = <&vbat>; + AVDD-supply = <&v3_3d_reg>; + IOVDD-supply = <&v3_3d_reg>; + DRVDD-supply = <&v3_3d_reg>; + DVDD-supply = <&v1_8d_reg>; }; }; Modified: stable/12/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-evmsk.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-evmsk.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -73,6 +73,24 @@ enable-active-high; }; + /* TPS79518 */ + v1_8d_reg: fixedregulator-v1_8d { + compatible = "regulator-fixed"; + regulator-name = "v1_8d"; + vin-supply = <&vbat>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + /* TPS78633 */ + v3_3d_reg: fixedregulator-v3_3d { + compatible = "regulator-fixed"; + regulator-name = "v3_3d"; + vin-supply = <&vbat>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + leds { pinctrl-names = "default"; pinctrl-0 = <&user_leds_s0>; @@ -501,10 +519,10 @@ status = "okay"; /* Regulators */ - AVDD-supply = <&vaux2_reg>; - IOVDD-supply = <&vaux2_reg>; - DRVDD-supply = <&vaux2_reg>; - DVDD-supply = <&vbat>; + AVDD-supply = <&v3_3d_reg>; + IOVDD-supply = <&v3_3d_reg>; + DRVDD-supply = <&v3_3d_reg>; + DVDD-supply = <&v1_8d_reg>; }; }; Copied: stable/12/sys/gnu/dts/arm/am335x-guardian.dts (from r347366, head/sys/gnu/dts/arm/am335x-guardian.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am335x-guardian.dts Wed Aug 7 19:18:32 2019 (r350690, copy of r347366, head/sys/gnu/dts/arm/am335x-guardian.dts) @@ -0,0 +1,511 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2018 Robert Bosch Power Tools GmbH + */ +/dts-v1/; + +#include "am33xx.dtsi" +#include +#include + +/ { + model = "Bosch AM335x Guardian"; + compatible = "bosch,am335x-guardian", "ti,am33xx"; + + chosen { + stdout-path = &uart0; + tick-timer = &timer2; + }; + + cpus { + cpu@0 { + cpu0-supply = <&dcdc2_reg>; + }; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x10000000>; /* 256 MB */ + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&gpio_keys_pins>; + + button21 { + label = "guardian-power-button"; + linux,code = ; + gpios = <&gpio2 21 0>; + wakeup-source; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&leds_pins>; + + led1 { + label = "green:heartbeat"; + gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + + led2 { + label = "green:mmc0"; + gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + }; + + panel { + compatible = "ti,tilcdc,panel"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&lcd_pins_default &lcd_disen_pins>; + pinctrl-1 = <&lcd_pins_sleep>; + + display-timings { + 320x240 { + hactive = <320>; + vactive = <240>; + hback-porch = <68>; + hfront-porch = <20>; + hsync-len = <1>; + vback-porch = <18>; + vfront-porch = <4>; + vsync-len = <1>; + clock-frequency = <9000000>; + hsync-active = <0>; + vsync-active = <0>; + }; + }; + panel-info { + ac-bias = <255>; + ac-bias-intrpt = <0>; + dma-burst-sz = <16>; + bpp = <24>; + bus-width = <16>; + fdd = <0x80>; + sync-edge = <0>; + sync-ctrl = <1>; + raster-order = <0>; + fifo-th = <0>; + }; + + }; + + pwm7: dmtimer-pwm { + compatible = "ti,omap-dmtimer-pwm"; + ti,timers = <&timer7>; + pinctrl-names = "default"; + pinctrl-0 = <&dmtimer7_pins>; + }; + + vmmcsd_fixed: regulator-3v3 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; +}; + +&cppi41dma { + status = "okay"; +}; + +&elm { + status = "okay"; +}; + +&gpmc { + pinctrl-names = "default"; + pinctrl-0 = <&nandflash_pins>; + ranges = <0 0 0x08000000 0x1000000>; /* CS0: 16MB for NAND */ + status = "okay"; + + nand@0,0 { + compatible = "ti,omap2-nand"; + reg = <0 0 4>; /* CS0, offset 0, IO size 4 */ + interrupt-parent = <&gpmc>; + interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ + <1 IRQ_TYPE_NONE>; /* termcount */ + rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */ + ti,nand-ecc-opt = "bch16"; + ti,elm-id = <&elm>; + nand-bus-width = <8>; + gpmc,device-width = <1>; + 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-on-ns = <0>; + gpmc,we-off-ns = <40>; + gpmc,oe-on-ns = <0>; + gpmc,oe-off-ns = <54>; + gpmc,access-ns = <64>; + gpmc,rd-cycle-ns = <82>; + gpmc,wr-cycle-ns = <82>; + gpmc,bus-turnaround-ns = <0>; + gpmc,cycle2cycle-delay-ns = <0>; + gpmc,clk-activation-ns = <0>; + gpmc,wr-access-ns = <40>; + gpmc,wr-data-mux-bus-ns = <0>; + + /* + * MTD partition table + * + * All SPL-* partitions are sized to minimal length which can + * be independently programmable. For NAND flash this is equal + * to size of erase-block. + */ + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SPL"; + reg = <0x0 0x40000>; + }; + + partition@1 { + label = "SPL.backup1"; + reg = <0x40000 0x40000>; + }; + + partition@2 { + label = "SPL.backup2"; + reg = <0x80000 0x40000>; + }; + + partition@3 { + label = "SPL.backup3"; + reg = <0xc0000 0x40000>; + }; + + partition@4 { + label = "u-boot"; + reg = <0x100000 0x100000>; + }; + + partition@5 { + label = "u-boot.backup1"; + reg = <0x200000 0x100000>; + }; + + partition@6 { + label = "u-boot-env"; + reg = <0x300000 0x40000>; + }; + + partition@7 { + label = "u-boot-env.backup1"; + reg = <0x340000 0x40000>; + }; + + partition@8 { + label = "UBI"; + reg = <0x380000 0x1fc80000>; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + clock-frequency = <400000>; + status = "okay"; + + tps: tps@24 { + reg = <0x24>; + }; +}; + +&lcdc { + blue-and-red-wiring = "crossed"; + status = "okay"; +}; + +&mmc1 { + bus-width = <0x4>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + vmmc-supply = <&vmmcsd_fixed>; + status = "okay"; +}; + +&rtc { + clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; + clock-names = "ext-clk", "int-clk"; + system-power-controller; +}; + +&spi0 { + ti,pindir-d0-out-d1-in; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins>; + status = "okay"; +}; + +#include "tps65217.dtsi" + +&tps { + ti,pmic-shutdown-controller; + interrupt-parent = <&intc>; + interrupts = <7>; /* NMI */ + + backlight { + isel = <1>; /* 1 - ISET1, 2 ISET2 */ + fdim = <100>; /* TPS65217_BL_FDIM_100HZ */ + default-brightness = <100>; + }; + + regulators { + dcdc1_reg: regulator@0 { + regulator-name = "vdds_dpr"; + regulator-always-on; + }; + + dcdc2_reg: regulator@1 { + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1351500>; + regulator-boot-on; + regulator-always-on; + }; + + dcdc3_reg: regulator@2 { + 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; + }; + }; +}; + +&tscadc { + status = "okay"; + + adc { + ti,adc-channels = <0 1 2 3 4 5 6>; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0 { + dr_mode = "peripheral"; + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1 { + dr_mode = "host"; + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&am33xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&clkout2_pin &gpio_pins>; + + clkout2_pin: pinmux_clkout2_pin { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3) + >; + }; + + dmtimer7_pins: pinmux_dmtimer7_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x968, PIN_OUTPUT | MUX_MODE5) + >; + }; + + gpio_keys_pins: pinmux_gpio_keys_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x940, PIN_INPUT | MUX_MODE7) + >; + }; + + gpio_pins: pinmux_gpio_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x928, PIN_OUTPUT | MUX_MODE7) + AM33XX_IOPAD(0x990, PIN_OUTPUT | MUX_MODE7) + >; + }; + + i2c0_pins: pinmux_i2c0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) + >; + }; + + lcd_disen_pins: pinmux_lcd_disen_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9a4, PIN_OUTPUT_PULLUP | SLEWCTRL_SLOW | MUX_MODE7) + >; + }; + + lcd_pins_default: pinmux_lcd_pins_default { + pinctrl-single,pins = < + AM33XX_IOPAD(0x820, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x824, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x828, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x82c, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x830, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x834, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x838, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x83c, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1) + AM33XX_IOPAD(0x8a0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8a4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8a8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8ac, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8b0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8b4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8b8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8bc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8c0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8c4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8c8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8cc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8d0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8d4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8d8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8dc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8e0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8e4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8e8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + AM33XX_IOPAD(0x8ec, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0) + >; + }; + + lcd_pins_sleep: pinmux_lcd_pins_sleep { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8a0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8a4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8a8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8ac, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8b0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8b4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8b8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8bc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8c0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8c4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8c8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8cc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8d0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8d4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8d8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8dc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8e0, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7) + AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7) + >; + }; + + leds_pins: pinmux_leds_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x868, PIN_OUTPUT | MUX_MODE7) + AM33XX_IOPAD(0x86c, PIN_OUTPUT | MUX_MODE7) + >; + }; + + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) + >; + }; + + spi0_pins: pinmux_spi0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_OUTPUT_PULLDOWN | MUX_MODE0) + AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x95c, PIN_OUTPUT_PULLUP | MUX_MODE0) + >; + }; + + uart0_pins: pinmux_uart0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) + >; + }; + + nandflash_pins: pinmux_nandflash_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x800, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x804, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x808, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x80c, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x810, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x814, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x818, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x81c, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x870, PIN_INPUT | MUX_MODE0) + AM33XX_IOPAD(0x874, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0) + AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0) + >; + }; +}; Modified: stable/12/sys/gnu/dts/arm/am335x-icev2.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-icev2.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-icev2.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -484,10 +484,6 @@ dual_emac; }; -&phy_sel { - rmii-clock-ext; -}; - &davinci_mdio { pinctrl-names = "default", "sleep"; pinctrl-0 = <&davinci_mdio_default>; Modified: stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-igep0033.dtsi Wed Aug 7 19:18:32 2019 (r350690) @@ -123,10 +123,6 @@ phy-mode = "rmii"; }; -&phy_sel { - rmii-clock-ext; -}; - &elm { status = "okay"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-lxm.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-lxm.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-lxm.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -328,10 +328,6 @@ dual_emac_res_vlan = <3>; }; -&phy_sel { - rmii-clock-ext; -}; - &mac { pinctrl-names = "default", "sleep"; pinctrl-0 = <&cpsw_default>; Modified: stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Wed Aug 7 19:18:32 2019 (r350690) @@ -159,11 +159,6 @@ status = "okay"; }; -&phy_sel { - reg= <0x44e10650 0xf5>; - rmii-clock-ext; -}; - &sham { status = "okay"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -446,11 +446,6 @@ dual_emac_res_vlan = <2>; }; -&phy_sel { - reg= <0x44e10650 0xf5>; - rmii-clock-ext; -}; - &sham { status = "okay"; }; Modified: stable/12/sys/gnu/dts/arm/am335x-phycore-som.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-phycore-som.dtsi Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-phycore-som.dtsi Wed Aug 7 19:18:32 2019 (r350690) @@ -100,10 +100,6 @@ status = "okay"; }; -&phy_sel { - rmii-clock-ext; -}; - /* I2C Busses */ &am33xx_pinmux { i2c0_pins: pinmux_i2c0 { Modified: stable/12/sys/gnu/dts/arm/am335x-shc.dts ============================================================================== --- stable/12/sys/gnu/dts/arm/am335x-shc.dts Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am335x-shc.dts Wed Aug 7 19:18:32 2019 (r350690) @@ -1,11 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 /* * support for the bosch am335x based shc c3 board * * Copyright, C) 2015 Heiko Schocher * - * 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. */ /dts-v1/; Modified: stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi Wed Aug 7 18:35:59 2019 (r350689) +++ stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi Wed Aug 7 19:18:32 2019 (r350690) @@ -279,17 +279,9 @@ #pinctrl-cells = <1>; ranges = <0 0 0x2000>; - phy_sel: cpsw-phy-sel@650 { - compatible = "ti,am3352-cpsw-phy-sel"; - reg= <0x650 0x4>; - reg-names = "gmii-sel"; - }; - am33xx_pinmux: pinmux@800 { compatible = "pinctrl-single"; reg = <0x800 0x238>; - #address-cells = <1>; - #size-cells = <0>; #pinctrl-cells = <1>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x7f>; @@ -302,6 +294,12 @@ #size-cells = <1>; ranges = <0 0 0x800>; + phy_gmii_sel: phy-gmii-sel { + compatible = "ti,am3352-phy-gmii-sel"; + reg = <0x650 0x4>; + #phy-cells = <2>; + }; + scm_clocks: clocks { #address-cells = <1>; #size-cells = <0>; @@ -717,7 +715,6 @@ interrupts = <40 41 42 43>; ranges = <0 0 0x8000>; syscon = <&scm_conf>; - cpsw-phy-sel = <&phy_sel>; status = "disabled"; davinci_mdio: mdio@1000 { @@ -733,11 +730,13 @@ cpsw_emac0: slave@200 { /* Filled in by U-Boot */ mac-address = [ 00 00 00 00 00 00 ]; + phys = <&phy_gmii_sel 1 1>; }; cpsw_emac1: slave@300 { /* Filled in by U-Boot */ mac-address = [ 00 00 00 00 00 00 ]; + phys = <&phy_gmii_sel 2 1>; }; }; }; @@ -1763,7 +1762,7 @@ reg = <0xcc000 0x4>; reg-names = "rev"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ - clocks = <&l4ls_clkctrl AM3_D_CAN0_CLKCTRL 0>; + clocks = <&l4ls_clkctrl AM3_L4LS_D_CAN0_CLKCTRL 0>; clock-names = "fck"; #address-cells = <1>; #size-cells = <1>; @@ -1786,7 +1785,7 @@ reg = <0xd0000 0x4>; reg-names = "rev"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ - clocks = <&l4ls_clkctrl AM3_D_CAN1_CLKCTRL 0>; + clocks = <&l4ls_clkctrl AM3_L4LS_D_CAN1_CLKCTRL 0>; clock-names = "fck"; #address-cells = <1>; #size-cells = <1>; Copied: stable/12/sys/gnu/dts/arm/am3874-iceboard.dts (from r347366, head/sys/gnu/dts/arm/am3874-iceboard.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/gnu/dts/arm/am3874-iceboard.dts Wed Aug 7 19:18:32 2019 (r350690, copy of r347366, head/sys/gnu/dts/arm/am3874-iceboard.dts) @@ -0,0 +1,496 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device tree for Winterland IceBoard + * + * http://mcgillcosmology.com + * http://threespeedlogic.com + * + * This is an ARM + FPGA instrumentation board used at telescopes in + * Antarctica (the South Pole Telescope), Chile (POLARBEAR), and at the DRAO + * observatory in British Columbia (CHIME). + * + * Copyright (c) 2019 Three-Speed Logic, Inc. + */ + +/dts-v1/; + +#include "dm814x.dtsi" +#include + +/ { + model = "Winterland IceBoard"; + compatible = "ti,dm8148", "ti,dm814"; + + chosen { + stdout-path = "serial1:115200n8"; + bootargs = "earlycon"; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x40000000>; /* 1 GB */ + }; + + vmmcsd_fixed: fixedregulator0 { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; +}; + +/* The MAC provides internal delay for the transmit path ONLY, which is enabled + * provided no -id/-txid/-rxid suffix is provided to "phy-mode". + * + * The receive path is delayed at the PHY. The recommended register settings + * are 0xf0 for the control bits, and 0x7777 for the data bits. However, the + * conversion code in the kernel lies: the PHY's registers are 120 ps per tap, + * and the kernel assumes 200 ps per tap. So we have fudged the numbers here to + * obtain the correct register settings. + */ +&mac { dual_emac = <1>; }; +&cpsw_emac0 { + phy-handle = <ðphy0>; + phy-mode = "rgmii"; + dual_emac_res_vlan = <1>; +}; +&cpsw_emac1 { + phy-handle = <ðphy1>; + phy-mode = "rgmii"; + dual_emac_res_vlan = <2>; +}; + +&davinci_mdio { + ethphy0: ethernet-phy@0 { + reg = <0x2>; + + rxc-skew-ps = <3000>; + rxdv-skew-ps = <0>; + + rxd3-skew-ps = <0>; + rxd2-skew-ps = <0>; + rxd1-skew-ps = <0>; + rxd0-skew-ps = <0>; + + phy-reset-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; + }; + + ethphy1: ethernet-phy@1 { + reg = <0x1>; + + rxc-skew-ps = <3000>; + rxdv-skew-ps = <0>; + + rxd3-skew-ps = <0>; + rxd2-skew-ps = <0>; + rxd1-skew-ps = <0>; + rxd0-skew-ps = <0>; + + phy-reset-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; +}; + +&mmc1 { status = "disabled"; }; +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <4>; +}; +&mmc3 { status = "disabled"; }; + +&i2c1 { + /* Most I2C activity happens through this port, with the sole exception + * of the backplane. Since there are multiply assigned addresses, the + * "i2c-mux-idle-disconnect" is important. + */ + + pca9548@70 { + compatible = "nxp,pca9548"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + /* FMC A */ + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + i2c-mux-idle-disconnect; + }; + + i2c@1 { + /* FMC B */ + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + i2c-mux-idle-disconnect; + }; + + i2c@2 { + /* QSFP A */ + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + i2c-mux-idle-disconnect; + }; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 7 19:23:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CDA47B50CE; Wed, 7 Aug 2019 19: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463hHJ53tvz4C3t; Wed, 7 Aug 2019 19:23:08 +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 8F5D3196E9; Wed, 7 Aug 2019 19:23:08 +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 x77JN8KV083699; Wed, 7 Aug 2019 19:23:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77JN7Ci083696; Wed, 7 Aug 2019 19:23:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908071923.x77JN7Ci083696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 7 Aug 2019 19:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350691 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 350691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 19:23:08 -0000 Author: cem Date: Wed Aug 7 19:23:07 2019 New Revision: 350691 URL: https://svnweb.freebsd.org/changeset/base/350691 Log: sbuf(9): Add NOWAIT dynamic buffer extension mode The goal is to avoid some kinds of low-memory deadlock when formatting heap-allocated buffers. Reviewed by: vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21015 Modified: head/share/man/man9/sbuf.9 head/sys/kern/subr_sbuf.c head/sys/sys/sbuf.h Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Wed Aug 7 19:18:32 2019 (r350690) +++ head/share/man/man9/sbuf.9 Wed Aug 7 19:23:07 2019 (r350691) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2019 +.Dd August 7, 2019 .Dt SBUF 9 .Os .Sh NAME @@ -288,6 +288,11 @@ If a record grows sufficiently large such that it fill and therefore cannot be drained without being split, an error of .Er EDEADLK is set. +.It Dv SBUF_NOWAIT +Indicates that attempts to extend the storage buffer should fail in low memory +conditions, like +.Xr malloc 9 +.Dv M_NOWAIT . .El .Pp Note that if Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Wed Aug 7 19:18:32 2019 (r350690) +++ head/sys/kern/subr_sbuf.c Wed Aug 7 19:23:07 2019 (r350691) @@ -56,11 +56,11 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers"); -#define SBMALLOC(size) malloc(size, M_SBUF, M_WAITOK|M_ZERO) +#define SBMALLOC(size, flags) malloc(size, M_SBUF, (flags) | M_ZERO) #define SBFREE(buf) free(buf, M_SBUF) #else /* _KERNEL */ #define KASSERT(e, m) -#define SBMALLOC(size) calloc(1, size) +#define SBMALLOC(size, flags) calloc(1, size) #define SBFREE(buf) free(buf) #endif /* _KERNEL */ @@ -77,6 +77,8 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers") #define SBUF_NULINCLUDED(s) ((s)->s_flags & SBUF_INCLUDENUL) #define SBUF_ISDRAINTOEOR(s) ((s)->s_flags & SBUF_DRAINTOEOR) #define SBUF_DODRAINTOEOR(s) (SBUF_ISSECTION(s) && SBUF_ISDRAINTOEOR(s)) +#define SBUF_MALLOCFLAG(s) \ + (((s)->s_flags & SBUF_NOWAIT) ? M_NOWAIT : M_WAITOK) /* * Set / clear flags @@ -171,7 +173,7 @@ sbuf_extend(struct sbuf *s, int addlen) if (!SBUF_CANEXTEND(s)) return (-1); newsize = sbuf_extendsize(s->s_size + addlen); - newbuf = SBMALLOC(newsize); + newbuf = SBMALLOC(newsize, SBUF_MALLOCFLAG(s)); if (newbuf == NULL) return (-1); memcpy(newbuf, s->s_buf, s->s_size); @@ -198,7 +200,7 @@ sbuf_newbuf(struct sbuf *s, char *buf, int length, int s->s_size = length; s->s_buf = buf; - if ((s->s_flags & SBUF_AUTOEXTEND) == 0) { + if (!SBUF_CANEXTEND(s)) { KASSERT(s->s_size >= SBUF_MINSIZE, ("attempt to create an sbuf smaller than %d bytes", SBUF_MINSIZE)); @@ -207,10 +209,10 @@ sbuf_newbuf(struct sbuf *s, char *buf, int length, int if (s->s_buf != NULL) return (s); - if ((flags & SBUF_AUTOEXTEND) != 0) + if (SBUF_CANEXTEND(s)) s->s_size = sbuf_extendsize(s->s_size); - s->s_buf = SBMALLOC(s->s_size); + s->s_buf = SBMALLOC(s->s_size, SBUF_MALLOCFLAG(s)); if (s->s_buf == NULL) return (NULL); SBUF_SETFLAG(s, SBUF_DYNAMIC); @@ -235,7 +237,7 @@ sbuf_new(struct sbuf *s, char *buf, int length, int fl if (s != NULL) return (sbuf_newbuf(s, buf, length, flags)); - s = SBMALLOC(sizeof(*s)); + s = SBMALLOC(sizeof(*s), (flags & SBUF_NOWAIT) ? M_NOWAIT : M_WAITOK); if (s == NULL) return (NULL); if (sbuf_newbuf(s, buf, length, flags) == NULL) { Modified: head/sys/sys/sbuf.h ============================================================================== --- head/sys/sys/sbuf.h Wed Aug 7 19:18:32 2019 (r350690) +++ head/sys/sys/sbuf.h Wed Aug 7 19:23:07 2019 (r350691) @@ -52,6 +52,7 @@ struct sbuf { #define SBUF_AUTOEXTEND 0x00000001 /* automatically extend buffer */ #define SBUF_INCLUDENUL 0x00000002 /* nulterm byte is counted in len */ #define SBUF_DRAINTOEOR 0x00000004 /* use section 0 as drain EOR marker */ +#define SBUF_NOWAIT 0x00000008 /* Extend with non-blocking malloc */ #define SBUF_USRFLAGMSK 0x0000ffff /* mask of flags the user may specify */ #define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */ #define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */ From owner-svn-src-all@freebsd.org Wed Aug 7 19:25:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BE7AB5164; Wed, 7 Aug 2019 19:25:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463hLY3BdWz4CCy; Wed, 7 Aug 2019 19:25:57 +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 5009C196FD; Wed, 7 Aug 2019 19:25:57 +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 x77JPv6q083873; Wed, 7 Aug 2019 19:25:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77JPvmP083872; Wed, 7 Aug 2019 19:25:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908071925.x77JPvmP083872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 7 Aug 2019 19:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350692 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 19:25:57 -0000 Author: cem Date: Wed Aug 7 19:25:56 2019 New Revision: 350692 URL: https://svnweb.freebsd.org/changeset/base/350692 Log: sbuf(9): Refactor sbuf_newbuf into sbuf_new Code flow was somewhat difficult to read due to the combination of multiple return sites and the 4x possible dynamic constructions of an sbuf. (Future consideration: do we need all 4?) Refactored slightly to improve legibility. No functional change. Sponsored by: Dell EMC Isilon Modified: head/sys/kern/subr_sbuf.c Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Wed Aug 7 19:23:07 2019 (r350691) +++ head/sys/kern/subr_sbuf.c Wed Aug 7 19:25:56 2019 (r350692) @@ -187,39 +187,6 @@ sbuf_extend(struct sbuf *s, int addlen) } /* - * Initialize the internals of an sbuf. - * If buf is non-NULL, it points to a static or already-allocated string - * big enough to hold at least length characters. - */ -static struct sbuf * -sbuf_newbuf(struct sbuf *s, char *buf, int length, int flags) -{ - - memset(s, 0, sizeof(*s)); - s->s_flags = flags; - s->s_size = length; - s->s_buf = buf; - - if (!SBUF_CANEXTEND(s)) { - KASSERT(s->s_size >= SBUF_MINSIZE, - ("attempt to create an sbuf smaller than %d bytes", - SBUF_MINSIZE)); - } - - if (s->s_buf != NULL) - return (s); - - if (SBUF_CANEXTEND(s)) - s->s_size = sbuf_extendsize(s->s_size); - - s->s_buf = SBMALLOC(s->s_size, SBUF_MALLOCFLAG(s)); - if (s->s_buf == NULL) - return (NULL); - SBUF_SETFLAG(s, SBUF_DYNAMIC); - return (s); -} - -/* * Initialize an sbuf. * If buf is non-NULL, it points to a static or already-allocated string * big enough to hold at least length characters. @@ -232,19 +199,52 @@ sbuf_new(struct sbuf *s, char *buf, int length, int fl ("attempt to create an sbuf of negative length (%d)", length)); KASSERT((flags & ~SBUF_USRFLAGMSK) == 0, ("%s called with invalid flags", __func__)); + KASSERT((flags & SBUF_AUTOEXTEND) || length >= SBUF_MINSIZE, + ("sbuf buffer %d smaller than minimum %d bytes", length, + SBUF_MINSIZE)); flags &= SBUF_USRFLAGMSK; - if (s != NULL) - return (sbuf_newbuf(s, buf, length, flags)); - s = SBMALLOC(sizeof(*s), (flags & SBUF_NOWAIT) ? M_NOWAIT : M_WAITOK); - if (s == NULL) - return (NULL); - if (sbuf_newbuf(s, buf, length, flags) == NULL) { - SBFREE(s); - return (NULL); + /* + * Allocate 'DYNSTRUCT' sbuf from the heap, if NULL 's' was provided. + */ + if (s == NULL) { + s = SBMALLOC(sizeof(*s), + (flags & SBUF_NOWAIT) ? M_NOWAIT : M_WAITOK); + if (s == NULL) + goto out; + SBUF_SETFLAG(s, SBUF_DYNSTRUCT); + } else { + /* + * DYNSTRUCT SBMALLOC sbufs are allocated with M_ZERO, but + * user-provided sbuf objects must be initialized. + */ + memset(s, 0, sizeof(*s)); } - SBUF_SETFLAG(s, SBUF_DYNSTRUCT); + + s->s_flags |= flags; + s->s_size = length; + s->s_buf = buf; + + /* + * Allocate DYNAMIC, i.e., heap data buffer backing the sbuf, if no + * buffer was provided. + */ + if (s->s_buf == NULL) { + if (SBUF_CANEXTEND(s)) + s->s_size = sbuf_extendsize(s->s_size); + s->s_buf = SBMALLOC(s->s_size, SBUF_MALLOCFLAG(s)); + if (s->s_buf == NULL) + goto out; + SBUF_SETFLAG(s, SBUF_DYNAMIC); + } + +out: + if (s != NULL && s->s_buf == NULL) { + if (SBUF_ISDYNSTRUCT(s)) + SBFREE(s); + s = NULL; + } return (s); } From owner-svn-src-all@freebsd.org Wed Aug 7 19:27:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A6711B5213; Wed, 7 Aug 2019 19:27:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463hN33wMrz4CM5; Wed, 7 Aug 2019 19:27:15 +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 683F219702; Wed, 7 Aug 2019 19:27:15 +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 x77JRFv6083974; Wed, 7 Aug 2019 19:27:15 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77JREeu083971; Wed, 7 Aug 2019 19:27:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908071927.x77JREeu083971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 7 Aug 2019 19:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350693 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 350693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 19:27:15 -0000 Author: cem Date: Wed Aug 7 19:27:14 2019 New Revision: 350693 URL: https://svnweb.freebsd.org/changeset/base/350693 Log: sbuf(9): Add sbuf_nl_terminate() API The API is used to gracefully terminate text line(s) with a single \n. If the formatted buffer was empty or already ended in \n, it is unmodified. Otherwise, a newline character is appended to it. The API, like other sbuf-modifying routines, is only valid while the sbuf is not FINISHED. Reviewed by: rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21030 Modified: head/share/man/man9/sbuf.9 head/sys/kern/subr_sbuf.c head/sys/sys/sbuf.h Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Wed Aug 7 19:25:56 2019 (r350692) +++ head/share/man/man9/sbuf.9 Wed Aug 7 19:27:14 2019 (r350693) @@ -44,6 +44,7 @@ .Nm sbuf_cat , .Nm sbuf_copyin , .Nm sbuf_cpy , +.Nm sbuf_nl_terminate , .Nm sbuf_printf , .Nm sbuf_vprintf , .Nm sbuf_putc , @@ -123,6 +124,8 @@ .Fa "const char *str" .Fc .Ft int +.Fn sbuf_nl_terminate "struct sbuf *" +.Ft int .Fo sbuf_printf .Fa "struct sbuf *s" .Fa "const char *fmt" "..." @@ -440,10 +443,14 @@ To do unbuffered draining, initialize the sbuf with a The drain will be called for every byte added to the sbuf. The .Fn sbuf_bcopyin , +.Fn sbuf_bcpy , +.Fn sbuf_clear , .Fn sbuf_copyin , +.Fn sbuf_cpy , .Fn sbuf_trim , +.Fn sbuf_data , and -.Fn sbuf_data +.Fn sbuf_len functions cannot be used on an sbuf with a drain. .Pp The @@ -474,6 +481,11 @@ or one which position has been reset to zero with .Fn sbuf_clear or .Fn sbuf_setpos . +.Pp +The +.Fn sbuf_nl_terminate +function appends a trailing newline character, if the current line is non-empty +and not already terminated by a newline character. .Pp The .Fn sbuf_printf Modified: head/sys/kern/subr_sbuf.c ============================================================================== --- head/sys/kern/subr_sbuf.c Wed Aug 7 19:25:56 2019 (r350692) +++ head/sys/kern/subr_sbuf.c Wed Aug 7 19:27:14 2019 (r350693) @@ -70,6 +70,7 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers") #define SBUF_ISDYNAMIC(s) ((s)->s_flags & SBUF_DYNAMIC) #define SBUF_ISDYNSTRUCT(s) ((s)->s_flags & SBUF_DYNSTRUCT) #define SBUF_ISFINISHED(s) ((s)->s_flags & SBUF_FINISHED) +#define SBUF_ISDRAINATEOL(s) ((s)->s_flags & SBUF_DRAINATEOL) #define SBUF_HASROOM(s) ((s)->s_len < (s)->s_size - 1) #define SBUF_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) #define SBUF_CANEXTEND(s) ((s)->s_flags & SBUF_AUTOEXTEND) @@ -225,6 +226,10 @@ sbuf_new(struct sbuf *s, char *buf, int length, int fl s->s_flags |= flags; s->s_size = length; s->s_buf = buf; + /* + * Never-written sbufs do not need \n termination. + */ + SBUF_SETFLAG(s, SBUF_DRAINATEOL); /* * Allocate DYNAMIC, i.e., heap data buffer backing the sbuf, if no @@ -310,6 +315,8 @@ sbuf_clear(struct sbuf *s) assert_sbuf_integrity(s); /* don't care if it's finished or not */ + KASSERT(s->s_drain_func == NULL, + ("%s makes no sense on sbuf %p with drain", __func__, s)); SBUF_CLEARFLAG(s, SBUF_FINISHED); s->s_error = 0; @@ -384,6 +391,7 @@ sbuf_drain(struct sbuf *s) KASSERT(s->s_len > 0, ("Shouldn't drain empty sbuf %p", s)); KASSERT(s->s_error == 0, ("Called %s with error on %p", __func__, s)); + if (SBUF_DODRAINTOEOR(s) && s->s_rec_off == 0) return (s->s_error = EDEADLK); len = s->s_drain_func(s->s_drain_arg, s->s_buf, @@ -400,8 +408,18 @@ sbuf_drain(struct sbuf *s) * Fast path for the expected case where all the data was * drained. */ - if (s->s_len == 0) + if (s->s_len == 0) { + /* + * When the s_buf is entirely drained, we need to remember if + * the last character was a '\n' or not for + * sbuf_nl_terminate(). + */ + if (s->s_buf[len - 1] == '\n') + SBUF_SETFLAG(s, SBUF_DRAINATEOL); + else + SBUF_CLEARFLAG(s, SBUF_DRAINATEOL); return (0); + } /* * Move the remaining characters to the beginning of the * string. @@ -711,6 +729,38 @@ sbuf_putc(struct sbuf *s, int c) { sbuf_put_byte(s, c); + if (s->s_error != 0) + return (-1); + return (0); +} + +/* + * Append a trailing newline to a non-empty sbuf, if one is not already + * present. Handles sbufs with drain functions correctly. + */ +int +sbuf_nl_terminate(struct sbuf *s) +{ + + assert_sbuf_integrity(s); + assert_sbuf_state(s, 0); + + /* + * If the s_buf isn't empty, the last byte is simply s_buf[s_len - 1]. + * + * If the s_buf is empty because a drain function drained it, we + * remember if the last byte was a \n with the SBUF_DRAINATEOL flag in + * sbuf_drain(). + * + * In either case, we only append a \n if the previous character was + * something else. + */ + if (s->s_len == 0) { + if (!SBUF_ISDRAINATEOL(s)) + sbuf_put_byte(s, '\n'); + } else if (s->s_buf[s->s_len - 1] != '\n') + sbuf_put_byte(s, '\n'); + if (s->s_error != 0) return (-1); return (0); Modified: head/sys/sys/sbuf.h ============================================================================== --- head/sys/sys/sbuf.h Wed Aug 7 19:25:56 2019 (r350692) +++ head/sys/sys/sbuf.h Wed Aug 7 19:27:14 2019 (r350693) @@ -58,6 +58,7 @@ struct sbuf { #define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */ #define SBUF_DYNSTRUCT 0x00080000 /* sbuf must be freed */ #define SBUF_INSECTION 0x00100000 /* set by sbuf_start_section() */ +#define SBUF_DRAINATEOL 0x00200000 /* drained contents ended in \n */ int s_flags; /* flags */ ssize_t s_sect_len; /* current length of section */ ssize_t s_rec_off; /* current record start offset */ @@ -91,6 +92,7 @@ int sbuf_printf(struct sbuf *, const char *, ...) __printflike(2, 3); int sbuf_vprintf(struct sbuf *, const char *, __va_list) __printflike(2, 0); +int sbuf_nl_terminate(struct sbuf *); int sbuf_putc(struct sbuf *, int); void sbuf_set_drain(struct sbuf *, sbuf_drain_func *, void *); int sbuf_trim(struct sbuf *); From owner-svn-src-all@freebsd.org Wed Aug 7 19:28:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FDECB52A6; Wed, 7 Aug 2019 19:28:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463hPp4191z4CWL; Wed, 7 Aug 2019 19:28:46 +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 5255C19715; Wed, 7 Aug 2019 19:28:46 +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 x77JSkUi084123; Wed, 7 Aug 2019 19:28:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77JSZw4084069; Wed, 7 Aug 2019 19:28:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908071928.x77JSZw4084069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 7 Aug 2019 19:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350694 - in head: share/man/man9 sys/dev/fdc sys/geom sys/geom/cache sys/geom/concat sys/geom/eli sys/geom/gate sys/geom/journal sys/geom/label sys/geom/linux_lvm sys/geom/mirror sys/g... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man9 sys/dev/fdc sys/geom sys/geom/cache sys/geom/concat sys/geom/eli sys/geom/gate sys/geom/journal sys/geom/label sys/geom/linux_lvm sys/geom/mirror sys/geom/mountver sys/geom/nop... X-SVN-Commit-Revision: 350694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 19:28:46 -0000 Author: cem Date: Wed Aug 7 19:28:35 2019 New Revision: 350694 URL: https://svnweb.freebsd.org/changeset/base/350694 Log: GEOM: Reduce unnecessary log interleaving with sbufs Similar to what was done for device_printfs in r347229. Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an sbuf; documented in g_bio.9. Reviewed by: markj Discussed with: rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21165 Added: head/sys/geom/geom_dbg.h (contents, props changed) Modified: head/share/man/man9/Makefile head/share/man/man9/g_bio.9 head/sys/dev/fdc/fdc.c head/sys/geom/cache/g_cache.c head/sys/geom/cache/g_cache.h head/sys/geom/concat/g_concat.c head/sys/geom/concat/g_concat.h head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_ctl.c head/sys/geom/eli/g_eli_integrity.c head/sys/geom/eli/g_eli_privacy.c head/sys/geom/gate/g_gate.c head/sys/geom/gate/g_gate.h head/sys/geom/geom.h head/sys/geom/geom_io.c head/sys/geom/geom_subr.c head/sys/geom/geom_vfs.c head/sys/geom/journal/g_journal.c head/sys/geom/journal/g_journal.h head/sys/geom/journal/g_journal_ufs.c head/sys/geom/label/g_label.c head/sys/geom/label/g_label.h head/sys/geom/label/g_label_ext2fs.c head/sys/geom/label/g_label_iso9660.c head/sys/geom/label/g_label_msdosfs.c head/sys/geom/label/g_label_reiserfs.c head/sys/geom/label/g_label_ufs.c head/sys/geom/linux_lvm/g_linux_lvm.c head/sys/geom/linux_lvm/g_linux_lvm.h head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h head/sys/geom/mirror/g_mirror_ctl.c head/sys/geom/mountver/g_mountver.c head/sys/geom/mountver/g_mountver.h head/sys/geom/nop/g_nop.c head/sys/geom/nop/g_nop.h head/sys/geom/raid/g_raid.c head/sys/geom/raid/g_raid.h head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_intel.c head/sys/geom/raid/md_jmicron.c head/sys/geom/raid/md_nvidia.c head/sys/geom/raid/md_promise.c head/sys/geom/raid/md_sii.c head/sys/geom/raid/tr_concat.c head/sys/geom/raid/tr_raid0.c head/sys/geom/raid/tr_raid1.c head/sys/geom/raid/tr_raid1e.c head/sys/geom/raid3/g_raid3.c head/sys/geom/raid3/g_raid3.h head/sys/geom/sched/g_sched.c head/sys/geom/sched/g_sched.h head/sys/geom/shsec/g_shsec.c head/sys/geom/shsec/g_shsec.h head/sys/geom/stripe/g_stripe.c head/sys/geom/stripe/g_stripe.h head/sys/geom/vinum/geom_vinum.c head/sys/geom/vinum/geom_vinum.h head/sys/geom/vinum/geom_vinum_create.c head/sys/geom/vinum/geom_vinum_drive.c head/sys/geom/vinum/geom_vinum_events.c head/sys/geom/vinum/geom_vinum_init.c head/sys/geom/vinum/geom_vinum_move.c head/sys/geom/vinum/geom_vinum_plex.c head/sys/geom/vinum/geom_vinum_raid5.c head/sys/geom/vinum/geom_vinum_rename.c head/sys/geom/vinum/geom_vinum_rm.c head/sys/geom/vinum/geom_vinum_state.c head/sys/geom/vinum/geom_vinum_subr.c head/sys/geom/virstor/g_virstor.c head/sys/geom/virstor/g_virstor.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Aug 7 19:27:14 2019 (r350693) +++ head/share/man/man9/Makefile Wed Aug 7 19:28:35 2019 (r350694) @@ -1004,6 +1004,7 @@ MLINKS+=g_bio.9 g_alloc_bio.9 \ g_bio.9 g_clone_bio.9 \ g_bio.9 g_destroy_bio.9 \ g_bio.9 g_duplicate_bio.9 \ + g_bio.9 g_format_bio.9 \ g_bio.9 g_new_bio.9 \ g_bio.9 g_print_bio.9 \ g_bio.9 g_reset_bio.9 Modified: head/share/man/man9/g_bio.9 ============================================================================== --- head/share/man/man9/g_bio.9 Wed Aug 7 19:27:14 2019 (r350693) +++ head/share/man/man9/g_bio.9 Wed Aug 7 19:28:35 2019 (r350694) @@ -24,13 +24,14 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 7, 2018 +.Dd August 7, 2019 .Dt G_BIO 9 .Os .Sh NAME .Nm g_new_bio , .Nm g_clone_bio , .Nm g_destroy_bio , +.Nm g_format_bio , .Nm g_print_bio , .Nm g_reset_bio .Nd "GEOM bio controlling functions" @@ -48,8 +49,13 @@ .Ft void .Fn g_destroy_bio "struct bio *bp" .Ft void -.Fn g_print_bio "struct bio *bp" +.Fn g_format_bio "struct sbuf *sb" "const struct bio *bp" .Ft void +.Fo g_print_bio +.Fa "struct sbuf *sb" "const char *prefix" "const struct bio *bp" +.Fa "const char *fmtsuffix" ... +.Fc +.Ft void .Fn g_reset_bio "struct bio *bp" .Sh DESCRIPTION A @@ -204,12 +210,30 @@ function deallocates and destroys the given structure. .Pp The -.Fn g_print_bio +.Fn g_format_bio function prints information about the given .Vt bio -structure (for debugging purposes). +structure into the provided +.Vt sbuf . .Pp The +.Fn g_print_bio +function is a convenience wrapper around +.Fn g_format_bio +that can be used for debugging purposes. +It prints a provided +.Fa prefix +string, followed by the formatted +.Vt bio , +followed by a +.Fa fmtsuffix +in the style of +.Xr 9 printf . +Any of the prefix or suffix strings may be the empty string. +.Fn g_print_bio +always prints a newline character at the end of the line. +.Pp +The .Fn g_reset_bio function resets the given .Vt bio @@ -261,9 +285,7 @@ example_start(struct bio *bp) struct example_softc *sc; struct bio *cbp; - printf("Request received: "); - g_print_bio(bp); - printf("\\n"); + g_print_bio("Request received: ", bp, ""); sc = bp->bio_to->geom->softc; if (sc == NULL) { Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/dev/fdc/fdc.c Wed Aug 7 19:28:35 2019 (r350694) @@ -1160,10 +1160,8 @@ fdc_thread(void *arg) mtx_unlock(&fdc->fdc_mtx); i = fdc_worker(fdc); if (i && debugflags & 0x20) { - if (fdc->bp != NULL) { - g_print_bio(fdc->bp); - printf("\n"); - } + if (fdc->bp != NULL) + g_print_bio("", fdc->bp, ""); printf("Retry line %d\n", retry_line); } fdc->retry += i; Modified: head/sys/geom/cache/g_cache.c ============================================================================== --- head/sys/geom/cache/g_cache.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/cache/g_cache.c Wed Aug 7 19:28:35 2019 (r350694) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include FEATURE(geom_cache, "GEOM cache module"); Modified: head/sys/geom/cache/g_cache.h ============================================================================== --- head/sys/geom/cache/g_cache.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/cache/g_cache.h Wed Aug 7 19:28:35 2019 (r350694) @@ -41,25 +41,10 @@ #define G_CACHE_TYPE_MANUAL 0 #define G_CACHE_TYPE_AUTOMATIC 1 -#define G_CACHE_DEBUG(lvl, ...) do { \ - if (g_cache_debug >= (lvl)) { \ - printf("GEOM_CACHE"); \ - if (g_cache_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) -#define G_CACHE_LOGREQ(bp, ...) do { \ - if (g_cache_debug >= 2) { \ - printf("GEOM_CACHE[2]: "); \ - printf(__VA_ARGS__); \ - printf(" "); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) +#define G_CACHE_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_CACHE", g_cache_debug, (lvl), NULL, __VA_ARGS__) +#define G_CACHE_LOGREQ(bp, ...) \ + _GEOM_DEBUG("GEOM_CACHE", g_cache_debug, 2, (bp), __VA_ARGS__) #define G_CACHE_BUCKETS (1 << 3) #define G_CACHE_BUCKET(bno) ((bno) & (G_CACHE_BUCKETS - 1)) Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/concat/g_concat.c Wed Aug 7 19:28:35 2019 (r350694) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include FEATURE(geom_concat, "GEOM concatenation support"); Modified: head/sys/geom/concat/g_concat.h ============================================================================== --- head/sys/geom/concat/g_concat.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/concat/g_concat.h Wed Aug 7 19:28:35 2019 (r350694) @@ -49,25 +49,10 @@ #define G_CONCAT_TYPE_MANUAL 0 #define G_CONCAT_TYPE_AUTOMATIC 1 -#define G_CONCAT_DEBUG(lvl, ...) do { \ - if (g_concat_debug >= (lvl)) { \ - printf("GEOM_CONCAT"); \ - if (g_concat_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) -#define G_CONCAT_LOGREQ(bp, ...) do { \ - if (g_concat_debug >= 2) { \ - printf("GEOM_CONCAT[2]: "); \ - printf(__VA_ARGS__); \ - printf(" "); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) +#define G_CONCAT_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_CONCAT", g_concat_debug, (lvl), NULL, __VA_ARGS__) +#define G_CONCAT_LOGREQ(bp, ...) \ + _GEOM_DEBUG("GEOM_CONCAT", g_concat_debug, 2, (bp), __VA_ARGS__) struct g_concat_disk { struct g_consumer *d_consumer; Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/eli/g_eli.c Wed Aug 7 19:28:35 2019 (r350694) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/eli/g_eli.h Wed Aug 7 19:28:35 2019 (r350694) @@ -155,28 +155,10 @@ extern int g_eli_debug; extern u_int g_eli_overwrites; extern u_int g_eli_batch; -#define G_ELI_DEBUG(lvl, ...) do { \ - if (g_eli_debug >= (lvl)) { \ - printf("GEOM_ELI"); \ - if (g_eli_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) -#define G_ELI_LOGREQ(lvl, bp, ...) do { \ - if (g_eli_debug >= (lvl)) { \ - printf("GEOM_ELI"); \ - if (g_eli_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf(" "); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) +#define G_ELI_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_ELI", g_eli_debug, (lvl), NULL, __VA_ARGS__) +#define G_ELI_LOGREQ(lvl, bp, ...) \ + _GEOM_DEBUG("GEOM_ELI", g_eli_debug, (lvl), (bp), __VA_ARGS__) struct g_eli_worker { struct g_eli_softc *w_softc; Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/eli/g_eli_ctl.c Wed Aug 7 19:28:35 2019 (r350694) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/eli/g_eli_integrity.c Wed Aug 7 19:28:35 2019 (r350694) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/eli/g_eli_privacy.c Wed Aug 7 19:28:35 2019 (r350694) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/geom/gate/g_gate.c ============================================================================== --- head/sys/geom/gate/g_gate.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/gate/g_gate.c Wed Aug 7 19:28:35 2019 (r350694) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include FEATURE(geom_gate, "GEOM Gate module"); Modified: head/sys/geom/gate/g_gate.h ============================================================================== --- head/sys/geom/gate/g_gate.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/gate/g_gate.h Wed Aug 7 19:28:35 2019 (r350694) @@ -103,28 +103,10 @@ struct g_gate_softc { char sc_info[G_GATE_INFOSIZE]; /* P: (read-only) */ }; -#define G_GATE_DEBUG(lvl, ...) do { \ - if (g_gate_debug >= (lvl)) { \ - printf("GEOM_GATE"); \ - if (g_gate_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) -#define G_GATE_LOGREQ(lvl, bp, ...) do { \ - if (g_gate_debug >= (lvl)) { \ - printf("GEOM_GATE"); \ - if (g_gate_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf(" "); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) +#define G_GATE_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_GATE", g_gate_debug, (lvl), NULL, __VA_ARGS__) +#define G_GATE_LOGREQ(lvl, bp, ...) \ + _GEOM_DEBUG("GEOM_GATE", g_gate_debug, (lvl), (bp), __VA_ARGS__) #endif /* !_KERNEL */ struct g_gate_ctl_create { Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/geom.h Wed Aug 7 19:28:35 2019 (r350694) @@ -345,7 +345,8 @@ void g_reset_bio(struct bio *); void * g_read_data(struct g_consumer *cp, off_t offset, off_t length, int *error); int g_write_data(struct g_consumer *cp, off_t offset, void *ptr, off_t length); int g_delete_data(struct g_consumer *cp, off_t offset, off_t length); -void g_print_bio(struct bio *bp); +void g_format_bio(struct sbuf *, const struct bio *bp); +void g_print_bio(const char *prefix, const struct bio *bp, const char *fmtsuffix, ...) __printflike(3, 4); int g_use_g_read_data(void *, off_t, void **, int); int g_use_g_write_data(void *, off_t, void *, int); Added: head/sys/geom/geom_dbg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/geom/geom_dbg.h Wed Aug 7 19:28:35 2019 (r350694) @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Conrad Meyer + * + * 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$ + */ + +#pragma once + +#ifdef _KERNEL + +#define _GEOM_DEBUG(classname, ctrlvar, loglvl, biop, formatstr, ...) \ +do { \ + const int __control = (ctrlvar); \ + const int __level = (loglvl); \ + \ + if (__control < __level) \ + break; \ + \ + g_dbg_printf((classname), (__control > 0) ? __level : -1, \ + (biop), ": " formatstr, ## __VA_ARGS__); \ +} while (0) + +void g_dbg_printf(const char *classname, int lvl, struct bio *bp, + const char *format, ...) __printflike(4, 5); + +#endif /* _KERNEL */ Modified: head/sys/geom/geom_io.c ============================================================================== --- head/sys/geom/geom_io.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/geom_io.c Wed Aug 7 19:28:35 2019 (r350694) @@ -49,9 +49,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include @@ -1029,8 +1031,37 @@ g_delete_data(struct g_consumer *cp, off_t offset, off } void -g_print_bio(struct bio *bp) +g_print_bio(const char *prefix, const struct bio *bp, const char *fmtsuffix, + ...) { +#ifndef PRINTF_BUFR_SIZE +#define PRINTF_BUFR_SIZE 64 +#endif + char bufr[PRINTF_BUFR_SIZE]; + struct sbuf sb, *sbp __unused; + va_list ap; + + sbp = sbuf_new(&sb, bufr, sizeof(bufr), SBUF_FIXEDLEN); + KASSERT(sbp != NULL, ("sbuf_new misused?")); + + sbuf_set_drain(&sb, sbuf_printf_drain, NULL); + + sbuf_cat(&sb, prefix); + g_format_bio(&sb, bp); + + va_start(ap, fmtsuffix); + sbuf_vprintf(&sb, fmtsuffix, ap); + va_end(ap); + + sbuf_nl_terminate(&sb); + + sbuf_finish(&sb); + sbuf_delete(&sb); +} + +void +g_format_bio(struct sbuf *sb, const struct bio *bp) +{ const char *pname, *cmd = NULL; if (bp->bio_to != NULL) @@ -1041,11 +1072,12 @@ g_print_bio(struct bio *bp) switch (bp->bio_cmd) { case BIO_GETATTR: cmd = "GETATTR"; - printf("%s[%s(attr=%s)]", pname, cmd, bp->bio_attribute); + sbuf_printf(sb, "%s[%s(attr=%s)]", pname, cmd, + bp->bio_attribute); return; case BIO_FLUSH: cmd = "FLUSH"; - printf("%s[%s]", pname, cmd); + sbuf_printf(sb, "%s[%s]", pname, cmd); return; case BIO_ZONE: { char *subcmd = NULL; @@ -1073,7 +1105,7 @@ g_print_bio(struct bio *bp) subcmd = "UNKNOWN"; break; } - printf("%s[%s,%s]", pname, cmd, subcmd); + sbuf_printf(sb, "%s[%s,%s]", pname, cmd, subcmd); return; } case BIO_READ: @@ -1087,9 +1119,9 @@ g_print_bio(struct bio *bp) break; default: cmd = "UNKNOWN"; - printf("%s[%s()]", pname, cmd); + sbuf_printf(sb, "%s[%s()]", pname, cmd); return; } - printf("%s[%s(offset=%jd, length=%jd)]", pname, cmd, + sbuf_printf(sb, "%s[%s(offset=%jd, length=%jd)]", pname, cmd, (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length); } Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/geom_subr.c Wed Aug 7 19:28:35 2019 (r350694) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -76,6 +77,44 @@ struct g_hh00 { int error; int post; }; + +void +g_dbg_printf(const char *classname, int lvl, struct bio *bp, + const char *format, + ...) +{ +#ifndef PRINTF_BUFR_SIZE +#define PRINTF_BUFR_SIZE 64 +#endif + char bufr[PRINTF_BUFR_SIZE]; + struct sbuf sb, *sbp __unused; + va_list ap; + + sbp = sbuf_new(&sb, bufr, sizeof(bufr), SBUF_FIXEDLEN); + KASSERT(sbp != NULL, ("sbuf_new misused?")); + + sbuf_set_drain(&sb, sbuf_printf_drain, NULL); + + sbuf_cat(&sb, classname); + if (lvl >= 0) + sbuf_printf(&sb, "[%d]", lvl); + + va_start(ap, format); + sbuf_vprintf(&sb, format, ap); + va_end(ap); + + if (bp != NULL) { + sbuf_putc(&sb, ' '); + g_format_bio(&sb, bp); + } + + /* Terminate the debug line with a single '\n'. */ + sbuf_nl_terminate(&sb); + + /* Flush line to printf. */ + sbuf_finish(&sb); + sbuf_delete(&sb); +} /* * This event offers a new class a chance to taste all preexisting providers. Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/geom_vfs.c Wed Aug 7 19:28:35 2019 (r350694) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -138,11 +139,9 @@ g_vfs_done(struct bio *bip) cp = bip->bio_from; sc = cp->geom->softc; - if (bip->bio_error) { - printf("g_vfs_done():"); - g_print_bio(bip); - printf("error = %d\n", bip->bio_error); - } + if (bip->bio_error) + g_print_bio("g_vfs_done():", bip, "error = %d", + bip->bio_error); bp->b_error = bip->bio_error; bp->b_ioflags = bip->bio_flags; if (bip->bio_error) Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/journal/g_journal.c Wed Aug 7 19:28:35 2019 (r350694) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/geom/journal/g_journal.h ============================================================================== --- head/sys/geom/journal/g_journal.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/journal/g_journal.h Wed Aug 7 19:28:35 2019 (r350694) @@ -49,28 +49,10 @@ #ifdef _KERNEL extern int g_journal_debug; -#define GJ_DEBUG(lvl, ...) do { \ - if (g_journal_debug >= (lvl)) { \ - printf("GEOM_JOURNAL"); \ - if (g_journal_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) -#define GJ_LOGREQ(lvl, bp, ...) do { \ - if (g_journal_debug >= (lvl)) { \ - printf("GEOM_JOURNAL"); \ - if (g_journal_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf(" "); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) +#define GJ_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_JOURNAL", g_journal_debug, (lvl), NULL, __VA_ARGS__) +#define GJ_LOGREQ(lvl, bp, ...) \ + _GEOM_DEBUG("GEOM_JOURNAL", g_journal_debug, (lvl), (bp), __VA_ARGS__) #define JEMPTY(sc) ((sc)->sc_journal_offset - \ (sc)->sc_jprovider->sectorsize == \ Modified: head/sys/geom/journal/g_journal_ufs.c ============================================================================== --- head/sys/geom/journal/g_journal_ufs.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/journal/g_journal_ufs.c Wed Aug 7 19:28:35 2019 (r350694) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include static int Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/label/g_label.c Wed Aug 7 19:28:35 2019 (r350694) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/geom/label/g_label.h ============================================================================== --- head/sys/geom/label/g_label.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/label/g_label.h Wed Aug 7 19:28:35 2019 (r350694) @@ -50,16 +50,8 @@ #ifdef _KERNEL extern u_int g_label_debug; -#define G_LABEL_DEBUG(lvl, ...) do { \ - if (g_label_debug >= (lvl)) { \ - printf("GEOM_LABEL"); \ - if (g_label_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) +#define G_LABEL_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_LABEL", g_label_debug, (lvl), NULL, __VA_ARGS__) SYSCTL_DECL(_kern_geom_label); Modified: head/sys/geom/label/g_label_ext2fs.c ============================================================================== --- head/sys/geom/label/g_label_ext2fs.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/label/g_label_ext2fs.c Wed Aug 7 19:28:35 2019 (r350694) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #define EXT2FS_SB_OFFSET 1024 Modified: head/sys/geom/label/g_label_iso9660.c ============================================================================== --- head/sys/geom/label/g_label_iso9660.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/label/g_label_iso9660.c Wed Aug 7 19:28:35 2019 (r350694) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #define G_LABEL_ISO9660_DIR "iso9660" Modified: head/sys/geom/label/g_label_msdosfs.c ============================================================================== --- head/sys/geom/label/g_label_msdosfs.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/label/g_label_msdosfs.c Wed Aug 7 19:28:35 2019 (r350694) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/geom/label/g_label_reiserfs.c ============================================================================== --- head/sys/geom/label/g_label_reiserfs.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/label/g_label_reiserfs.c Wed Aug 7 19:28:35 2019 (r350694) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #define REISERFS_NEW_DISK_OFFSET 64 * 1024 Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/label/g_label_ufs.c Wed Aug 7 19:28:35 2019 (r350694) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #define G_LABEL_UFS_VOLUME_DIR "ufs" Modified: head/sys/geom/linux_lvm/g_linux_lvm.c ============================================================================== --- head/sys/geom/linux_lvm/g_linux_lvm.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/linux_lvm/g_linux_lvm.c Wed Aug 7 19:28:35 2019 (r350694) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/geom/linux_lvm/g_linux_lvm.h ============================================================================== --- head/sys/geom/linux_lvm/g_linux_lvm.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/linux_lvm/g_linux_lvm.h Wed Aug 7 19:28:35 2019 (r350694) @@ -28,16 +28,8 @@ * $FreeBSD$ */ -#define G_LLVM_DEBUG(lvl, ...) do { \ - if (g_llvm_debug >= (lvl)) { \ - printf("GEOM_LINUX_LVM"); \ - if (g_llvm_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) +#define G_LLVM_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_LINUX_LVM", g_llvm_debug, (lvl), NULL, __VA_ARGS__) #define G_LLVM_CLASS_NAME "LINUX_LVM" #define G_LLVM_NAMELEN 128 Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/mirror/g_mirror.c Wed Aug 7 19:28:35 2019 (r350694) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include FEATURE(geom_mirror, "GEOM mirroring support"); Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/mirror/g_mirror.h Wed Aug 7 19:28:35 2019 (r350694) @@ -86,28 +86,10 @@ extern int g_mirror_debug; -#define G_MIRROR_DEBUG(lvl, ...) do { \ - if (g_mirror_debug >= (lvl)) { \ - printf("GEOM_MIRROR"); \ - if (g_mirror_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) -#define G_MIRROR_LOGREQ(lvl, bp, ...) do { \ - if (g_mirror_debug >= (lvl)) { \ - printf("GEOM_MIRROR"); \ - if (g_mirror_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf(" "); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) +#define G_MIRROR_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_MIRROR", g_mirror_debug, (lvl), NULL, __VA_ARGS__) +#define G_MIRROR_LOGREQ(lvl, bp, ...) \ + _GEOM_DEBUG("GEOM_MIRROR", g_mirror_debug, (lvl), (bp), __VA_ARGS__) #define G_MIRROR_BIO_FLAG_REGULAR 0x01 #define G_MIRROR_BIO_FLAG_SYNC 0x02 Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/mirror/g_mirror_ctl.c Wed Aug 7 19:28:35 2019 (r350694) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/mountver/g_mountver.c Wed Aug 7 19:28:35 2019 (r350694) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/geom/mountver/g_mountver.h ============================================================================== --- head/sys/geom/mountver/g_mountver.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/mountver/g_mountver.h Wed Aug 7 19:28:35 2019 (r350694) @@ -38,25 +38,10 @@ #ifdef _KERNEL -#define G_MOUNTVER_DEBUG(lvl, ...) do { \ - if (g_mountver_debug >= (lvl)) { \ - printf("GEOM_MOUNTVER"); \ - if (g_mountver_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) -#define G_MOUNTVER_LOGREQ(bp, ...) do { \ - if (g_mountver_debug >= 2) { \ - printf("GEOM_MOUNTVER[2]: "); \ - printf(__VA_ARGS__); \ - printf(" "); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) +#define G_MOUNTVER_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_MOUNTVER", g_mountver_debug, (lvl), NULL, __VA_ARGS__) +#define G_MOUNTVER_LOGREQ(bp, ...) \ + _GEOM_DEBUG("GEOM_MOUNTVER", g_mountver_debug, 2, (bp), __VA_ARGS__) struct g_mountver_softc { TAILQ_HEAD(, bio) sc_queue; Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/nop/g_nop.c Wed Aug 7 19:28:35 2019 (r350694) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/geom/nop/g_nop.h ============================================================================== --- head/sys/geom/nop/g_nop.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/nop/g_nop.h Wed Aug 7 19:28:35 2019 (r350694) @@ -41,26 +41,11 @@ #define G_NOP_PHYSPATH_PASSTHROUGH "\255" #ifdef _KERNEL -#define G_NOP_DEBUG(lvl, ...) do { \ - if (g_nop_debug >= (lvl)) { \ - printf("GEOM_NOP"); \ - if (g_nop_debug > 0) \ - printf("[%u]", lvl); \ - printf(": "); \ - printf(__VA_ARGS__); \ - printf("\n"); \ - } \ -} while (0) +#define G_NOP_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_NOP", g_nop_debug, (lvl), NULL, __VA_ARGS__) +#define G_NOP_LOGREQLVL(lvl, bp, ...) \ + _GEOM_DEBUG("GEOM_NOP", g_nop_debug, (lvl), (bp), __VA_ARGS__) #define G_NOP_LOGREQ(bp, ...) G_NOP_LOGREQLVL(2, bp, __VA_ARGS__) -#define G_NOP_LOGREQLVL(lvl, bp, ...) do { \ - if (g_nop_debug >= (lvl)) { \ - printf("GEOM_NOP[%d]: ", (lvl)); \ - printf(__VA_ARGS__); \ - printf(" "); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) struct g_nop_delay; Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/g_raid.c Wed Aug 7 19:28:35 2019 (r350694) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/geom/raid/g_raid.h ============================================================================== --- head/sys/geom/raid/g_raid.h Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/g_raid.h Wed Aug 7 19:28:35 2019 (r350694) @@ -61,39 +61,13 @@ extern int g_raid_read_err_thresh; extern u_int g_raid_start_timeout; extern struct g_class g_raid_class; -#define G_RAID_DEBUG(lvl, fmt, ...) do { \ - if (g_raid_debug >= (lvl)) { \ - if (g_raid_debug > 0) { \ - printf("GEOM_RAID[%u]: " fmt "\n", \ - lvl, ## __VA_ARGS__); \ - } else { \ - printf("GEOM_RAID: " fmt "\n", \ - ## __VA_ARGS__); \ - } \ - } \ -} while (0) -#define G_RAID_DEBUG1(lvl, sc, fmt, ...) do { \ - if (g_raid_debug >= (lvl)) { \ - if (g_raid_debug > 0) { \ - printf("GEOM_RAID[%u]: %s: " fmt "\n", \ - lvl, (sc)->sc_name, ## __VA_ARGS__); \ - } else { \ - printf("GEOM_RAID: %s: " fmt "\n", \ - (sc)->sc_name, ## __VA_ARGS__); \ - } \ - } \ -} while (0) -#define G_RAID_LOGREQ(lvl, bp, fmt, ...) do { \ - if (g_raid_debug >= (lvl)) { \ - if (g_raid_debug > 0) { \ - printf("GEOM_RAID[%u]: " fmt " ", \ - lvl, ## __VA_ARGS__); \ - } else \ - printf("GEOM_RAID: " fmt " ", ## __VA_ARGS__); \ - g_print_bio(bp); \ - printf("\n"); \ - } \ -} while (0) +#define G_RAID_DEBUG(lvl, ...) \ + _GEOM_DEBUG("GEOM_RAID", g_raid_debug, (lvl), NULL, __VA_ARGS__) +#define G_RAID_DEBUG1(lvl, sc, fmt, ...) \ + _GEOM_DEBUG("GEOM_RAID", g_raid_debug, (lvl), NULL, "%s: " fmt, \ + (sc)->sc_name, ## __VA_ARGS__) +#define G_RAID_LOGREQ(lvl, bp, ...) \ + _GEOM_DEBUG("GEOM_RAID", g_raid_debug, (lvl), (bp), __VA_ARGS__) /* * Flags we use to distinguish I/O initiated by the TR layer to maintain Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/md_ddf.c Wed Aug 7 19:28:35 2019 (r350694) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "geom/raid/md_ddf.h" #include "g_raid_md_if.h" Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/md_intel.c Wed Aug 7 19:28:35 2019 (r350694) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "g_raid_md_if.h" Modified: head/sys/geom/raid/md_jmicron.c ============================================================================== --- head/sys/geom/raid/md_jmicron.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/md_jmicron.c Wed Aug 7 19:28:35 2019 (r350694) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "g_raid_md_if.h" Modified: head/sys/geom/raid/md_nvidia.c ============================================================================== --- head/sys/geom/raid/md_nvidia.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/md_nvidia.c Wed Aug 7 19:28:35 2019 (r350694) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "g_raid_md_if.h" Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/md_promise.c Wed Aug 7 19:28:35 2019 (r350694) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "g_raid_md_if.h" Modified: head/sys/geom/raid/md_sii.c ============================================================================== --- head/sys/geom/raid/md_sii.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/md_sii.c Wed Aug 7 19:28:35 2019 (r350694) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "g_raid_md_if.h" Modified: head/sys/geom/raid/tr_concat.c ============================================================================== --- head/sys/geom/raid/tr_concat.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/tr_concat.c Wed Aug 7 19:28:35 2019 (r350694) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" Modified: head/sys/geom/raid/tr_raid0.c ============================================================================== --- head/sys/geom/raid/tr_raid0.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/tr_raid0.c Wed Aug 7 19:28:35 2019 (r350694) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" Modified: head/sys/geom/raid/tr_raid1.c ============================================================================== --- head/sys/geom/raid/tr_raid1.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/tr_raid1.c Wed Aug 7 19:28:35 2019 (r350694) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "geom/raid/g_raid.h" #include "g_raid_tr_if.h" Modified: head/sys/geom/raid/tr_raid1e.c ============================================================================== --- head/sys/geom/raid/tr_raid1e.c Wed Aug 7 19:27:14 2019 (r350693) +++ head/sys/geom/raid/tr_raid1e.c Wed Aug 7 19:28:35 2019 (r350694) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 7 19:30:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB3B9B5391; Wed, 7 Aug 2019 19:30:33 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463hRs5Xhhz4ClP; Wed, 7 Aug 2019 19:30:33 +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 9FE351971D; Wed, 7 Aug 2019 19:30:33 +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 x77JUXdr084438; Wed, 7 Aug 2019 19:30:33 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77JUXxh084437; Wed, 7 Aug 2019 19:30:33 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201908071930.x77JUXxh084437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 7 Aug 2019 19:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350695 - head/lib/libcasper/services/cap_fileargs X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_fileargs X-SVN-Commit-Revision: 350695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 19:30:33 -0000 Author: oshogbo Date: Wed Aug 7 19:30:33 2019 New Revision: 350695 URL: https://svnweb.freebsd.org/changeset/base/350695 Log: cap_filergs: limit size of the file name The limit of the name in fileargs is twice the size of the MAXPATH. The nvlist will not add an element with the longer name. We can detect at this point that the path is too big, and simple return the same error as open(2) would. PR: 239700 Reported by: markj Tested by: markj MFC after: 2 weeks Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Modified: head/lib/libcasper/services/cap_fileargs/cap_fileargs.c ============================================================================== --- head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Aug 7 19:28:35 2019 (r350694) +++ head/lib/libcasper/services/cap_fileargs/cap_fileargs.c Wed Aug 7 19:30:33 2019 (r350695) @@ -185,6 +185,11 @@ fileargs_create_limit(int argc, const char * const *ar nvlist_add_number(limits, "mode", (uint64_t)mode); for (i = 0; i < argc; i++) { + if (strlen(argv[i]) >= MAXPATHLEN) { + nvlist_destroy(limits); + errno = ENAMETOOLONG; + return (NULL); + } nvlist_add_null(limits, argv[i]); } From owner-svn-src-all@freebsd.org Wed Aug 7 19:38:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CADCB55B6; Wed, 7 Aug 2019 19:38:58 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (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 463hdZ1ywJz4D8v; Wed, 7 Aug 2019 19:38:57 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 393AE2016D; Wed, 7 Aug 2019 15:38:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 07 Aug 2019 15:38:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=6 c4Q7MqdOG0pJYWOK+YRpJ2Lqux6z1e8IG7ru09EOvA=; b=P3nueDoZnTOXsmHdz kV4dMdewjNazM7wi+nP8AXtyTQpRrrLFjupJmH2ZGz0jeD0SwUDJCz9sG46T8pKk MvcZ8AnK5eR3fCouILDrRyn83b5I10Uii/DI3ZRGVNDCrh97fAWA4iOHxeZkEmOm mSIbWm8FGKCqQd8z0CmH3eh1tVzAvFnHqaMuFB/dspPVqD0wJoZU8tQZZIJyVJKf WKQcBD1uCDELSCWfBgzmNzJCUSsE4g1IM3Y5+BT35DNWQcpaQcYBP9swV/7p0Arq 5Qr15fHB7ClUo+1o/2TmCkfhJNHD2iDVMrzEplugK6YlPhfGJkhPGUdEJbJ8JnNn RcV8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=6c4Q7MqdOG0pJYWOK+YRpJ2Lqux6z1e8IG7ru09EO vA=; b=Z5OyByFRQeBVn0cBQKQ4fllaKx/Ax5Cs090dfBBoJUFiUWTzUzeemhjaw eUpSDYrKItvD6voZKpiDcA6QZ704bSTzXLlsMFbG+HG/H76eyTfQPNzH2M9Mxy7a h8tAOFu1hYnaxmkVxZs9ilsOUjUhZscBNtWJpfUbbimZSnwXQxsyH038jgFXiMvJ sdx/mCKJCwV7kCi3XB5akoI2JjcSfWFF2Tcn6GtHlAMJHNdLv6o7qXIU6oe7RrTZ UIEibEK/Xc1HVn3cCl3JegtXIiRXqCOz8v6lYRVxqcJjTooxZU6kdRZKM7+X/Xsj 9os+uIL13c4gRb5ww45V7xm+L7qEw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudduvddgudeflecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesth hqmhdthhdtvdenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlsehsrghm shgtohdrohhrgheqnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecukfhppedule dvrdehhedrheegrdehkeenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtthhlsehs rghmshgtohdrohhrghenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [10.178.24.14] (unknown [192.55.54.58]) by mail.messagingengine.com (Postfix) with ESMTPA id CE7008005A; Wed, 7 Aug 2019 15:38:55 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r350694 - in head: share/man/man9 sys/dev/fdc sys/geom sys/geom/cache sys/geom/concat sys/geom/eli sys/geom/gate sys/geom/journal sys/geom/label sys/geom/linux_lvm sys/geom/mirror sys/g... From: Scott Long In-Reply-To: <201908071928.x77JSZw4084069@repo.freebsd.org> Date: Wed, 7 Aug 2019 13:38:54 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201908071928.x77JSZw4084069@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 463hdZ1ywJz4D8v X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.963,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 19:38:58 -0000 Good work on this and on r347229 and the sbuf improvements! Scott > On Aug 7, 2019, at 1:28 PM, Conrad Meyer wrote: >=20 > Author: cem > Date: Wed Aug 7 19:28:35 2019 > New Revision: 350694 > URL: https://svnweb.freebsd.org/changeset/base/350694 >=20 > Log: > GEOM: Reduce unnecessary log interleaving with sbufs >=20 > Similar to what was done for device_printfs in r347229. >=20 > Convert g_print_bio() to a thin shim around g_format_bio(), which = acts on an > sbuf; documented in g_bio.9. From owner-svn-src-all@freebsd.org Wed Aug 7 19:45:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83168B595A; Wed, 7 Aug 2019 19:45:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463hnP2rt0z4DfY; Wed, 7 Aug 2019 19:45: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 436F219ABE; Wed, 7 Aug 2019 19:45:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77JjjUW096335; Wed, 7 Aug 2019 19:45:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77Jji3J096333; Wed, 7 Aug 2019 19:45:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908071945.x77Jji3J096333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Aug 2019 19:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350696 - in head/sys/amd64/vmm: amd intel X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/amd64/vmm: amd intel X-SVN-Commit-Revision: 350696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 19:45:45 -0000 Author: markj Date: Wed Aug 7 19:45:44 2019 New Revision: 350696 URL: https://svnweb.freebsd.org/changeset/base/350696 Log: Use designated initializers for vmm_ops. MFC after: 3 days Modified: head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Wed Aug 7 19:30:33 2019 (r350695) +++ head/sys/amd64/vmm/amd/svm.c Wed Aug 7 19:45:44 2019 (r350696) @@ -2283,20 +2283,20 @@ svm_vlapic_cleanup(void *arg, struct vlapic *vlapic) } struct vmm_ops vmm_ops_amd = { - svm_init, - svm_cleanup, - svm_restore, - svm_vminit, - svm_vmrun, - svm_vmcleanup, - svm_getreg, - svm_setreg, - vmcb_getdesc, - vmcb_setdesc, - svm_getcap, - svm_setcap, - svm_npt_alloc, - svm_npt_free, - svm_vlapic_init, - svm_vlapic_cleanup + .init = svm_init, + .cleanup = svm_cleanup, + .resume = svm_restore, + .vminit = svm_vminit, + .vmrun = svm_vmrun, + .vmcleanup = svm_vmcleanup, + .vmgetreg = svm_getreg, + .vmsetreg = svm_setreg, + .vmgetdesc = vmcb_getdesc, + .vmsetdesc = vmcb_setdesc, + .vmgetcap = svm_getcap, + .vmsetcap = svm_setcap, + .vmspace_alloc = svm_npt_alloc, + .vmspace_free = svm_npt_free, + .vlapic_init = svm_vlapic_init, + .vlapic_cleanup = svm_vlapic_cleanup, }; Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Aug 7 19:30:33 2019 (r350695) +++ head/sys/amd64/vmm/intel/vmx.c Wed Aug 7 19:45:44 2019 (r350696) @@ -3790,20 +3790,20 @@ vmx_vlapic_cleanup(void *arg, struct vlapic *vlapic) } struct vmm_ops vmm_ops_intel = { - vmx_init, - vmx_cleanup, - vmx_restore, - vmx_vminit, - vmx_run, - vmx_vmcleanup, - vmx_getreg, - vmx_setreg, - vmx_getdesc, - vmx_setdesc, - vmx_getcap, - vmx_setcap, - ept_vmspace_alloc, - ept_vmspace_free, - vmx_vlapic_init, - vmx_vlapic_cleanup, + .init = vmx_init, + .cleanup = vmx_cleanup, + .resume = vmx_restore, + .vminit = vmx_vminit, + .vmrun = vmx_run, + .vmcleanup = vmx_vmcleanup, + .vmgetreg = vmx_getreg, + .vmsetreg = vmx_setreg, + .vmgetdesc = vmx_getdesc, + .vmsetdesc = vmx_setdesc, + .vmgetcap = vmx_getcap, + .vmsetcap = vmx_setcap, + .vmspace_alloc = ept_vmspace_alloc, + .vmspace_free = ept_vmspace_free, + .vlapic_init = vmx_vlapic_init, + .vlapic_cleanup = vmx_vlapic_cleanup, }; From owner-svn-src-all@freebsd.org Wed Aug 7 20:12:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B26F5B6453; Wed, 7 Aug 2019 20:12:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 463jNB3W7bz4GTC; Wed, 7 Aug 2019 20:12:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x77KCOHh089133; Wed, 7 Aug 2019 13:12:24 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x77KCObt089132; Wed, 7 Aug 2019 13:12:24 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201908072012.x77KCObt089132@gndrsh.dnsmgr.net> Subject: Re: svn commit: r350550 - head/share/mk In-Reply-To: <86621ce5-3a8d-2e22-f146-3b0cc8252124@FreeBSD.org> To: Pedro Giffuni Date: Wed, 7 Aug 2019 13:12:24 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 463jNB3W7bz4GTC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 20:12:26 -0000 > On 07/08/2019 11:00, John Baldwin wrote: > > On 8/6/19 9:56 AM, Glen Barber wrote: > >> On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: > >>> Author: jhb > >>> Date: Sat Aug 3 01:06:17 2019 > >>> New Revision: 350550 > >>> URL: https://svnweb.freebsd.org/changeset/base/350550 > >>> > >>> Log: > >>> Flip REPRODUCIBLE_BUILD back to off by default in head. > >>> > >>> Having the full uname output can be useful on head even with > >>> unmodified trees or trees that newvers.sh fails to recognize as > >>> modified. > >>> > >>> Reviewed by: emaste > >>> Differential Revision: https://reviews.freebsd.org/D20895 > >>> > >> I would like to request this commit be reverted. While the original > >> commit message to enable this knob stated the commit would be reverted > >> after stable/12 branched, I have seen no public complaints about > >> enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see > >> the benefit of disabling it by default -- why wouldn't we want > >> reproducibility?). > >> > >> To me, this feels like a step backwards, with no tangible benefit. > >> Note, newvers.sh does properly detect a modified tree if it can find > >> the VCS metadata directory (i.e., .git, .svn) -- I know this because > >> I personally helped with it. > >> > >> In my opinion, those that want the non-reproducible metadata included in > >> output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their > >> src.conf. Turning off a sane default for the benefit of what I suspect > >> is likely a short list of use cases feels like a step in the wrong > >> direction. > > My arguments for flipping this in head (and head only) are that the data > > provided in uname -a when this is disabled is useful for development, and > > that in head we do tailor settings towards development (e.g. GENERIC in > > head vs GENERIC in stable). > > > > The logic to handle modified trees has an inherent assumption that I think > > is false, at least for my workflow and I suspect many others. I do builds > > and tests of kernels on separate machines (VMs or bare metal) from where I > > use VCS to manage sources so that a kernel crash doesn't toast my source > > tree. The trees are then shared to the build/test machines via NFS. As > > a result, the build/test machines are not always able to detect that the > > tree is modified either because a subset of the checkout is exported via > > NFS, or the VCS tool isn't installed on the build/test machines because > > they are generally barebones systems with only a base installed. This > > does mean that flipping the knob off doesn't provide all of the same info, > > but it does provide the path, and the path matters because 'kgdb -n last' > > uses it, and because if you use separate directories for separate projects > > (e.g. git worktrees), then the path tells you which test kernel you booted. > > (It is not uncommon for me to have several test projects in flight on a > > single test machine for different branches.) > > > > In the original discussion on arch, we collectively recognized that > > developer builds vs release builds were different and needed different > > defaults. The compromise reached at that time was to depend on the VCS > > to detect developer builds to choose the policy. What I have found is that > > in practice for at least my workflow that doesn't actually work. I posit > > that the majority of kernels built from head are developer builds, not > > releases, and that the default should cater to that. You could also always > > patch release.sh to set WITH_REPRODUCIBLE_BUILD in the environment which I > > think would give a more accurate sense of when builds are releases or not. > > > > However, I will yield to whatever the consensus is. > > +1 keeping metadata in head. I am conflicted on this one, and I think there is a reasonable argument on both sides, but from what I have read here this appears to be mostly the kernel that is at issue, loss of the meta data from newvers.sh in the kernel is infact a PITA, even on stable or production release systems. I propose a compromise, add 2 knobs: WITHOUT_REPRODUCIBLE_KERNEL (aka get your metadata in uname) WITH_REPRODUCIBLE_USERLAND (aka reproducible userland) WITH{,OUT}_REPRODUCIBLE_BUILD overrides both, for backwards compat, and neither should be defined by default. Somehow set WITH_REPRODUCIBLE_KERNEL for builds of GENERIC for releases/snapshots, but do not ship the system with it set (I can here a growl from Glen on this) Thus we build a reproducible kernel and ship it with the system but if the user builds a kernel it gets meta data to indicate it is no longer a stock kernel. FYI, upon finding I could not figure out what kernel I was running after installing 12.0 release I turnd off REPRODUCIBLE on my kernel build VM for 12.0. I do leave it on if I am building userland. Thoughts? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 7 20:13:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6704B65A0; Wed, 7 Aug 2019 20:13:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463jPg5Pgyz4GlG; Wed, 7 Aug 2019 20:13:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B34A1A04A; Wed, 7 Aug 2019 20:13:43 +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 x77KDhTB014932; Wed, 7 Aug 2019 20:13:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77KDhgM014931; Wed, 7 Aug 2019 20:13:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201908072013.x77KDhgM014931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 7 Aug 2019 20:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350697 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 350697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 20:13:44 -0000 Author: dim Date: Wed Aug 7 20:13:43 2019 New Revision: 350697 URL: https://svnweb.freebsd.org/changeset/base/350697 Log: Fix a possible segfault in wcsxfrm(3) and wcsxfrm_l(3). If the length of the source wide character string, passed in via the "size_t n" parameter, is set to zero, the function should only return the required length for the destination wide character string. In this case, it should *not* attempt to write to the destination, so the "dst" parameter is permitted to be NULL. However, when the internally called _collate_wxfrm() function returns an error, such as when using the "C" locale, as a fallback wcscpy(3) or wcsncpy(3) are used. But if the input length is zero, wcsncpy(3) will be called with a length of -1! If the "dst" parameter is NULL, this will immediately result in a segfault, or if "dst" is a valid pointer, it will most likely result in unexpectedly overwritten memory. Fix this by explicitly checking for an input length greater than zero, before calling wcsncpy(3). Note that a similar situation does not occur in strxfrm(3), the plain character version of this function, as it uses strlcpy(3) for the error case. The strlcpy(3) function does not write to the destination if the input length is zero. MFC after: 1 week Modified: head/lib/libc/string/wcsxfrm.c Modified: head/lib/libc/string/wcsxfrm.c ============================================================================== --- head/lib/libc/string/wcsxfrm.c Wed Aug 7 19:45:44 2019 (r350696) +++ head/lib/libc/string/wcsxfrm.c Wed Aug 7 20:13:43 2019 (r350697) @@ -73,7 +73,7 @@ error: slen = wcslen(src); if (slen < len) (void) wcscpy(dest, src); - else { + else if (len > 0) { (void) wcsncpy(dest, src, len - 1); dest[len - 1] = L'\0'; } From owner-svn-src-all@freebsd.org Wed Aug 7 20:27:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3709B6B59; Wed, 7 Aug 2019 20:27:37 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463jjh6m35z4Hby; Wed, 7 Aug 2019 20:27:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-ot1-x32c.google.com with SMTP id q20so109448574otl.0; Wed, 07 Aug 2019 13:27:36 -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=h7823emz+A8txgLOwhiX8ZIQX+qXPxr2GlwMIi9MVnw=; b=NhMhym77Wz3MLC7Jk4WzikyaKnHmtQ8kP4UWhEAEuThRPwffShWJyM9ozfKw4nDMsW m63uOaTS78CdwXOiekTv99B7PSJsjVRa9fP9BLmZ+SIvW3YnUp+txEqQP70MLL6x0+q1 4PPO51QttrLUHo+sArsZGFTO9CfmENzmFZmHTej3gJaBL1X4jMxI1T3rzWYo6P64QXnL CkcTMU1ee9G+g3f+XjJDwPvwBUAZBISU+5PBNza5NlnLyQ6qqouHBRtfxz7Whp4+yaNx fNV9bP8jk9JeDlqJ52xfHlVQoYLNvPSeWf7cgLm/FfcBCqFcdsKH+P3013V1KA/utdz2 La3A== 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=h7823emz+A8txgLOwhiX8ZIQX+qXPxr2GlwMIi9MVnw=; b=J1hZRP7qSXRjzfUKeoGk6WsZrSrMPAMukbeC0oCQe7KWiV5FC6ygJk0pHyt/PhcDFU FajUXJQ6aj9k7Q3GHc6hxcZcCk1vdnUgnbUzHfP1kzsBRJH3Ot/G4msmRs/IeqWWHvSB pZ7z2jXRkZbritsf9TfjVWBxyP8i6+baLOwmR6b/5Nxj+0ci3NVFwl3z6/peCNrbbAKM 3zb4A+Sook+qic0Ww/j/va13LXyv8ig1zYu5NjQK0nCcKEb+hgbXOawnkINUFuoU4XQY nA22mmkKnTFcOigm2uOH8FaX56JIdaBsnaJU6+tp/tJDVRM1NGA8/dOMe3m8QhNIa6NO s8kQ== X-Gm-Message-State: APjAAAUYm74Wyze/IzEthhBcIwbui57q8EbuILXTGRBtTTzN512QlFb3 VbX4bkPyu73wQ8S5g42Qq2yrKYd2pSk= X-Google-Smtp-Source: APXvYqw4eQCDftgX1+aiJu+4j67DzbY8MpQRapvjZ/lzPRzNNMR+YBOElyjIroqWgjB2t8K5No81Hw== X-Received: by 2002:a5d:9bc6:: with SMTP id d6mr10206293ion.160.1565209655207; Wed, 07 Aug 2019 13:27:35 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-124.dsl.bell.ca. [184.145.252.124]) by smtp.gmail.com with ESMTPSA id s10sm192649922iod.46.2019.08.07.13.27.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 07 Aug 2019 13:27:34 -0700 (PDT) Sender: Mark Johnston Date: Wed, 7 Aug 2019 16:27:32 -0400 From: Mark Johnston To: Li-Wen Hsu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350512 - head/tests/sys/kern Message-ID: <20190807202732.GD1377@raichu> References: <201908011819.x71IJG0M076399@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908011819.x71IJG0M076399@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 463jjh6m35z4Hby X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=NhMhym77; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::32c as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-5.63 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.94)[ip: (-9.16), ipnet: 2607:f8b0::/32(-3.03), asn: 15169(-2.43), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; RCVD_IN_DNSWL_NONE(0.00)[c.2.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[124.252.145.184.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 20:27:37 -0000 On Thu, Aug 01, 2019 at 06:19:16PM +0000, Li-Wen Hsu wrote: > Author: lwhsu > Date: Thu Aug 1 18:19:16 2019 > New Revision: 350512 > URL: https://svnweb.freebsd.org/changeset/base/350512 > > Log: > Only skip test cases sometimes failing in CI when they are running in CI > > Suggested by: jhb > Sponsored by: The FreeBSD Foundation This seems to break running the tests manually; atf dies because the "ci" variable is not defined. I have to use an invocation like this to avoid that: $ kyua -v test_suites.FreeBSD.ci=false test ptrace_test I suspect that share/mk/suite.test.mk needs to be augmented somehow to set this variable to "false" by default, so that the CI infrastructure can override that. > Modified: > head/tests/sys/kern/ptrace_test.c > > Modified: head/tests/sys/kern/ptrace_test.c > ============================================================================== > --- head/tests/sys/kern/ptrace_test.c Thu Aug 1 17:59:56 2019 (r350511) > +++ head/tests/sys/kern/ptrace_test.c Thu Aug 1 18:19:16 2019 (r350512) > @@ -258,7 +258,8 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debug > int cpipe[2], dpipe[2], status; > char c; > > - atf_tc_skip("https://bugs.freebsd.org/239399"); > + if (atf_tc_get_config_var_as_bool(tc, "ci")) > + atf_tc_skip("https://bugs.freebsd.org/239399"); > > ATF_REQUIRE(pipe(cpipe) == 0); > ATF_REQUIRE((child = fork()) != -1); > @@ -801,7 +802,8 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelate > pid_t children[2], fpid, wpid; > int cpipe[2], status; > > - atf_tc_skip("https://bugs.freebsd.org/239397"); > + if (atf_tc_get_config_var_as_bool(tc, "ci")) > + atf_tc_skip("https://bugs.freebsd.org/239397"); > > ATF_REQUIRE(pipe(cpipe) == 0); > ATF_REQUIRE((fpid = fork()) != -1); > @@ -871,7 +873,8 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelat > pid_t children[2], fpid, wpid; > int cpipe[2], status; > > - atf_tc_skip("https://bugs.freebsd.org/239292"); > + if (atf_tc_get_config_var_as_bool(tc, "ci")) > + atf_tc_skip("https://bugs.freebsd.org/239292"); > > ATF_REQUIRE(pipe(cpipe) == 0); > ATF_REQUIRE((fpid = fork()) != -1); > @@ -936,7 +939,8 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrela > pid_t children[2], fpid, wpid; > int cpipe[2], status; > > - atf_tc_skip("https://bugs.freebsd.org/239425"); > + if (atf_tc_get_config_var_as_bool(tc, "ci")) > + atf_tc_skip("https://bugs.freebsd.org/239425"); > > ATF_REQUIRE(pipe(cpipe) == 0); > ATF_REQUIRE((fpid = fork()) != -1); > @@ -2084,7 +2088,8 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) > struct ptrace_lwpinfo pl; > struct sched_param sched_param; > > - atf_tc_skip("https://bugs.freebsd.org/220841"); > + if (atf_tc_get_config_var_as_bool(tc, "ci")) > + atf_tc_skip("https://bugs.freebsd.org/220841"); > > ATF_REQUIRE((fpid = fork()) != -1); > if (fpid == 0) { > From owner-svn-src-all@freebsd.org Wed Aug 7 20:27:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 738B9B6BA6; Wed, 7 Aug 2019 20:27:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463jjy2YpKz4HkD; Wed, 7 Aug 2019 20:27:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from [192.168.0.5] (unknown [181.52.72.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: pfg) by smtp.freebsd.org (Postfix) with ESMTPSA id 59B6A17353; Wed, 7 Aug 2019 20:27:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Subject: Re: svn commit: r350550 - head/share/mk To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org References: <201908072012.x77KCObt089132@gndrsh.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Message-ID: Date: Wed, 7 Aug 2019 15:27:48 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <201908072012.x77KCObt089132@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 20:27:50 -0000 On 07/08/2019 15:12, Rodney W. Grimes wrote: >> On 07/08/2019 11:00, John Baldwin wrote: >>> On 8/6/19 9:56 AM, Glen Barber wrote: >>>> On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: >>>>> Author: jhb >>>>> Date: Sat Aug 3 01:06:17 2019 >>>>> New Revision: 350550 >>>>> URL: https://svnweb.freebsd.org/changeset/base/350550 >>>>> >>>>> Log: >>>>> Flip REPRODUCIBLE_BUILD back to off by default in head. >>>>> >>>>> Having the full uname output can be useful on head even with >>>>> unmodified trees or trees that newvers.sh fails to recognize as >>>>> modified. >>>>> >>>>> Reviewed by: emaste >>>>> Differential Revision: https://reviews.freebsd.org/D20895 >>>>> >>>> I would like to request this commit be reverted. While the original >>>> commit message to enable this knob stated the commit would be reverted >>>> after stable/12 branched, I have seen no public complaints about >>>> enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see >>>> the benefit of disabling it by default -- why wouldn't we want >>>> reproducibility?). >>>> >>>> To me, this feels like a step backwards, with no tangible benefit. >>>> Note, newvers.sh does properly detect a modified tree if it can find >>>> the VCS metadata directory (i.e., .git, .svn) -- I know this because >>>> I personally helped with it. >>>> >>>> In my opinion, those that want the non-reproducible metadata included in >>>> output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their >>>> src.conf. Turning off a sane default for the benefit of what I suspect >>>> is likely a short list of use cases feels like a step in the wrong >>>> direction. >>> My arguments for flipping this in head (and head only) are that the data >>> provided in uname -a when this is disabled is useful for development, and >>> that in head we do tailor settings towards development (e.g. GENERIC in >>> head vs GENERIC in stable). >>> >>> The logic to handle modified trees has an inherent assumption that I think >>> is false, at least for my workflow and I suspect many others. I do builds >>> and tests of kernels on separate machines (VMs or bare metal) from where I >>> use VCS to manage sources so that a kernel crash doesn't toast my source >>> tree. The trees are then shared to the build/test machines via NFS. As >>> a result, the build/test machines are not always able to detect that the >>> tree is modified either because a subset of the checkout is exported via >>> NFS, or the VCS tool isn't installed on the build/test machines because >>> they are generally barebones systems with only a base installed. This >>> does mean that flipping the knob off doesn't provide all of the same info, >>> but it does provide the path, and the path matters because 'kgdb -n last' >>> uses it, and because if you use separate directories for separate projects >>> (e.g. git worktrees), then the path tells you which test kernel you booted. >>> (It is not uncommon for me to have several test projects in flight on a >>> single test machine for different branches.) >>> >>> In the original discussion on arch, we collectively recognized that >>> developer builds vs release builds were different and needed different >>> defaults. The compromise reached at that time was to depend on the VCS >>> to detect developer builds to choose the policy. What I have found is that >>> in practice for at least my workflow that doesn't actually work. I posit >>> that the majority of kernels built from head are developer builds, not >>> releases, and that the default should cater to that. You could also always >>> patch release.sh to set WITH_REPRODUCIBLE_BUILD in the environment which I >>> think would give a more accurate sense of when builds are releases or not. >>> >>> However, I will yield to whatever the consensus is. >> +1 keeping metadata in head. > I am conflicted on this one, and I think there is a reasonable argument > on both sides, but from what I have read here this appears to be mostly > the kernel that is at issue, loss of the meta data from newvers.sh in > the kernel is infact a PITA, even on stable or production release > systems. > > I propose a compromise, add 2 knobs: > WITHOUT_REPRODUCIBLE_KERNEL (aka get your metadata in uname) > WITH_REPRODUCIBLE_USERLAND (aka reproducible userland) > > WITH{,OUT}_REPRODUCIBLE_BUILD overrides both, for backwards compat, > and neither should be defined by default. Too complex IMHO. Either the system is reproducible or it isn't. > Somehow set WITH_REPRODUCIBLE_KERNEL for builds of GENERIC > for releases/snapshots, but do not ship the system with it > set (I can here a growl from Glen on this) Thus we build > a reproducible kernel and ship it with the system but if > the user builds a kernel it gets meta data to indicate it > is no longer a stock kernel. > FYI, upon finding I could not figure out what kernel I was running > after installing 12.0 release I turnd off REPRODUCIBLE on my kernel > build VM for 12.0. I do leave it on if I am building userland. > > Thoughts? Among other things, reproducible builds implies that pkg upgrades are smaller. I see it makes sense to make releases, and in fact -stable, completely reproducible. For -current I am fine with it not being reproducible, All just IMHO. Pedro. From owner-svn-src-all@freebsd.org Wed Aug 7 20:28:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05468B6D60; Wed, 7 Aug 2019 20:28:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463jkg6LkSz4J42; Wed, 7 Aug 2019 20:28:27 +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 BD2941A217; Wed, 7 Aug 2019 20:28:27 +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 x77KSRwm021697; Wed, 7 Aug 2019 20:28:27 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77KSRWA021696; Wed, 7 Aug 2019 20:28:27 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201908072028.x77KSRWA021696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 7 Aug 2019 20:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350698 - head/sys/modules/fusefs X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/modules/fusefs X-SVN-Commit-Revision: 350698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 20:28:28 -0000 Author: asomers Date: Wed Aug 7 20:28:27 2019 New Revision: 350698 URL: https://svnweb.freebsd.org/changeset/base/350698 Log: Remove the fuse.ko -> fusefs.ko symlink On FreeBSD 13.0, the fuse driver will always be known as fusefs. The backwards compatibility symlink will still be used for stable/12 and stable/11, though. Reported by: jhibbits Reviewed by: rgrimes, imp, cem MFC after: Never Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21181 Modified: head/sys/modules/fusefs/Makefile Modified: head/sys/modules/fusefs/Makefile ============================================================================== --- head/sys/modules/fusefs/Makefile Wed Aug 7 20:13:43 2019 (r350697) +++ head/sys/modules/fusefs/Makefile Wed Aug 7 20:28:27 2019 (r350698) @@ -7,23 +7,4 @@ SRCS= vnode_if.h \ fuse_node.c fuse_io.c fuse_device.c fuse_ipc.c fuse_file.c \ fuse_vfsops.c fuse_vnops.c fuse_internal.c fuse_main.c -# Symlink for backwards compatibility with systems installed at 12.0 or older -.if ${MACHINE_CPUARCH} != "powerpc" -SYMLINKS= ${KMOD}.ko ${KMODDIR}/fuse.ko -.else -# Some PPC systems use msdosfs for /boot, which can't handle links or symlinks -afterinstall: alias alias_debug -alias: .PHONY - ${INSTALL} -T release -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ - ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${KMODDIR}/fuse.ko -.if defined(DEBUG_FLAGS) && !defined(INSTALL_NODEBUG) && "${MK_KERNEL_SYMBOLS}" != "no" -alias_debug: .PHONY - ${INSTALL} -T debug -o ${KMODOWN} -g ${KMODGRP} -m ${KMODMODE} \ - ${_INSTALLFLAGS} ${PROG}.debug \ - ${DESTDIR}${KERN_DEBUGDIR}${KMODDIR}/fuse.ko -.else -alias_debug: .PHONY -.endif -.endif - .include From owner-svn-src-all@freebsd.org Wed Aug 7 20:36:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B84DDB712D; Wed, 7 Aug 2019 20:36:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463jw54QVDz4JVj; Wed, 7 Aug 2019 20:36:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 793D81A3E1; Wed, 7 Aug 2019 20:36:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77Kab85027535; Wed, 7 Aug 2019 20:36:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77Kabid027533; Wed, 7 Aug 2019 20:36:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908072036.x77Kabid027533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Aug 2019 20:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350699 - stable/12/tests/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/tests/sys/vm X-SVN-Commit-Revision: 350699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 20:36:37 -0000 Author: markj Date: Wed Aug 7 20:36:36 2019 New Revision: 350699 URL: https://svnweb.freebsd.org/changeset/base/350699 Log: MFC r346995: Add a few regression tests for mlock(2). Added: stable/12/tests/sys/vm/mlock_test.c - copied unchanged from r346995, head/tests/sys/vm/mlock_test.c Modified: stable/12/tests/sys/vm/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/vm/Makefile ============================================================================== --- stable/12/tests/sys/vm/Makefile Wed Aug 7 20:28:27 2019 (r350698) +++ stable/12/tests/sys/vm/Makefile Wed Aug 7 20:36:36 2019 (r350699) @@ -4,6 +4,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/vm -ATF_TESTS_C+= mmap_test +ATF_TESTS_C+= mlock_test \ + mmap_test .include Copied: stable/12/tests/sys/vm/mlock_test.c (from r346995, head/tests/sys/vm/mlock_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/vm/mlock_test.c Wed Aug 7 20:36:36 2019 (r350699, copy of r346995, head/tests/sys/vm/mlock_test.c) @@ -0,0 +1,174 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Mark Johnston + * + * 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 + +static void +test_wired_copy_on_write(void *addr, size_t len) +{ + int status, val; + pid_t pid; + + pid = fork(); + if (pid == -1) + atf_tc_fail("fork() failed: %s", strerror(errno)); + if (pid == 0) { + if (mlock(addr, len) != 0) + _exit(1); + if (ptrace(PT_TRACE_ME, 0, NULL, 0) != 0) + _exit(2); + if (raise(SIGSTOP) != 0) + _exit(3); + if (munlock(addr, len) != 0) + _exit(4); + _exit(0); + } + + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE_MSG(!WIFEXITED(status), + "child exited with status %d", WEXITSTATUS(status)); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + errno = 0; + val = ptrace(PT_READ_D, pid, addr, 0); + ATF_REQUIRE(errno == 0); + ATF_REQUIRE(ptrace(PT_WRITE_D, pid, addr, val) == 0); + ATF_REQUIRE(ptrace(PT_CONTINUE, pid, (caddr_t)1, 0) == 0); + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 0, + "child exited with status %d", WSTOPSIG(status)); +} + +/* + * Use ptrace(2) to trigger a copy-on-write fault of anonymous memory. + */ +ATF_TC_WITHOUT_HEAD(mlock__copy_on_write_anon); +ATF_TC_BODY(mlock__copy_on_write_anon, tc) +{ + char *addr; + int len; + + len = getpagesize(); + addr = mmap(NULL, len, PROT_READ, MAP_ANON, -1, 0); + ATF_REQUIRE(addr != MAP_FAILED); + + test_wired_copy_on_write(addr, len); +} + +/* + * Use ptrace(2) to trigger a copy-on-write fault of a read-only text page. + */ +ATF_TC_WITHOUT_HEAD(mlock__copy_on_write_vnode); +ATF_TC_BODY(mlock__copy_on_write_vnode, tc) +{ + void *addr; + int len; + + len = getpagesize(); + addr = (void *)((uintptr_t)test_wired_copy_on_write & ~(len - 1)); + + test_wired_copy_on_write(addr, len); +} + +/* + * Try truncating and then resizing an mlock()ed mapping. + */ +ATF_TC_WITHOUT_HEAD(mlock__truncate_and_resize); +ATF_TC_BODY(mlock__truncate_and_resize, tc) +{ + char filename[16]; + char *addr; + int fd, i, len; + + snprintf(filename, sizeof(filename), "tmp.XXXXXX"); + fd = mkstemp(filename); + ATF_REQUIRE(fd >= 0); + ATF_REQUIRE(unlink(filename) == 0); + + len = getpagesize(); + ATF_REQUIRE(ftruncate(fd, len) == 0); + + addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(addr != MAP_FAILED); + ATF_REQUIRE(mlock(addr, len) == 0); + memset(addr, 1, len); + ATF_REQUIRE(ftruncate(fd, 0) == 0); + ATF_REQUIRE(ftruncate(fd, len) == 0); + for (i = 0; i < len; i++) + ATF_REQUIRE(addr[i] == 0); + ATF_REQUIRE(munlock(addr, len) == 0); +} + +/* + * Make sure that we can munlock() a truncated mapping. + */ +ATF_TC_WITHOUT_HEAD(mlock__truncate_and_unlock); +ATF_TC_BODY(mlock__truncate_and_unlock, tc) +{ + char filename[16]; + void *addr; + int fd, len; + + snprintf(filename, sizeof(filename), "tmp.XXXXXX"); + fd = mkstemp(filename); + ATF_REQUIRE(fd >= 0); + ATF_REQUIRE(unlink(filename) == 0); + + len = getpagesize(); + ATF_REQUIRE(ftruncate(fd, len) == 0); + + addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(addr != MAP_FAILED); + ATF_REQUIRE(mlock(addr, len) == 0); + ATF_REQUIRE(ftruncate(fd, 0) == 0); + ATF_REQUIRE(munlock(addr, len) == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, mlock__copy_on_write_anon); + ATF_TP_ADD_TC(tp, mlock__copy_on_write_vnode); + ATF_TP_ADD_TC(tp, mlock__truncate_and_resize); + ATF_TP_ADD_TC(tp, mlock__truncate_and_unlock); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Wed Aug 7 20:41:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBF43B73B1; Wed, 7 Aug 2019 20:41:16 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 463k1R2q6lz4Jr1; Wed, 7 Aug 2019 20:41:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x77KfDIK089237; Wed, 7 Aug 2019 13:41:13 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x77KfDv1089236; Wed, 7 Aug 2019 13:41:13 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201908072041.x77KfDv1089236@gndrsh.dnsmgr.net> Subject: Re: svn commit: r350550 - head/share/mk In-Reply-To: To: Pedro Giffuni Date: Wed, 7 Aug 2019 13:41:13 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 463k1R2q6lz4Jr1 X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [1.72 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_MEDIUM(0.73)[0.727,0]; IP_SCORE(0.05)[ip: (0.15), ipnet: 69.59.192.0/19(0.08), asn: 13868(0.05), country: US(-0.05)]; NEURAL_HAM_SHORT(-0.63)[-0.630,0]; NEURAL_SPAM_LONG(0.68)[0.679,0]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 20:41:16 -0000 > On 07/08/2019 15:12, Rodney W. Grimes wrote: > >> On 07/08/2019 11:00, John Baldwin wrote: > >>> On 8/6/19 9:56 AM, Glen Barber wrote: > >>>> On Sat, Aug 03, 2019 at 01:06:18AM +0000, John Baldwin wrote: > >>>>> Author: jhb > >>>>> Date: Sat Aug 3 01:06:17 2019 > >>>>> New Revision: 350550 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/350550 > >>>>> > >>>>> Log: > >>>>> Flip REPRODUCIBLE_BUILD back to off by default in head. > >>>>> > >>>>> Having the full uname output can be useful on head even with > >>>>> unmodified trees or trees that newvers.sh fails to recognize as > >>>>> modified. > >>>>> > >>>>> Reviewed by: emaste > >>>>> Differential Revision: https://reviews.freebsd.org/D20895 > >>>>> > >>>> I would like to request this commit be reverted. While the original > >>>> commit message to enable this knob stated the commit would be reverted > >>>> after stable/12 branched, I have seen no public complaints about > >>>> enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see > >>>> the benefit of disabling it by default -- why wouldn't we want > >>>> reproducibility?). > >>>> > >>>> To me, this feels like a step backwards, with no tangible benefit. > >>>> Note, newvers.sh does properly detect a modified tree if it can find > >>>> the VCS metadata directory (i.e., .git, .svn) -- I know this because > >>>> I personally helped with it. > >>>> > >>>> In my opinion, those that want the non-reproducible metadata included in > >>>> output from 'uname -a' should set WITHOUT_REPRODUCIBLE_BUILDS in their > >>>> src.conf. Turning off a sane default for the benefit of what I suspect > >>>> is likely a short list of use cases feels like a step in the wrong > >>>> direction. > >>> My arguments for flipping this in head (and head only) are that the data > >>> provided in uname -a when this is disabled is useful for development, and > >>> that in head we do tailor settings towards development (e.g. GENERIC in > >>> head vs GENERIC in stable). > >>> > >>> The logic to handle modified trees has an inherent assumption that I think > >>> is false, at least for my workflow and I suspect many others. I do builds > >>> and tests of kernels on separate machines (VMs or bare metal) from where I > >>> use VCS to manage sources so that a kernel crash doesn't toast my source > >>> tree. The trees are then shared to the build/test machines via NFS. As > >>> a result, the build/test machines are not always able to detect that the > >>> tree is modified either because a subset of the checkout is exported via > >>> NFS, or the VCS tool isn't installed on the build/test machines because > >>> they are generally barebones systems with only a base installed. This > >>> does mean that flipping the knob off doesn't provide all of the same info, > >>> but it does provide the path, and the path matters because 'kgdb -n last' > >>> uses it, and because if you use separate directories for separate projects > >>> (e.g. git worktrees), then the path tells you which test kernel you booted. > >>> (It is not uncommon for me to have several test projects in flight on a > >>> single test machine for different branches.) > >>> > >>> In the original discussion on arch, we collectively recognized that > >>> developer builds vs release builds were different and needed different > >>> defaults. The compromise reached at that time was to depend on the VCS > >>> to detect developer builds to choose the policy. What I have found is that > >>> in practice for at least my workflow that doesn't actually work. I posit > >>> that the majority of kernels built from head are developer builds, not > >>> releases, and that the default should cater to that. You could also always > >>> patch release.sh to set WITH_REPRODUCIBLE_BUILD in the environment which I > >>> think would give a more accurate sense of when builds are releases or not. > >>> > >>> However, I will yield to whatever the consensus is. > >> +1 keeping metadata in head. > > I am conflicted on this one, and I think there is a reasonable argument > > on both sides, but from what I have read here this appears to be mostly > > the kernel that is at issue, loss of the meta data from newvers.sh in > > the kernel is infact a PITA, even on stable or production release > > systems. > > > > I propose a compromise, add 2 knobs: > > WITHOUT_REPRODUCIBLE_KERNEL (aka get your metadata in uname) > > WITH_REPRODUCIBLE_USERLAND (aka reproducible userland) > > > > WITH{,OUT}_REPRODUCIBLE_BUILD overrides both, for backwards compat, > > and neither should be defined by default. > Too complex IMHO. Either the system is reproducible or it isn't. > > Somehow set WITH_REPRODUCIBLE_KERNEL for builds of GENERIC > > for releases/snapshots, but do not ship the system with it > > set (I can here a growl from Glen on this) Thus we build > > a reproducible kernel and ship it with the system but if > > the user builds a kernel it gets meta data to indicate it > > is no longer a stock kernel. > > FYI, upon finding I could not figure out what kernel I was running > > after installing 12.0 release I turnd off REPRODUCIBLE on my kernel > > build VM for 12.0. I do leave it on if I am building userland. > > > > Thoughts? > > Among other things, reproducible builds implies that pkg upgrades are Do you mean freebsd-update? > smaller. I see it makes sense to make releases, and in fact -stable, > completely reproducible. For -current I am fine with it not being > reproducible, > > All just IMHO. Let me try to add a case for it on ^head, weekly snapshots are built, if ^head was running reproducible it would be possible to diff these snapshots in a meaniful way. It would also mean one could get pretty creative with ZFS, zfs-snapshots and the built snapshots to actually have on line almost all binary versions of ^head in a fairly compact form. > Pedro. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Aug 7 21:02:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36EADB7CF2; Wed, 7 Aug 2019 21:02:24 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463kTr0gWPz4L60; Wed, 7 Aug 2019 21:02:24 +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 ED0B81A828; Wed, 7 Aug 2019 21:02:23 +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 x77L2Nwb045958; Wed, 7 Aug 2019 21:02:23 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77L2NpO045957; Wed, 7 Aug 2019 21:02:23 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201908072102.x77L2NpO045957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 7 Aug 2019 21:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350700 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 350700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 21:02:24 -0000 Author: lwhsu Date: Wed Aug 7 21:02:23 2019 New Revision: 350700 URL: https://svnweb.freebsd.org/changeset/base/350700 Log: Get configuration variable with default value for not breaking default setting Reported by: markj Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Wed Aug 7 20:36:36 2019 (r350699) +++ head/tests/sys/kern/ptrace_test.c Wed Aug 7 21:02:23 2019 (r350700) @@ -259,7 +259,7 @@ ATF_TC_BODY(ptrace__parent_sees_exit_after_child_debug int cpipe[2], dpipe[2], status; char c; - if (atf_tc_get_config_var_as_bool(tc, "ci")) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/239399"); ATF_REQUIRE(pipe(cpipe) == 0); @@ -803,7 +803,7 @@ ATF_TC_BODY(ptrace__follow_fork_both_attached_unrelate pid_t children[2], fpid, wpid; int cpipe[2], status; - if (atf_tc_get_config_var_as_bool(tc, "ci")) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/239397"); ATF_REQUIRE(pipe(cpipe) == 0); @@ -874,7 +874,7 @@ ATF_TC_BODY(ptrace__follow_fork_child_detached_unrelat pid_t children[2], fpid, wpid; int cpipe[2], status; - if (atf_tc_get_config_var_as_bool(tc, "ci")) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/239292"); ATF_REQUIRE(pipe(cpipe) == 0); @@ -940,7 +940,7 @@ ATF_TC_BODY(ptrace__follow_fork_parent_detached_unrela pid_t children[2], fpid, wpid; int cpipe[2], status; - if (atf_tc_get_config_var_as_bool(tc, "ci")) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/239425"); ATF_REQUIRE(pipe(cpipe) == 0); @@ -2089,7 +2089,7 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) struct ptrace_lwpinfo pl; struct sched_param sched_param; - if (atf_tc_get_config_var_as_bool(tc, "ci")) + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) atf_tc_skip("https://bugs.freebsd.org/220841"); ATF_REQUIRE((fpid = fork()) != -1); From owner-svn-src-all@freebsd.org Wed Aug 7 21:04:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3EB2B7DA6; Wed, 7 Aug 2019 21:04:26 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463kXB4n3yz4LGH; Wed, 7 Aug 2019 21:04:26 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-vs1-f54.google.com with SMTP id j26so61624116vsn.10; Wed, 07 Aug 2019 14:04:26 -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=R9Y/Kz8/B5pR78bDbKMlIiAx4P+5sHZ6XtOOWa4mOZY=; b=fj6h6XpoXkXZvz63c+KK2ImV7LTukyQ/bpjsldwQeEllKT7a3uzB0fTSO299bkXhNn 0ntSjCEJzB0bZ5wYs3RTXYiCkWRn3hIpwf9jTcYQJMVHz57AJHeShki+IDeGQxbunDoU UgM1muwqK5+pLk2jJMSt01L4QArkwnx2C16r3rnPFQyTSzGc8ebH93HgtTV8P9EL3E1o DcVTLsZX3IUGqqKQ8zsw4inky+qmIvdo/CUDbHPy+JEE/DiXDMSgo9HXgJCXjW8sC+8P mK12hs6EJPxpLNHZ3B6wQjl5gd9+LDtfYE3n1BsPY6ZPEBRpgwmggAzsE5ZEVZnHBH1S GQHA== X-Gm-Message-State: APjAAAVdNPmV3HTa5IYpRI7RKuqCQlSLN7D6pfJsJGE+vKlwGKRgIqcz BpVpkZmeywPY72JiXG21+VqPBXc0e1AR8iXhnujsUQ== X-Google-Smtp-Source: APXvYqy8eUxXgmSkQwPzFgBe8W89Jh8L/5SAfrF51ifQsOx3WWFNBfPZe34OTCBgG3E2axoY8+4MxgHouE5vGw2nD+E= X-Received: by 2002:a05:6102:458:: with SMTP id e24mr7052529vsq.31.1565211865028; Wed, 07 Aug 2019 14:04:25 -0700 (PDT) MIME-Version: 1.0 References: <201908011819.x71IJG0M076399@repo.freebsd.org> <20190807202732.GD1377@raichu> In-Reply-To: <20190807202732.GD1377@raichu> From: Li-Wen Hsu Date: Thu, 8 Aug 2019 05:04:13 +0800 Message-ID: Subject: Re: svn commit: r350512 - head/tests/sys/kern To: Mark Johnston Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 463kXB4n3yz4LGH X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 21:04:26 -0000 On Thu, Aug 8, 2019 at 4:27 AM Mark Johnston wrote: > > On Thu, Aug 01, 2019 at 06:19:16PM +0000, Li-Wen Hsu wrote: > > Author: lwhsu > > Date: Thu Aug 1 18:19:16 2019 > > New Revision: 350512 > > URL: https://svnweb.freebsd.org/changeset/base/350512 > > > > Log: > > Only skip test cases sometimes failing in CI when they are running in CI > > > > Suggested by: jhb > > Sponsored by: The FreeBSD Foundation > > This seems to break running the tests manually; atf dies because the > "ci" variable is not defined. I have to use an invocation like this to > avoid that: > > $ kyua -v test_suites.FreeBSD.ci=false test ptrace_test > > I suspect that share/mk/suite.test.mk needs to be augmented somehow to > set this variable to "false" by default, so that the CI infrastructure > can override that. Thanks for catching this! I feel that the better approach is using function that gets this variable with default value, for keeping things simple. Best, Li-Wen From owner-svn-src-all@freebsd.org Wed Aug 7 21:08:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14332B7E50; Wed, 7 Aug 2019 21:08:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463kcH6lqsz4LQx; Wed, 7 Aug 2019 21:07:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4D471A949; Wed, 7 Aug 2019 21:07:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77L7xho046484; Wed, 7 Aug 2019 21:07:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77L7xvY046483; Wed, 7 Aug 2019 21:07:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908072107.x77L7xvY046483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 7 Aug 2019 21:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350701 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 350701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 21:08:00 -0000 Author: avg Date: Wed Aug 7 21:07:59 2019 New Revision: 350701 URL: https://svnweb.freebsd.org/changeset/base/350701 Log: rc.8: add a reference to service(8) While here: - use Xr macro for a reference to sysrc(8) - clarify that rc.shutdown invokes rc.d scripts with "faststop" argument MFC after: 1 week Modified: head/share/man/man8/rc.8 Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Wed Aug 7 21:02:23 2019 (r350700) +++ head/share/man/man8/rc.8 Wed Aug 7 21:07:59 2019 (r350701) @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 29, 2018 +.Dd August 7, 2019 .Dt RC 8 .Os .Sh NAME @@ -89,8 +89,13 @@ The directories contain scripts which will be automatically executed at boot time and shutdown time. .Pp -The sysrc(8) command provides a scripting interface to modify system -config files. +The +.Xr service 8 +command provides a conveninet interface to manage rc.d services. +.Pp +The +.Xr sysrc 8 +command provides a scripting interface to modify system config files. .Ss Operation of Nm .Bl -enum .It @@ -214,7 +219,7 @@ Call each script in turn using which sets .Va $1 to -.Dq Li stop , +.Dq Li faststop , and sources the script in a subshell. .El .Ss Contents of Nm rc.d/ @@ -556,6 +561,7 @@ is unnecessary, but is often included. .Xr rcorder 8 , .Xr reboot 8 , .Xr savecore 8 , +.Xr service 8 , .Xr sysrc 8 .Sh HISTORY The From owner-svn-src-all@freebsd.org Wed Aug 7 21:20:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82A35B82B0; Wed, 7 Aug 2019 21:20:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463ktf2t5Gz4M7L; Wed, 7 Aug 2019 21:20:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45B0F1AB34; Wed, 7 Aug 2019 21:20:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x77LKQoD053265; Wed, 7 Aug 2019 21:20:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x77LKQjJ053263; Wed, 7 Aug 2019 21:20:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201908072120.x77LKQjJ053263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 7 Aug 2019 21:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350702 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 350702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 07 Aug 2019 21:20:26 -0000 Author: avg Date: Wed Aug 7 21:20:25 2019 New Revision: 350702 URL: https://svnweb.freebsd.org/changeset/base/350702 Log: rc.8: fix a typo in r350701 I wronlgy expected that igor(1) checks spelling of all words. MFC after: 1 week Modified: head/share/man/man8/rc.8 Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Wed Aug 7 21:07:59 2019 (r350701) +++ head/share/man/man8/rc.8 Wed Aug 7 21:20:25 2019 (r350702) @@ -91,7 +91,7 @@ executed at boot time and shutdown time. .Pp The .Xr service 8 -command provides a conveninet interface to manage rc.d services. +command provides a convenient interface to manage rc.d services. .Pp The .Xr sysrc 8 From owner-svn-src-all@freebsd.org Wed Aug 7 23:06:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40F1FBAD1E for ; Wed, 7 Aug 2019 23:06:12 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 463nDg68lKz4SpD for ; Wed, 7 Aug 2019 23:06:11 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1565219170; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=nxz9Xe79Zibwx7vg0Lq0UKIdyIdRUyMPOv+pKDVIHHgV9V9M+GxXlgaThnHMtlemRGMl2RoBaIJk9 MSRR0H08Tl9YQ0ai/vpxRnfhq2HICsRMdi/JaFl/TRSbySyvaiq6RoccycLR73KXGnqz/5mO59MzAB 1S9ryi5cceEgF/Vgd27wHTL2zAMl08v7JuSLuPC0ChD32/OszCYowyhEqN2OKTR4qccfufFYO5FA6W LDpcnmWdpnVz/IZQ+9/A4Zod1vrVoAOniFwqxJSwB4uvA6en4NPG7ptsSDfqQnHfbWvcCUfr5mWz28 X9HxdNjIHKcDixFGBNElTizr1JZxCVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=SFJ/GfNdJOPzga7q8d30sRWgZvfEqH5HmMEKv/SjFGM=; b=glbLidK/jGlErn/XhmDOeM+16xB45SGgVkA3a8tMY0wsIGkmjnumjdADclv2FyuKat6XBgIQEeJne ZTHi2ngE7HPp3ZL6S2Ep38JdVPq5DTgbGZjeVbbE+pJCZcuNNixOBM/lHC6Jx5K9fkRO103CM7Dpof etcyNPgRZmsOj20Ac7qVi9cPIEra0b/kEjqJnkEzG36pj5ghtO5w4V3whJG5uTdgzFpg/0uHEn6SVf cmtusPW+ewiHMPD7+FxtLLJTudwSsMwPKmG/vNvzRxp2jwdYOC3Bxt7gXb+2kJVSfD7BVRGuPLQpUB Ig7uO40HNPCGfJr4BvuAuPpUG3MTOkA== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=SFJ/GfNdJOPzga7q8d30sRWgZvfEqH5HmMEKv/SjFGM=; b=LI6/7/D5VbznPpITKxkpD6okIY8j9H0hYpecOSMAkwMPRuJUEGxQqV4HkoKtgh1pDoijzJV35Enn7 3TcvoBq0vFzDqDhU2JDbjGaPKxadxHerN4NYbA3U42FGJtVarDkPsQvI46Ut7c3/ZdIJ8hxiuamBVE 2BYEFl9eFUz+Dw3gBwUHpd2NXy1n4fBCK5gFESfcwoyhgZF2us5b8M575q0IRnZkE+XkEEyYL4rjZo 625BtEMwZW279wcmvWzU1Oe5bBQgzh0sj4QWps9BLGB3V9TW0Q7H9A+KeoNQKpjGDvCsbg0A7/H6/i LJh6yncSMTbdQlGySAbJRuOZqu+KXyw== X-MHO-RoutePath: aGlwcGll X-MHO-User: f0003418-b967-11e9-85ec-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id f0003418-b967-11e9-85ec-13b9aae3a1d2; Wed, 07 Aug 2019 23:06:08 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x77N66Im027269; Wed, 7 Aug 2019 17:06:06 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <7f4c49df080f5e640723cea190ac2e7f909c4059.camel@freebsd.org> Subject: Re: svn commit: r350702 - head/share/man/man8 From: Ian Lepore To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 07 Aug 2019 17:06:06 -0600 In-Reply-To: <201908072120.x77LKQjJ053263@repo.freebsd.org> References: <201908072120.x77LKQjJ053263@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 463nDg68lKz4SpD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.992,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2019 23:06:12 -0000 On Wed, 2019-08-07 at 21:20 +0000, Andriy Gapon wrote: > Author: avg > Date: Wed Aug 7 21:20:25 2019 > New Revision: 350702 > URL: https://svnweb.freebsd.org/changeset/base/350702 > > Log: > rc.8: fix a typo in r350701 > > I wronlgy expected that igor(1) checks spelling of all words. > > MFC after: 1 week > > Modified: > head/share/man/man8/rc.8 > > Modified: head/share/man/man8/rc.8 > ============================================================================== > --- head/share/man/man8/rc.8 Wed Aug 7 21:07:59 2019 (r350701) > +++ head/share/man/man8/rc.8 Wed Aug 7 21:20:25 2019 (r350702) > @@ -91,7 +91,7 @@ executed at boot time and shutdown time. > .Pp > The > .Xr service 8 > -command provides a conveninet interface to manage rc.d services. > +command provides a convenient interface to manage rc.d services. > .Pp > The > .Xr sysrc 8 > Given that probably 60% of any manpage is jargon that won't appear in any dictionary, I think nobody would use igor if it tried to be a full spellchecker. It pissed me off the other day by flagging a dozen occurrances of 'ti' as typos of 'it', in a manpage documenting a Texas Instruments device. -- Ian From owner-svn-src-all@freebsd.org Thu Aug 8 00:17:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81EEDBC547; Thu, 8 Aug 2019 00:17:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463ppj2tWmz4WKJ; Thu, 8 Aug 2019 00:17:17 +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 405F61CBB4; Thu, 8 Aug 2019 00:17:17 +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 x780HHxg060176; Thu, 8 Aug 2019 00:17:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780HGd1060174; Thu, 8 Aug 2019 00:17:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080017.x780HGd1060174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350703 - in stable/12/sys/cam: . scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: . scsi X-SVN-Commit-Revision: 350703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:17:17 -0000 Author: mav Date: Thu Aug 8 00:17:16 2019 New Revision: 350703 URL: https://svnweb.freebsd.org/changeset/base/350703 Log: MFC r340024 (by imp): Add comments explaining what hold/unhold do They act as a simple one-deep semaphore to keep open/close/probe from running at the same time to avoid races that creates. Modified: stable/12/sys/cam/cam_periph.c stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/cam_periph.c ============================================================================== --- stable/12/sys/cam/cam_periph.c Wed Aug 7 21:20:25 2019 (r350702) +++ stable/12/sys/cam/cam_periph.c Thu Aug 8 00:17:16 2019 (r350703) @@ -474,6 +474,12 @@ cam_periph_release(struct cam_periph *periph) mtx_unlock(mtx); } +/* + * hold/unhold act as mutual exclusion for sections of the code that + * need to sleep and want to make sure that other sections that + * will interfere are held off. This only protects exclusive sections + * from each other. + */ int cam_periph_hold(struct cam_periph *periph, int priority) { Modified: stable/12/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_da.c Wed Aug 7 21:20:25 2019 (r350702) +++ stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 00:17:16 2019 (r350703) @@ -2737,9 +2737,10 @@ daregister(struct cam_periph *periph, void *arg) TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph); /* - * Take an exclusive refcount on the periph while dastart is called - * to finish the probe. The reference will be dropped in dadone at - * the end of probe. + * Take an exclusive section lock qon the periph while dastart is called + * to finish the probe. The lock will be dropped in dadone at the end + * of probe. This locks out daopen and daclose from racing with the + * probe. * * XXX if cam_periph_hold returns an error, we don't hold a refcount. */ From owner-svn-src-all@freebsd.org Thu Aug 8 00:18:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D7F1BC5F5; Thu, 8 Aug 2019 00:18:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463prF17Jqz4WRv; Thu, 8 Aug 2019 00:18:37 +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 085D71CBB6; Thu, 8 Aug 2019 00:18:37 +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 x780IaeD060291; Thu, 8 Aug 2019 00:18:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780IaIR060289; Thu, 8 Aug 2019 00:18:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080018.x780IaIR060289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350704 - in stable/12/sys/cam: ata scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: ata scsi X-SVN-Commit-Revision: 350704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:18:37 -0000 Author: mav Date: Thu Aug 8 00:18:36 2019 New Revision: 350704 URL: https://svnweb.freebsd.org/changeset/base/350704 Log: MFC r340448 (by imp): Remove trailing white space in advance of other changes. Modified: stable/12/sys/cam/ata/ata_da.c stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ata/ata_da.c ============================================================================== --- stable/12/sys/cam/ata/ata_da.c Thu Aug 8 00:17:16 2019 (r350703) +++ stable/12/sys/cam/ata/ata_da.c Thu Aug 8 00:18:36 2019 (r350704) @@ -994,7 +994,7 @@ adaclose(struct disk *dp) cam_periph_sleep(periph, &softc->refcount, PRIBIO, "adaclose", 1); cam_periph_unlock(periph); cam_periph_release(periph); - return (0); + return (0); } static void @@ -1018,7 +1018,7 @@ adastrategy(struct bio *bp) { struct cam_periph *periph; struct ada_softc *softc; - + periph = (struct cam_periph *)bp->bio_disk->d_drv1; softc = (struct ada_softc *)periph->softc; @@ -1042,7 +1042,7 @@ adastrategy(struct bio *bp) */ if (bp->bio_cmd == BIO_ZONE) bp->bio_flags |= BIO_ORDERED; - + /* * Place it in the queue of disk activities for this disk */ @@ -1075,7 +1075,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical secsize = softc->params.secsize; lba = offset / secsize; count = length / secsize; - if ((periph->flags & CAM_PERIPH_INVALID) != 0) return (ENXIO); @@ -1265,7 +1264,7 @@ adaasync(void *callback_arg, u_int32_t code, { struct ccb_getdev *cgd; cam_status status; - + cgd = (struct ccb_getdev *)arg; if (cgd == NULL) break; @@ -2155,7 +2154,7 @@ ada_zone_cmd(struct cam_periph *periph, union ccb *ccb error = ENOMEM; goto bailout; } - + ata_zac_mgmt_in(&ccb->ataio, /*retries*/ ada_retry_count, /*cbcfnp*/ adadone, @@ -2996,7 +2995,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb */ if ((softc->valid_logdir_len >= ((ATA_IDENTIFY_DATA_LOG + 1) * sizeof(uint16_t))) - && (le16dec(softc->ata_logdir.header) == + && (le16dec(softc->ata_logdir.header) == ATA_GP_LOG_DIR_VERSION) && (le16dec(&softc->ata_logdir.num_pages[ (ATA_IDENTIFY_DATA_LOG * @@ -3016,7 +3015,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb * then ATA logs are effectively not * supported even if the bit is set in the * identify data. - */ + */ softc->flags &= ~(ADA_FLAG_CAN_LOG | ADA_FLAG_CAN_IDLOG); if ((done_ccb->ccb_h.status & @@ -3126,7 +3125,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb softc->state = ADA_STATE_SUP_CAP; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - } else + } else adaprobedone(periph, done_ccb); return; } @@ -3190,11 +3189,10 @@ adadone(struct cam_periph *periph, union ccb *done_ccb * to an earlier spec, it won't have * the field. So, assume all * commands are supported. - */ + */ softc->zone_flags |= ADA_ZONE_FLAG_SUP_MASK; } - } } else { error = adaerror(done_ccb, CAM_RETRY_SELTO, @@ -3231,7 +3229,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb softc->state = ADA_STATE_ZONE; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); - } else + } else adaprobedone(periph, done_ccb); return; } @@ -3315,7 +3313,6 @@ adadone(struct cam_periph *periph, union ccb *done_ccb /*getcount_only*/0); } } - } free(ataio->data_ptr, M_ATADA); @@ -3382,7 +3379,7 @@ adagetparams(struct cam_periph *periph, struct ccb_get dp->secs_per_track = cgd->ident_data.sectors; dp->cylinders = cgd->ident_data.cylinders; dp->sectors = cgd->ident_data.cylinders * - (u_int32_t)(dp->heads * dp->secs_per_track); + (u_int32_t)(dp->heads * dp->secs_per_track); } lbasize = (u_int32_t)cgd->ident_data.lba_size_1 | ((u_int32_t)cgd->ident_data.lba_size_2 << 16); @@ -3596,7 +3593,7 @@ adaresume(void *arg) /*openings*/0, /*timeout*/0, /*getcount_only*/0); - + cam_periph_unlock(periph); } } Modified: stable/12/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 00:17:16 2019 (r350703) +++ stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 00:18:36 2019 (r350704) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); * Note that there are probe ordering dependencies here. The order isn't * controlled by this enumeration, but by explicit state transitions in * dastart() and dadone(). Here are some of the dependencies: - * + * * 1. RC should come first, before RC16, unless there is evidence that RC16 * is supported. * 2. BDC needs to come before any of the ATA probes, or the ZONE probe. @@ -163,7 +163,7 @@ typedef enum { DA_CCB_PROBE_ATA_ZONE = 0x11, DA_CCB_PROBE_WP = 0x12, DA_CCB_TYPE_MASK = 0x1F, - DA_CCB_RETRY_UA = 0x20 + DA_CCB_RETRY_UA = 0x20 } da_ccb_state; /* @@ -312,7 +312,7 @@ struct da_softc { LIST_HEAD(, ccb_hdr) pending_ccbs; int refcount; /* Active xpt_action() calls */ da_state state; - da_flags flags; + da_flags flags; da_quirks quirks; int minimum_cmd_size; int error_inject; @@ -698,7 +698,7 @@ static struct da_quirk_entry da_quirk_table[] = { /* * PNY USB Flash keys - * PR: usb/75578, usb/72344, usb/65436 + * PR: usb/75578, usb/72344, usb/65436 */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "*" , "USB DISK*", "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE @@ -1389,9 +1389,9 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* - * Hama Innostor USB-Stick + * Hama Innostor USB-Stick */ - { T_DIRECT, SIP_MEDIA_REMOVABLE, "Innostor", "Innostor*", "*" }, + { T_DIRECT, SIP_MEDIA_REMOVABLE, "Innostor", "Innostor*", "*" }, /*quirks*/DA_Q_NO_RC16 }, { @@ -1811,7 +1811,7 @@ dastrategy(struct bio *bp) { struct cam_periph *periph; struct da_softc *softc; - + periph = (struct cam_periph *)bp->bio_disk->d_drv1; softc = (struct da_softc *)periph->softc; @@ -1864,7 +1864,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, periph = dp->d_drv1; softc = (struct da_softc *)periph->softc; secsize = softc->params.secsize; - + if ((softc->flags & DA_FLAG_PACK_INVALID) != 0) return (ENXIO); @@ -1891,7 +1891,7 @@ dadump(void *arg, void *virtual, vm_offset_t physical, printf("Aborting dump due to I/O error.\n"); return (error); } - + /* * Sync the disk cache contents to the physical media. */ @@ -1948,7 +1948,7 @@ dainit(void) } else if (da_send_ordered) { /* Register our shutdown event handler */ - if ((EVENTHANDLER_REGISTER(shutdown_post_sync, dashutdown, + if ((EVENTHANDLER_REGISTER(shutdown_post_sync, dashutdown, NULL, SHUTDOWN_PRI_DEFAULT)) == NULL) printf("dainit: shutdown event registration failed!\n"); } @@ -2044,7 +2044,7 @@ daasync(void *callback_arg, u_int32_t code, { struct ccb_getdev *cgd; cam_status status; - + cgd = (struct ccb_getdev *)arg; if (cgd == NULL) break; @@ -2260,7 +2260,7 @@ dasysctlinit(void *context, int pending) SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "unmapped_io", - CTLFLAG_RD, + CTLFLAG_RD, &softc->unmappedio, 0, "Unmapped I/O support"); @@ -2269,7 +2269,7 @@ dasysctlinit(void *context, int pending) SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "rotating", - CTLFLAG_RD, + CTLFLAG_RD, &softc->rotating, 0, "Rotating media"); @@ -2683,7 +2683,7 @@ daregister(struct cam_periph *periph, void *arg) free(softc, M_DEVBUF); return(CAM_REQ_CMP_ERR); } - + LIST_INIT(&softc->pending_ccbs); softc->state = DA_STATE_PROBE_WP; bioq_init(&softc->delete_run_queue); @@ -2782,7 +2782,7 @@ daregister(struct cam_periph *periph, void *arg) softc->minimum_cmd_size = 10; else softc->minimum_cmd_size = 6; - + /* Predict whether device may support READ CAPACITY(16). */ if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 && (softc->quirks & DA_Q_NO_RC16) == 0) { @@ -2860,7 +2860,7 @@ daregister(struct cam_periph *periph, void *arg) AC_INQ_CHANGED, daasync, periph, periph->path); /* - * Emit an attribute changed notification just in case + * Emit an attribute changed notification just in case * physical path information arrived before our async * event handler was registered, but after anyone attaching * to our disk device polled it. @@ -3024,7 +3024,7 @@ da_zone_cmd(struct cam_periph *periph, union ccb *ccb, error = ENOMEM; goto bailout; } - + if (softc->zone_interface != DA_ZONE_IF_ATA_PASS) { scsi_zbc_in(&ccb->csio, /*retries*/ da_retry_count, @@ -3859,7 +3859,7 @@ out: * single device request, we might have changed the delete * method due to the device incorrectly advertising either * its supported methods or limits. - * + * * To prevent this causing further issues we validate the * against the methods limits, and warn which would * otherwise be unnecessary. @@ -4808,7 +4808,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *d "Attempt to query device " "size failed: %s, %s", sense_key_desc, asc_desc); - } else { + } else { if (have_sense) scsi_sense_print(&done_ccb->csio); else { @@ -4826,7 +4826,7 @@ dadone_proberc(struct cam_periph *periph, union ccb *d * Free up resources. */ cam_periph_invalidate(periph); - } + } } } free(csio->data_ptr, M_SCSIDA); @@ -5117,7 +5117,7 @@ dadone_probebdc(struct cam_periph *periph, union ccb * softc->zone_mode =DA_ZONE_DRIVE_MANAGED; softc->zone_interface = (ata_proto) ? DA_ZONE_IF_ATA_SAT : DA_ZONE_IF_SCSI; - } else if ((bdc->flags & SVPD_ZBC_MASK) != + } else if ((bdc->flags & SVPD_ZBC_MASK) != SVPD_ZBC_NR) { xpt_print(periph->path, "Unknown zoned " "type %#x", @@ -5266,7 +5266,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * /* * If the ATA IDENTIFY failed, we could be talking * to a SCSI drive, although that seems unlikely, - * since the drive did report that it supported the + * since the drive did report that it supported the * ATA Information VPD page. If the ATA IDENTIFY * succeeded, and the SAT layer doesn't support * ZBC -> ZAC translation, continue on to get the @@ -5326,7 +5326,7 @@ dadone_probeatalogdir(struct cam_periph *periph, union */ if ((softc->valid_logdir_len >= ((ATA_IDENTIFY_DATA_LOG + 1) * sizeof(uint16_t))) - && (le16dec(softc->ata_logdir.header) == + && (le16dec(softc->ata_logdir.header) == ATA_GP_LOG_DIR_VERSION) && (le16dec(&softc->ata_logdir.num_pages[ (ATA_IDENTIFY_DATA_LOG * @@ -5346,7 +5346,7 @@ dadone_probeatalogdir(struct cam_periph *periph, union * then ATA logs are effectively not * supported even if the bit is set in the * identify data. - */ + */ softc->flags &= ~(DA_FLAG_CAN_ATA_LOG | DA_FLAG_CAN_ATA_IDLOG); if ((done_ccb->ccb_h.status & @@ -5369,7 +5369,7 @@ dadone_probeatalogdir(struct cam_periph *periph, union xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - } + } daprobedone(periph, done_ccb); return; } @@ -5460,7 +5460,7 @@ dadone_probeataiddir(struct cam_periph *periph, union xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - } + } daprobedone(periph, done_ccb); return; } @@ -5535,10 +5535,9 @@ dadone_probeatasup(struct cam_periph *periph, union cc * to an earlier spec, it won't have * the field. So, assume all * commands are supported. - */ + */ softc->zone_flags |= DA_ZONE_FLAG_SUP_MASK; } - } } else { error = daerror(done_ccb, CAM_RETRY_SELTO, @@ -5574,7 +5573,7 @@ dadone_probeatasup(struct cam_periph *periph, union cc xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; - } + } daprobedone(periph, done_ccb); return; } @@ -5910,9 +5909,9 @@ static void daprevent(struct cam_periph *periph, int action) { struct da_softc *softc; - union ccb *ccb; + union ccb *ccb; int error; - + cam_periph_assert(periph, MA_OWNED); softc = (struct da_softc *)periph->softc; @@ -6185,7 +6184,7 @@ scsi_read_defects(struct ccb_scsiio *csio, uint32_t re void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t list_format, uint32_t addr_desc_index, uint8_t *data_ptr, - uint32_t dxfer_len, int minimum_cmd_size, + uint32_t dxfer_len, int minimum_cmd_size, uint8_t sense_len, uint32_t timeout) { uint8_t cdb_len; @@ -6195,7 +6194,7 @@ scsi_read_defects(struct ccb_scsiio *csio, uint32_t re * need to use the 12 byte command. */ if ((minimum_cmd_size <= 10) - && (addr_desc_index == 0) + && (addr_desc_index == 0) && (dxfer_len <= SRDD10_MAX_LENGTH)) { struct scsi_read_defect_data_10 *cdb10; @@ -6263,7 +6262,7 @@ scsi_sanitize(struct ccb_scsiio *csio, u_int32_t retri #endif /* _KERNEL */ void -scsi_zbc_out(struct ccb_scsiio *csio, uint32_t retries, +scsi_zbc_out(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t service_action, uint64_t zone_id, uint8_t zone_flags, uint8_t *data_ptr, uint32_t dxfer_len, @@ -6290,7 +6289,7 @@ scsi_zbc_out(struct ccb_scsiio *csio, uint32_t retries } void -scsi_zbc_in(struct ccb_scsiio *csio, uint32_t retries, +scsi_zbc_in(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t service_action, uint64_t zone_start_lba, uint8_t zone_options, uint8_t *data_ptr, uint32_t dxfer_len, @@ -6319,7 +6318,7 @@ scsi_zbc_in(struct ccb_scsiio *csio, uint32_t retries, } int -scsi_ata_zac_mgmt_out(struct ccb_scsiio *csio, uint32_t retries, +scsi_ata_zac_mgmt_out(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int use_ncq, uint8_t zm_action, uint64_t zone_id, uint8_t zone_flags, @@ -6431,7 +6430,7 @@ bailout: } int -scsi_ata_zac_mgmt_in(struct ccb_scsiio *csio, uint32_t retries, +scsi_ata_zac_mgmt_in(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int use_ncq, uint8_t zm_action, uint64_t zone_id, uint8_t zone_flags, From owner-svn-src-all@freebsd.org Thu Aug 8 00:19:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4040ABC6DF; Thu, 8 Aug 2019 00:19:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463psZ0xPHz4WZV; Thu, 8 Aug 2019 00:19:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 031831CBB7; Thu, 8 Aug 2019 00:19:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x780JjcT060404; Thu, 8 Aug 2019 00:19:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780JjwG060402; Thu, 8 Aug 2019 00:19:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080019.x780JjwG060402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350705 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 350705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:19:46 -0000 Author: mav Date: Thu Aug 8 00:19:45 2019 New Revision: 350705 URL: https://svnweb.freebsd.org/changeset/base/350705 Log: MFC r340452 (by imp): Introduce scsi_ata_setfeatures() as a convenient way to make a passthru ATA SETFEATURES command. Modified: stable/12/sys/cam/scsi/scsi_all.c stable/12/sys/cam/scsi/scsi_all.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.c Thu Aug 8 00:18:36 2019 (r350704) +++ stable/12/sys/cam/scsi/scsi_all.c Thu Aug 8 00:19:45 2019 (r350705) @@ -8387,6 +8387,38 @@ scsi_ata_read_log(struct ccb_scsiio *csio, uint32_t re return (retval); } +int scsi_ata_setfeatures(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t feature, + uint64_t lba, uint32_t count, + uint8_t sense_len, uint32_t timeout) +{ + return (scsi_ata_pass(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_NONE, + tag_action, + /*protocol*/AP_PROTO_PIO_IN, + /*ata_flags*/AP_FLAG_TDIR_FROM_DEV | + AP_FLAG_BYT_BLOK_BYTES | + AP_FLAG_TLEN_SECT_CNT, + /*features*/feature, + /*sector_count*/count, + /*lba*/lba, + /*command*/ATA_SETFEATURES, + /*device*/ 0, + /*icc*/ 0, + /*auxiliary*/0, + /*control*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*cdb_storage*/NULL, + /*cdb_storage_len*/0, + /*minimum_cmd_size*/0, + sense_len, + timeout)); +} + /* * Note! This is an unusual CDB building function because it can return * an error in the event that the command in question requires a variable Modified: stable/12/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.h Thu Aug 8 00:18:36 2019 (r350704) +++ stable/12/sys/cam/scsi/scsi_all.h Thu Aug 8 00:19:45 2019 (r350705) @@ -4177,6 +4177,12 @@ int scsi_ata_read_log(struct ccb_scsiio *csio, uint32_ uint8_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint8_t sense_len, uint32_t timeout); +int scsi_ata_setfeatures(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + uint8_t tag_action, uint8_t feature, + uint64_t lba, uint32_t count, + uint8_t sense_len, uint32_t timeout); + int scsi_ata_pass(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint32_t flags, uint8_t tag_action, From owner-svn-src-all@freebsd.org Thu Aug 8 00:22:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 033BCBC929; Thu, 8 Aug 2019 00:22:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463pwR6M6fz4Wwh; Thu, 8 Aug 2019 00:22: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 BBE411CD5B; Thu, 8 Aug 2019 00:22:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x780MFhW065246; Thu, 8 Aug 2019 00:22:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780MFIf065245; Thu, 8 Aug 2019 00:22:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080022.x780MFIf065245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350706 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 350706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:22:16 -0000 Author: mav Date: Thu Aug 8 00:22:15 2019 New Revision: 350706 URL: https://svnweb.freebsd.org/changeset/base/350706 Log: MFC r341769 (by imp): Send a START UNIT command when a disk responds with an ASC of 04/1C. This will hopefully spin up a disk that's in low-power mode. Modified: stable/12/sys/cam/scsi/scsi_all.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.c Thu Aug 8 00:19:45 2019 (r350705) +++ stable/12/sys/cam/scsi/scsi_all.c Thu Aug 8 00:22:15 2019 (r350706) @@ -1165,7 +1165,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ "Logical unit not ready, sanitize in progress") }, /* DT MAEB */ - { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */ + { SST(0x04, 0x1C, SS_START | SSQ_DECREMENT_COUNT | ENXIO, "Logical unit not ready, additional power use not yet granted") }, /* D */ { SST(0x04, 0x1D, SS_RDEF, /* XXX TBD */ From owner-svn-src-all@freebsd.org Thu Aug 8 00:23:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E9DC4BC9CB; Thu, 8 Aug 2019 00:23:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463pxW5syWz4X4p; Thu, 8 Aug 2019 00:23:11 +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 AB4021CD75; Thu, 8 Aug 2019 00:23:11 +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 x780NBJu066155; Thu, 8 Aug 2019 00:23:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780NBLl066154; Thu, 8 Aug 2019 00:23:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080023.x780NBLl066154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350707 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 350707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:23:12 -0000 Author: mav Date: Thu Aug 8 00:23:11 2019 New Revision: 350707 URL: https://svnweb.freebsd.org/changeset/base/350707 Log: MFC r342866 (by imp): Add NO_SYNC_CACHE quirk for PENTAX cameras PR: 93389 Modified: stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 00:22:15 2019 (r350706) +++ stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 00:23:11 2019 (r350707) @@ -1122,6 +1122,14 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Pentax Digital Camera + * PR: usb/93389 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "PENTAX", "DIGITAL CAMERA", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* * LG UP3S MP3 player */ {T_DIRECT, SIP_MEDIA_REMOVABLE, "LG", "UP3S", From owner-svn-src-all@freebsd.org Thu Aug 8 00:27:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC1D2BCA6E; Thu, 8 Aug 2019 00:27:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463q2R5Ml2z4XD3; Thu, 8 Aug 2019 00:27:27 +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 9389C1CD7D; Thu, 8 Aug 2019 00:27:27 +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 x780RR7p066470; Thu, 8 Aug 2019 00:27:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780RRmQ066469; Thu, 8 Aug 2019 00:27:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080027.x780RRmQ066469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350708 - in stable/12/sys/cam: ata scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: ata scsi X-SVN-Commit-Revision: 350708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:27:27 -0000 Author: mav Date: Thu Aug 8 00:27:26 2019 New Revision: 350708 URL: https://svnweb.freebsd.org/changeset/base/350708 Log: MFC r343814 (by imp): Add quirk for Sansisk X400 drives Certain versions of Sandisk x400 firmware can hang under extremely heavly load of large I/Os for prolonged periods of time. Newer / current versions work fine, and should be used where possible. Where not possible, this quirk ensures that I/O requests are limited to 128k to avoids the bug, even under extreme load. Since MAXPHYS is 128k, only users with custom kernels are at risk on the older firmware. Once all known users of the older firmware have upgraded, this quirk will be removed. Modified: stable/12/sys/cam/ata/ata_da.c stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ata/ata_da.c ============================================================================== --- stable/12/sys/cam/ata/ata_da.c Thu Aug 8 00:23:11 2019 (r350707) +++ stable/12/sys/cam/ata/ata_da.c Thu Aug 8 00:27:26 2019 (r350708) @@ -119,7 +119,8 @@ typedef enum { ADA_Q_NCQ_TRIM_BROKEN = 0x02, ADA_Q_LOG_BROKEN = 0x04, ADA_Q_SMR_DM = 0x08, - ADA_Q_NO_TRIM = 0x10 + ADA_Q_NO_TRIM = 0x10, + ADA_Q_128KB = 0x20 } ada_quirks; #define ADA_Q_BIT_STRING \ @@ -128,7 +129,8 @@ typedef enum { "\002NCQ_TRIM_BROKEN" \ "\003LOG_BROKEN" \ "\004SMR_DM" \ - "\005NO_TRIM" + "\005NO_TRIM" \ + "\006128KB" typedef enum { ADA_CCB_RAHEAD = 0x01, @@ -274,6 +276,11 @@ struct ada_quirk_entry { static struct ada_quirk_entry ada_quirk_table[] = { { + /* Sandisk X400 */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SanDisk?SD8SB8U1T00*", "X4162000*" }, + /*quirks*/ADA_Q_128KB + }, + { /* Hitachi Advanced Format (4k) drives */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Hitachi H??????????E3*", "*" }, /*quirks*/ADA_Q_4K @@ -1800,6 +1807,8 @@ adaregister(struct cam_periph *periph, void *arg) maxio = min(maxio, 65536 * softc->params.secsize); else /* 28bit ATA command limit */ maxio = min(maxio, 256 * softc->params.secsize); + if (softc->quirks & ADA_Q_128KB) + maxio = min(maxio, 128 * 1024); softc->disk->d_maxsize = maxio; softc->disk->d_unit = periph->unit_number; softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; Modified: stable/12/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 00:23:11 2019 (r350707) +++ stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 00:27:26 2019 (r350708) @@ -130,7 +130,8 @@ typedef enum { DA_Q_NO_UNMAP = 0x20, DA_Q_RETRY_BUSY = 0x40, DA_Q_SMR_DM = 0x80, - DA_Q_STRICT_UNMAP = 0x100 + DA_Q_STRICT_UNMAP = 0x100, + DA_Q_128KB = 0x200 } da_quirks; #define DA_Q_BIT_STRING \ @@ -143,7 +144,8 @@ typedef enum { "\006NO_UNMAP" \ "\007RETRY_BUSY" \ "\010SMR_DM" \ - "\011STRICT_UNMAP" + "\011STRICT_UNMAP" \ + "\012128KB" typedef enum { DA_CCB_PROBE_RC = 0x01, @@ -870,6 +872,11 @@ static struct da_quirk_entry da_quirk_table[] = }, /* ATA/SATA devices over SAS/USB/... */ { + /* Sandisk X400 */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SanDisk SD8SB8U1*", "*" }, + /*quirks*/DA_Q_128KB + }, + { /* Hitachi Advanced Format (4k) drives */ { T_DIRECT, SIP_MEDIA_FIXED, "Hitachi", "H??????????E3*", "*" }, /*quirks*/DA_Q_4K @@ -2821,6 +2828,8 @@ daregister(struct cam_periph *periph, void *arg) softc->maxio = MAXPHYS; /* for safety */ else softc->maxio = cpi.maxio; + if (softc->quirks & DA_Q_128KB) + softc->maxio = min(softc->maxio, 128 * 1024); softc->disk->d_maxsize = softc->maxio; softc->disk->d_unit = periph->unit_number; softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; From owner-svn-src-all@freebsd.org Thu Aug 8 00:29:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D8D4BCB06; Thu, 8 Aug 2019 00:29:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463q500Mkjz4XLJ; Thu, 8 Aug 2019 00:29:40 +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 DE3061CD7E; Thu, 8 Aug 2019 00:29:39 +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 x780TdUD066617; Thu, 8 Aug 2019 00:29:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780Tdex066616; Thu, 8 Aug 2019 00:29:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080029.x780Tdex066616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350709 - stable/12/sys/cam X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam X-SVN-Commit-Revision: 350709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:29:40 -0000 Author: mav Date: Thu Aug 8 00:29:39 2019 New Revision: 350709 URL: https://svnweb.freebsd.org/changeset/base/350709 Log: MFC r344070 (by imp): Fix panic message. The panic message lead people to believe some userland CAM request had caused a problem when in reallity it was for a kernel request (eg the USER bit was cleared). Reword message. Also, improve a couple of comments to reflect that the periph shouldn't be completely torn down before we get here (so the path and sim pointers should be valid, but aren't and the code is designed to be robust enough in the face of that to give a specific panic message). Modified: stable/12/sys/cam/cam_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/cam_xpt.c ============================================================================== --- stable/12/sys/cam/cam_xpt.c Thu Aug 8 00:27:26 2019 (r350708) +++ stable/12/sys/cam/cam_xpt.c Thu Aug 8 00:29:39 2019 (r350709) @@ -5425,8 +5425,9 @@ xpt_done_process(struct ccb_hdr *ccb_h) } /* - * Insulate against a race where the periph is destroyed - * but CCBs are still not all processed. + * Insulate against a race where the periph is destroyed but CCBs are + * still not all processed. This shouldn't happen, but allows us better + * bug diagnostic when it does. */ if (ccb_h->path->bus) sim = ccb_h->path->bus->sim; @@ -5448,7 +5449,7 @@ xpt_done_process(struct ccb_hdr *ccb_h) if (sim) devq = sim->devq; - KASSERT(devq, ("sim missing for XPT_FC_USER_CCB request")); + KASSERT(devq, ("Periph disappeared with request pending.")); mtx_lock(&devq->send_mtx); devq->send_active--; From owner-svn-src-all@freebsd.org Thu Aug 8 00:31:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E14FBCBB6; Thu, 8 Aug 2019 00:31:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463q6Y18Vlz4XbT; Thu, 8 Aug 2019 00:31:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E48331CDAD; Thu, 8 Aug 2019 00:31:00 +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 x780V0S1069730; Thu, 8 Aug 2019 00:31:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780V0jU069728; Thu, 8 Aug 2019 00:31:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080031.x780V0jU069728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350710 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:31:01 -0000 Author: mav Date: Thu Aug 8 00:31:00 2019 New Revision: 350710 URL: https://svnweb.freebsd.org/changeset/base/350710 Log: MFC r345051 (by imp): Add -l to camcontrol readcap. The -l flag sends only the READ CAPACITY (16) sevice action. Normally we send the READ CAPACITY (10) command, and only send RC16 when the capacity is larger than 2TB (since that's the max RC10 can report). However, some badly programmed drives report different numbers for RC10 and RC16. This can be hard to diagnose, but generally there's a "Logical block address out of range" error when RC16 reports a larger number than RC10 and the RC10 number is the correct one. By comparing the output of readcap with and without the -l argmuent, one can determine if there's a mismatch and if the DA_Q_NO_RC16 quirk is needed. Modified: stable/12/sbin/camcontrol/camcontrol.8 stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 00:29:39 2019 (r350709) +++ stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 00:31:00 2019 (r350710) @@ -78,6 +78,7 @@ .Op Fl b .Op Fl h .Op Fl H +.Op Fl l .Op Fl N .Op Fl q .Op Fl s @@ -548,6 +549,11 @@ or .Fl b . .It Fl H Print out the device size in human readable (base 10, 1K == 1000) format. +.It Fl l +Skip sending the SCSI READ CAPACITY (10) command. +Send only the SCSI READ CAPACITY (16) service action and report +its results. +When the two do not match, a quirk is needed to resolve the ambiguity. .It Fl N Print out the number of blocks in the device instead of the last logical block. Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 00:29:39 2019 (r350709) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 00:31:00 2019 (r350710) @@ -204,7 +204,7 @@ static struct camcontrol_opts option_table[] = { {"load", CAM_CMD_STARTSTOP, CAM_ARG_START_UNIT | CAM_ARG_EJECT, NULL}, {"eject", CAM_CMD_STARTSTOP, CAM_ARG_EJECT, NULL}, {"reportluns", CAM_CMD_REPORTLUNS, CAM_ARG_NONE, "clr:"}, - {"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHNqs"}, + {"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHlNqs"}, {"reprobe", CAM_CMD_REPROBE, CAM_ARG_NONE, NULL}, #endif /* MINIMALISTIC */ {"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL}, @@ -7164,7 +7164,7 @@ scsireadcapacity(struct cam_device *device, int argc, char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; - int blocksizeonly, humanize, numblocks, quiet, sizeonly, baseten; + int blocksizeonly, humanize, numblocks, quiet, sizeonly, baseten, longonly; struct scsi_read_capacity_data rcap; struct scsi_read_capacity_data_long rcaplong; uint64_t maxsector; @@ -7174,6 +7174,7 @@ scsireadcapacity(struct cam_device *device, int argc, blocksizeonly = 0; humanize = 0; + longonly = 0; numblocks = 0; quiet = 0; sizeonly = 0; @@ -7202,6 +7203,9 @@ scsireadcapacity(struct cam_device *device, int argc, humanize++; baseten++; break; + case 'l': + longonly++; + break; case 'N': numblocks++; break; @@ -7244,6 +7248,9 @@ scsireadcapacity(struct cam_device *device, int argc, goto bailout; } + if (longonly != 0) + goto long_only; + scsi_read_capacity(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, @@ -7286,6 +7293,7 @@ scsireadcapacity(struct cam_device *device, int argc, if (maxsector != 0xffffffff) goto do_print; +long_only: scsi_read_capacity_16(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, @@ -9582,7 +9590,7 @@ usage(int printlong) " camcontrol identify [dev_id][generic args] [-v]\n" " camcontrol reportluns [dev_id][generic args] [-c] [-l] [-r report]\n" " camcontrol readcap [dev_id][generic args] [-b] [-h] [-H] [-N]\n" -" [-q] [-s]\n" +" [-q] [-s] [-l]\n" " camcontrol start [dev_id][generic args]\n" " camcontrol stop [dev_id][generic args]\n" " camcontrol load [dev_id][generic args]\n" From owner-svn-src-all@freebsd.org Thu Aug 8 00:32:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91AB0BCDA2; Thu, 8 Aug 2019 00:32:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463q873MzZz4Xn3; Thu, 8 Aug 2019 00:32:23 +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 5699C1CF26; Thu, 8 Aug 2019 00:32:23 +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 x780WNYV072251; Thu, 8 Aug 2019 00:32:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780WN73072250; Thu, 8 Aug 2019 00:32:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080032.x780WN73072250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350711 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:32:23 -0000 Author: mav Date: Thu Aug 8 00:32:22 2019 New Revision: 350711 URL: https://svnweb.freebsd.org/changeset/base/350711 Log: MFC r345060 (by 0mp): camcontrol.8: Bump date after r345051 Modified: stable/12/sbin/camcontrol/camcontrol.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 00:31:00 2019 (r350710) +++ stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 00:32:22 2019 (r350711) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 9, 2019 +.Dd March 12, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Thu Aug 8 00:33:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46A8DBCE28; Thu, 8 Aug 2019 00:33:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463q9J0zgVz4Xvv; Thu, 8 Aug 2019 00:33:24 +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 051841CF3C; Thu, 8 Aug 2019 00:33:24 +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 x780XNdS072373; Thu, 8 Aug 2019 00:33:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780XNBL072372; Thu, 8 Aug 2019 00:33:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080033.x780XNBL072372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 00:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350712 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:33:24 -0000 Author: mav Date: Thu Aug 8 00:33:23 2019 New Revision: 350712 URL: https://svnweb.freebsd.org/changeset/base/350712 Log: MFC r345363 (by imp): Make WD and WDC aliases for HGST. HGST was bought by WDC. Over the years, it has sold different drives branded as HGST, WD or WDC. All of them need the HGST workaround of sending 4k-sized packets (or multiples of 4k). And the ones that don't really need this aren't broken by this change. Submitter is the vendor who has tested these changes on a number of drives. I've simplified it slightly, since we don't need additional vendors for this at this time. Modified: stable/12/sbin/camcontrol/fwdownload.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/12/sbin/camcontrol/fwdownload.c Thu Aug 8 00:32:22 2019 (r350711) +++ stable/12/sbin/camcontrol/fwdownload.c Thu Aug 8 00:33:23 2019 (r350712) @@ -212,6 +212,10 @@ static struct fw_vendor vendors_list[] = { 0x8000, 0x07, 0x07, 0, 1, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT}, {VENDOR_SMART, "SmrtStor", T_DIRECT, 0x8000, 0x07, 0x07, 0, 1, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT}, + {VENDOR_HGST, "WD", T_DIRECT, + 0x1000, 0x07, 0x07, 1, 0, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT}, + {VENDOR_HGST, "WDC", T_DIRECT, + 0x1000, 0x07, 0x07, 1, 0, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT}, /* * We match any ATA device. This is really just a placeholder, From owner-svn-src-all@freebsd.org Thu Aug 8 00:42:29 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFE32BD0F3; Thu, 8 Aug 2019 00:42:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463qMn5TDvz4YL1; Thu, 8 Aug 2019 00:42:29 +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 9D85F1D115; Thu, 8 Aug 2019 00:42:29 +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 x780gTtR078294; Thu, 8 Aug 2019 00:42:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780gThf078293; Thu, 8 Aug 2019 00:42:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908080042.x780gThf078293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 00:42:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350713 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:42:29 -0000 Author: cem Date: Thu Aug 8 00:42:29 2019 New Revision: 350713 URL: https://svnweb.freebsd.org/changeset/base/350713 Log: ddb(4): Add 'sysctl' command Implement `sysctl` in `ddb` by overriding `SYSCTL_OUT`. When handling the req, we install custom ddb in/out handlers. The out handler prints straight to the debugger, while the in handler ignores all input. This is intended to allow us to print just about any sysctl. There is a known issue when used from ddb(4) entered via 'sysctl debug.kdb.enter=1'. The DDB mode does not quite prevent all lock interactions, and it is possible for the recursive Giant lock to be unlocked when the ddb(4) 'sysctl' command is used. This may result in a panic on return from ddb(4) via 'c' (continue). Obviously, this is not a problem when debugging already-paniced systems. Submitted by: Travis Lane (formerly: ) Reviewed by: vangyzen (earlier version), Don Morris Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20219 Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Aug 8 00:33:23 2019 (r350712) +++ head/sys/kern/kern_sysctl.c Thu Aug 8 00:42:29 2019 (r350713) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include "opt_capsicum.h" +#include "opt_ddb.h" #include "opt_ktrace.h" #include @@ -48,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -64,6 +66,12 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef DDB +#include +#include +#include +#endif + #include #include @@ -1609,9 +1617,10 @@ sysctl_handle_string(SYSCTL_HANDLER_ARGS) /* * A zero-length buffer indicates a fixed size read-only - * string: + * string. In ddb, don't worry about trying to make a malloced + * snapshot. */ - if (arg2 == 0) { + if (arg2 == 0 || kdb_active) { arg2 = strlen((char *)arg1) + 1; ro_string = 1; } @@ -2240,3 +2249,528 @@ sbuf_new_for_sysctl(struct sbuf *s, char *buf, int len sbuf_set_drain(s, sbuf_sysctl_drain, req); return (s); } + +#ifdef DDB + +/* The current OID the debugger is working with */ +static struct sysctl_oid *g_ddb_oid; + +/* The current flags specified by the user */ +static int g_ddb_sysctl_flags; + +/* Check to see if the last sysctl printed */ +static int g_ddb_sysctl_printed; + +static const int ctl_sign[CTLTYPE+1] = { + [CTLTYPE_INT] = 1, + [CTLTYPE_LONG] = 1, + [CTLTYPE_S8] = 1, + [CTLTYPE_S16] = 1, + [CTLTYPE_S32] = 1, + [CTLTYPE_S64] = 1, +}; + +static const int ctl_size[CTLTYPE+1] = { + [CTLTYPE_INT] = sizeof(int), + [CTLTYPE_UINT] = sizeof(u_int), + [CTLTYPE_LONG] = sizeof(long), + [CTLTYPE_ULONG] = sizeof(u_long), + [CTLTYPE_S8] = sizeof(int8_t), + [CTLTYPE_S16] = sizeof(int16_t), + [CTLTYPE_S32] = sizeof(int32_t), + [CTLTYPE_S64] = sizeof(int64_t), + [CTLTYPE_U8] = sizeof(uint8_t), + [CTLTYPE_U16] = sizeof(uint16_t), + [CTLTYPE_U32] = sizeof(uint32_t), + [CTLTYPE_U64] = sizeof(uint64_t), +}; + +#define DB_SYSCTL_NAME_ONLY 0x001 /* Compare with -N */ +#define DB_SYSCTL_VALUE_ONLY 0x002 /* Compare with -n */ +#define DB_SYSCTL_OPAQUE 0x004 /* Compare with -o */ +#define DB_SYSCTL_HEX 0x008 /* Compare with -x */ + +#define DB_SYSCTL_SAFE_ONLY 0x100 /* Only simple types */ + +static const char db_sysctl_modifs[] = { + 'N', 'n', 'o', 'x', +}; + +static const int db_sysctl_modif_values[] = { + DB_SYSCTL_NAME_ONLY, DB_SYSCTL_VALUE_ONLY, + DB_SYSCTL_OPAQUE, DB_SYSCTL_HEX, +}; + +/* Handlers considered safe to print while recursing */ +static int (* const db_safe_handlers[])(SYSCTL_HANDLER_ARGS) = { + sysctl_handle_bool, + sysctl_handle_8, + sysctl_handle_16, + sysctl_handle_32, + sysctl_handle_64, + sysctl_handle_int, + sysctl_handle_long, + sysctl_handle_string, + sysctl_handle_opaque, +}; + +/* + * Use in place of sysctl_old_kernel to print sysctl values. + * + * Compare to the output handling in show_var from sbin/sysctl/sysctl.c + */ +static int +sysctl_old_ddb(struct sysctl_req *req, const void *ptr, size_t len) +{ + const u_char *val, *p; + const char *sep1; + size_t intlen, slen; + uintmax_t umv; + intmax_t mv; + int sign, ctltype, hexlen, xflag, error; + + /* Suppress false-positive GCC uninitialized variable warnings */ + mv = 0; + umv = 0; + + slen = len; + val = p = ptr; + + if (ptr == NULL) { + error = 0; + goto out; + } + + /* We are going to print */ + g_ddb_sysctl_printed = 1; + + xflag = g_ddb_sysctl_flags & DB_SYSCTL_HEX; + + ctltype = (g_ddb_oid->oid_kind & CTLTYPE); + sign = ctl_sign[ctltype]; + intlen = ctl_size[ctltype]; + + switch (ctltype) { + case CTLTYPE_NODE: + case CTLTYPE_STRING: + db_printf("%.*s", (int) len, (const char *) p); + error = 0; + goto out; + + case CTLTYPE_INT: + case CTLTYPE_UINT: + case CTLTYPE_LONG: + case CTLTYPE_ULONG: + case CTLTYPE_S8: + case CTLTYPE_S16: + case CTLTYPE_S32: + case CTLTYPE_S64: + case CTLTYPE_U8: + case CTLTYPE_U16: + case CTLTYPE_U32: + case CTLTYPE_U64: + hexlen = 2 + (intlen * CHAR_BIT + 3) / 4; + sep1 = ""; + while (len >= intlen) { + switch (ctltype) { + case CTLTYPE_INT: + case CTLTYPE_UINT: + umv = *(const u_int *)p; + mv = *(const int *)p; + break; + case CTLTYPE_LONG: + case CTLTYPE_ULONG: + umv = *(const u_long *)p; + mv = *(const long *)p; + break; + case CTLTYPE_S8: + case CTLTYPE_U8: + umv = *(const uint8_t *)p; + mv = *(const int8_t *)p; + break; + case CTLTYPE_S16: + case CTLTYPE_U16: + umv = *(const uint16_t *)p; + mv = *(const int16_t *)p; + break; + case CTLTYPE_S32: + case CTLTYPE_U32: + umv = *(const uint32_t *)p; + mv = *(const int32_t *)p; + break; + case CTLTYPE_S64: + case CTLTYPE_U64: + umv = *(const uint64_t *)p; + mv = *(const int64_t *)p; + break; + } + + db_printf("%s", sep1); + if (xflag) + db_printf("%#0*jx", hexlen, umv); + else if (!sign) + db_printf("%ju", umv); + else if (g_ddb_oid->oid_fmt[1] == 'K') { + /* Kelvins are currently unsupported. */ + error = EOPNOTSUPP; + goto out; + } else + db_printf("%jd", mv); + + sep1 = " "; + len -= intlen; + p += intlen; + } + error = 0; + goto out; + + case CTLTYPE_OPAQUE: + /* TODO: Support struct functions. */ + + /* FALLTHROUGH */ + default: + db_printf("Format:%s Length:%zu Dump:0x", + g_ddb_oid->oid_fmt, len); + while (len-- && (xflag || p < val + 16)) + db_printf("%02x", *p++); + if (!xflag && len > 16) + db_printf("..."); + error = 0; + goto out; + } + +out: + req->oldidx += slen; + return (error); +} + +/* + * Avoid setting new sysctl values from the debugger + */ +static int +sysctl_new_ddb(struct sysctl_req *req, void *p, size_t l) +{ + + if (!req->newptr) + return (0); + + /* Changing sysctls from the debugger is currently unsupported */ + return (EPERM); +} + +/* + * Run a sysctl handler with the DDB oldfunc and newfunc attached. + * Instead of copying any output to a buffer we'll dump it right to + * the console. + */ +static int +db_sysctl(struct sysctl_oid *oidp, int *name, u_int namelen, + void *old, size_t *oldlenp, size_t *retval, int flags) +{ + struct sysctl_req req; + int error; + + /* Setup the request */ + bzero(&req, sizeof req); + req.td = kdb_thread; + req.oldfunc = sysctl_old_ddb; + req.newfunc = sysctl_new_ddb; + req.lock = REQ_UNWIRED; + if (oldlenp) { + req.oldlen = *oldlenp; + } + req.validlen = req.oldlen; + if (old) { + req.oldptr = old; + } + + /* Setup our globals for sysctl_old_ddb */ + g_ddb_oid = oidp; + g_ddb_sysctl_flags = flags; + g_ddb_sysctl_printed = 0; + + error = sysctl_root(0, name, namelen, &req); + + /* Reset globals */ + g_ddb_oid = NULL; + g_ddb_sysctl_flags = 0; + + if (retval) { + if (req.oldptr && req.oldidx > req.validlen) + *retval = req.validlen; + else + *retval = req.oldidx; + } + return (error); +} + +/* + * Show a sysctl's name + */ +static void +db_show_oid_name(int *oid, size_t nlen) +{ + struct sysctl_oid *oidp; + int qoid[CTL_MAXNAME+2]; + int error; + + qoid[0] = 0; + memcpy(qoid + 2, oid, nlen * sizeof(int)); + qoid[1] = 1; + + error = sysctl_find_oid(qoid, nlen + 2, &oidp, NULL, NULL); + if (error) + db_error("sysctl name oid"); + + error = db_sysctl(oidp, qoid, nlen + 2, NULL, NULL, NULL, 0); + if (error) + db_error("sysctl name"); +} + +/* + * Check to see if an OID is safe to print from ddb. + */ +static bool +db_oid_safe(const struct sysctl_oid *oidp) +{ + for (unsigned int i = 0; i < nitems(db_safe_handlers); ++i) { + if (oidp->oid_handler == db_safe_handlers[i]) + return (true); + } + + return (false); +} + +/* + * Show a sysctl at a specific OID + * Compare to the input handling in show_var from sbin/sysctl/sysctl.c + */ +static int +db_show_oid(struct sysctl_oid *oidp, int *oid, size_t nlen, int flags) +{ + int error, xflag, oflag, Nflag, nflag; + size_t len; + + xflag = flags & DB_SYSCTL_HEX; + oflag = flags & DB_SYSCTL_OPAQUE; + nflag = flags & DB_SYSCTL_VALUE_ONLY; + Nflag = flags & DB_SYSCTL_NAME_ONLY; + + if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_OPAQUE && + (!xflag && !oflag)) + return (0); + + if (Nflag) { + db_show_oid_name(oid, nlen); + error = 0; + goto out; + } + + if (!nflag) { + db_show_oid_name(oid, nlen); + db_printf(": "); + } + + if ((flags & DB_SYSCTL_SAFE_ONLY) && !db_oid_safe(oidp)) { + db_printf("Skipping, unsafe to print while recursing."); + error = 0; + goto out; + } + + /* Try once, and ask about the size */ + len = 0; + error = db_sysctl(oidp, oid, nlen, + NULL, NULL, &len, flags); + if (error) + goto out; + + if (!g_ddb_sysctl_printed) + /* Lie about the size */ + error = db_sysctl(oidp, oid, nlen, + (void *) 1, &len, NULL, flags); + +out: + db_printf("\n"); + return (error); +} + +/* + * Show all sysctls under a specific OID + * Compare to sysctl_all from sbin/sysctl/sysctl.c + */ +static int +db_show_sysctl_all(int *oid, size_t len, int flags) +{ + struct sysctl_oid *oidp; + int name1[CTL_MAXNAME + 2], name2[CTL_MAXNAME + 2]; + size_t l1, l2; + + name1[0] = 0; + name1[1] = 2; + l1 = 2; + if (len) { + memcpy(name1+2, oid, len * sizeof(int)); + l1 +=len; + } else { + name1[2] = 1; + l1++; + } + for (;;) { + int i, error; + + l2 = sizeof(name2); + error = kernel_sysctl(kdb_thread, name1, l1, + name2, &l2, NULL, 0, &l2, 0); + if (error != 0) { + if (error == ENOENT) + return (0); + else + db_error("sysctl(getnext)"); + } + + l2 /= sizeof(int); + + if (l2 < (unsigned int)len) + return (0); + + for (i = 0; i < len; i++) + if (name2[i] != oid[i]) + return (0); + + /* Find the OID in question */ + error = sysctl_find_oid(name2, l2, &oidp, NULL, NULL); + if (error) + return (error); + + i = db_show_oid(oidp, name2, l2, flags | DB_SYSCTL_SAFE_ONLY); + + if (db_pager_quit) + return (0); + + memcpy(name1+2, name2, l2 * sizeof(int)); + l1 = 2 + l2; + } +} + +/* + * Show a sysctl by its user facing string + */ +static int +db_sysctlbyname(char *name, int flags) +{ + struct sysctl_oid *oidp; + int oid[CTL_MAXNAME]; + int error, nlen; + + error = name2oid(name, oid, &nlen, &oidp); + if (error) { + return (error); + } + + if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) { + db_show_sysctl_all(oid, nlen, flags); + } else { + error = db_show_oid(oidp, oid, nlen, flags); + } + + return (error); +} + +static void +db_sysctl_cmd_usage(void) +{ + db_printf( + " sysctl [/Nnox] \n" + " \n" + " The name of the sysctl to show. \n" + " \n" + " Show a sysctl by hooking into SYSCTL_IN and SYSCTL_OUT. \n" + " This will work for most sysctls, but should not be used \n" + " with sysctls that are known to malloc. \n" + " \n" + " While recursing any \"unsafe\" sysctls will be skipped. \n" + " Call sysctl directly on the sysctl to try printing the \n" + " skipped sysctl. This is unsafe and may make the ddb \n" + " session unusable. \n" + " \n" + " Arguments: \n" + " /N Display only the name of the sysctl. \n" + " /n Display only the value of the sysctl. \n" + " /o Display opaque values. \n" + " /x Display the sysctl in hex. \n" + " \n" + "For example: \n" + "sysctl vm.v_free_min \n" + "vn.v_free_min: 12669 \n" + ); +} + +/* + * Show a specific sysctl similar to sysctl (8). + */ +DB_FUNC(sysctl, db_sysctl_cmd, db_cmd_table, CS_OWN, NULL) +{ + char name[TOK_STRING_SIZE]; + int error, i, t, flags; + + /* Parse the modifiers */ + t = db_read_token(); + if (t == tSLASH || t == tMINUS) { + t = db_read_token(); + if (t != tIDENT) { + db_printf("Bad modifier\n"); + error = EINVAL; + goto out; + } + db_strcpy(modif, db_tok_string); + } + else { + db_unread_token(t); + modif[0] = '\0'; + } + + flags = 0; + for (i = 0; i < nitems(db_sysctl_modifs); i++) { + if (strchr(modif, db_sysctl_modifs[i])) { + flags |= db_sysctl_modif_values[i]; + } + } + + /* Parse the sysctl names */ + t = db_read_token(); + if (t != tIDENT) { + db_printf("Need sysctl name\n"); + error = EINVAL; + goto out; + } + + /* Copy the name into a temporary buffer */ + db_strcpy(name, db_tok_string); + + /* Ensure there is no trailing cruft */ + t = db_read_token(); + if (t != tEOL) { + db_printf("Unexpected sysctl argument\n"); + error = EINVAL; + goto out; + } + + error = db_sysctlbyname(name, flags); + if (error == ENOENT) { + db_printf("unknown oid: '%s'\n", db_tok_string); + goto out; + } else if (error) { + db_printf("%s: error: %d\n", db_tok_string, error); + goto out; + } + +out: + /* Ensure we eat all of our text */ + db_flush_lex(); + + if (error == EINVAL) { + db_sysctl_cmd_usage(); + } +} + +#endif /* DDB */ From owner-svn-src-all@freebsd.org Thu Aug 8 00:51:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3C23BD3CC; Thu, 8 Aug 2019 00:51:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463qYx4BKjz4Yq0; Thu, 8 Aug 2019 00:51:17 +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 715FF1D17F; Thu, 8 Aug 2019 00:51:17 +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 x780pH8r079465; Thu, 8 Aug 2019 00:51:17 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x780pHQe079464; Thu, 8 Aug 2019 00:51:17 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201908080051.x780pHQe079464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 8 Aug 2019 00:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350714 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 350714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 00:51:17 -0000 Author: lwhsu Date: Thu Aug 8 00:51:17 2019 New Revision: 350714 URL: https://svnweb.freebsd.org/changeset/base/350714 Log: Follow r350693 to add a link for sbuf_nl_terminate(9) Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Aug 8 00:42:29 2019 (r350713) +++ head/share/man/man9/Makefile Thu Aug 8 00:51:17 2019 (r350714) @@ -1790,6 +1790,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_new.9 \ sbuf.9 sbuf_new_auto.9 \ sbuf.9 sbuf_new_for_sysctl.9 \ + sbuf.9 sbuf_nl_terminate.9 \ sbuf.9 sbuf_printf.9 \ sbuf.9 sbuf_printf_drain.9 \ sbuf.9 sbuf_putbuf.9 \ From owner-svn-src-all@freebsd.org Thu Aug 8 01:27:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76977BE780; Thu, 8 Aug 2019 01:27:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463rMc2W7Fz4bkb; Thu, 8 Aug 2019 01:27:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f46.google.com with SMTP id q20so112002893otl.0; Wed, 07 Aug 2019 18:27:23 -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=OL3M+oWhRekHMvAfglyENaOEybMYil14kJfoR0QEtCs=; b=eZtpnNnTszPG5+qxn9s2+sR9dw7JLlYU+NdGv1X4pzd8mN1CrjDf4gMj5H1cOvRk48 uLjVcD1BA1dFbkRXEwGOYd2dync7i4a4MYJMl/kHnAnZ2MbthFSLE2rSLb7u1cBjQQM8 YYYynq3cCVLhymRssVgjZm82y2XPGsYBc6hmLifVfr9KYMcjno7HlBWzqA+3/pbk73rF dVP774+1lomGu1Xt8O0x+2nEDhI0w2QenYClNbHuiN/4ustHh5+l262tM0SY1NJCq32M EejPCwJ96lmF9m9TSsejR3AV7eKHzuUREdZlPCCNAaEG0HfrzIzHNoucZwuBs43RmGwk nkmw== X-Gm-Message-State: APjAAAWCo6RGwRU+y7YPTdl6PYf/udeIyVvpN4ix8UikTfXeMOoLnm+Q lPE6ozXvA/2Dh6iCh6uAv/cRT21i X-Google-Smtp-Source: APXvYqxbniiD8Ll/ZBjVt1GDJbx2LvbWVrtqctU8DPH1L1Qyv2i3Lz3Y+7j7UKJQgRn6XC3nCdsXlQ== X-Received: by 2002:a9d:65cb:: with SMTP id z11mr10826528oth.325.1565227642209; Wed, 07 Aug 2019 18:27:22 -0700 (PDT) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com. [209.85.210.49]) by smtp.gmail.com with ESMTPSA id b21sm31825451otp.80.2019.08.07.18.27.21 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 18:27:22 -0700 (PDT) Received: by mail-ot1-f49.google.com with SMTP id x21so18829828otq.12; Wed, 07 Aug 2019 18:27:21 -0700 (PDT) X-Received: by 2002:a02:aa0d:: with SMTP id r13mr13735632jam.129.1565227641770; Wed, 07 Aug 2019 18:27:21 -0700 (PDT) MIME-Version: 1.0 References: <201908080051.x780pHQe079464@repo.freebsd.org> In-Reply-To: <201908080051.x780pHQe079464@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 7 Aug 2019 18:27:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r350714 - head/share/man/man9 To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 463rMc2W7Fz4bkb X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 01:27:24 -0000 Thanks Li-Wen Hsu! On Wed, Aug 7, 2019 at 5:51 PM Li-Wen Hsu wrote: > > Author: lwhsu > Date: Thu Aug 8 00:51:17 2019 > New Revision: 350714 > URL: https://svnweb.freebsd.org/changeset/base/350714 > > Log: > Follow r350693 to add a link for sbuf_nl_terminate(9) > > Sponsored by: The FreeBSD Foundation > > Modified: > head/share/man/man9/Makefile > > Modified: head/share/man/man9/Makefile > ============================================================================== > --- head/share/man/man9/Makefile Thu Aug 8 00:42:29 2019 (r350713) > +++ head/share/man/man9/Makefile Thu Aug 8 00:51:17 2019 (r350714) > @@ -1790,6 +1790,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ > sbuf.9 sbuf_new.9 \ > sbuf.9 sbuf_new_auto.9 \ > sbuf.9 sbuf_new_for_sysctl.9 \ > + sbuf.9 sbuf_nl_terminate.9 \ > sbuf.9 sbuf_printf.9 \ > sbuf.9 sbuf_printf_drain.9 \ > sbuf.9 sbuf_putbuf.9 \ > From owner-svn-src-all@freebsd.org Thu Aug 8 01:37:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CB82BEF27; Thu, 8 Aug 2019 01:37:42 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463rbV0NLPz4cVM; Thu, 8 Aug 2019 01:37:42 +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 E30411DA7A; Thu, 8 Aug 2019 01:37:41 +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 x781bf7s007994; Thu, 8 Aug 2019 01:37:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x781bf4N007993; Thu, 8 Aug 2019 01:37:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908080137.x781bf4N007993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 01:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350715 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 01:37:42 -0000 Author: cem Date: Thu Aug 8 01:37:41 2019 New Revision: 350715 URL: https://svnweb.freebsd.org/changeset/base/350715 Log: Fix !DDB kernel configurations after r350713 KDB is standard and the kdb_active variable is always available. So, de-conditionalize inclusion of sys/kdb.h in kern_sysctl.c. Reported by: Michael Butler X-MFC-With: r350713 Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Thu Aug 8 00:51:17 2019 (r350714) +++ head/sys/kern/kern_sysctl.c Thu Aug 8 01:37:41 2019 (r350715) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -67,7 +68,6 @@ __FBSDID("$FreeBSD$"); #endif #ifdef DDB -#include #include #include #endif From owner-svn-src-all@freebsd.org Thu Aug 8 02:00:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D6EFBF929; Thu, 8 Aug 2019 02:00:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463s5S1RVLz4dg9; Thu, 8 Aug 2019 02:00:12 +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 147151DE25; Thu, 8 Aug 2019 02:00:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7820BU5019861; Thu, 8 Aug 2019 02:00:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7820Bcp019859; Thu, 8 Aug 2019 02:00:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080200.x7820Bcp019859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350716 - in stable/12/sys: cam/nvme conf X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: cam/nvme conf X-SVN-Commit-Revision: 350716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:00:12 -0000 Author: mav Date: Thu Aug 8 02:00:11 2019 New Revision: 350716 URL: https://svnweb.freebsd.org/changeset/base/350716 Log: MFC r345817: Build NVMe CAM transport unrelated to NVMe SIM. Before this I suppose it was impossible load CAM-based NVMe as module. Plus this appeared to be needed to build r345815 without NVMe driver. Modified: stable/12/sys/cam/nvme/nvme_da.c stable/12/sys/conf/files Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/nvme/nvme_da.c ============================================================================== --- stable/12/sys/cam/nvme/nvme_da.c Thu Aug 8 01:37:41 2019 (r350715) +++ stable/12/sys/cam/nvme/nvme_da.c Thu Aug 8 02:00:11 2019 (r350716) @@ -759,10 +759,6 @@ ndaregister(struct cam_periph *periph, void *arg) softc->quirks = quirks; cam_iosched_set_sort_queue(softc->cam_iosched, 0); softc->disk = disk = disk_alloc(); - strlcpy(softc->disk->d_descr, cd->mn, - MIN(sizeof(softc->disk->d_descr), sizeof(cd->mn))); - strlcpy(softc->disk->d_ident, cd->sn, - MIN(sizeof(softc->disk->d_ident), sizeof(cd->sn))); disk->d_rotation_rate = DISK_RR_NON_ROTATING; disk->d_open = ndaopen; disk->d_close = ndaclose; @@ -801,9 +797,9 @@ ndaregister(struct cam_periph *periph, void *arg) * d_ident and d_descr are both far bigger than the length of either * the serial or model number strings. */ - nvme_strvis(disk->d_descr, cd->mn, + cam_strvis(disk->d_descr, cd->mn, sizeof(disk->d_descr), NVME_MODEL_NUMBER_LENGTH); - nvme_strvis(disk->d_ident, cd->sn, + cam_strvis(disk->d_ident, cd->sn, sizeof(disk->d_ident), NVME_SERIAL_NUMBER_LENGTH); disk->d_hba_vendor = cpi.hba_vendor; disk->d_hba_device = cpi.hba_device; Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Thu Aug 8 01:37:41 2019 (r350715) +++ stable/12/sys/conf/files Thu Aug 8 02:00:11 2019 (r350716) @@ -78,9 +78,9 @@ cam/cam_xpt.c optional scbus cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus cam/ata/ata_pmp.c optional scbus -cam/nvme/nvme_all.c optional scbus nvme -cam/nvme/nvme_da.c optional scbus nvme da -cam/nvme/nvme_xpt.c optional scbus nvme +cam/nvme/nvme_all.c optional scbus +cam/nvme/nvme_da.c optional nda | da +cam/nvme/nvme_xpt.c optional scbus cam/scsi/scsi_xpt.c optional scbus cam/scsi/scsi_all.c optional scbus cam/scsi/scsi_cd.c optional cd From owner-svn-src-all@freebsd.org Thu Aug 8 02:01:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EF98BFA9B; Thu, 8 Aug 2019 02:01:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463s6Q3BDSz4drh; Thu, 8 Aug 2019 02:01:02 +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 4EC661DE4D; Thu, 8 Aug 2019 02:01:02 +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 x78212Or022424; Thu, 8 Aug 2019 02:01:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78211l1022420; Thu, 8 Aug 2019 02:01:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080201.x78211l1022420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350717 - in stable/12: lib/libcam sys/cam sys/cam/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: lib/libcam sys/cam sys/cam/nvme X-SVN-Commit-Revision: 350717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:01:02 -0000 Author: mav Date: Thu Aug 8 02:01:01 2019 New Revision: 350717 URL: https://svnweb.freebsd.org/changeset/base/350717 Log: MFC r345815: Make cam_error_print() decode NVMe commands. Modified: stable/12/lib/libcam/Makefile stable/12/sys/cam/cam.c stable/12/sys/cam/nvme/nvme_all.c stable/12/sys/cam/nvme/nvme_all.h stable/12/sys/cam/nvme/nvme_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libcam/Makefile ============================================================================== --- stable/12/lib/libcam/Makefile Thu Aug 8 02:00:11 2019 (r350716) +++ stable/12/lib/libcam/Makefile Thu Aug 8 02:01:01 2019 (r350717) @@ -4,7 +4,7 @@ PACKAGE= lib${LIB} LIB= cam SHLIBDIR?= /lib SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \ - ata_all.c smp_all.c + ata_all.c nvme_all.c smp_all.c INCS= camlib.h LIBADD= sbuf @@ -38,6 +38,7 @@ MLINKS+= cam.3 cam_open_device.3 \ .PATH: ${SRCTOP}/sys/cam \ ${SRCTOP}/sys/cam/ata \ + ${SRCTOP}/sys/cam/nvme \ ${SRCTOP}/sys/cam/mmc \ ${SRCTOP}/sys/cam/scsi Modified: stable/12/sys/cam/cam.c ============================================================================== --- stable/12/sys/cam/cam.c Thu Aug 8 02:00:11 2019 (r350716) +++ stable/12/sys/cam/cam.c Thu Aug 8 02:01:01 2019 (r350717) @@ -415,7 +415,6 @@ cam_error_string(struct cam_device *device, union ccb switch (ccb->ccb_h.func_code) { case XPT_ATA_IO: ata_command_sbuf(&ccb->ataio, &sb); - sbuf_printf(&sb, "\n"); break; case XPT_SCSI_IO: #ifdef _KERNEL @@ -423,17 +422,22 @@ cam_error_string(struct cam_device *device, union ccb #else /* !_KERNEL */ scsi_command_string(device, &ccb->csio, &sb); #endif /* _KERNEL/!_KERNEL */ - sbuf_printf(&sb, "\n"); break; case XPT_SMP_IO: smp_command_sbuf(&ccb->smpio, &sb, path_str, 79 - strlen(path_str), (proto_flags & CAM_ESMF_PRINT_FULL_CMD) ? 79 : 0); - sbuf_printf(&sb, "\n"); break; + case XPT_NVME_IO: + case XPT_NVME_ADMIN: + nvme_command_sbuf(&ccb->nvmeio, &sb); + break; default: + sbuf_printf(&sb, "CAM func %#x", + ccb->ccb_h.func_code); break; } + sbuf_printf(&sb, "\n"); } if (flags & CAM_ESF_CAM_STATUS) { Modified: stable/12/sys/cam/nvme/nvme_all.c ============================================================================== --- stable/12/sys/cam/nvme/nvme_all.c Thu Aug 8 02:00:11 2019 (r350716) +++ stable/12/sys/cam/nvme/nvme_all.c Thu Aug 8 02:01:01 2019 (r350717) @@ -111,37 +111,84 @@ nvme_opc2str[] = { "COMPARE", "RSVD-6", "RSVD-7", - "DATASET_MANAGEMENT" + "WRITE_ZEROES", + "DATASET_MANAGEMENT", + "RSVD-a", + "RSVD-b", + "RSVD-c", + "RESERVATION_REGISTER", + "RESERVATION_REPORT", + "RSVD-f", + "RSVD-10", + "RESERVATION_ACQUIRE", + "RSVD-12", + "RSVD-13", + "RSVD-14", + "RESERVATION_RELEASE", }; const char * -nvme_op_string(const struct nvme_command *cmd) +nvme_op_string(const struct nvme_command *cmd, int admin) { - if (cmd->opc >= nitems(nvme_opc2str)) - return "UNKNOWN"; - - return nvme_opc2str[cmd->opc]; + if (admin) { + return "ADMIN"; + } else { + if (cmd->opc >= nitems(nvme_opc2str)) + return "UNKNOWN"; + return nvme_opc2str[cmd->opc]; + } } const char * nvme_cmd_string(const struct nvme_command *cmd, char *cmd_string, size_t len) { + struct sbuf sb; + int error; + if (len == 0) + return (""); + + sbuf_new(&sb, cmd_string, len, SBUF_FIXEDLEN); + nvme_cmd_sbuf(cmd, &sb); + + error = sbuf_finish(&sb); + if (error != 0 && error != ENOMEM) + return (""); + + return(sbuf_data(&sb)); +} + +void +nvme_cmd_sbuf(const struct nvme_command *cmd, struct sbuf *sb) +{ + /* * cid, rsvd areas and mptr not printed, since they are used * only internally by the SIM. */ - snprintf(cmd_string, len, + sbuf_printf(sb, "opc=%x fuse=%x nsid=%x prp1=%llx prp2=%llx cdw=%x %x %x %x %x %x", cmd->opc, cmd->fuse, cmd->nsid, (unsigned long long)cmd->prp1, (unsigned long long)cmd->prp2, cmd->cdw10, cmd->cdw11, cmd->cdw12, cmd->cdw13, cmd->cdw14, cmd->cdw15); +} - return cmd_string; +/* + * nvme_command_sbuf() returns 0 for success and -1 for failure. + */ +int +nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb) +{ + + sbuf_printf(sb, "%s. NCB: ", nvme_op_string(&nvmeio->cmd, + nvmeio->ccb_h.func_code == XPT_NVME_ADMIN)); + nvme_cmd_sbuf(&nvmeio->cmd, sb); + return(0); } +#ifdef _KERNEL const void * nvme_get_identify_cntrl(struct cam_periph *periph) { @@ -161,3 +208,4 @@ nvme_get_identify_ns(struct cam_periph *periph) return device->nvme_data; } +#endif Modified: stable/12/sys/cam/nvme/nvme_all.h ============================================================================== --- stable/12/sys/cam/nvme/nvme_all.h Thu Aug 8 02:00:11 2019 (r350716) +++ stable/12/sys/cam/nvme/nvme_all.h Thu Aug 8 02:01:01 2019 (r350717) @@ -42,8 +42,10 @@ int nvme_identify_match(caddr_t identbuffer, caddr_t t struct sbuf; void nvme_print_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); -const char *nvme_op_string(const struct nvme_command *); +const char *nvme_op_string(const struct nvme_command *, int admin); const char *nvme_cmd_string(const struct nvme_command *, char *, size_t); +void nvme_cmd_sbuf(const struct nvme_command *, struct sbuf *sb); +int nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); const void *nvme_get_identify_cntrl(struct cam_periph *); const void *nvme_get_identify_ns(struct cam_periph *); Modified: stable/12/sys/cam/nvme/nvme_xpt.c ============================================================================== --- stable/12/sys/cam/nvme/nvme_xpt.c Thu Aug 8 02:00:11 2019 (r350716) +++ stable/12/sys/cam/nvme/nvme_xpt.c Thu Aug 8 02:01:01 2019 (r350717) @@ -769,11 +769,13 @@ nvme_proto_debug_out(union ccb *ccb) { char cdb_str[(sizeof(struct nvme_command) * 3) + 1]; - if (ccb->ccb_h.func_code != XPT_NVME_IO) + if (ccb->ccb_h.func_code != XPT_NVME_IO || + ccb->ccb_h.func_code != XPT_NVME_ADMIN) return; CAM_DEBUG(ccb->ccb_h.path, - CAM_DEBUG_CDB,("%s. NCB: %s\n", nvme_op_string(&ccb->nvmeio.cmd), + CAM_DEBUG_CDB,("%s. NCB: %s\n", nvme_op_string(&ccb->nvmeio.cmd, + ccb->ccb_h.func_code == XPT_NVME_ADMIN), nvme_cmd_string(&ccb->nvmeio.cmd, cdb_str, sizeof(cdb_str)))); } From owner-svn-src-all@freebsd.org Thu Aug 8 02:02:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BA15BFE3D; Thu, 8 Aug 2019 02:02:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463s7Z0pf7z4f5l; Thu, 8 Aug 2019 02:02:02 +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 F11281DFAF; Thu, 8 Aug 2019 02:02:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78221Tl024041; Thu, 8 Aug 2019 02:02:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782211I024040; Thu, 8 Aug 2019 02:02:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080202.x782211I024040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350718 - stable/12/sys/cam/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/nvme X-SVN-Commit-Revision: 350718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:02:02 -0000 Author: mav Date: Thu Aug 8 02:02:01 2019 New Revision: 350718 URL: https://svnweb.freebsd.org/changeset/base/350718 Log: MFC r348110: Fix condition broken at r345815. Modified: stable/12/sys/cam/nvme/nvme_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/nvme/nvme_xpt.c ============================================================================== --- stable/12/sys/cam/nvme/nvme_xpt.c Thu Aug 8 02:01:01 2019 (r350717) +++ stable/12/sys/cam/nvme/nvme_xpt.c Thu Aug 8 02:02:01 2019 (r350718) @@ -769,7 +769,7 @@ nvme_proto_debug_out(union ccb *ccb) { char cdb_str[(sizeof(struct nvme_command) * 3) + 1]; - if (ccb->ccb_h.func_code != XPT_NVME_IO || + if (ccb->ccb_h.func_code != XPT_NVME_IO && ccb->ccb_h.func_code != XPT_NVME_ADMIN) return; From owner-svn-src-all@freebsd.org Thu Aug 8 02:04:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6870ABFF49; Thu, 8 Aug 2019 02:04:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sBQ1Jmwz4fN6; Thu, 8 Aug 2019 02:04:30 +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 0DDD91DFE2; Thu, 8 Aug 2019 02:04:30 +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 x7824TrC025772; Thu, 8 Aug 2019 02:04:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7824T1J025770; Thu, 8 Aug 2019 02:04:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080204.x7824T1J025770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350719 - in stable/12/sys: cam/nvme dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: cam/nvme dev/nvme X-SVN-Commit-Revision: 350719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:04:30 -0000 Author: mav Date: Thu Aug 8 02:04:29 2019 New Revision: 350719 URL: https://svnweb.freebsd.org/changeset/base/350719 Log: MFC r348786 (by chuck): Fix nda(4) PCIe link status output Differentiate between PCI Express Endpoint devices and Root Complex Integrated Endpoints in the nda driver. The Link Status and Capability registers are not valid for Integrated Endpoints and should not be displayed. The bhyve emulated NVMe device will advertise as being an Integrated Endpoint. Modified: stable/12/sys/cam/nvme/nvme_xpt.c stable/12/sys/dev/nvme/nvme_sim.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/nvme/nvme_xpt.c ============================================================================== --- stable/12/sys/cam/nvme/nvme_xpt.c Thu Aug 8 02:02:01 2019 (r350718) +++ stable/12/sys/cam/nvme/nvme_xpt.c Thu Aug 8 02:04:29 2019 (r350719) @@ -722,6 +722,8 @@ nvme_announce_periph(struct cam_periph *periph) struct ccb_trans_settings cts; struct cam_path *path = periph->path; struct ccb_trans_settings_nvme *nvmex; + struct sbuf sb; + char buffer[120]; cam_periph_assert(periph, MA_OWNED); @@ -736,13 +738,18 @@ nvme_announce_periph(struct cam_periph *periph) /* Ask the SIM for its base transfer speed */ xpt_path_inq(&cpi, periph->path); - printf("%s%d: nvme version %d.%d x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + sbuf_printf(&sb, "%s%d: nvme version %d.%d", periph->periph_name, periph->unit_number, NVME_MAJOR(nvmex->spec), - NVME_MINOR(nvmex->spec), - nvmex->lanes, nvmex->max_lanes, - nvmex->speed, nvmex->max_speed); - printf("\n"); + NVME_MINOR(nvmex->spec)); + if (nvmex->valid & CTS_NVME_VALID_LINK) + sbuf_printf(&sb, " x%d (max x%d) lanes PCIe Gen%d (max Gen%d) link", + nvmex->lanes, nvmex->max_lanes, + nvmex->speed, nvmex->max_speed); + sbuf_printf(&sb, "\n"); + sbuf_finish(&sb); + sbuf_putbuf(&sb); } static void Modified: stable/12/sys/dev/nvme/nvme_sim.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_sim.c Thu Aug 8 02:02:01 2019 (r350718) +++ stable/12/sys/dev/nvme/nvme_sim.c Thu Aug 8 02:04:29 2019 (r350719) @@ -212,7 +212,7 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) struct ccb_trans_settings_nvme *nvmep; struct ccb_trans_settings_nvme *nvmex; device_t dev; - uint32_t status, caps; + uint32_t status, caps, flags; dev = ctrlr->dev; cts = &ccb->cts; @@ -221,12 +221,16 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) status = pcie_read_config(dev, PCIER_LINK_STA, 2); caps = pcie_read_config(dev, PCIER_LINK_CAP, 2); - nvmex->valid = CTS_NVME_VALID_SPEC | CTS_NVME_VALID_LINK; + flags = pcie_read_config(dev, PCIER_FLAGS, 2); nvmex->spec = nvme_mmio_read_4(ctrlr, vs); - nvmex->speed = status & PCIEM_LINK_STA_SPEED; - nvmex->lanes = (status & PCIEM_LINK_STA_WIDTH) >> 4; - nvmex->max_speed = caps & PCIEM_LINK_CAP_MAX_SPEED; - nvmex->max_lanes = (caps & PCIEM_LINK_CAP_MAX_WIDTH) >> 4; + nvmex->valid = CTS_NVME_VALID_SPEC; + if ((flags & PCIEM_FLAGS_TYPE) == PCIEM_TYPE_ENDPOINT) { + nvmex->valid |= CTS_NVME_VALID_LINK; + nvmex->speed = status & PCIEM_LINK_STA_SPEED; + nvmex->lanes = (status & PCIEM_LINK_STA_WIDTH) >> 4; + nvmex->max_speed = caps & PCIEM_LINK_CAP_MAX_SPEED; + nvmex->max_lanes = (caps & PCIEM_LINK_CAP_MAX_WIDTH) >> 4; + } /* XXX these should be something else maybe ? */ nvmep->valid = 1; From owner-svn-src-all@freebsd.org Thu Aug 8 02:06:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F40DBFFE5; Thu, 8 Aug 2019 02:06:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sDb6s8bz4fVV; Thu, 8 Aug 2019 02:06:23 +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 CCA111DFE5; Thu, 8 Aug 2019 02:06:23 +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 x7826NnE025932; Thu, 8 Aug 2019 02:06:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7826NVA025931; Thu, 8 Aug 2019 02:06:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080206.x7826NVA025931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350720 - stable/12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/scsi X-SVN-Commit-Revision: 350720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:06:24 -0000 Author: mav Date: Thu Aug 8 02:06:23 2019 New Revision: 350720 URL: https://svnweb.freebsd.org/changeset/base/350720 Log: MFC r348963: Minor white space changes. Remove trailing white space that's crept into this file. Modified: stable/12/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_xpt.c Thu Aug 8 02:04:29 2019 (r350719) +++ stable/12/sys/cam/scsi/scsi_xpt.c Thu Aug 8 02:06:23 2019 (r350720) @@ -1603,7 +1603,7 @@ probe_device_check: start = strspn(serial_buf->serial_num, " "); slen = serial_buf->length - start; if (slen <= 0) { - /* + /* * SPC5r05 says that an all-space serial * number means no product serial number * is available @@ -2116,7 +2116,7 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *re CAM_GET_LUN(target->luns, 0, first); if (first == 0 && scan_info->lunindex[target_id] == 0) { scan_info->lunindex[target_id]++; - } + } /* * Skip any LUNs that the HBA can't deal with. @@ -2601,7 +2601,7 @@ scsi_dev_advinfo(union ccb *start_ccb) * We fetch extended inquiry data during probe, if * available. We don't allow changing it. */ - if (cdai->flags & CDAI_FLAG_STORE) + if (cdai->flags & CDAI_FLAG_STORE) return; cdai->provsiz = device->ext_inq_len; if (device->ext_inq_len == 0) @@ -2993,7 +2993,7 @@ scsi_dev_async(u_int32_t async_code, struct cam_eb *bu */ if (async_code == AC_SENT_BDR || async_code == AC_BUS_RESET) { - cam_freeze_devq(&newpath); + cam_freeze_devq(&newpath); cam_release_devq(&newpath, RELSIM_RELEASE_AFTER_TIMEOUT, /*reduction*/0, @@ -3051,7 +3051,7 @@ _scsi_announce_periph(struct cam_periph *periph, u_int cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - /* Report connection speed */ + /* Report connection speed */ *speed = cpi.base_transfer_speed; *freq = 0; From owner-svn-src-all@freebsd.org Thu Aug 8 02:07:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F009C0050; Thu, 8 Aug 2019 02:07:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sFQ0kJcz4fcq; Thu, 8 Aug 2019 02:07:06 +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 EFAD41DFE8; Thu, 8 Aug 2019 02:07:05 +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 x78275xC026022; Thu, 8 Aug 2019 02:07:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78275qr026021; Thu, 8 Aug 2019 02:07:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080207.x78275qr026021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350721 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:07:06 -0000 Author: mav Date: Thu Aug 8 02:07:05 2019 New Revision: 350721 URL: https://svnweb.freebsd.org/changeset/base/350721 Log: MFC r349010: Increase the timeout for READ NATIVE MAX READ NATIVE MAX can take longer than a second if the queued NCQ I/Os take longer than a second to drain. Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:06:23 2019 (r350720) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:07:05 2019 (r350721) @@ -2059,7 +2059,7 @@ ata_read_native_max(struct cam_device *device, int ret /*sector_count*/0, /*data_ptr*/NULL, /*dxfer_len*/0, - timeout ? timeout : 1000, + timeout ? timeout : 5000, is48bit); if (error) From owner-svn-src-all@freebsd.org Thu Aug 8 02:08:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E438C00CA; Thu, 8 Aug 2019 02:08:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sGf2kRzz4flK; Thu, 8 Aug 2019 02:08:10 +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 3F6BB1DFEB; Thu, 8 Aug 2019 02:08:10 +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 x7828Aai026121; Thu, 8 Aug 2019 02:08:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7828Amx026120; Thu, 8 Aug 2019 02:08:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080208.x7828Amx026120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350722 - stable/12/sys/cam X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam X-SVN-Commit-Revision: 350722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:08:10 -0000 Author: mav Date: Thu Aug 8 02:08:09 2019 New Revision: 350722 URL: https://svnweb.freebsd.org/changeset/base/350722 Log: MFC r349283 (by scottl): Refactor xpt_getattr() to make it more readable. No outwardly visible functional changes, though code flow was modified a bit internally to lessen the need for goto jumps and chained if conditionals. Modified: stable/12/sys/cam/cam_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/cam_xpt.c ============================================================================== --- stable/12/sys/cam/cam_xpt.c Thu Aug 8 02:07:05 2019 (r350721) +++ stable/12/sys/cam/cam_xpt.c Thu Aug 8 02:08:09 2019 (r350722) @@ -1253,6 +1253,7 @@ xpt_getattr(char *buf, size_t len, const char *attr, s { int ret = -1, l, o; struct ccb_dev_advinfo cdai; + struct scsi_vpd_device_id *did; struct scsi_vpd_id_descriptor *idd; xpt_path_assert(path, MA_OWNED); @@ -1285,31 +1286,36 @@ xpt_getattr(char *buf, size_t len, const char *attr, s cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); if (cdai.provsiz == 0) goto out; - if (cdai.buftype == CDAI_TYPE_SCSI_DEVID) { + switch(cdai.buftype) { + case CDAI_TYPE_SCSI_DEVID: + did = (struct scsi_vpd_device_id *)cdai.buf; if (strcmp(attr, "GEOM::lunid") == 0) { - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_naa); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_naa); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_eui64); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_eui64); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_uuid); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_uuid); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_md5); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_md5); } else idd = NULL; + if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_t10); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_t10); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_name); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_name); if (idd == NULL) - goto out; + break; + ret = 0; - if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_ASCII) { + if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == + SVPD_ID_CODESET_ASCII) { if (idd->length < len) { for (l = 0; l < idd->length; l++) buf[l] = idd->identifier[l] ? @@ -1317,38 +1323,46 @@ xpt_getattr(char *buf, size_t len, const char *attr, s buf[l] = 0; } else ret = EFAULT; - } else if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_UTF8) { + break; + } + if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == + SVPD_ID_CODESET_UTF8) { l = strnlen(idd->identifier, idd->length); if (l < len) { bcopy(idd->identifier, buf, l); buf[l] = 0; } else ret = EFAULT; - } else if ((idd->id_type & SVPD_ID_TYPE_MASK) == SVPD_ID_TYPE_UUID - && idd->identifier[0] == 0x10) { - if ((idd->length - 2) * 2 + 4 < len) { - for (l = 2, o = 0; l < idd->length; l++) { - if (l == 6 || l == 8 || l == 10 || l == 12) - o += sprintf(buf + o, "-"); - o += sprintf(buf + o, "%02x", - idd->identifier[l]); - } - } else + break; + } + if ((idd->id_type & SVPD_ID_TYPE_MASK) == + SVPD_ID_TYPE_UUID && idd->identifier[0] == 0x10) { + if ((idd->length - 2) * 2 + 4 >= len) { ret = EFAULT; - } else { - if (idd->length * 2 < len) { - for (l = 0; l < idd->length; l++) - sprintf(buf + l * 2, "%02x", - idd->identifier[l]); - } else - ret = EFAULT; + break; + } + for (l = 2, o = 0; l < idd->length; l++) { + if (l == 6 || l == 8 || l == 10 || l == 12) + o += sprintf(buf + o, "-"); + o += sprintf(buf + o, "%02x", + idd->identifier[l]); + } + break; } - } else { + if (idd->length * 2 < len) { + for (l = 0; l < idd->length; l++) + sprintf(buf + l * 2, "%02x", + idd->identifier[l]); + } else + ret = EFAULT; + break; + default: if (cdai.provsiz < len) { cdai.buf[cdai.provsiz] = 0; ret = 0; } else ret = EFAULT; + break; } out: From owner-svn-src-all@freebsd.org Thu Aug 8 02:11:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78EF1C01C3; Thu, 8 Aug 2019 02:11:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sL52gN4z4fwC; Thu, 8 Aug 2019 02:11: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 3D4A51E022; Thu, 8 Aug 2019 02:11: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 x782B9t2028603; Thu, 8 Aug 2019 02:11:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782B99V028602; Thu, 8 Aug 2019 02:11:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080211.x782B99V028602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350723 - stable/12/sys/cam/ata X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ata X-SVN-Commit-Revision: 350723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:11:09 -0000 Author: mav Date: Thu Aug 8 02:11:08 2019 New Revision: 350723 URL: https://svnweb.freebsd.org/changeset/base/350723 Log: MFC r349339 (by imp): Go ahead and completely fix the ata_params before calling the veto function. This breaks nothing that uses it in the tree since ata_params is ignored in storvsc_ada_probe_veto which is the only in-tree consumer. Modified: stable/12/sys/cam/ata/ata_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/12/sys/cam/ata/ata_xpt.c Thu Aug 8 02:08:09 2019 (r350722) +++ stable/12/sys/cam/ata/ata_xpt.c Thu Aug 8 02:11:08 2019 (r350723) @@ -896,22 +896,14 @@ noerror: int16_t *ptr; int veto = 0; + /* + * Convert to host byte order, and fix the strings. + */ ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { *ptr = le16toh(*ptr); } - - /* - * Allow others to veto this ATA disk attachment. This - * is mainly used by VMs, whose disk controllers may - * share the disks with the simulated ATA controllers. - */ - EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); - if (veto) { - goto device_fail; - } - if (strncmp(ident_buf->model, "FX", 2) && strncmp(ident_buf->model, "NEC", 3) && strncmp(ident_buf->model, "Pioneer", 7) && @@ -926,6 +918,17 @@ noerror: ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + + /* + * Allow others to veto this ATA disk attachment. This + * is mainly used by VMs, whose disk controllers may + * share the disks with the simulated ATA controllers. + */ + EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); + if (veto) { + goto device_fail; + } + /* Device may need spin-up before IDENTIFY become valid. */ if ((ident_buf->specconf == 0x37c8 || ident_buf->specconf == 0x738c) && From owner-svn-src-all@freebsd.org Thu Aug 8 02:11:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA723C03BA; Thu, 8 Aug 2019 02:11:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sLl5xWDz4gCn; Thu, 8 Aug 2019 02:11:43 +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 ADC641E060; Thu, 8 Aug 2019 02:11:43 +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 x782BhIo029322; Thu, 8 Aug 2019 02:11:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782BgjP029318; Thu, 8 Aug 2019 02:11:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080211.x782BgjP029318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350724 - in stable/12/sys/cam: ata scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: ata scsi X-SVN-Commit-Revision: 350724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:11:44 -0000 Author: mav Date: Thu Aug 8 02:11:42 2019 New Revision: 350724 URL: https://svnweb.freebsd.org/changeset/base/350724 Log: MFC r349340 (by imp): Create ata_param_fixup Create a common fixup routine to do the canonical fixup of the ata_param fixup. Call it from both the ATA and the ATA over SCSI paths. Modified: stable/12/sys/cam/ata/ata_all.c stable/12/sys/cam/ata/ata_all.h stable/12/sys/cam/ata/ata_xpt.c stable/12/sys/cam/scsi/scsi_da.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ata/ata_all.c ============================================================================== --- stable/12/sys/cam/ata/ata_all.c Thu Aug 8 02:11:08 2019 (r350723) +++ stable/12/sys/cam/ata/ata_all.c Thu Aug 8 02:11:42 2019 (r350724) @@ -1238,3 +1238,28 @@ ata_zac_mgmt_in(struct ccb_ataio *ataio, uint32_t retr ataio->aux = auxiliary; } } + +void +ata_param_fixup(struct ata_params *ident_buf) +{ + int16_t *ptr; + + for (ptr = (int16_t *)ident_buf; + ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { + *ptr = le16toh(*ptr); + } + if (strncmp(ident_buf->model, "FX", 2) && + strncmp(ident_buf->model, "NEC", 3) && + strncmp(ident_buf->model, "Pioneer", 7) && + strncmp(ident_buf->model, "SHARP", 5)) { + ata_bswap(ident_buf->model, sizeof(ident_buf->model)); + ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); + } + ata_btrim(ident_buf->model, sizeof(ident_buf->model)); + ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); + ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); + ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); + ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); + ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); +} Modified: stable/12/sys/cam/ata/ata_all.h ============================================================================== --- stable/12/sys/cam/ata/ata_all.h Thu Aug 8 02:11:08 2019 (r350723) +++ stable/12/sys/cam/ata/ata_all.h Thu Aug 8 02:11:42 2019 (r350724) @@ -135,6 +135,7 @@ void ata_read_log(struct ccb_ataio *ataio, uint32_t re uint16_t block_count, uint32_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint32_t timeout); +void ata_param_fixup(struct ata_params *ident_buf); void ata_bswap(int8_t *buf, int len); void ata_btrim(int8_t *buf, int len); void ata_bpack(int8_t *src, int8_t *dst, int len); Modified: stable/12/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/12/sys/cam/ata/ata_xpt.c Thu Aug 8 02:11:08 2019 (r350723) +++ stable/12/sys/cam/ata/ata_xpt.c Thu Aug 8 02:11:42 2019 (r350724) @@ -893,31 +893,13 @@ noerror: case PROBE_IDENTIFY: { struct ccb_pathinq cpi; - int16_t *ptr; int veto = 0; /* * Convert to host byte order, and fix the strings. */ ident_buf = &softc->ident_data; - for (ptr = (int16_t *)ident_buf; - ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { - *ptr = le16toh(*ptr); - } - if (strncmp(ident_buf->model, "FX", 2) && - strncmp(ident_buf->model, "NEC", 3) && - strncmp(ident_buf->model, "Pioneer", 7) && - strncmp(ident_buf->model, "SHARP", 5)) { - ata_bswap(ident_buf->model, sizeof(ident_buf->model)); - ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); - } - ata_btrim(ident_buf->model, sizeof(ident_buf->model)); - ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); - ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); - ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + ata_param_fixup(ident_buf); /* * Allow others to veto this ATA disk attachment. This Modified: stable/12/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 02:11:08 2019 (r350723) +++ stable/12/sys/cam/scsi/scsi_da.c Thu Aug 8 02:11:42 2019 (r350724) @@ -5174,7 +5174,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * struct da_softc *softc; u_int32_t priority; int continue_probe; - int error, i; + int error; int16_t *ptr; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone_probeata\n")); @@ -5192,8 +5192,7 @@ dadone_probeata(struct cam_periph *periph, union ccb * if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { uint16_t old_rate; - for (i = 0; i < sizeof(*ata_params) / 2; i++) - ptr[i] = le16toh(ptr[i]); + ata_param_fixup(ata_params); if (ata_params->support_dsm & ATA_SUPPORT_DSM_TRIM && (softc->quirks & DA_Q_NO_UNMAP) == 0) { dadeleteflag(softc, DA_DELETE_ATA_TRIM, 1); From owner-svn-src-all@freebsd.org Thu Aug 8 02:12:09 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 637B9C0459; Thu, 8 Aug 2019 02:12:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sMF22gCz3BmB; Thu, 8 Aug 2019 02:12: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 27E181E188; Thu, 8 Aug 2019 02:12: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 x782C9UR029400; Thu, 8 Aug 2019 02:12:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782C9us029399; Thu, 8 Aug 2019 02:12:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080212.x782C9us029399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:12:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350725 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:12:09 -0000 Author: mav Date: Thu Aug 8 02:12:08 2019 New Revision: 350725 URL: https://svnweb.freebsd.org/changeset/base/350725 Log: MFC r349341: Use ata_param_fixup instead of a custom copy here Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:11:42 2019 (r350724) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:12:08 2019 (r350725) @@ -2326,9 +2326,11 @@ ata_do_identify(struct cam_device *device, int retry_c } } + ident_buf = (struct ata_params *)ptr; + ata_param_fixup(ident_buf); + error = 1; for (i = 0; i < sizeof(struct ata_params) / 2; i++) { - ptr[i] = le16toh(ptr[i]); if (ptr[i] != 0) error = 0; } @@ -2345,26 +2347,6 @@ ata_do_identify(struct cam_device *device, int retry_c free(ptr); return (error); } - - ident_buf = (struct ata_params *)ptr; - if (strncmp(ident_buf->model, "FX", 2) && - strncmp(ident_buf->model, "NEC", 3) && - strncmp(ident_buf->model, "Pioneer", 7) && - strncmp(ident_buf->model, "SHARP", 5)) { - ata_bswap(ident_buf->model, sizeof(ident_buf->model)); - ata_bswap(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bswap(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bswap(ident_buf->media_serial, sizeof(ident_buf->media_serial)); - } - ata_btrim(ident_buf->model, sizeof(ident_buf->model)); - ata_bpack(ident_buf->model, ident_buf->model, sizeof(ident_buf->model)); - ata_btrim(ident_buf->revision, sizeof(ident_buf->revision)); - ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); - ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); - ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); - ata_btrim(ident_buf->media_serial, sizeof(ident_buf->media_serial)); - ata_bpack(ident_buf->media_serial, ident_buf->media_serial, - sizeof(ident_buf->media_serial)); *ident_bufp = ident_buf; From owner-svn-src-all@freebsd.org Thu Aug 8 02:17:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 506B7C07CB; Thu, 8 Aug 2019 02:17:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sTK0M8Cz3C5d; Thu, 8 Aug 2019 02:17:25 +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 E1FC51E1BD; Thu, 8 Aug 2019 02:17:24 +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 x782HOxQ031950; Thu, 8 Aug 2019 02:17:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782HOm4031948; Thu, 8 Aug 2019 02:17:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080217.x782HOm4031948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350726 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:17:25 -0000 Author: mav Date: Thu Aug 8 02:17:24 2019 New Revision: 350726 URL: https://svnweb.freebsd.org/changeset/base/350726 Log: MFC r349964: Add device type NVME and device type MMCSD to get_device_type For completeness, add nvme and mmc/sd devices to the list of device types we know. Modified: stable/12/sbin/camcontrol/camcontrol.c stable/12/sbin/camcontrol/camcontrol.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:12:08 2019 (r350725) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:17:24 2019 (r350726) @@ -5391,6 +5391,14 @@ get_device_type(struct cam_device *dev, int retry_coun *devtype = CC_DT_ATA; goto bailout; break; /*NOTREACHED*/ + case PROTO_NVME: + *devtype = CC_DT_NVME; + goto bailout; + break; /*NOTREACHED*/ + case PROTO_MMCSD: + *devtype = CC_DT_MMCSD; + goto bailout; + break; /*NOTREACHED*/ default: *devtype = CC_DT_UNKNOWN; goto bailout; Modified: stable/12/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.h Thu Aug 8 02:12:08 2019 (r350725) +++ stable/12/sbin/camcontrol/camcontrol.h Thu Aug 8 02:17:24 2019 (r350726) @@ -44,6 +44,8 @@ typedef enum { CC_DT_SCSI, CC_DT_ATA_BEHIND_SCSI, CC_DT_ATA, + CC_DT_NVME, + CC_DT_MMCSD, CC_DT_UNKNOWN } camcontrol_devtype; From owner-svn-src-all@freebsd.org Thu Aug 8 02:18:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A000AC0870; Thu, 8 Aug 2019 02:18:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sVH3nrGz3CD8; Thu, 8 Aug 2019 02:18: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 63F0B1E1BE; Thu, 8 Aug 2019 02:18:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x782IFwS032051; Thu, 8 Aug 2019 02:18:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782IEht032045; Thu, 8 Aug 2019 02:18:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080218.x782IEht032045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350727 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:18:15 -0000 Author: mav Date: Thu Aug 8 02:18:14 2019 New Revision: 350727 URL: https://svnweb.freebsd.org/changeset/base/350727 Log: MFC r350008 (by imp): Use the more proper term of SATL instead of ATA_BEHIND_SCSI. Most people know SAS attached SATA devices by the name SAT or SATL (with the latter being a little more common). Change the device type ATA_BEHIND_SCSI to SATL since it's more specific and meaningful. Modified: stable/12/sbin/camcontrol/camcontrol.c stable/12/sbin/camcontrol/camcontrol.h stable/12/sbin/camcontrol/epc.c stable/12/sbin/camcontrol/fwdownload.c stable/12/sbin/camcontrol/zone.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:17:24 2019 (r350726) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:18:14 2019 (r350727) @@ -5416,7 +5416,7 @@ get_device_type(struct cam_device *dev, int retry_coun retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, timeout, verbosemode); if (retval == 1) - *devtype = CC_DT_ATA_BEHIND_SCSI; + *devtype = CC_DT_SATL; else *devtype = CC_DT_SCSI; Modified: stable/12/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.h Thu Aug 8 02:17:24 2019 (r350726) +++ stable/12/sbin/camcontrol/camcontrol.h Thu Aug 8 02:18:14 2019 (r350727) @@ -42,7 +42,7 @@ typedef enum { typedef enum { CC_DT_NONE, CC_DT_SCSI, - CC_DT_ATA_BEHIND_SCSI, + CC_DT_SATL, CC_DT_ATA, CC_DT_NVME, CC_DT_MMCSD, Modified: stable/12/sbin/camcontrol/epc.c ============================================================================== --- stable/12/sbin/camcontrol/epc.c Thu Aug 8 02:17:24 2019 (r350726) +++ stable/12/sbin/camcontrol/epc.c Thu Aug 8 02:18:14 2019 (r350727) @@ -767,7 +767,7 @@ epc(struct cam_device *device, int argc, char **argv, switch (devtype) { case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: + case CC_DT_SATL: break; default: warnx("The epc subcommand only works with ATA protocol " Modified: stable/12/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/12/sbin/camcontrol/fwdownload.c Thu Aug 8 02:17:24 2019 (r350726) +++ stable/12/sbin/camcontrol/fwdownload.c Thu Aug 8 02:18:14 2019 (r350727) @@ -694,7 +694,7 @@ fw_check_device_ready(struct cam_device *dev, camcontr /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 5000); break; - case CC_DT_ATA_BEHIND_SCSI: + case CC_DT_SATL: case CC_DT_ATA: { retval = build_ata_cmd(ccb, /*retries*/ 1, @@ -853,7 +853,7 @@ fw_download_img(struct cam_device *cam_dev, struct fw_ timeout ? timeout : WB_TIMEOUT); /* timeout*/ break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint32_t off; off = (uint32_t)(pkt_ptr - buf); @@ -969,7 +969,7 @@ fwdownload(struct cam_device *device, int argc, char * errx(1, "Unable to determine device type"); if ((devtype == CC_DT_ATA) - || (devtype == CC_DT_ATA_BEHIND_SCSI)) { + || (devtype == CC_DT_SATL)) { ccb = cam_getccb(device); if (ccb == NULL) { warnx("couldn't allocate CCB"); Modified: stable/12/sbin/camcontrol/zone.c ============================================================================== --- stable/12/sbin/camcontrol/zone.c Thu Aug 8 02:17:24 2019 (r350726) +++ stable/12/sbin/camcontrol/zone.c Thu Aug 8 02:18:14 2019 (r350727) @@ -466,7 +466,7 @@ restart_report: /*timeout*/ timeout ? timeout : 60000); break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint8_t command = 0; uint8_t protocol = 0; uint16_t features = 0, sector_count = 0; @@ -558,7 +558,7 @@ restart_report: /*timeout*/ timeout ? timeout : 60000); break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint8_t command = 0; uint8_t protocol = 0; uint16_t features = 0, sector_count = 0; From owner-svn-src-all@freebsd.org Thu Aug 8 02:20:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F66CC0943; Thu, 8 Aug 2019 02:20:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sY76QbGz3CM1; Thu, 8 Aug 2019 02:20:43 +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 BE2581E1C9; Thu, 8 Aug 2019 02:20:43 +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 x782Khxk032242; Thu, 8 Aug 2019 02:20:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782KhTI032239; Thu, 8 Aug 2019 02:20:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080220.x782KhTI032239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350728 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:20:44 -0000 Author: mav Date: Thu Aug 8 02:20:42 2019 New Revision: 350728 URL: https://svnweb.freebsd.org/changeset/base/350728 Log: MFC r350018: Implement a devtype command. List the device's protocol. The returned value is one of the following: ata direct attach ATA or SATA device satl a SATA device attached via SAS scsi A parallel SCSI or SAS nvme A direct attached NVMe device mmcsd A MMC or SD attached device Modified: stable/12/sbin/camcontrol/camcontrol.8 stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 02:18:14 2019 (r350727) +++ stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 02:20:42 2019 (r350728) @@ -353,6 +353,9 @@ .Op generic args .Ao Fl r Oo Ns Fl f Ar format | Fl m | Fl U Oc | Fl s Ao Fl f Ar format Fl T Ar time | Fl U Ac Ac .Nm +.Ic devtype +.Op device id +.Nm .Ic help .Sh DESCRIPTION The @@ -2515,6 +2518,26 @@ option. .It Fl U Set the timestamp to the host system's time in UTC. .El +.El +.It Ic devtype +Print out the device type for specified device. +.Bl -tag -width 10n +.It ata +An ATA device attached directly to an ATA controller +.It satl +An SATA device attached behind a SAS controller via SCSI-ATA Translation Layer (SATL) +.It scsi +A SCSI device +.It nvme +An directly attached NVMe device +.It mmcsd +An MMC or SD device attached via a mmcsd bus +.It none +No device type reported +.It unknown +Device type is unknown +.It illegal +A programming error occurred .El .It Ic help Print out verbose usage information. Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:18:14 2019 (r350727) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:20:42 2019 (r350728) @@ -111,6 +111,7 @@ typedef enum { CAM_CMD_TIMESTAMP = 0x00000028, CAM_CMD_MMCSD_CMD = 0x00000029, CAM_CMD_POWER_MODE = 0x0000002a, + CAM_CMD_DEVTYPE = 0x0000002b, } cam_cmdmask; typedef enum { @@ -225,6 +226,7 @@ static struct camcontrol_opts option_table[] = { {"defectlist", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts}, #endif /* MINIMALISTIC */ {"devlist", CAM_CMD_DEVTREE, CAM_ARG_NONE, "-b"}, + {"devtype", CAM_CMD_DEVTYPE, CAM_ARG_NONE, ""}, #ifndef MINIMALISTIC {"periphlist", CAM_CMD_DEVLIST, CAM_ARG_NONE, NULL}, {"modepage", CAM_CMD_MODE_PAGE, CAM_ARG_NONE, "bdelm:P:"}, @@ -273,6 +275,16 @@ struct cam_devlist { static cam_cmdmask cmdlist; static cam_argmask arglist; +static const char *devtype_names[] = { + "none", + "scsi", + "satl", + "ata", + "nvme", + "mmcsd", + "unknown", +}; + camcontrol_optret getoption(struct camcontrol_opts *table, char *arg, uint32_t *cmdnum, cam_argmask *argnum, const char **subopt); @@ -280,6 +292,7 @@ camcontrol_optret getoption(struct camcontrol_opts *ta static int getdevlist(struct cam_device *device); #endif /* MINIMALISTIC */ static int getdevtree(int argc, char **argv, char *combinedopt); +static int getdevtype(struct cam_device *device); static int print_dev_scsi(struct device_match_result *dev_result, char *tmpstr); static int print_dev_ata(struct device_match_result *dev_result, char *tmpstr); static int print_dev_semb(struct device_match_result *dev_result, char *tmpstr); @@ -672,6 +685,24 @@ getdevtree(int argc, char **argv, char *combinedopt) } static int +getdevtype(struct cam_device *cam_dev) +{ + camcontrol_devtype dt; + int error; + + /* + * Get the device type and report it, request no I/O be done to do this. + */ + error = get_device_type(cam_dev, -1, 0, 0, &dt); + if (error != 0 || dt < CC_DT_NONE || dt > CC_DT_UNKNOWN) { + fprintf(stdout, "illegal\n"); + return (1); + } + fprintf(stdout, "%s\n", devtype_names[dt]); + return (0); +} + +static int print_dev_scsi(struct device_match_result *dev_result, char *tmpstr) { char vendor[16], product[48], revision[16]; @@ -5376,7 +5407,7 @@ get_device_type(struct cam_device *dev, int retry_coun int verbosemode, camcontrol_devtype *devtype) { struct ccb_getdev cgd; - int retval = 0; + int retval; retval = get_cgd(dev, &cgd); if (retval != 0) @@ -5405,21 +5436,34 @@ get_device_type(struct cam_device *dev, int retry_coun break; /*NOTREACHED*/ } - /* - * Check for the ATA Information VPD page (0x89). If this is an - * ATA device behind a SCSI to ATA translation layer, this VPD page - * should be present. - * - * If that VPD page isn't present, or we get an error back from the - * INQUIRY command, we'll just treat it as a normal SCSI device. - */ - retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, - timeout, verbosemode); - if (retval == 1) - *devtype = CC_DT_SATL; - else - *devtype = CC_DT_SCSI; - + if (retry_count == -1) { + /* + * For a retry count of -1, used only the cached data to avoid + * I/O to the drive. Sending the identify command to the drive + * can cause issues for SATL attachaed drives since identify is + * not an NCQ command. + */ + if (cgd.ident_data.config != 0) + *devtype = CC_DT_SATL; + else + *devtype = CC_DT_SCSI; + } else { + /* + * Check for the ATA Information VPD page (0x89). If this is an + * ATA device behind a SCSI to ATA translation layer (SATL), + * this VPD page should be present. + * + * If that VPD page isn't present, or we get an error back from + * the INQUIRY command, we'll just treat it as a normal SCSI + * device. + */ + retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, + timeout, verbosemode); + if (retval == 1) + *devtype = CC_DT_SATL; + else + *devtype = CC_DT_SCSI; + } retval = 0; bailout: @@ -9648,6 +9692,7 @@ usage(int printlong) " [-S power_src] [-T timer]\n" " camcontrol timestamp [dev_id][generic_args] <-r [-f format|-m|-U]>|\n" " <-s <-f format -T time | -U >>\n" +" camcontrol devtype [dev_id]\n" " \n" #endif /* MINIMALISTIC */ " camcontrol help\n"); @@ -9695,6 +9740,7 @@ usage(int printlong) "zone manage Zoned Block (Shingled) devices\n" "epc send ATA Extended Power Conditions commands\n" "timestamp report or set the device's timestamp\n" +"devtype report the type of device\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -10166,6 +10212,9 @@ main(int argc, char **argv) #endif /* MINIMALISTIC */ case CAM_CMD_DEVTREE: error = getdevtree(argc, argv, combinedopt); + break; + case CAM_CMD_DEVTYPE: + error = getdevtype(cam_dev); break; #ifndef MINIMALISTIC case CAM_CMD_TUR: From owner-svn-src-all@freebsd.org Thu Aug 8 02:21:30 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7780C0AE0; Thu, 8 Aug 2019 02:21:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sZ25RxRz3CWN; Thu, 8 Aug 2019 02:21:30 +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 9CBAE1E211; Thu, 8 Aug 2019 02:21:30 +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 x782LUOk033039; Thu, 8 Aug 2019 02:21:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782LUtT033038; Thu, 8 Aug 2019 02:21:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080221.x782LUtT033038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350729 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:21:30 -0000 Author: mav Date: Thu Aug 8 02:21:30 2019 New Revision: 350729 URL: https://svnweb.freebsd.org/changeset/base/350729 Log: MFC r350020 (by imp): Use a different approach to range check. gcc hates dt < CC_DT_NONE since it can never be true when dt is an unsigned type. Since that's a compiler choice and may be affected by weird stuff, instead use (unsigned)dt > CC_DT_UNKNOWN to test for bounds error since that will work regardless of the signedness of dt. Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:20:42 2019 (r350728) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:21:30 2019 (r350729) @@ -694,7 +694,7 @@ getdevtype(struct cam_device *cam_dev) * Get the device type and report it, request no I/O be done to do this. */ error = get_device_type(cam_dev, -1, 0, 0, &dt); - if (error != 0 || dt < CC_DT_NONE || dt > CC_DT_UNKNOWN) { + if (error != 0 || (unsigned)dt > CC_DT_UNKNOWN) { fprintf(stdout, "illegal\n"); return (1); } From owner-svn-src-all@freebsd.org Thu Aug 8 02:24:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8DC6C0B93; Thu, 8 Aug 2019 02:24: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sf26bkKz3Crg; Thu, 8 Aug 2019 02:24: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 C00CD1E392; Thu, 8 Aug 2019 02:24: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 x782OwtE038086; Thu, 8 Aug 2019 02:24:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782Ovv6038082; Thu, 8 Aug 2019 02:24:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080224.x782Ovv6038082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350730 - in stable/12: sbin/camcontrol sys/cam/ata sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: sbin/camcontrol sys/cam/ata sys/sys X-SVN-Commit-Revision: 350730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:24:59 -0000 Author: mav Date: Thu Aug 8 02:24:57 2019 New Revision: 350730 URL: https://svnweb.freebsd.org/changeset/base/350730 Log: MFC r350149: Add Accessible Max Address Configuration support to camcontrol. AMA replaced HPA in ACS-3 specification. It allows to limit size of the disk alike to HPA, but declares inaccessible data as indeterminate. One of its practical use cases is to under-provision SATA SSDs for better reliability and performance. While there, fix HPA Security detection/reporting. Modified: stable/12/sbin/camcontrol/camcontrol.8 stable/12/sbin/camcontrol/camcontrol.c stable/12/sys/cam/ata/ata_all.c stable/12/sys/sys/ata.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 02:21:30 2019 (r350729) +++ stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 02:24:57 2019 (r350730) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2019 +.Dd July 19, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -292,6 +292,13 @@ .Op Fl U Ar pwd .Op Fl y .Nm +.Ic ama +.Op device id +.Op generic args +.Op Fl f +.Op Fl q +.Op Fl s Ar max_sectors +.Nm .Ic persist .Op device id .Op generic args @@ -1599,6 +1606,40 @@ without prompting for confirmation .Pp The password for all HPA commands is limited to 32 characters, longer passwords will fail. +.It Ic ama +Update or report Accessible Max Address Configuration. +By default +.Nm +will print out the Accessible Max Address Configuration support and associated +settings of the device. +The +.Ic ama +command takes several optional arguments: +.Bl -tag -width 0n +.It Fl f +.Pp +Freeze the Accessible Max Address Configuration of the specified device. +.Pp +After command completion any other commands that update the configuration +shall be command aborted. +Frozen mode is disabled by power-off. +.It Fl q +.Pp +Be quiet, do not print any status messages. +.It Fl s Ar max_sectors +.Pp +Configures the maximum user accessible sectors of the device. +This will change the number of sectors the device reports. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Changing the max sectors of a device using this option will make the data on +the device beyond the specified value indeterminate. +.Pp +Only one successful +.Fl s Ar max_sectors +call can be made without a power-on reset of the device. +.El .It Ic fwdownload Program firmware of the named .Tn SCSI Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:21:30 2019 (r350729) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:24:57 2019 (r350730) @@ -112,6 +112,7 @@ typedef enum { CAM_CMD_MMCSD_CMD = 0x00000029, CAM_CMD_POWER_MODE = 0x0000002a, CAM_CMD_DEVTYPE = 0x0000002b, + CAM_CMD_AMA = 0x0000002c, } cam_cmdmask; typedef enum { @@ -245,6 +246,7 @@ static struct camcontrol_opts option_table[] = { {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:qsy"}, {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, {"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"}, + {"ama", CAM_CMD_AMA, CAM_ARG_NONE, "fqs:"}, {"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"}, {"attrib", CAM_CMD_ATTRIB, CAM_ARG_NONE, "a:ce:F:p:r:s:T:w:V:"}, {"opcodes", CAM_CMD_OPCODES, CAM_ARG_NONE, "No:s:T"}, @@ -374,6 +376,8 @@ static int atasecurity(struct cam_device *device, int int argc, char **argv, char *combinedopt); static int atahpa(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt); +static int ataama(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt); static int scsiprintoneopcode(struct cam_device *device, int req_opcode, int sa_set, int req_sa, uint8_t *buf, uint32_t valid_len); @@ -1442,8 +1446,9 @@ atahpa_print(struct ata_params *parm, u_int64_t hpasiz lba, hpasize); printf("HPA - Security "); - if (parm->support.command1 & ATA_SUPPORT_MAXSECURITY) - printf("yes\n"); + if (parm->support.command2 & ATA_SUPPORT_MAXSECURITY) + printf("yes %s\n", (parm->enabled.command2 & + ATA_SUPPORT_MAXSECURITY) ? "yes" : "no "); else printf("no\n"); } else { @@ -1451,6 +1456,32 @@ atahpa_print(struct ata_params *parm, u_int64_t hpasiz } } +static void +ataama_print(struct ata_params *parm, u_int64_t nativesize, int header) +{ + u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | + ((u_int32_t)parm->lba_size_2 << 16); + + u_int64_t lbasize48 = ((u_int64_t)parm->lba_size48_1) | + ((u_int64_t)parm->lba_size48_2 << 16) | + ((u_int64_t)parm->lba_size48_3 << 32) | + ((u_int64_t)parm->lba_size48_4 << 48); + + if (header) { + printf("\nFeature " + "Support Enabled Value\n"); + } + + printf("Accessible Max Address Config "); + if (parm->support2 & ATA_SUPPORT_AMAX_ADDR) { + u_int64_t lba = lbasize48 ? lbasize48 : lbasize; + printf("yes %s %ju/%ju\n", + (nativesize > lba) ? "yes" : "no ", lba, nativesize); + } else { + printf("no\n"); + } +} + static int atasata(struct ata_params *parm) { @@ -2277,7 +2308,95 @@ atahpa_freeze_lock(struct cam_device *device, int retr return atahpa_proc_resp(device, ccb, is48bit, NULL); } +static int +ata_get_native_max(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + u_int64_t *nativesize) +{ + int error; + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_GET, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, nativesize); +} + +static int +ataama_set(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, u_int64_t maxsize) +{ + int error; + + /* lba's are zero indexed so the max lba is requested max - 1 */ + if (maxsize) + maxsize--; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_SET, + /*lba*/maxsize, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); +} + +static int +ataama_freeze(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb) +{ + int error; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_FREEZE, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); +} + int ata_do_identify(struct cam_device *device, int retry_count, int timeout, union ccb *ccb, struct ata_params** ident_bufp) @@ -2390,7 +2509,7 @@ ataidentify(struct cam_device *device, int retry_count { union ccb *ccb; struct ata_params *ident_buf; - u_int64_t hpasize; + u_int64_t hpasize, nativesize; if ((ccb = cam_getccb(device)) == NULL) { warnx("couldn't allocate CCB"); @@ -2411,12 +2530,22 @@ ataidentify(struct cam_device *device, int retry_count } else { hpasize = 0; } + if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) { + if (ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize) != 0) { + cam_freeccb(ccb); + return (1); + } + } else { + nativesize = 0; + } printf("%s%d: ", device->device_name, device->dev_unit_num); ata_print_ident(ident_buf); camxferrate(device); atacapprint(ident_buf); atahpa_print(ident_buf, hpasize, 0); + ataama_print(ident_buf, nativesize, 0); free(ident_buf); cam_freeccb(ccb); @@ -2938,7 +3067,7 @@ atahpa(struct cam_device *device, int retry_count, int return (1); } - if (security && !(ident_buf->support.command1 & ATA_SUPPORT_MAXSECURITY)) { + if (security && !(ident_buf->support.command2 & ATA_SUPPORT_MAXSECURITY)) { warnx("HPA Security is not supported by this device"); cam_freeccb(ccb); free(ident_buf); @@ -2967,7 +3096,7 @@ atahpa(struct cam_device *device, int retry_count, int if (error == 0) { error = atahpa_set_max(device, retry_count, timeout, ccb, is48bit, maxsize, persist); - if (error == 0) { + if (error == 0 && quiet == 0) { /* redo identify to get new lba values */ error = ata_do_identify(device, retry_count, timeout, ccb, @@ -2980,28 +3109,28 @@ atahpa(struct cam_device *device, int retry_count, int case ATA_HPA_ACTION_SET_PWD: error = atahpa_password(device, retry_count, timeout, ccb, is48bit, &pwd); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA password has been set\n"); break; case ATA_HPA_ACTION_LOCK: error = atahpa_lock(device, retry_count, timeout, ccb, is48bit); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been locked\n"); break; case ATA_HPA_ACTION_UNLOCK: error = atahpa_unlock(device, retry_count, timeout, ccb, is48bit, &pwd); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been unlocked\n"); break; case ATA_HPA_ACTION_FREEZE_LOCK: error = atahpa_freeze_lock(device, retry_count, timeout, ccb, is48bit); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been frozen\n"); break; @@ -3015,7 +3144,128 @@ atahpa(struct cam_device *device, int retry_count, int return (error); } +enum { + ATA_AMA_ACTION_PRINT, + ATA_AMA_ACTION_SET_MAX, + ATA_AMA_ACTION_FREEZE_LOCK +}; + static int +ataama(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt) +{ + union ccb *ccb; + struct ata_params *ident_buf; + struct ccb_getdev cgd; + int error, quiet, c, action, actions; + u_int64_t nativesize, maxsize; + + actions = 0; + quiet = 0; + maxsize = 0; + + /* default action is to print AMA information */ + action = ATA_AMA_ACTION_PRINT; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch(c){ + case 's': + action = ATA_AMA_ACTION_SET_MAX; + maxsize = strtoumax(optarg, NULL, 0); + actions++; + break; + + case 'f': + action = ATA_AMA_ACTION_FREEZE_LOCK; + actions++; + break; + + case 'q': + quiet++; + break; + } + } + + if (actions > 1) { + warnx("too many AMA actions specified"); + return (1); + } + + if (get_cgd(device, &cgd) != 0) { + warnx("couldn't get CGD"); + return (1); + } + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("couldn't allocate CCB"); + return (1); + } + + error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf); + if (error != 0) { + cam_freeccb(ccb); + return (1); + } + + if (quiet == 0) { + printf("%s%d: ", device->device_name, device->dev_unit_num); + ata_print_ident(ident_buf); + camxferrate(device); + } + + if (action == ATA_AMA_ACTION_PRINT) { + error = ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); + if (error == 0) + ataama_print(ident_buf, nativesize, 1); + + cam_freeccb(ccb); + free(ident_buf); + return (error); + } + + if (!(ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR)) { + warnx("Accessible Max Address is not supported by this device"); + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + switch(action) { + case ATA_AMA_ACTION_SET_MAX: + error = ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); + if (error == 0) { + error = ataama_set(device, retry_count, timeout, + ccb, maxsize); + if (error == 0 && quiet == 0) { + /* redo identify to get new lba values */ + error = ata_do_identify(device, retry_count, + timeout, ccb, &ident_buf); + ataama_print(ident_buf, nativesize, 1); + } + } + break; + + case ATA_AMA_ACTION_FREEZE_LOCK: + error = ataama_freeze(device, retry_count, timeout, + ccb); + if (error == 0 && quiet == 0) + printf("Accessible Max Address has been frozen\n"); + break; + + default: + errx(1, "Option currently not supported"); + } + + cam_freeccb(ccb); + free(ident_buf); + + return (error); +} + +static int atasecurity(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt) { @@ -9677,6 +9927,7 @@ usage(int printlong) " [-U ] [-y]\n" " camcontrol hpa [dev_id][generic args] [-f] [-l] [-P] [-p pwd]\n" " [-q] [-s max_sectors] [-U pwd] [-y]\n" +" camcontrol ama [dev_id][generic args] [-f] [-q] [-s max_sectors]\n" " camcontrol persist [dev_id][generic args] <-i action|-o action>\n" " [-a][-I tid][-k key][-K sa_key][-p][-R rtp]\n" " [-s scope][-S][-T type][-U]\n" @@ -9877,6 +10128,11 @@ usage(int printlong) " device\n" "-U pwd unlock the HPA configuration of the device\n" "-y don't ask any questions\n" +"ama arguments:\n" +"-f freeze the AMA configuration of the device\n" +"-q be quiet, do not print any status messages\n" +"-s sectors configures the maximum user accessible sectors of the\n" +" device\n" "persist arguments:\n" "-i action specify read_keys, read_reservation, report_cap, or\n" " read_full_status\n" @@ -10207,6 +10463,10 @@ main(int argc, char **argv) break; case CAM_CMD_HPA: error = atahpa(cam_dev, retry_count, timeout, + argc, argv, combinedopt); + break; + case CAM_CMD_AMA: + error = ataama(cam_dev, retry_count, timeout, argc, argv, combinedopt); break; #endif /* MINIMALISTIC */ Modified: stable/12/sys/cam/ata/ata_all.c ============================================================================== --- stable/12/sys/cam/ata/ata_all.c Thu Aug 8 02:21:30 2019 (r350729) +++ stable/12/sys/cam/ata/ata_all.c Thu Aug 8 02:24:57 2019 (r350730) @@ -184,7 +184,13 @@ ata_op_string(struct ata_cmd *cmd) return ("SEP_ATTN"); case 0x70: return ("SEEK"); case 0x77: return ("SET_DATE_TIME_EXT"); - case 0x78: return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); + case 0x78: + switch (cmd->features) { + case 0x00: return ("GET_NATIVE_MAX_ADDRESS_EXT"); + case 0x01: return ("SET_ACCESSIBLE_MAX_ADDRESS_EXT"); + case 0x02: return ("FREEZE_ACCESSIBLE_MAX_ADDRESS_EXT"); + } + return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); case 0x7C: return ("REMOVE_ELEMENT_AND_TRUNCATE"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); Modified: stable/12/sys/sys/ata.h ============================================================================== --- stable/12/sys/sys/ata.h Thu Aug 8 02:21:30 2019 (r350729) +++ stable/12/sys/sys/ata.h Thu Aug 8 02:24:57 2019 (r350730) @@ -236,12 +236,15 @@ struct ata_params { #define ATA_SUPPORT_FREEFALL 0x0020 #define ATA_SUPPORT_SENSE_REPORT 0x0040 #define ATA_SUPPORT_EPC 0x0080 +#define ATA_SUPPORT_AMAX_ADDR 0x0100 +#define ATA_SUPPORT_DSN 0x0200 /*120*/ u_int16_t enabled2; #define ATA_ENABLED_WRITEREADVERIFY 0x0002 #define ATA_ENABLED_WRITEUNCORREXT 0x0004 #define ATA_ENABLED_FREEFALL 0x0020 #define ATA_ENABLED_SENSE_REPORT 0x0040 #define ATA_ENABLED_EPC 0x0080 +#define ATA_ENABLED_DSN 0x0200 u_int16_t reserved121[6]; /*127*/ u_int16_t removable_status; /*128*/ u_int16_t security_status; @@ -418,6 +421,10 @@ struct ata_params { #define ATA_RFPDMA_ZAC_MGMT_IN 0x02 /* NCQ ZAC mgmt in w/data */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ +#define ATA_AMAX_ADDR 0x78 /* Accessible Max Address */ +#define ATA_AMAX_ADDR_GET 0x00 /* GET NATIVE MAX ADDRESS EXT */ +#define ATA_AMAX_ADDR_SET 0x01 /* SET ACCESSIBLE MAX ADDRESS EXT */ +#define ATA_AMAX_ADDR_FREEZE 0x02 /* FREEZE ACCESSIBLE MAX ADDRESS EXT */ #define ATA_ZAC_MANAGEMENT_OUT 0x9f /* ZAC management out */ #define ATA_ZM_CLOSE_ZONE 0x01 /* close zone */ #define ATA_ZM_FINISH_ZONE 0x02 /* finish zone */ From owner-svn-src-all@freebsd.org Thu Aug 8 02:25:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E2A1C0C0C; Thu, 8 Aug 2019 02:25:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sfk73Rhz3D20; Thu, 8 Aug 2019 02:25:34 +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 D40551E393; Thu, 8 Aug 2019 02:25:34 +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 x782PYJV038184; Thu, 8 Aug 2019 02:25:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782PYTQ038183; Thu, 8 Aug 2019 02:25:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080225.x782PYTQ038183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350731 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:25:35 -0000 Author: mav Date: Thu Aug 8 02:25:34 2019 New Revision: 350731 URL: https://svnweb.freebsd.org/changeset/base/350731 Log: MFC r350150: Properly report ACS revisions alike to kernel. Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:24:57 2019 (r350730) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:25:34 2019 (r350731) @@ -1497,6 +1497,7 @@ atasata(struct ata_params *parm) static void atacapprint(struct ata_params *parm) { + const char *proto; u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | ((u_int32_t)parm->lba_size_2 << 16); @@ -1507,7 +1508,19 @@ atacapprint(struct ata_params *parm) printf("\n"); printf("protocol "); - printf("ATA/ATAPI-%d", ata_version(parm->version_major)); + proto = (parm->config == ATA_PROTO_CFA) ? "CFA" : + (parm->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA"; + if (ata_version(parm->version_major) == 0) { + printf("%s", proto); + } else if (ata_version(parm->version_major) <= 7) { + printf("%s-%d", proto, + ata_version(parm->version_major)); + } else if (ata_version(parm->version_major) == 8) { + printf("%s8-ACS", proto); + } else { + printf("ACS-%d %s", + ata_version(parm->version_major) - 7, proto); + } if (parm->satacapabilities && parm->satacapabilities != 0xffff) { if (parm->satacapabilities & ATA_SATA_GEN3) printf(" SATA 3.x\n"); From owner-svn-src-all@freebsd.org Thu Aug 8 02:26:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8737C0C89; Thu, 8 Aug 2019 02:26:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sgT4W18z3D8t; Thu, 8 Aug 2019 02:26:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 654701E394; Thu, 8 Aug 2019 02:26:13 +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 x782QD54038273; Thu, 8 Aug 2019 02:26:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782QDFo038271; Thu, 8 Aug 2019 02:26:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080226.x782QDFo038271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350732 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:26:13 -0000 Author: mav Date: Thu Aug 8 02:26:12 2019 New Revision: 350732 URL: https://svnweb.freebsd.org/changeset/base/350732 Log: MFC r350214: Unify BTL parsing for `camcontrol debug` and `reset`. This makes `camcontrol debug` also allow peripheral device specification. While there, make BTL parser more strict and switch from strtok() to strsep(). Modified: stable/12/sbin/camcontrol/camcontrol.8 stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 02:25:34 2019 (r350731) +++ stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 02:26:12 2019 (r350732) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2019 +.Dd July 22, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -185,7 +185,7 @@ .Op Fl X .Op Fl c .Op Fl p -.Aq all|off|bus Ns Op :target Ns Op :lun +.Aq all | off | device id | bus Ns Op :target Ns Op :lun .Nm .Ic tags .Op device id Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:25:34 2019 (r350731) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:26:12 2019 (r350732) @@ -3557,6 +3557,66 @@ atasecurity(struct cam_device *device, int retry_count #endif /* MINIMALISTIC */ /* + * Convert periph name into a bus, target and lun. + * + * Returns the number of parsed components, or 0. + */ +static int +parse_btl_name(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, + cam_argmask *arglst) +{ + int fd; + union ccb ccb; + + bzero(&ccb, sizeof(ccb)); + ccb.ccb_h.func_code = XPT_GDEVLIST; + if (cam_get_device(tstr, ccb.cgdl.periph_name, + sizeof(ccb.cgdl.periph_name), &ccb.cgdl.unit_number) == -1) { + warnx("%s", cam_errbuf); + return (0); + } + + /* + * Attempt to get the passthrough device. This ioctl will + * fail if the device name is null, if the device doesn't + * exist, or if the passthrough driver isn't in the kernel. + */ + if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { + warn("Unable to open %s", XPT_DEVICE); + return (0); + } + if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) { + warn("Unable to find bus:target:lun for device %s%d", + ccb.cgdl.periph_name, ccb.cgdl.unit_number); + close(fd); + return (0); + } + close(fd); + if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + const struct cam_status_entry *entry; + + entry = cam_fetch_status_entry(ccb.ccb_h.status); + warnx("Unable to find bus:target_lun for device %s%d, " + "CAM status: %s (%#x)", + ccb.cgdl.periph_name, ccb.cgdl.unit_number, + entry ? entry->status_text : "Unknown", + ccb.ccb_h.status); + return (0); + } + + /* + * The kernel fills in the bus/target/lun. We don't + * need the passthrough device name and unit number since + * we aren't going to open it. + */ + *bus = ccb.ccb_h.path_id; + *target = ccb.ccb_h.target_id; + *lun = ccb.ccb_h.target_lun; + *arglst |= CAM_ARG_BUS | CAM_ARG_TARGET | CAM_ARG_LUN; + return (3); +} + +/* * Parse out a bus, or a bus, target and lun in the following * format: * bus @@ -3569,25 +3629,43 @@ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst) { - char *tmpstr; + char *tmpstr, *end; int convs = 0; + *bus = CAM_BUS_WILDCARD; + *target = CAM_TARGET_WILDCARD; + *lun = CAM_LUN_WILDCARD; + while (isspace(*tstr) && (*tstr != '\0')) tstr++; - tmpstr = (char *)strtok(tstr, ":"); + if (strncasecmp(tstr, "all", strlen("all")) == 0) { + arglist |= CAM_ARG_BUS; + return (1); + } + + if (!isdigit(*tstr)) + return (parse_btl_name(tstr, bus, target, lun, arglst)); + + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *bus = strtol(tmpstr, NULL, 0); + *bus = strtol(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_BUS; convs++; - tmpstr = (char *)strtok(NULL, ":"); + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *target = strtol(tmpstr, NULL, 0); + *target = strtol(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_TARGET; convs++; - tmpstr = (char *)strtok(NULL, ":"); + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *lun = strtol(tmpstr, NULL, 0); + *lun = strtoll(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_LUN; convs++; } @@ -3601,7 +3679,7 @@ static int dorescan_or_reset(int argc, char **argv, int rescan) { static const char must[] = - "you must specify \"all\", a bus, or a bus:target:lun to %s"; + "you must specify \"all\", a bus, a bus:target:lun or periph to %s"; int rv, error = 0; path_id_t bus = CAM_BUS_WILDCARD; target_id_t target = CAM_TARGET_WILDCARD; @@ -3618,118 +3696,19 @@ dorescan_or_reset(int argc, char **argv, int rescan) tstr++; if (strncasecmp(tstr, "all", strlen("all")) == 0) arglist |= CAM_ARG_BUS; - else if (isdigit(*tstr)) { + else { rv = parse_btl(argv[optind], &bus, &target, &lun, &arglist); if (rv != 1 && rv != 3) { - warnx(must, rescan? "rescan" : "reset"); + warnx(must, rescan ? "rescan" : "reset"); return (1); } - } else { - char name[30]; - int unit; - int fd = -1; - union ccb ccb; - - /* - * Note that resetting or rescanning a device used to - * require a bus or bus:target:lun. This is because the - * device in question may not exist and you're trying to - * get the controller to rescan to find it. It may also be - * because the device is hung / unresponsive, and opening - * an unresponsive device is not desireable. - * - * It can be more convenient to reference a device by - * peripheral name and unit number, though, and it is - * possible to get the bus:target:lun for devices that - * currently exist in the EDT. So this can work for - * devices that we want to reset, or devices that exist - * that we want to rescan, but not devices that do not - * exist yet. - * - * So, we are careful here to look up the bus/target/lun - * for the device the user wants to operate on, specified - * by peripheral instance (e.g. da0, pass32) without - * actually opening that device. The process is similar to - * what cam_lookup_pass() does, except that we don't - * actually open the passthrough driver instance in the end. - */ - - if (cam_get_device(tstr, name, sizeof(name), &unit) == -1) { - warnx("%s", cam_errbuf); - error = 1; - goto bailout; - } - - if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { - warn("Unable to open %s", XPT_DEVICE); - error = 1; - goto bailout; - } - - bzero(&ccb, sizeof(ccb)); - - /* - * The function code isn't strictly necessary for the - * GETPASSTHRU ioctl. - */ - ccb.ccb_h.func_code = XPT_GDEVLIST; - - /* - * These two are necessary for the GETPASSTHRU ioctl to - * work. - */ - strlcpy(ccb.cgdl.periph_name, name, - sizeof(ccb.cgdl.periph_name)); - ccb.cgdl.unit_number = unit; - - /* - * Attempt to get the passthrough device. This ioctl will - * fail if the device name is null, if the device doesn't - * exist, or if the passthrough driver isn't in the kernel. - */ - if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) { - warn("Unable to find bus:target:lun for device %s%d", - name, unit); - error = 1; - close(fd); - goto bailout; - } - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - const struct cam_status_entry *entry; - - entry = cam_fetch_status_entry(ccb.ccb_h.status); - warnx("Unable to find bus:target_lun for device %s%d, " - "CAM status: %s (%#x)", name, unit, - entry ? entry->status_text : "Unknown", - ccb.ccb_h.status); - error = 1; - close(fd); - goto bailout; - } - - /* - * The kernel fills in the bus/target/lun. We don't - * need the passthrough device name and unit number since - * we aren't going to open it. - */ - bus = ccb.ccb_h.path_id; - target = ccb.ccb_h.target_id; - lun = ccb.ccb_h.target_lun; - - arglist |= CAM_ARG_BUS | CAM_ARG_TARGET | CAM_ARG_LUN; - - close(fd); } - if ((arglist & CAM_ARG_BUS) - && (arglist & CAM_ARG_TARGET) - && (arglist & CAM_ARG_LUN)) + if (arglist & CAM_ARG_LUN) error = scanlun_or_reset_dev(bus, target, lun, rescan); else error = rescan_or_reset_bus(bus, rescan); -bailout: - return (error); } @@ -5116,9 +5095,9 @@ camdebug(int argc, char **argv, char *combinedopt) path_id_t bus = CAM_BUS_WILDCARD; target_id_t target = CAM_TARGET_WILDCARD; lun_id_t lun = CAM_LUN_WILDCARD; - char *tstr, *tmpstr = NULL; + char *tstr; union ccb ccb; - int error = 0; + int error = 0, rv; bzero(&ccb, sizeof(union ccb)); @@ -5157,23 +5136,16 @@ camdebug(int argc, char **argv, char *combinedopt) } } - if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - warnx("error opening transport layer device %s", XPT_DEVICE); - warn("%s", XPT_DEVICE); - return (1); - } argc -= optind; argv += optind; if (argc <= 0) { warnx("you must specify \"off\", \"all\" or a bus,"); - warnx("bus:target, or bus:target:lun"); - close(fd); + warnx("bus:target, bus:target:lun or periph"); return (1); } tstr = *argv; - while (isspace(*tstr) && (*tstr != '\0')) tstr++; @@ -5182,66 +5154,54 @@ camdebug(int argc, char **argv, char *combinedopt) arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH| CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE| CAM_ARG_DEBUG_XPT|CAM_ARG_DEBUG_PROBE); - } else if (strncmp(tstr, "all", 3) != 0) { - tmpstr = (char *)strtok(tstr, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - bus = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_BUS; - tmpstr = (char *)strtok(NULL, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - target = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_TARGET; - tmpstr = (char *)strtok(NULL, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - lun = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_LUN; - } - } - } else { - error = 1; + } else { + rv = parse_btl(tstr, &bus, &target, &lun, &arglist); + if (rv < 1) { warnx("you must specify \"all\", \"off\", or a bus,"); - warnx("bus:target, or bus:target:lun to debug"); + warnx("bus:target, bus:target:lun or periph to debug"); + return (1); } } - if (error == 0) { + if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { + warnx("error opening transport layer device %s", XPT_DEVICE); + warn("%s", XPT_DEVICE); + return (1); + } - ccb.ccb_h.func_code = XPT_DEBUG; - ccb.ccb_h.path_id = bus; - ccb.ccb_h.target_id = target; - ccb.ccb_h.target_lun = lun; + ccb.ccb_h.func_code = XPT_DEBUG; + ccb.ccb_h.path_id = bus; + ccb.ccb_h.target_id = target; + ccb.ccb_h.target_lun = lun; - if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - warn("CAMIOCOMMAND ioctl failed"); + if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { + warn("CAMIOCOMMAND ioctl failed"); + error = 1; + } else { + if ((ccb.ccb_h.status & CAM_STATUS_MASK) == + CAM_FUNC_NOTAVAIL) { + warnx("CAM debugging not available"); + warnx("you need to put options CAMDEBUG in" + " your kernel config file!"); error = 1; - } - - if (error == 0) { - if ((ccb.ccb_h.status & CAM_STATUS_MASK) == - CAM_FUNC_NOTAVAIL) { - warnx("CAM debugging not available"); - warnx("you need to put options CAMDEBUG in" - " your kernel config file!"); - error = 1; - } else if ((ccb.ccb_h.status & CAM_STATUS_MASK) != - CAM_REQ_CMP) { - warnx("XPT_DEBUG CCB failed with status %#x", - ccb.ccb_h.status); - error = 1; + } else if ((ccb.ccb_h.status & CAM_STATUS_MASK) != + CAM_REQ_CMP) { + warnx("XPT_DEBUG CCB failed with status %#x", + ccb.ccb_h.status); + error = 1; + } else { + if (ccb.cdbg.flags == CAM_DEBUG_NONE) { + fprintf(stderr, + "Debugging turned off\n"); } else { - if (ccb.cdbg.flags == CAM_DEBUG_NONE) { - fprintf(stderr, - "Debugging turned off\n"); - } else { - fprintf(stderr, - "Debugging enabled for " - "%d:%d:%jx\n", - bus, target, (uintmax_t)lun); - } + fprintf(stderr, + "Debugging enabled for " + "%d:%d:%jx\n", + bus, target, (uintmax_t)lun); } } - close(fd); } + close(fd); return (error); } @@ -9915,7 +9875,7 @@ usage(int printlong) " camcontrol smpphylist [dev_id][generic args][-l][-q]\n" " camcontrol smpmaninfo [dev_id][generic args][-l]\n" " camcontrol debug [-I][-P][-T][-S][-X][-c]\n" -" \n" +" \n" " camcontrol tags [dev_id][generic args] [-N tags] [-q] [-v]\n" " camcontrol negotiate [dev_id][generic args] [-a][-c]\n" " [-D ][-M mode][-O offset]\n" From owner-svn-src-all@freebsd.org Thu Aug 8 02:28:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A834EC0D86; Thu, 8 Aug 2019 02:28: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463sk84j83z3DMx; Thu, 8 Aug 2019 02:28: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 82E701E39B; Thu, 8 Aug 2019 02:28:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x782SWLF038438; Thu, 8 Aug 2019 02:28:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782SWvA038437; Thu, 8 Aug 2019 02:28:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080228.x782SWvA038437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350733 - stable/12/sys/cam/ata X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ata X-SVN-Commit-Revision: 350733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:28:32 -0000 Author: mav Date: Thu Aug 8 02:28:32 2019 New Revision: 350733 URL: https://svnweb.freebsd.org/changeset/base/350733 Log: MFC r350233: Make CAM ATA stack handle disk resizes. While for ATA disks resize is even more rare situation than for SCSI, it may happen in case of HPA or AMA being used. Make ATA XPT report minor IDENTIFY DATA change to upper layers with AC_GETDEV_CHANGED, and ada(4) periph driver handle that event, recalculating all the disk properties and signalling resize to GEOM. Since ATA has no mechanism of UNIT ATTENTIONs, like SCSI, it has no way to detect that something has changed. That is why this functionality depends on explicit reprobe via XPT_REPROBE_LUN call. Modified: stable/12/sys/cam/ata/ata_da.c stable/12/sys/cam/ata/ata_xpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ata/ata_da.c ============================================================================== --- stable/12/sys/cam/ata/ata_da.c Thu Aug 8 02:26:12 2019 (r350732) +++ stable/12/sys/cam/ata/ata_da.c Thu Aug 8 02:28:32 2019 (r350733) @@ -248,8 +248,9 @@ struct ada_softc { int periodic_read_error; int periodic_read_count; #endif - struct disk_params params; - struct disk *disk; + struct ccb_pathinq cpi; + struct disk_params params; + struct disk *disk; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -804,6 +805,8 @@ static void adasysctlinit(void *context, int pending) static int adagetattr(struct bio *bp); static void adasetflags(struct ada_softc *softc, struct ccb_getdev *cgd); +static void adasetgeom(struct ada_softc *softc, + struct ccb_getdev *cgd); static periph_ctor_t adaregister; static void ada_dsmtrim(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio); @@ -819,8 +822,6 @@ static void adadone(struct cam_periph *periph, union ccb *done_ccb); static int adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); -static void adagetparams(struct cam_periph *periph, - struct ccb_getdev *cgd); static timeout_t adasendorderedtag; static void adashutdown(void *arg, int howto); static void adasuspend(void *arg); @@ -1304,9 +1305,11 @@ adaasync(void *callback_arg, u_int32_t code, xpt_action((union ccb *)&cgd); /* - * Set/clear support flags based on the new Identify data. + * Update our information based on the new Identify data. */ adasetflags(softc, &cgd); + adasetgeom(softc, &cgd); + disk_resize(softc->disk, M_NOWAIT); cam_periph_async(periph, code, path, arg); break; @@ -1630,7 +1633,8 @@ adasetflags(struct ada_softc *softc, struct ccb_getdev softc->flags &= ~ADA_FLAG_CAN_NCQ; if ((cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) && - (cgd->inq_flags & SID_DMA)) { + (cgd->inq_flags & SID_DMA) && + (softc->quirks & ADA_Q_NO_TRIM) == 0) { softc->flags |= ADA_FLAG_CAN_TRIM; softc->trim_max_ranges = TRIM_MAX_RANGES; if (cgd->ident_data.max_dsm_blocks != 0) { @@ -1698,13 +1702,11 @@ static cam_status adaregister(struct cam_periph *periph, void *arg) { struct ada_softc *softc; - struct ccb_pathinq cpi; struct ccb_getdev *cgd; struct disk_params *dp; struct sbuf sb; char *announce_buf; caddr_t match; - u_int maxio; int quirks; cgd = (struct ccb_getdev *)arg; @@ -1733,6 +1735,7 @@ adaregister(struct cam_periph *periph, void *arg) } periph->softc = softc; + xpt_path_inq(&softc->cpi, periph->path); /* * See if this device has any quirks. @@ -1746,8 +1749,6 @@ adaregister(struct cam_periph *periph, void *arg) else softc->quirks = ADA_Q_NONE; - xpt_path_inq(&cpi, periph->path); - TASK_INIT(&softc->sysctl_task, 0, adasysctlinit, periph); /* @@ -1773,6 +1774,8 @@ adaregister(struct cam_periph *periph, void *arg) * Set support flags based on the Identify data and quirks. */ adasetflags(softc, cgd); + if (softc->cpi.hba_misc & PIM_ATA_EXT) + softc->flags |= ADA_FLAG_PIM_ATA_EXT; /* Disable queue sorting for non-rotational media by default. */ if (cgd->ident_data.media_rotation_rate == ATA_RATE_NON_ROTATING) { @@ -1781,14 +1784,13 @@ adaregister(struct cam_periph *periph, void *arg) softc->rotating = 1; } cam_iosched_set_sort_queue(softc->cam_iosched, softc->rotating ? -1 : 0); - adagetparams(periph, cgd); softc->disk = disk_alloc(); - softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; + adasetgeom(softc, cgd); softc->disk->d_devstat = devstat_new_entry(periph->periph_name, periph->unit_number, softc->params.secsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT | - XPORT_DEVSTAT_TYPE(cpi.transport), + XPORT_DEVSTAT_TYPE(softc->cpi.transport), DEVSTAT_PRIORITY_DISK); softc->disk->d_open = adaopen; softc->disk->d_close = adaclose; @@ -1798,70 +1800,8 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_gone = adadiskgonecb; softc->disk->d_name = "ada"; softc->disk->d_drv1 = periph; - maxio = cpi.maxio; /* Honor max I/O size of SIM */ - if (maxio == 0) - maxio = DFLTPHYS; /* traditional default */ - else if (maxio > MAXPHYS) - maxio = MAXPHYS; /* for safety */ - if (softc->flags & ADA_FLAG_CAN_48BIT) - maxio = min(maxio, 65536 * softc->params.secsize); - else /* 28bit ATA command limit */ - maxio = min(maxio, 256 * softc->params.secsize); - if (softc->quirks & ADA_Q_128KB) - maxio = min(maxio, 128 * 1024); - softc->disk->d_maxsize = maxio; softc->disk->d_unit = periph->unit_number; - softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; - if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) - softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - /* Device lies about TRIM capability. */ - if ((softc->quirks & ADA_Q_NO_TRIM) && - (softc->flags & ADA_FLAG_CAN_TRIM)) - softc->flags &= ~ADA_FLAG_CAN_TRIM; - if (softc->flags & ADA_FLAG_CAN_TRIM) { - softc->disk->d_flags |= DISKFLAG_CANDELETE; - softc->disk->d_delmaxsize = softc->params.secsize * - ATA_DSM_RANGE_MAX * - softc->trim_max_ranges; - } else if ((softc->flags & ADA_FLAG_CAN_CFA) && - !(softc->flags & ADA_FLAG_CAN_48BIT)) { - softc->disk->d_flags |= DISKFLAG_CANDELETE; - softc->disk->d_delmaxsize = 256 * softc->params.secsize; - } else - softc->disk->d_delmaxsize = maxio; - if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { - softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; - softc->unmappedio = 1; - } - if (cpi.hba_misc & PIM_ATA_EXT) - softc->flags |= ADA_FLAG_PIM_ATA_EXT; - strlcpy(softc->disk->d_descr, cgd->ident_data.model, - MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); - strlcpy(softc->disk->d_ident, cgd->ident_data.serial, - MIN(sizeof(softc->disk->d_ident), sizeof(cgd->ident_data.serial))); - softc->disk->d_hba_vendor = cpi.hba_vendor; - softc->disk->d_hba_device = cpi.hba_device; - softc->disk->d_hba_subvendor = cpi.hba_subvendor; - softc->disk->d_hba_subdevice = cpi.hba_subdevice; - softc->disk->d_sectorsize = softc->params.secsize; - softc->disk->d_mediasize = (off_t)softc->params.sectors * - softc->params.secsize; - if (ata_physical_sector_size(&cgd->ident_data) != - softc->params.secsize) { - softc->disk->d_stripesize = - ata_physical_sector_size(&cgd->ident_data); - softc->disk->d_stripeoffset = (softc->disk->d_stripesize - - ata_logical_sector_offset(&cgd->ident_data)) % - softc->disk->d_stripesize; - } else if (softc->quirks & ADA_Q_4K) { - softc->disk->d_stripesize = 4096; - softc->disk->d_stripeoffset = 0; - } - softc->disk->d_fwsectors = softc->params.secs_per_track; - softc->disk->d_fwheads = softc->params.heads; - ata_disk_firmware_geom_adjust(softc->disk); - /* * Acquire a reference to the periph before we register with GEOM. * We'll release this reference once GEOM calls us back (via @@ -3368,16 +3308,17 @@ adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_ } static void -adagetparams(struct cam_periph *periph, struct ccb_getdev *cgd) +adasetgeom(struct ada_softc *softc, struct ccb_getdev *cgd) { - struct ada_softc *softc = (struct ada_softc *)periph->softc; struct disk_params *dp = &softc->params; u_int64_t lbasize48; u_int32_t lbasize; + u_int maxio, d_flags; dp->secsize = ata_logical_sector_size(&cgd->ident_data); if ((cgd->ident_data.atavalid & ATA_FLAG_54_58) && - cgd->ident_data.current_heads && cgd->ident_data.current_sectors) { + cgd->ident_data.current_heads != 0 && + cgd->ident_data.current_sectors != 0) { dp->heads = cgd->ident_data.current_heads; dp->secs_per_track = cgd->ident_data.current_sectors; dp->cylinders = cgd->ident_data.cylinders; @@ -3405,6 +3346,60 @@ adagetparams(struct cam_periph *periph, struct ccb_get if ((cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) && lbasize48 > ATA_MAX_28BIT_LBA) dp->sectors = lbasize48; + + maxio = softc->cpi.maxio; /* Honor max I/O size of SIM */ + if (maxio == 0) + maxio = DFLTPHYS; /* traditional default */ + else if (maxio > MAXPHYS) + maxio = MAXPHYS; /* for safety */ + if (softc->flags & ADA_FLAG_CAN_48BIT) + maxio = min(maxio, 65536 * softc->params.secsize); + else /* 28bit ATA command limit */ + maxio = min(maxio, 256 * softc->params.secsize); + if (softc->quirks & ADA_Q_128KB) + maxio = min(maxio, 128 * 1024); + softc->disk->d_maxsize = maxio; + d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; + if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) + d_flags |= DISKFLAG_CANFLUSHCACHE; + if (softc->flags & ADA_FLAG_CAN_TRIM) { + d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = softc->params.secsize * + ATA_DSM_RANGE_MAX * softc->trim_max_ranges; + } else if ((softc->flags & ADA_FLAG_CAN_CFA) && + !(softc->flags & ADA_FLAG_CAN_48BIT)) { + d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = 256 * softc->params.secsize; + } else + softc->disk->d_delmaxsize = maxio; + if ((softc->cpi.hba_misc & PIM_UNMAPPED) != 0) { + d_flags |= DISKFLAG_UNMAPPED_BIO; + softc->unmappedio = 1; + } + softc->disk->d_flags = d_flags; + strlcpy(softc->disk->d_descr, cgd->ident_data.model, + MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); + strlcpy(softc->disk->d_ident, cgd->ident_data.serial, + MIN(sizeof(softc->disk->d_ident), sizeof(cgd->ident_data.serial))); + + softc->disk->d_sectorsize = softc->params.secsize; + softc->disk->d_mediasize = (off_t)softc->params.sectors * + softc->params.secsize; + if (ata_physical_sector_size(&cgd->ident_data) != + softc->params.secsize) { + softc->disk->d_stripesize = + ata_physical_sector_size(&cgd->ident_data); + softc->disk->d_stripeoffset = (softc->disk->d_stripesize - + ata_logical_sector_offset(&cgd->ident_data)) % + softc->disk->d_stripesize; + } else if (softc->quirks & ADA_Q_4K) { + softc->disk->d_stripesize = 4096; + softc->disk->d_stripeoffset = 0; + } + softc->disk->d_fwsectors = softc->params.secs_per_track; + softc->disk->d_fwheads = softc->params.heads; + ata_disk_firmware_geom_adjust(softc->disk); + softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; } static void Modified: stable/12/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/12/sys/cam/ata/ata_xpt.c Thu Aug 8 02:26:12 2019 (r350732) +++ stable/12/sys/cam/ata/ata_xpt.c Thu Aug 8 02:28:32 2019 (r350733) @@ -344,6 +344,7 @@ probestart(struct cam_periph *periph, union ccb *start probe_softc *softc; struct cam_path *path; struct ata_params *ident_buf; + u_int oif; CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probestart\n")); @@ -383,7 +384,7 @@ probestart(struct cam_periph *periph, union ccb *start /*data_ptr*/(u_int8_t *)&softc->ident_data, /*dxfer_len*/sizeof(softc->ident_data), 30 * 1000); - if (periph->path->device->protocol == PROTO_ATA) + if (path->device->protocol == PROTO_ATA) ata_28bit_cmd(ataio, ATA_ATA_IDENTIFY, 0, 0, 0); else ata_28bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); @@ -419,7 +420,7 @@ probestart(struct cam_periph *periph, union ccb *start if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } - if (periph->path->device->protocol == PROTO_ATA) { + if (path->device->protocol == PROTO_ATA) { if (ata_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) mode = ATA_PIO_MAX; } else { @@ -459,11 +460,13 @@ negotiate: if (mode != wantmode) goto negotiate; /* Remember what transport thinks about DMA. */ + oif = path->device->inq_flags; if (mode < ATA_DMA) path->device->inq_flags &= ~SID_DMA; else path->device->inq_flags |= SID_DMA; - xpt_async(AC_GETDEV_CHANGED, path, NULL); + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -516,11 +519,13 @@ negotiate: break; case PROBE_SETAN: /* Remember what transport thinks about AEN. */ + oif = path->device->inq_flags; if (softc->caps & CTS_SATA_CAPS_H_AN) path->device->inq_flags |= SID_AEN; else path->device->inq_flags &= ~SID_AEN; - xpt_async(AC_GETDEV_CHANGED, path, NULL); + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -639,7 +644,7 @@ negotiate: { u_int inquiry_len; struct scsi_inquiry_data *inq_buf = - &periph->path->device->inq_data; + &path->device->inq_data; if (softc->action == PROBE_INQUIRY) inquiry_len = SHORT_INQUIRY_LENGTH; @@ -744,8 +749,8 @@ probedone(struct cam_periph *periph, union ccb *done_c struct cam_path *path; cam_status status; u_int32_t priority; - u_int caps; - int changed = 1, found = 1; + u_int caps, oif; + int changed, found = 1; static const uint8_t fake_device_id_hdr[8] = {0, SVPD_DEVICE_ID, 0, 12, SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_NAA, 0, 8}; @@ -922,23 +927,32 @@ noerror: goto out; } ident_buf = &path->device->ident_data; + + /* Check that it is the same device as we know. */ if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { - /* Check that it is the same device. */ if (bcmp(softc->ident_data.model, ident_buf->model, sizeof(ident_buf->model)) || - bcmp(softc->ident_data.revision, ident_buf->revision, - sizeof(ident_buf->revision)) || bcmp(softc->ident_data.serial, ident_buf->serial, sizeof(ident_buf->serial))) { - /* Device changed. */ + /* The device was replaced. */ + changed = 2; xpt_async(AC_LOST_DEVICE, path, NULL); + } else if (bcmp(&softc->ident_data, ident_buf, + sizeof(*ident_buf))) { + /* The device is the same, but has changed. */ + changed = 1; } else { - bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + /* Nothing has changed. */ changed = 0; } + } else { + /* This is a new device. */ + changed = 2; } - if (changed) { + + if (changed != 0) bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + if (changed == 2) { /* Clean up from previous instance of this device */ if (path->device->serial_num != NULL) { free(path->device->serial_num, M_CAMXPT); @@ -975,10 +989,10 @@ noerror: ata_bswap(path->device->device_id + 8, 8); } } - path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; - xpt_async(AC_GETDEV_CHANGED, path, NULL); } + if (changed == 1) + xpt_async(AC_GETDEV_CHANGED, path, NULL); if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) { path->device->mintags = 2; path->device->maxtags = @@ -1002,7 +1016,7 @@ noerror: } } ata_device_transport(path); - if (changed) + if (changed == 2) proberequestdefaultnegotiation(periph); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); @@ -1058,6 +1072,7 @@ noerror: * capability information is not provided or transport is * SATA, we take support for granted. */ + oif = path->device->inq_flags; if (!(path->device->inq_flags & SID_DMA) || (path->device->transport == XPORT_ATA && (cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) && @@ -1065,6 +1080,8 @@ noerror: path->device->inq_flags &= ~SID_DMA48; else path->device->inq_flags |= SID_DMA48; + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1235,6 +1252,7 @@ notsata: else caps = 0; /* Remember what transport thinks about AEN. */ + oif = path->device->inq_flags; if ((caps & CTS_SATA_CAPS_H_AN) && path->device->protocol != PROTO_ATA) path->device->inq_flags |= SID_AEN; else @@ -1248,7 +1266,6 @@ notsata: cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; xpt_action((union ccb *)&cts); softc->caps = caps; - xpt_async(AC_GETDEV_CHANGED, path, NULL); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; xpt_acquire_device(path->device); @@ -1256,6 +1273,8 @@ notsata: xpt_action(done_ccb); xpt_async(AC_FOUND_DEVICE, path, done_ccb); } else { + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); xpt_async(AC_SCSI_AEN, path, done_ccb); @@ -1268,12 +1287,14 @@ notsata: /* Check that it is the same device. */ if (bcmp(&softc->ident_data, ident_buf, 53)) { /* Device changed. */ + changed = 2; xpt_async(AC_LOST_DEVICE, path, NULL); } else { bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); changed = 0; } - } + } else + changed = 2; if (changed) { bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); /* Clean up from previous instance of this device */ From owner-svn-src-all@freebsd.org Thu Aug 8 02:29:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66B79C0E44; Thu, 8 Aug 2019 02:29:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463skw1vLxz3DVW; Thu, 8 Aug 2019 02:29:12 +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 08B7E1E39C; Thu, 8 Aug 2019 02:29:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x782TBJ1038523; Thu, 8 Aug 2019 02:29:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782TBqN038522; Thu, 8 Aug 2019 02:29:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080229.x782TBqN038522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350734 - stable/12/sbin/camcontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sbin/camcontrol X-SVN-Commit-Revision: 350734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:29:12 -0000 Author: mav Date: Thu Aug 8 02:29:11 2019 New Revision: 350734 URL: https://svnweb.freebsd.org/changeset/base/350734 Log: MFC r350257: Make `camcontrol hpa` and `camcontrol ama` trigger reprobe. This makes OS automatically see the disk's new disk size. Modified: stable/12/sbin/camcontrol/camcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:28:32 2019 (r350733) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:29:11 2019 (r350734) @@ -315,6 +315,7 @@ static int scsiserial(struct cam_device *device, int t #endif /* MINIMALISTIC */ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst); +static int reprobe(struct cam_device *device); static int dorescan_or_reset(int argc, char **argv, int rescan); static int rescan_or_reset_bus(path_id_t bus, int rescan); static int scanlun_or_reset_dev(path_id_t bus, target_id_t target, @@ -386,7 +387,6 @@ static int scsiprintopcodes(struct cam_device *device, static int scsiopcodes(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout, int verbose); -static int scsireprobe(struct cam_device *device); #endif /* MINIMALISTIC */ #ifndef min @@ -3115,6 +3115,8 @@ atahpa(struct cam_device *device, int retry_count, int timeout, ccb, &ident_buf); atahpa_print(ident_buf, hpasize, 1); + /* Hint CAM to reprobe the device. */ + reprobe(device); } } break; @@ -3257,6 +3259,8 @@ ataama(struct cam_device *device, int retry_count, int error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf); ataama_print(ident_buf, nativesize, 1); + /* Hint CAM to reprobe the device. */ + reprobe(device); } } break; @@ -9799,7 +9803,7 @@ bailout: #endif /* MINIMALISTIC */ static int -scsireprobe(struct cam_device *device) +reprobe(struct cam_device *device) { union ccb *ccb; int retval = 0; @@ -9811,7 +9815,7 @@ scsireprobe(struct cam_device *device) return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); ccb->ccb_h.func_code = XPT_REPROBE_LUN; @@ -10580,7 +10584,7 @@ main(int argc, char **argv) arglist & CAM_ARG_VERBOSE); break; case CAM_CMD_REPROBE: - error = scsireprobe(cam_dev); + error = reprobe(cam_dev); break; case CAM_CMD_ZONE: error = zone(cam_dev, argc, argv, combinedopt, From owner-svn-src-all@freebsd.org Thu Aug 8 02:29:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55C8AC0EAE; Thu, 8 Aug 2019 02:29:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463slX2KGTz3Dcn; Thu, 8 Aug 2019 02:29:44 +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 315CB1E39D; Thu, 8 Aug 2019 02:29:44 +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 x782TiZx038604; Thu, 8 Aug 2019 02:29:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x782ThYx038597; Thu, 8 Aug 2019 02:29:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080229.x782ThYx038597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 02:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350735 - in stable/12: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/sys X-SVN-Commit-Revision: 350735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 02:29:44 -0000 Author: mav Date: Thu Aug 8 02:29:42 2019 New Revision: 350735 URL: https://svnweb.freebsd.org/changeset/base/350735 Log: MFC r350331: Make `camcontrol sanitize` support also ATA devices. ATA sanitize is functionally identical to SCSI, just uses different initiation commands and status reporting mechanism. While there, make kernel better handle sanitize commands and statuses. Modified: stable/12/sbin/camcontrol/camcontrol.8 stable/12/sbin/camcontrol/camcontrol.c stable/12/sys/cam/ata/ata_all.c stable/12/sys/cam/scsi/scsi_all.c stable/12/sys/sys/ata.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 02:29:11 2019 (r350734) +++ stable/12/sbin/camcontrol/camcontrol.8 Thu Aug 8 02:29:42 2019 (r350735) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2019 +.Dd July 25, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -1276,13 +1276,11 @@ will not be asked about the timeout if a timeout is sp command line. .El .It Ic sanitize -Issue the -.Tn SCSI -SANITIZE command to the named device. +Issue the SANITIZE command to the named device. .Pp .Em WARNING! WARNING! WARNING! .Pp -ALL data in the cache and on the disk will be destroyed or made inaccessible. +ALL data on the disk will be destroyed or made inaccessible. Recovery of the data is not possible. Use extreme caution when issuing this command. .Pp Modified: stable/12/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:29:11 2019 (r350734) +++ stable/12/sbin/camcontrol/camcontrol.c Thu Aug 8 02:29:42 2019 (r350735) @@ -362,7 +362,7 @@ static int ratecontrol(struct cam_device *device, int static int scsiformat(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout); -static int scsisanitize(struct cam_device *device, int argc, char **argv, +static int sanitize(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout); static int scsireportluns(struct cam_device *device, int argc, char **argv, @@ -1762,6 +1762,19 @@ atacapprint(struct ata_params *parm) } else { printf("no\n"); } + printf("Sanitize "); + if (parm->multi & ATA_SUPPORT_SANITIZE) { + printf("yes\t\t%s%s%s\n", + parm->multi & ATA_SUPPORT_BLOCK_ERASE_EXT ? "block, " : "", + parm->multi & ATA_SUPPORT_OVERWRITE_EXT ? "overwrite, " : "", + parm->multi & ATA_SUPPORT_CRYPTO_SCRAMBLE_EXT ? "crypto" : ""); + printf("Sanitize - commands allowed %s\n", + parm->multi & ATA_SUPPORT_SANITIZE_ALLOWED ? "yes" : "no"); + printf("Sanitize - antifreeze lock %s\n", + parm->multi & ATA_SUPPORT_ANTIFREEZE_LOCK_EXT ? "yes" : "no"); + } else { + printf("no\n"); + } } static int @@ -2008,6 +2021,11 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, res->lba_high_exp = res_pass16->lba_high_exp; res->sector_count = res_pass16->sector_count; res->sector_count_exp = res_pass16->sector_count_exp; + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + if (res->status & ATA_STATUS_ERROR) + ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; + else + ccb->ccb_h.status |= CAM_REQ_CMP; } return (error); @@ -2498,12 +2516,6 @@ ata_do_identify(struct cam_device *device, int retry_c error = 0; } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw identify data:\n", - device->device_name, device->dev_unit_num); - dump_data(ptr, sizeof(struct ata_params)); - } - /* check for invalid (all zero) response */ if (error != 0) { warnx("Invalid identify response detected"); @@ -2534,6 +2546,12 @@ ataidentify(struct cam_device *device, int retry_count return (1); } + if (arglist & CAM_ARG_VERBOSE) { + printf("%s%d: Raw identify data:\n", + device->device_name, device->dev_unit_num); + dump_data((void*)ident_buf, sizeof(struct ata_params)); + } + if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { if (ata_read_native_max(device, retry_count, timeout, ccb, ident_buf, &hpasize) != 0) { @@ -6769,15 +6787,184 @@ scsiformat_bailout: } static int -scsisanitize(struct cam_device *device, int argc, char **argv, +sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet) +{ + struct ata_res *res; + int retval; + cam_status status; + u_int val, perc; + + do { + retval = ata_do_cmd(device, + ccb, + /*retries*/1, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SANITIZE, + /*features*/0x00, /* SANITIZE STATUS EXT */ + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/10000, + /*is48bit*/1); + if (retval < 0) { + warn("error sending CAMIOCOMMAND ioctl"); + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + return (1); + } + + status = ccb->ccb_h.status & CAM_STATUS_MASK; + if (status == CAM_REQ_CMP) { + res = &ccb->ataio.res; + if (res->sector_count_exp & 0x40) { + if (quiet == 0) { + val = (res->lba_mid << 8) + res->lba_low; + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } + sleep(1); + } else if ((res->sector_count_exp & 0x80) == 0) { + warnx("Sanitize complete with an error. "); + return (1); + } else + break; + + } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { + warnx("Unexpected CAM status %#x", status); + if (arglist & CAM_ARG_VERBOSE) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + } while (1); + return (0); +} + +static int +sanitize_wait_scsi(struct cam_device *device, union ccb *ccb, int task_attr, int quiet) +{ + int warnings = 0, retval; + cam_status status; + u_int val, perc; + + do { + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); + + /* + * There's really no need to do error recovery or + * retries here, since we're just going to sit in a + * loop and wait for the device to finish sanitizing. + */ + scsi_test_unit_ready(&ccb->csio, + /* retries */ 0, + /* cbfcnp */ NULL, + /* tag_action */ task_attr, + /* sense_len */ SSD_FULL_SIZE, + /* timeout */ 5000); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + retval = cam_send_ccb(device, ccb); + + /* + * If we get an error from the ioctl, bail out. SCSI + * errors are expected. + */ + if (retval < 0) { + warn("error sending CAMIOCOMMAND ioctl"); + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + return (1); + } + + status = ccb->ccb_h.status & CAM_STATUS_MASK; + if ((status == CAM_SCSI_STATUS_ERROR) && + ((ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0)) { + struct scsi_sense_data *sense; + int error_code, sense_key, asc, ascq; + + sense = &ccb->csio.sense_data; + scsi_extract_sense_len(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, &error_code, &sense_key, + &asc, &ascq, /*show_errors*/ 1); + + /* + * According to the SCSI-3 spec, a drive that is in the + * middle of a sanitize should return NOT READY with an + * ASC of "logical unit not ready, sanitize in + * progress". The sense key specific bytes will then + * be a progress indicator. + */ + if ((sense_key == SSD_KEY_NOT_READY) + && (asc == 0x04) && (ascq == 0x1b)) { + uint8_t sks[3]; + + if ((scsi_get_sks(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, sks) == 0) + && (quiet == 0)) { + val = scsi_2btoul(&sks[1]); + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } else if ((quiet == 0) && (++warnings <= 1)) { + warnx("Unexpected SCSI Sense Key " + "Specific value returned " + "during sanitize:"); + scsi_sense_print(device, &ccb->csio, + stderr); + warnx("Unable to print status " + "information, but sanitze will " + "proceed."); + warnx("will exit when sanitize is " + "complete"); + } + sleep(1); + } else { + warnx("Unexpected SCSI error during sanitize"); + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + + } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { + warnx("Unexpected CAM status %#x", status); + if (arglist & CAM_ARG_VERBOSE) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + } while ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP); + return (0); +} + +static int +sanitize(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int8_t action = 0; int c; int ycount = 0, quiet = 0; - int error = 0, retval = 0; - int use_timeout = 10800 * 1000; + int error = 0; + int use_timeout; int immediate = 1; int invert = 0; int passes = 0; @@ -6786,14 +6973,25 @@ scsisanitize(struct cam_device *device, int argc, char const char *pattern = NULL; u_int8_t *data_ptr = NULL; u_int32_t dxfer_len = 0; - u_int8_t byte2 = 0; - int num_warnings = 0; + uint8_t byte2; + uint16_t feature, count; + uint64_t lba; int reportonly = 0; + camcontrol_devtype dt; + /* + * Get the device type, request no I/O be done to do this. + */ + error = get_device_type(device, -1, 0, 0, &dt); + if (error != 0 || (unsigned)dt > CC_DT_UNKNOWN) { + warnx("sanitize: can't get device type"); + return (1); + } + ccb = cam_getccb(device); if (ccb == NULL) { - warnx("scsisanitize: error allocating ccb"); + warnx("sanitize: error allocating ccb"); return (1); } @@ -6814,7 +7012,7 @@ scsisanitize(struct cam_device *device, int argc, char warnx("invalid service operation \"%s\"", optarg); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } break; case 'c': @@ -6822,7 +7020,7 @@ scsisanitize(struct cam_device *device, int argc, char if (passes < 1 || passes > 31) { warnx("invalid passes value %d", passes); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } break; case 'I': @@ -6841,7 +7039,9 @@ scsisanitize(struct cam_device *device, int argc, char reportonly = 1; break; case 'w': - immediate = 0; + /* ATA supports only immediate commands. */ + if (dt == CC_DT_SCSI) + immediate = 0; break; case 'y': ycount++; @@ -6855,7 +7055,7 @@ scsisanitize(struct cam_device *device, int argc, char if (action == 0) { warnx("an action is required"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } else if (action == SSZ_SERVICE_ACTION_OVERWRITE) { struct scsi_sanitize_parameter_list *pl; struct stat sb; @@ -6864,43 +7064,43 @@ scsisanitize(struct cam_device *device, int argc, char if (pattern == NULL) { warnx("overwrite action requires -P argument"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } fd = open(pattern, O_RDONLY); if (fd < 0) { warn("cannot open pattern file %s", pattern); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } if (fstat(fd, &sb) < 0) { warn("cannot stat pattern file %s", pattern); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } sz = sb.st_size; if (sz > SSZPL_MAX_PATTERN_LENGTH) { warnx("pattern file size exceeds maximum value %d", SSZPL_MAX_PATTERN_LENGTH); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } dxfer_len = sizeof(*pl) + sz; data_ptr = calloc(1, dxfer_len); if (data_ptr == NULL) { warnx("cannot allocate parameter list buffer"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } amt = read(fd, data_ptr + sizeof(*pl), sz); if (amt < 0) { warn("cannot read pattern file"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } else if (amt != sz) { warnx("short pattern file read"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } pl = (struct scsi_sanitize_parameter_list *)data_ptr; @@ -6926,7 +7126,7 @@ scsisanitize(struct cam_device *device, int argc, char warnx("%s argument only valid with overwrite " "operation", arg); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } } @@ -6934,26 +7134,41 @@ scsisanitize(struct cam_device *device, int argc, char fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); - error = scsidoinquiry(device, argc, argv, combinedopt, - task_attr, retry_count, timeout); + if (dt == CC_DT_SCSI) { + error = scsidoinquiry(device, argc, argv, combinedopt, + task_attr, retry_count, timeout); + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + struct ata_params *ident_buf; + error = ata_do_identify(device, retry_count, timeout, + ccb, &ident_buf); + if (error == 0) { + printf("%s%d: ", device->device_name, + device->dev_unit_num); + ata_print_ident(ident_buf); + free(ident_buf); + } + } else + error = 1; if (error != 0) { - warnx("scsisanitize: error sending inquiry"); - goto scsisanitize_bailout; + warnx("sanitize: error sending inquiry"); + goto sanitize_bailout; } } if (ycount == 0) { if (!get_confirmation()) { error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } } if (timeout != 0) use_timeout = timeout; + else + use_timeout = (immediate ? 10 : 10800) * 1000; - if (quiet == 0) { + if (immediate == 0 && quiet == 0) { fprintf(stdout, "Current sanitize timeout is %d seconds\n", use_timeout / 1000); } @@ -6963,8 +7178,7 @@ scsisanitize(struct cam_device *device, int argc, char * timeout on the command line, ask them if they want the current * timeout. */ - if ((ycount == 0) - && (timeout == 0)) { + if (immediate == 0 && ycount == 0 && timeout == 0) { char str[1024]; int new_timeout = 0; @@ -6984,33 +7198,76 @@ scsisanitize(struct cam_device *device, int argc, char } } - byte2 = action; - if (ause != 0) - byte2 |= SSZ_UNRESTRICTED_EXIT; - if (immediate != 0) - byte2 |= SSZ_IMMED; + if (dt == CC_DT_SCSI) { + byte2 = action; + if (ause != 0) + byte2 |= SSZ_UNRESTRICTED_EXIT; + if (immediate != 0) + byte2 |= SSZ_IMMED; + scsi_sanitize(&ccb->csio, + /* retries */ retry_count, + /* cbfcnp */ NULL, + /* tag_action */ task_attr, + /* byte2 */ byte2, + /* control */ 0, + /* data_ptr */ data_ptr, + /* dxfer_len */ dxfer_len, + /* sense_len */ SSD_FULL_SIZE, + /* timeout */ use_timeout); - scsi_sanitize(&ccb->csio, - /* retries */ retry_count, - /* cbfcnp */ NULL, - /* tag_action */ task_attr, - /* byte2 */ byte2, - /* control */ 0, - /* data_ptr */ data_ptr, - /* dxfer_len */ dxfer_len, - /* sense_len */ SSD_FULL_SIZE, - /* timeout */ use_timeout); + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (arglist & CAM_ARG_ERR_RECOVER) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + if (cam_send_ccb(device, ccb) < 0) { + warn("error sending sanitize command"); + error = 1; + goto sanitize_bailout; + } + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + if (action == SSZ_SERVICE_ACTION_OVERWRITE) { + feature = 0x14; /* OVERWRITE EXT */ + lba = 0x4F5700000000 | scsi_4btoul(data_ptr + 4); + count = (passes == 0) ? 1 : (passes >= 16) ? 0 : passes; + if (invert) + count |= 0x80; /* INVERT PATTERN */ + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_BLOCK_ERASE) { + feature = 0x12; /* BLOCK ERASE EXT */ + lba = 0x0000426B4572; + count = 0; + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_CRYPTO_ERASE) { + feature = 0x11; /* CRYPTO SCRAMBLE EXT */ + lba = 0x000043727970; + count = 0; + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_EXIT_MODE_FAILURE) { + feature = 0x00; /* SANITIZE STATUS EXT */ + lba = 0; + count = 1; /* CLEAR SANITIZE OPERATION FAILED */ + } else { + error = 1; + goto sanitize_bailout; + } - /* Disable freezing the device queue */ - ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; - - if (arglist & CAM_ARG_ERR_RECOVER) - ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; - - if (cam_send_ccb(device, ccb) < 0) { - warn("error sending sanitize command"); - error = 1; - goto scsisanitize_bailout; + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SANITIZE, + /*features*/feature, + /*lba*/lba, + /*sector_count*/count, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/ use_timeout, + /*is48bit*/1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -7038,7 +7295,7 @@ scsisanitize(struct cam_device *device, int argc, char CAM_EPF_ALL, stderr); } error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } /* @@ -7051,124 +7308,20 @@ scsisanitize(struct cam_device *device, int argc, char if (quiet == 0) { fprintf(stdout, "Sanitize Complete\n"); } - goto scsisanitize_bailout; + goto sanitize_bailout; } doreport: - do { - cam_status status; + if (dt == CC_DT_SCSI) { + error = sanitize_wait_scsi(device, ccb, task_attr, quiet); + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + error = sanitize_wait_ata(device, ccb, quiet); + } else + error = 1; + if (error == 0 && quiet == 0) + fprintf(stdout, "Sanitize Complete \n"); - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - - /* - * There's really no need to do error recovery or - * retries here, since we're just going to sit in a - * loop and wait for the device to finish sanitizing. - */ - scsi_test_unit_ready(&ccb->csio, - /* retries */ 0, - /* cbfcnp */ NULL, - /* tag_action */ task_attr, - /* sense_len */ SSD_FULL_SIZE, - /* timeout */ 5000); - - /* Disable freezing the device queue */ - ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; - - retval = cam_send_ccb(device, ccb); - - /* - * If we get an error from the ioctl, bail out. SCSI - * errors are expected. - */ - if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - error = 1; - goto scsisanitize_bailout; - } - - status = ccb->ccb_h.status & CAM_STATUS_MASK; - - if ((status != CAM_REQ_CMP) - && (status == CAM_SCSI_STATUS_ERROR) - && ((ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0)) { - struct scsi_sense_data *sense; - int error_code, sense_key, asc, ascq; - - sense = &ccb->csio.sense_data; - scsi_extract_sense_len(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, &error_code, &sense_key, - &asc, &ascq, /*show_errors*/ 1); - - /* - * According to the SCSI-3 spec, a drive that is in the - * middle of a sanitize should return NOT READY with an - * ASC of "logical unit not ready, sanitize in - * progress". The sense key specific bytes will then - * be a progress indicator. - */ - if ((sense_key == SSD_KEY_NOT_READY) - && (asc == 0x04) && (ascq == 0x1b)) { - uint8_t sks[3]; - - if ((scsi_get_sks(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, sks) == 0) - && (quiet == 0)) { - int val; - u_int64_t percentage; - - val = scsi_2btoul(&sks[1]); - percentage = 10000 * val; - - fprintf(stdout, - "\rSanitizing: %ju.%02u %% " - "(%d/%d) done", - (uintmax_t)(percentage / - (0x10000 * 100)), - (unsigned)((percentage / - 0x10000) % 100), - val, 0x10000); - fflush(stdout); - } else if ((quiet == 0) - && (++num_warnings <= 1)) { - warnx("Unexpected SCSI Sense Key " - "Specific value returned " - "during sanitize:"); - scsi_sense_print(device, &ccb->csio, - stderr); - warnx("Unable to print status " - "information, but sanitze will " - "proceed."); - warnx("will exit when sanitize is " - "complete"); - } - sleep(1); - } else { - warnx("Unexpected SCSI error during sanitize"); - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - error = 1; - goto scsisanitize_bailout; - } - - } else if (status != CAM_REQ_CMP) { - warnx("Unexpected CAM status %#x", status); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - error = 1; - goto scsisanitize_bailout; - } - } while((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP); - - if (quiet == 0) - fprintf(stdout, "\nSanitize Complete\n"); - -scsisanitize_bailout: +sanitize_bailout: if (fd >= 0) close(fd); if (data_ptr != NULL) @@ -10562,9 +10715,8 @@ main(int argc, char **argv) timeout); break; case CAM_CMD_SANITIZE: - error = scsisanitize(cam_dev, argc, argv, - combinedopt, task_attr, - retry_count, timeout); + error = sanitize(cam_dev, argc, argv, combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_PERSIST: error = scsipersist(cam_dev, argc, argv, combinedopt, Modified: stable/12/sys/cam/ata/ata_all.c ============================================================================== --- stable/12/sys/cam/ata/ata_all.c Thu Aug 8 02:29:11 2019 (r350734) +++ stable/12/sys/cam/ata/ata_all.c Thu Aug 8 02:29:42 2019 (r350735) @@ -215,7 +215,16 @@ ata_op_string(struct ata_cmd *cmd) return ("SMART"); case 0xb1: return ("DEVICE CONFIGURATION"); case 0xb2: return ("SET_SECTOR_CONFIGURATION_EXT"); - case 0xb4: return ("SANITIZE_DEVICE"); + case 0xb4: + switch(cmd->features) { + case 0x00: return ("SANITIZE_STATUS_EXT"); + case 0x11: return ("CRYPTO_SCRAMBLE_EXT"); + case 0x12: return ("BLOCK_ERASE_EXT"); + case 0x14: return ("OVERWRITE_EXT"); + case 0x20: return ("SANITIZE_FREEZE_LOCK_EXT"); + case 0x40: return ("SANITIZE_ANTIFREEZE_LOCK_EXT"); + } + return ("SANITIZE_DEVICE"); case 0xc0: return ("CFA_ERASE"); case 0xc4: return ("READ_MUL"); case 0xc5: return ("WRITE_MUL"); Modified: stable/12/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.c Thu Aug 8 02:29:11 2019 (r350734) +++ stable/12/sys/cam/scsi/scsi_all.c Thu Aug 8 02:29:42 2019 (r350735) @@ -379,7 +379,7 @@ static struct op_table_entry scsi_op_codes[] = { { 0x40, D | T | L | P | W | R | O | M | S | C, "CHANGE DEFINITION" }, /* 41 O WRITE SAME(10) */ { 0x41, D, "WRITE SAME(10)" }, - /* 42 O UNMAP */ + /* 42 O UNMAP */ { 0x42, D, "UNMAP" }, /* 42 O READ SUB-CHANNEL */ { 0x42, R, "READ SUB-CHANNEL" }, @@ -394,7 +394,8 @@ static struct op_table_entry scsi_op_codes[] = { { 0x46, R, "GET CONFIGURATION" }, /* 47 O PLAY AUDIO MSF */ { 0x47, R, "PLAY AUDIO MSF" }, - /* 48 */ + /* 48 O SANITIZE */ + { 0x48, D, "SANITIZE" }, /* 49 */ /* 4A M GET EVENT STATUS NOTIFICATION */ { 0x4A, R, "GET EVENT STATUS NOTIFICATION" }, @@ -1162,7 +1163,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */ "Logical unit not ready, START/STOP UNIT command in progress") }, /* D B */ - { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ + { SST(0x04, 0x1B, SS_WAIT | EBUSY, "Logical unit not ready, sanitize in progress") }, /* DT MAEB */ { SST(0x04, 0x1C, SS_START | SSQ_DECREMENT_COUNT | ENXIO, @@ -1453,7 +1454,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x11, 0x14, SS_RDEF, /* XXX TBD */ "Read error - LBA marked bad by application client") }, /* D */ - { SST(0x11, 0x15, SS_RDEF, /* XXX TBD */ + { SST(0x11, 0x15, SS_FATAL | EIO, "Write after sanitize required") }, /* D W O BK */ { SST(0x12, 0x00, SS_RDEF, @@ -2064,7 +2065,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x31, 0x02, SS_RDEF, /* XXX TBD */ "Zoned formatting failed due to spare linking") }, /* D B */ - { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x31, 0x03, SS_FATAL | EIO, "SANITIZE command failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, Modified: stable/12/sys/sys/ata.h ============================================================================== --- stable/12/sys/sys/ata.h Thu Aug 8 02:29:11 2019 (r350734) +++ stable/12/sys/sys/ata.h Thu Aug 8 02:29:42 2019 (r350735) @@ -92,6 +92,8 @@ struct ata_params { /*057*/ u_int16_t current_size_1; /*058*/ u_int16_t current_size_2; /*059*/ u_int16_t multi; +#define ATA_SUPPORT_SANITIZE_ALLOWED 0x0800 +#define ATA_SUPPORT_ANTIFREEZE_LOCK_EXT 0x0400 #define ATA_MULTI_VALID 0x0100 /*060*/ u_int16_t lba_size_1; @@ -436,6 +438,7 @@ struct ata_params { #define ATA_ATAPI_IDENTIFY 0xa1 /* get ATAPI params*/ #define ATA_SERVICE 0xa2 /* service command */ #define ATA_SMART_CMD 0xb0 /* SMART command */ +#define ATA_SANITIZE 0xb4 /* sanitize device */ #define ATA_CFA_ERASE 0xc0 /* CFA erase */ #define ATA_READ_MUL 0xc4 /* read multi */ #define ATA_WRITE_MUL 0xc5 /* write multi */ From owner-svn-src-all@freebsd.org Thu Aug 8 02:39:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFFFBC120D; Thu, 8 Aug 2019 02:39:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463syR4dtHz3F4n; Thu, 8 Aug 2019 02:39:11 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f66.google.com with SMTP id r21so106654927otq.6; Wed, 07 Aug 2019 19:39:11 -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=yReDWTZcI1Q1R4sK8ZLH/khjCkVUGP0/VTmZaEA4Dxw=; b=HeI0VfSDX9ZDyYmjbzYnZTavhyEsOUoTpxoXYwibluSjzRvG4wRCHIY6uI/XSTrVGj gRFNHHEC7Qzi8OuUSNO5YLKKkrcVo2GlW2mpU+UTgVL1X1ATkXp0dMT/SJRkvbw1rsGy skEDeDUyJQbHpJehJHgiJ9xiWoj+P8AkdTlzNhUHo7uJQZ/IHWTBE1t3vs4epGOe/PEZ Q1OLBlgkh3VqKbKKTFaQepv3cXUXp0jqzgiTVWIK+jbtvVupYsWS38NtnKmLgaUcdBsT oWtEEXP/JM9I1oVU4ya5L2U2SvKJ4NnmEDvKjWCuMWob9CU42heoLpDXNVOZHzLWonqk bj8Q== X-Gm-Message-State: APjAAAWYyzrKCZqQC6RQYuicNep1ttwUs8JPyL0lY7XQJEbRFRMCf+jK GCBpYjF3dB5TeyP4BsZYbDhXloNv X-Google-Smtp-Source: APXvYqyaF4ux3Ib969chfBISQVnIweYDSRv/ec9XuO9PaSeugzPjhFNDHIbvgT2M+wRmSPpnO4IrSg== X-Received: by 2002:aca:b808:: with SMTP id i8mr906696oif.163.1565231950085; Wed, 07 Aug 2019 19:39:10 -0700 (PDT) Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com. [209.85.210.48]) by smtp.gmail.com with ESMTPSA id v203sm35642980oie.5.2019.08.07.19.39.09 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 19:39:09 -0700 (PDT) Received: by mail-ot1-f48.google.com with SMTP id o101so112643392ota.8; Wed, 07 Aug 2019 19:39:09 -0700 (PDT) X-Received: by 2002:a6b:6409:: with SMTP id t9mr1589050iog.270.1565231948982; Wed, 07 Aug 2019 19:39:08 -0700 (PDT) MIME-Version: 1.0 References: <201907250546.x6P5kHWq076756@repo.freebsd.org> In-Reply-To: <201907250546.x6P5kHWq076756@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Wed, 7 Aug 2019 19:38:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r350315 - in head/sys: kern sys To: Rick Macklem Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 463syR4dtHz3F4n X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.210.66 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-4.77 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[66.210.85.209.rep.mailspike.net : 127.0.0.18]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; IP_SCORE(-1.77)[ip: (-3.00), ipnet: 209.85.128.0/17(-3.39), asn: 15169(-2.43), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[66.210.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 02:39:12 -0000 Hi Rick, Coverity reports that the following portion of vn_generic_copy_file_range() is deadcode (CID 1403974), and it is: On Wed, Jul 24, 2019 at 10:46 PM Rick Macklem wrote: > > Author: rmacklem > Date: Thu Jul 25 05:46:16 2019 > New Revision: 350315 > URL: https://svnweb.freebsd.org/changeset/base/350315 > > Log: > Add kernel support for a Linux compatible copy_file_range(2) syscall. > ... > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Thu Jul 25 03:55:05 2019 (r350314) > +++ head/sys/kern/vfs_vnops.c Thu Jul 25 05:46:16 2019 (r350315) > ... > +int > +vn_generic_copy_file_range(struct vnode *invp, off_t *inoffp, > + struct vnode *outvp, off_t *outoffp, size_t *lenp, unsigned int flags, > + struct ucred *incred, struct ucred *outcred, struct thread *fsize_td) > +{ > ... > + error = vn_lock(invp, LK_SHARED); > + if (error != 0) > + goto out; // error is now zero > + if (VOP_PATHCONF(invp, _PC_MIN_HOLE_SIZE, &holein) != 0) > + holein = 0; > + VOP_UNLOCK(invp, 0); // the following condition is impossible: > + if (error != 0) > + goto out; Best, Conrad From owner-svn-src-all@freebsd.org Thu Aug 8 03:01:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00610C195E; Thu, 8 Aug 2019 03:01:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463tSH6BB0z3GCT; Thu, 8 Aug 2019 03:01:35 +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 B79DF1EA6B; Thu, 8 Aug 2019 03:01:35 +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 x7831ZZU059792; Thu, 8 Aug 2019 03:01:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7831ZVq059757; Thu, 8 Aug 2019 03:01:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908080301.x7831ZVq059757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 03:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350736 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 350736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 03:01:36 -0000 Author: mav Date: Thu Aug 8 03:01:35 2019 New Revision: 350736 URL: https://svnweb.freebsd.org/changeset/base/350736 Log: MFC r348376 (by rpokala): Add bits related to SANITIZE, SED, and form-factor to (struct ata_params) Based on ATA-ACS-4, recognize several bit-fields related to the ATA SANITIZE feature-set, Self-Encrypting Drives, and form-factor identification. As part of this change, the name of word 48 of (struct ata_params) is being changed. The previous name, "usedmovsd" does not appear to be related to the previous definition of the word ("double-word IO supported"). The word was defined that way in ATA-1 (1994), but it was marked "Reserved" (meaning "unused, but might be used in the future") in ATA-2 (1996). It stayed that way until ATA-8 (2008), which re-defined it as implemented in this change. The field is not used in-tree. Modified: stable/12/sys/sys/ata.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/ata.h ============================================================================== --- stable/12/sys/sys/ata.h Thu Aug 8 02:29:42 2019 (r350735) +++ stable/12/sys/sys/ata.h Thu Aug 8 03:01:35 2019 (r350736) @@ -66,7 +66,8 @@ struct ata_params { /*023*/ u_int8_t revision[8]; /* firmware revision */ /*027*/ u_int8_t model[40]; /* model name */ /*047*/ u_int16_t sectors_intr; /* sectors per interrupt */ -/*048*/ u_int16_t usedmovsd; /* double word read/write? */ +/*048*/ u_int16_t tcg; /* Trusted Computing Group */ +#define ATA_SUPPORT_TCG 0x0001 /*049*/ u_int16_t capabilities1; #define ATA_SUPPORT_DMA 0x0100 #define ATA_SUPPORT_LBA 0x0200 @@ -92,6 +93,10 @@ struct ata_params { /*057*/ u_int16_t current_size_1; /*058*/ u_int16_t current_size_2; /*059*/ u_int16_t multi; +#define ATA_SUPPORT_BLOCK_ERASE_EXT 0x8000 +#define ATA_SUPPORT_OVERWRITE_EXT 0x4000 +#define ATA_SUPPORT_CRYPTO_SCRAMBLE_EXT 0x2000 +#define ATA_SUPPORT_SANITIZE 0x1000 #define ATA_SUPPORT_SANITIZE_ALLOWED 0x0800 #define ATA_SUPPORT_ANTIFREEZE_LOCK_EXT 0x0400 #define ATA_MULTI_VALID 0x0100 @@ -109,6 +114,7 @@ struct ata_params { /*069*/ u_int16_t support3; #define ATA_SUPPORT_RZAT 0x0020 #define ATA_SUPPORT_DRAT 0x4000 +#define ATA_ENCRYPTS_ALL_USER_DATA 0x0010 /* Self-encrypting drive */ #define ATA_SUPPORT_ZONE_MASK 0x0003 #define ATA_SUPPORT_ZONE_NR 0x0000 #define ATA_SUPPORT_ZONE_HOST_AWARE 0x0001 @@ -264,7 +270,19 @@ struct ata_params { /*162*/ u_int16_t cfa_kms_support; /*163*/ u_int16_t cfa_trueide_modes; /*164*/ u_int16_t cfa_memory_modes; - u_int16_t reserved165[4]; + u_int16_t reserved165[3]; +/*168*/ u_int16_t form_factor; +#define ATA_FORM_FACTOR_MASK 0x000f +#define ATA_FORM_FACTOR_NOT_REPORTED 0x0000 +#define ATA_FORM_FACTOR_5_25 0x0001 +#define ATA_FORM_FACTOR_3_5 0x0002 +#define ATA_FORM_FACTOR_2_5 0x0003 +#define ATA_FORM_FACTOR_1_8 0x0004 +#define ATA_FORM_FACTOR_SUB_1_8 0x0005 +#define ATA_FORM_FACTOR_MSATA 0x0006 +#define ATA_FORM_FACTOR_M_2 0x0007 +#define ATA_FORM_FACTOR_MICRO_SSD 0x0008 +#define ATA_FORM_FACTOR_C_FAST 0x0009 /*169*/ u_int16_t support_dsm; #define ATA_SUPPORT_DSM_TRIM 0x0001 u_int16_t reserved170[6]; From owner-svn-src-all@freebsd.org Thu Aug 8 03:16:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EC51C1FB6; Thu, 8 Aug 2019 03:16:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463tnY0PMLz3H2s; Thu, 8 Aug 2019 03:16:33 +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 E39FB1ECB0; Thu, 8 Aug 2019 03:16:32 +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 x783GWmT070042; Thu, 8 Aug 2019 03:16:32 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x783GW3r070041; Thu, 8 Aug 2019 03:16:32 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908080316.x783GW3r070041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 8 Aug 2019 03:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350737 - head/usr.sbin/autofs X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.sbin/autofs X-SVN-Commit-Revision: 350737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 03:16:33 -0000 Author: jhibbits Date: Thu Aug 8 03:16:32 2019 New Revision: 350737 URL: https://svnweb.freebsd.org/changeset/base/350737 Log: Change autounmountd(8) to use time_t for duration instead of double Summary: autounmountd(8) uses doubles to handle mount time durations. However, it must convert to integer types, time_t in particular, to do anything meaningful. Additionally, even though it's a floating-point value in seconds, the sub-seconds component is never used, so it's unnecessary. Switching type to time_t fixes an assertion on powerpc64, which checks that a sleep value that's not -1.0 is greater than 0. On powerpc64, it happens that the value of -1.0 gets loaded as a float (perhaps a bug in gcc), but gets compared to a double. This compares as false, so follows through the 'sleep != -1.0' path, and fails the assert. Since the sub-second component isn't used in the double, just drop it and deal with whole-integer seconds. Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D21109 Modified: head/usr.sbin/autofs/autounmountd.c Modified: head/usr.sbin/autofs/autounmountd.c ============================================================================== --- head/usr.sbin/autofs/autounmountd.c Thu Aug 8 03:01:35 2019 (r350736) +++ head/usr.sbin/autofs/autounmountd.c Thu Aug 8 03:16:32 2019 (r350737) @@ -179,12 +179,12 @@ unmount_by_fsid(const fsid_t fsid, const char *mountpo return (error); } -static double -expire_automounted(double expiration_time) +static time_t +expire_automounted(time_t expiration_time) { struct automounted_fs *af, *tmpaf; time_t now; - double mounted_for, mounted_max = -1.0; + time_t mounted_for, mounted_max = -1; int error; now = time(NULL); @@ -196,9 +196,9 @@ expire_automounted(double expiration_time) if (mounted_for < expiration_time) { log_debugx("skipping %s (FSID:%d:%d), mounted " - "for %.0f seconds", af->af_mountpoint, + "for %ld seconds", af->af_mountpoint, af->af_fsid.val[0], af->af_fsid.val[1], - mounted_for); + (long)mounted_for); if (mounted_for > mounted_max) mounted_max = mounted_for; @@ -207,9 +207,9 @@ expire_automounted(double expiration_time) } log_debugx("filesystem mounted on %s (FSID:%d:%d), " - "was mounted for %.0f seconds; unmounting", + "was mounted for %ld seconds; unmounting", af->af_mountpoint, af->af_fsid.val[0], af->af_fsid.val[1], - mounted_for); + (long)mounted_for); error = unmount_by_fsid(af->af_fsid, af->af_mountpoint); if (error != 0) { if (mounted_for > mounted_max) @@ -229,18 +229,19 @@ usage_autounmountd(void) } static void -do_wait(int kq, double sleep_time) +do_wait(int kq, time_t sleep_time) { struct timespec timeout; struct kevent unused; int nevents; - if (sleep_time != -1.0) { - assert(sleep_time > 0.0); + if (sleep_time != -1) { + assert(sleep_time > 0); timeout.tv_sec = sleep_time; timeout.tv_nsec = 0; - log_debugx("waiting for filesystem event for %.0f seconds", sleep_time); + log_debugx("waiting for filesystem event for %ld seconds", + (long)sleep_time); nevents = kevent(kq, NULL, 0, &unused, 1, &timeout); } else { log_debugx("waiting for filesystem event"); @@ -254,7 +255,7 @@ do_wait(int kq, double sleep_time) if (nevents == 0) { log_debugx("timeout reached"); - assert(sleep_time > 0.0); + assert(sleep_time > 0); } else { log_debugx("got filesystem event"); } @@ -268,7 +269,7 @@ main_autounmountd(int argc, char **argv) pid_t otherpid; const char *pidfile_path = AUTOUNMOUNTD_PIDFILE; int ch, debug = 0, error, kq; - double expiration_time = 600, retry_time = 600, mounted_max, sleep_time; + time_t expiration_time = 600, retry_time = 600, mounted_max, sleep_time; bool dont_daemonize = false; while ((ch = getopt(argc, argv, "dr:t:v")) != -1) { @@ -336,17 +337,17 @@ main_autounmountd(int argc, char **argv) for (;;) { refresh_automounted(); mounted_max = expire_automounted(expiration_time); - if (mounted_max == -1.0) { + if (mounted_max == -1) { sleep_time = mounted_max; log_debugx("no filesystems to expire"); } else if (mounted_max < expiration_time) { sleep_time = difftime(expiration_time, mounted_max); - log_debugx("some filesystems expire in %.0f seconds", - sleep_time); + log_debugx("some filesystems expire in %ld seconds", + (long)sleep_time); } else { sleep_time = retry_time; log_debugx("some expired filesystems remain mounted, " - "will retry in %.0f seconds", sleep_time); + "will retry in %ld seconds", (long)sleep_time); } do_wait(kq, sleep_time); From owner-svn-src-all@freebsd.org Thu Aug 8 03:18:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67ECBC206B; Thu, 8 Aug 2019 03:18:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463tqw22Lfz3HCN; Thu, 8 Aug 2019 03:18:36 +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 279511ECBC; Thu, 8 Aug 2019 03:18:36 +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 x783Iac9070184; Thu, 8 Aug 2019 03:18:36 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x783Iabd070183; Thu, 8 Aug 2019 03:18:36 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908080318.x783Iabd070183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 8 Aug 2019 03:18:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350738 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 350738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 03:18:36 -0000 Author: jhibbits Date: Thu Aug 8 03:18:35 2019 New Revision: 350738 URL: https://svnweb.freebsd.org/changeset/base/350738 Log: powerpc/pmap: Minor optimizations to 64-bit booke pmap Don't recalculate the VM page of the page table pages, just pass them down to free. Also, use the pmap's page zero function instead of bzero(). Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Aug 8 03:16:32 2019 (r350737) +++ head/sys/powerpc/booke/pmap.c Thu Aug 8 03:18:35 2019 (r350738) @@ -264,7 +264,7 @@ static int pv_entry_count = 0, pv_entry_max = 0, pv_en #ifdef __powerpc64__ static pte_t *ptbl_alloc(mmu_t, pmap_t, pte_t **, unsigned int, boolean_t); -static void ptbl_free(mmu_t, pmap_t, pte_t **, unsigned int); +static void ptbl_free(mmu_t, pmap_t, pte_t **, unsigned int, vm_page_t); static void ptbl_hold(mmu_t, pmap_t, pte_t **, unsigned int); static int ptbl_unhold(mmu_t, pmap_t, vm_offset_t); #else @@ -615,19 +615,16 @@ pdir_alloc(mmu_t mmu, pmap_t pmap, unsigned int pp2d_i /* Zero whole ptbl. */ pdir = (pte_t **)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - bzero(pdir, PAGE_SIZE); + mmu_booke_zero_page(mmu, m); return (pdir); } /* Free pdir pages and invalidate pdir entry. */ static void -pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_idx) +pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_idx, vm_page_t m) { pte_t **pdir; - vm_paddr_t pa; - vm_offset_t va; - vm_page_t m; pdir = pmap->pm_pp2d[pp2d_idx]; @@ -635,9 +632,6 @@ pdir_free(mmu_t mmu, pmap_t pmap, unsigned int pp2d_id pmap->pm_pp2d[pp2d_idx] = NULL; - va = (vm_offset_t) pdir; - pa = DMAP_TO_PHYS(va); - m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); } @@ -667,7 +661,7 @@ pdir_unhold(mmu_t mmu, pmap_t pmap, u_int pp2d_idx) * Free pdir page if there are no dir entries in this pdir. */ if (vm_page_unwire_noq(m)) { - pdir_free(mmu, pmap, pp2d_idx); + pdir_free(mmu, pmap, pp2d_idx, m); return (1); } return (0); @@ -717,19 +711,16 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsi /* Zero whole ptbl. */ ptbl = (pte_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - bzero(ptbl, PAGE_SIZE); + mmu_booke_zero_page(mmu, m); return (ptbl); } /* Free ptbl pages and invalidate pdir entry. */ static void -ptbl_free(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsigned int pdir_idx) +ptbl_free(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsigned int pdir_idx, vm_page_t m) { pte_t *ptbl; - vm_paddr_t pa; - vm_offset_t va; - vm_page_t m; ptbl = pdir[pdir_idx]; @@ -737,9 +728,6 @@ ptbl_free(mmu_t mmu, pmap_t pmap, pte_t ** pdir, unsig pdir[pdir_idx] = NULL; - va = (vm_offset_t) ptbl; - pa = DMAP_TO_PHYS(va); - m = PHYS_TO_VM_PAGE(pa); vm_page_free_zero(m); } @@ -776,7 +764,7 @@ ptbl_unhold(mmu_t mmu, pmap_t pmap, vm_offset_t va) * last page. */ if (vm_page_unwire_noq(m)) { - ptbl_free(mmu, pmap, pdir, pdir_idx); + ptbl_free(mmu, pmap, pdir, pdir_idx, m); pdir_unhold(mmu, pmap, pp2d_idx); return (1); } From owner-svn-src-all@freebsd.org Thu Aug 8 03:27:47 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65725C230B; Thu, 8 Aug 2019 03:27:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463v2W1yb5z3Hgs; Thu, 8 Aug 2019 03:27:47 +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 260391EE8E; Thu, 8 Aug 2019 03:27:47 +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 x783Rlff075979; Thu, 8 Aug 2019 03:27:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x783Rkfr075978; Thu, 8 Aug 2019 03:27:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908080327.x783Rkfr075978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 03:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350739 - in head: share/mk sys/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/mk sys/conf X-SVN-Commit-Revision: 350739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 03:27:47 -0000 Author: cem Date: Thu Aug 8 03:27:46 2019 New Revision: 350739 URL: https://svnweb.freebsd.org/changeset/base/350739 Log: Disable useless -Wformat-zero-length It is part of -Wformat, which is enabled by -Wall. Empty format strings are well defined and it is perfectly reasonable to expect them in a formatting interface. Modified: head/share/mk/bsd.sys.mk head/sys/conf/kern.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Aug 8 03:18:35 2019 (r350738) +++ head/share/mk/bsd.sys.mk Thu Aug 8 03:27:46 2019 (r350739) @@ -186,6 +186,9 @@ FORMAT_EXTENSIONS= -fformat-extensions CWARNFLAGS+= -Wno-unknown-pragmas .endif # IGNORE_PRAGMA +# This warning is utter nonsense +CWARNFLAGS+= -Wno-format-zero-length + # We need this conditional because many places that use it # only enable it for some files with CLFAGS.$FILE+=${CLANG_NO_IAS}. # unconditionally, and can't easily use the CFLAGS.clang= Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Thu Aug 8 03:18:35 2019 (r350738) +++ head/sys/conf/kern.mk Thu Aug 8 03:27:46 2019 (r350739) @@ -61,8 +61,7 @@ CWARNEXTRA?= -Wno-error=address \ CWARNEXTRA+= -Wno-error=misleading-indentation \ -Wno-error=nonnull-compare \ -Wno-error=shift-overflow \ - -Wno-error=tautological-compare \ - -Wno-format-zero-length + -Wno-error=tautological-compare .endif .if ${COMPILER_VERSION} >= 70200 CWARNEXTRA+= -Wno-error=memset-elt-size @@ -79,6 +78,9 @@ NO_WCAST_QUAL= -Wno-cast-qual NO_WNONNULL= -Wno-nonnull .endif .endif + +# This warning is utter nonsense +CWARNFLAGS+= -Wno-format-zero-length # External compilers may not support our format extensions. Allow them # to be disabled. WARNING: format checking is disabled in this case. From owner-svn-src-all@freebsd.org Thu Aug 8 04:29:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6370C2DE5; Thu, 8 Aug 2019 04:29:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463wQ24rfLz3KqP; Thu, 8 Aug 2019 04:29:46 +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 84E731F9A7; Thu, 8 Aug 2019 04:29:46 +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 x784TkQ1011460; Thu, 8 Aug 2019 04:29:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x784Tk2O011459; Thu, 8 Aug 2019 04:29:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908080429.x784Tk2O011459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 04:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350740 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 350740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 04:29:46 -0000 Author: cem Date: Thu Aug 8 04:29:46 2019 New Revision: 350740 URL: https://svnweb.freebsd.org/changeset/base/350740 Log: r350739 try #2 For some inexplicable reason, C++ compilers reject the -Wno- flag, and also (ab)use CWARNFLAGS. Reported by: imp Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Aug 8 03:27:46 2019 (r350739) +++ head/share/mk/bsd.sys.mk Thu Aug 8 04:29:46 2019 (r350740) @@ -187,7 +187,7 @@ CWARNFLAGS+= -Wno-unknown-pragmas .endif # IGNORE_PRAGMA # This warning is utter nonsense -CWARNFLAGS+= -Wno-format-zero-length +CFLAGS+= -Wno-format-zero-length # We need this conditional because many places that use it # only enable it for some files with CLFAGS.$FILE+=${CLANG_NO_IAS}. From owner-svn-src-all@freebsd.org Thu Aug 8 06:26:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D50C3C4A9A; Thu, 8 Aug 2019 06:26:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463z0q5FSRz3PpF; Thu, 8 Aug 2019 06:26:35 +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 91F4420F30; Thu, 8 Aug 2019 06:26:35 +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 x786QZdL081447; Thu, 8 Aug 2019 06:26:35 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x786QZh9081445; Thu, 8 Aug 2019 06:26:35 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201908080626.x786QZh9081445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 8 Aug 2019 06:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350741 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 350741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 06:26:35 -0000 Author: alc Date: Thu Aug 8 06:26:34 2019 New Revision: 350741 URL: https://svnweb.freebsd.org/changeset/base/350741 Log: Ordinarily, during a superpage promotion or demotion within a pmap, the pmap's lock ensures that other operations on the pmap don't observe the old mapping being broken before the new mapping is established. However, pmap_kextract() doesn't acquire the kernel pmap's lock, so it may observe the broken mapping. And, if it does, it returns an incorrect result. This revision implements a lock-free solution to this problem in pmap_update_entry() and pmap_kextract() because pmap_kextract() can't acquire the kernel pmap's lock. Reported by: andrew, greg_unrelenting.technology Reviewed by: andrew, markj Tested by: greg_unrelenting.technology X-MFC with: r350579 Differential Revision: https://reviews.freebsd.org/D21169 Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pte.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Aug 8 04:29:46 2019 (r350740) +++ head/sys/arm64/arm64/pmap.c Thu Aug 8 06:26:34 2019 (r350741) @@ -1128,40 +1128,35 @@ vm_paddr_t pmap_kextract(vm_offset_t va) { pt_entry_t *pte, tpte; - vm_paddr_t pa; - int lvl; - if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) { - pa = DMAP_TO_PHYS(va); - } else { - pa = 0; - pte = pmap_pte(kernel_pmap, va, &lvl); - if (pte != NULL) { - tpte = pmap_load(pte); - pa = tpte & ~ATTR_MASK; - switch(lvl) { - case 1: - KASSERT((tpte & ATTR_DESCR_MASK) == L1_BLOCK, - ("pmap_kextract: Invalid L1 pte found: %lx", - tpte & ATTR_DESCR_MASK)); - pa |= (va & L1_OFFSET); - break; - case 2: - KASSERT((tpte & ATTR_DESCR_MASK) == L2_BLOCK, - ("pmap_kextract: Invalid L2 pte found: %lx", - tpte & ATTR_DESCR_MASK)); - pa |= (va & L2_OFFSET); - break; - case 3: - KASSERT((tpte & ATTR_DESCR_MASK) == L3_PAGE, - ("pmap_kextract: Invalid L3 pte found: %lx", - tpte & ATTR_DESCR_MASK)); - pa |= (va & L3_OFFSET); - break; - } - } - } - return (pa); + if (va >= DMAP_MIN_ADDRESS && va < DMAP_MAX_ADDRESS) + return (DMAP_TO_PHYS(va)); + pte = pmap_l1(kernel_pmap, va); + if (pte == NULL) + return (0); + + /* + * A concurrent pmap_update_entry() will clear the entry's valid bit + * but leave the rest of the entry unchanged. Therefore, we treat a + * non-zero entry as being valid, and we ignore the valid bit when + * determining whether the entry maps a block, page, or table. + */ + tpte = pmap_load(pte); + if (tpte == 0) + return (0); + if ((tpte & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_BLOCK) + return ((tpte & ~ATTR_MASK) | (va & L1_OFFSET)); + pte = pmap_l1_to_l2(&tpte, va); + tpte = pmap_load(pte); + if (tpte == 0) + return (0); + if ((tpte & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_BLOCK) + return ((tpte & ~ATTR_MASK) | (va & L2_OFFSET)); + pte = pmap_l2_to_l3(&tpte, va); + tpte = pmap_load(pte); + if (tpte == 0) + return (0); + return ((tpte & ~ATTR_MASK) | (va & L3_OFFSET)); } /*************************************************** @@ -3021,8 +3016,12 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent intr = intr_disable(); critical_enter(); - /* Clear the old mapping */ - pmap_clear(pte); + /* + * Clear the old mapping's valid bit, but leave the rest of the entry + * unchanged, so that a lockless, concurrent pmap_kextract() can still + * lookup the physical address. + */ + pmap_clear_bits(pte, ATTR_DESCR_VALID); pmap_invalidate_range_nopin(pmap, va, va + size); /* Create the new mapping */ Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Thu Aug 8 04:29:46 2019 (r350740) +++ head/sys/arm64/include/pte.h Thu Aug 8 06:26:34 2019 (r350741) @@ -71,7 +71,12 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define ATTR_DEFAULT (ATTR_AF | ATTR_SH(ATTR_SH_IS)) -#define ATTR_DESCR_MASK 3 +#define ATTR_DESCR_MASK 3 +#define ATTR_DESCR_VALID 1 +#define ATTR_DESCR_TYPE_MASK 2 +#define ATTR_DESCR_TYPE_TABLE 2 +#define ATTR_DESCR_TYPE_PAGE 2 +#define ATTR_DESCR_TYPE_BLOCK 0 /* Level 0 table, 512GiB per entry */ #define L0_SHIFT 39 From owner-svn-src-all@freebsd.org Thu Aug 8 06:27:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A314FC4B37; Thu, 8 Aug 2019 06:27:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463z243s2Cz3PxJ; Thu, 8 Aug 2019 06:27:40 +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 4C14B20F38; Thu, 8 Aug 2019 06:27:40 +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 x786Re1Q081538; Thu, 8 Aug 2019 06:27:40 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x786ReNW081537; Thu, 8 Aug 2019 06:27:40 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908080627.x786ReNW081537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 8 Aug 2019 06:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350742 - in head/sys: geom/uzip modules/geom/geom_uzip X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head/sys: geom/uzip modules/geom/geom_uzip X-SVN-Commit-Revision: 350742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 06:27:40 -0000 Author: delphij Date: Thu Aug 8 06:27:39 2019 New Revision: 350742 URL: https://svnweb.freebsd.org/changeset/base/350742 Log: Update geom_uzip to use new zlib: - Use new zlib headers; - Removed z_alloc and z_free to use the common sys/dev/zlib version. - Replace z_compressBound with compressBound from zlib. While there, limit LZMA CFLAGS to apply only for g_uzip_lzma.c. PR: 229763 Submitted by: Yoshihiro Ota (with changes, bugs are mine) Differential Revision: https://reviews.freebsd.org/D20271 Modified: head/sys/geom/uzip/g_uzip_zlib.c head/sys/modules/geom/geom_uzip/Makefile Modified: head/sys/geom/uzip/g_uzip_zlib.c ============================================================================== --- head/sys/geom/uzip/g_uzip_zlib.c Thu Aug 8 06:26:34 2019 (r350741) +++ head/sys/geom/uzip/g_uzip_zlib.c Thu Aug 8 06:27:39 2019 (r350742) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include #include #include @@ -46,8 +47,6 @@ struct g_uzip_zlib { z_stream zs; }; -static void *z_alloc(void *, u_int, u_int); -static void z_free(void *, void *); static int g_uzip_zlib_rewind(struct g_uzip_dapi *, const char *); static void @@ -97,26 +96,17 @@ g_uzip_zlib_rewind(struct g_uzip_dapi *zpp, const char return (err); } -static int -z_compressBound(int len) -{ - - return (len + (len >> 12) + (len >> 14) + 11); -} - struct g_uzip_dapi * g_uzip_zlib_ctor(uint32_t blksz) { struct g_uzip_zlib *zp; - zp = malloc(sizeof(struct g_uzip_zlib), M_GEOM_UZIP, M_WAITOK); - zp->zs.zalloc = z_alloc; - zp->zs.zfree = z_free; + zp = malloc(sizeof(struct g_uzip_zlib), M_GEOM_UZIP, M_WAITOK | M_ZERO); if (inflateInit(&zp->zs) != Z_OK) { goto e1; } zp->blksz = blksz; - zp->pub.max_blen = z_compressBound(blksz); + zp->pub.max_blen = compressBound(blksz); zp->pub.decompress = &g_uzip_zlib_decompress; zp->pub.free = &g_uzip_zlib_free; zp->pub.rewind = &g_uzip_zlib_rewind; @@ -125,21 +115,4 @@ g_uzip_zlib_ctor(uint32_t blksz) e1: free(zp, M_GEOM_UZIP); return (NULL); -} - -static void * -z_alloc(void *nil, u_int type, u_int size) -{ - void *ptr; - - ptr = malloc(type * size, M_GEOM_UZIP, M_NOWAIT); - - return (ptr); -} - -static void -z_free(void *nil, void *ptr) -{ - - free(ptr, M_GEOM_UZIP); } Modified: head/sys/modules/geom/geom_uzip/Makefile ============================================================================== --- head/sys/modules/geom/geom_uzip/Makefile Thu Aug 8 06:26:34 2019 (r350741) +++ head/sys/modules/geom/geom_uzip/Makefile Thu Aug 8 06:27:39 2019 (r350742) @@ -10,7 +10,7 @@ SRCS+= g_uzip.h g_uzip_dapi.h g_uzip_lzma.h g_uzip_zli .PATH: ${SRCTOP}/sys/net -CFLAGS+= -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ +CFLAGS.g_uzip_lzma.c+= -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz/ SRCS+= opt_geom.h From owner-svn-src-all@freebsd.org Thu Aug 8 06:30:13 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81162C4BEE; Thu, 8 Aug 2019 06:30:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463z512tcQz3Q7C; Thu, 8 Aug 2019 06:30:13 +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 5936E20F57; Thu, 8 Aug 2019 06:30:13 +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 x786UDkN081739; Thu, 8 Aug 2019 06:30:13 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x786UDSt081738; Thu, 8 Aug 2019 06:30:13 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908080630.x786UDSt081738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 8 Aug 2019 06:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350743 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 350743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 06:30:13 -0000 Author: delphij Date: Thu Aug 8 06:30:12 2019 New Revision: 350743 URL: https://svnweb.freebsd.org/changeset/base/350743 Log: Update bxe(4) to use new zlib. PR: 229763 Submitted by: Yoshihiro Ota Differential Revision: https://reviews.freebsd.org/D21175 Modified: head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Thu Aug 8 06:27:39 2019 (r350742) +++ head/sys/dev/bxe/bxe.h Thu Aug 8 06:30:12 2019 (r350743) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include From owner-svn-src-all@freebsd.org Thu Aug 8 07:27:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C53E2C6274; Thu, 8 Aug 2019 07:27: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4640MV4pyZz3y7y; Thu, 8 Aug 2019 07:27: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 8737D21A46; Thu, 8 Aug 2019 07:27: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 x787Rodu017074; Thu, 8 Aug 2019 07:27:50 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x787RofB017071; Thu, 8 Aug 2019 07:27:50 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201908080727.x787RofB017071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 8 Aug 2019 07:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350744 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 07:27:50 -0000 Author: delphij Date: Thu Aug 8 07:27:49 2019 New Revision: 350744 URL: https://svnweb.freebsd.org/changeset/base/350744 Log: Convert DDB_CTF to use newer version of ZLIB. PR: 229763 Submitted by: Yoshihiro Ota Differential Revision: https://reviews.freebsd.org/D21176 Modified: head/sys/kern/kern_ctf.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Thu Aug 8 06:30:12 2019 (r350743) +++ head/sys/kern/kern_ctf.c Thu Aug 8 07:27:49 2019 (r350744) @@ -40,21 +40,7 @@ #define CTF_HDR_STRLEN_U32 8 #ifdef DDB_CTF -static void * -z_alloc(void *nil, u_int items, u_int size) -{ - void *ptr; - - ptr = malloc(items * size, M_TEMP, M_NOWAIT); - return ptr; -} - -static void -z_free(void *nil, void *ptr) -{ - free(ptr, M_TEMP); -} - +#include #endif static int @@ -269,8 +255,6 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) /* Initialise the zlib structure. */ bzero(&zs, sizeof(zs)); - zs.zalloc = z_alloc; - zs.zfree = z_free; if (inflateInit(&zs) != Z_OK) { error = EIO; Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Thu Aug 8 06:30:12 2019 (r350743) +++ head/sys/kern/link_elf.c Thu Aug 8 07:27:49 2019 (r350744) @@ -67,10 +67,6 @@ __FBSDID("$FreeBSD$"); #include -#ifdef DDB_CTF -#include -#endif - #include "linker_if.h" #define MAXSEGS 4 Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Thu Aug 8 06:30:12 2019 (r350743) +++ head/sys/kern/link_elf_obj.c Thu Aug 8 07:27:49 2019 (r350744) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef DDB_CTF -#include +#include #endif #include "linker_if.h" From owner-svn-src-all@freebsd.org Thu Aug 8 08:23:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E471C7773; Thu, 8 Aug 2019 08:23:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4641bh0wZdz41fZ; Thu, 8 Aug 2019 08:23:28 +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 018A422572; Thu, 8 Aug 2019 08:23:28 +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 x788NR87051934; Thu, 8 Aug 2019 08:23:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x788NRb6051933; Thu, 8 Aug 2019 08:23:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201908080823.x788NRb6051933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 8 Aug 2019 08:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350745 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 350745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 08:23:28 -0000 Author: tuexen Date: Thu Aug 8 08:23:27 2019 New Revision: 350745 URL: https://svnweb.freebsd.org/changeset/base/350745 Log: Fix a typo. Submitted by: Thomas Dreibholz MFC after: 1 week Modified: head/sys/netinet/sctp_asconf.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Aug 8 07:27:49 2019 (r350744) +++ head/sys/netinet/sctp_asconf.c Thu Aug 8 08:23:27 2019 (r350745) @@ -1366,7 +1366,7 @@ sctp_asconf_queue_add(struct sctp_tcb *stcb, struct sc if (sctp_asconf_queue_mgmt(stcb, stcb->asoc.asconf_addr_del_pending, SCTP_DEL_IP_ADDRESS) == 0) { - SCTPDBG(SCTP_DEBUG_ASCONF2, "asconf_queue_add: queing pending delete\n"); + SCTPDBG(SCTP_DEBUG_ASCONF2, "asconf_queue_add: queuing pending delete\n"); pending_delete_queued = 1; /* clear out the pending delete info */ stcb->asoc.asconf_del_pending = 0; From owner-svn-src-all@freebsd.org Thu Aug 8 09:42:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D2ADC968A; Thu, 8 Aug 2019 09:42:58 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4643MQ0K4nz45cx; Thu, 8 Aug 2019 09:42:58 +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 C76E423414; Thu, 8 Aug 2019 09:42:57 +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 x789gvMR098962; Thu, 8 Aug 2019 09:42:57 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x789gvWU098961; Thu, 8 Aug 2019 09:42:57 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201908080942.x789gvWU098961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 8 Aug 2019 09:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350746 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 350746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 09:42:58 -0000 Author: bz Date: Thu Aug 8 09:42:57 2019 New Revision: 350746 URL: https://svnweb.freebsd.org/changeset/base/350746 Log: frag6.c: initial comment and whitespace cleanup. Cleanup some comments (start with upper case, ends in punctuation, use width and do not consume vertical space). Update comments to RFC8200. Some whitespace changes. No functional changes. MFC after: 3 months Sponsored by: Netflix Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Thu Aug 8 08:23:27 2019 (r350745) +++ head/sys/netinet6/frag6.c Thu Aug 8 09:42:57 2019 (r350746) @@ -60,16 +60,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* for ECN definitions */ -#include /* for ECN definitions */ +#include /* For ECN definitions. */ +#include /* For ECN definitions. */ #ifdef MAC #include #endif -/* - * Reassembly headers are stored in hash buckets. - */ +/* Reassembly headers are stored in hash buckets. */ #define IP6REASS_NHASH_LOG2 10 #define IP6REASS_NHASH (1 << IP6REASS_NHASH_LOG2) #define IP6REASS_HMASK (IP6REASS_NHASH - 1) @@ -211,8 +209,7 @@ ip6_deletefraghdr(struct mbuf *m, int offset, int wait } /* - * Free a fragment reassembly header and all - * associated datagrams. + * Free a fragment reassembly header and all associated datagrams. */ static void frag6_freef(struct ip6q *q6, uint32_t bucket) @@ -235,17 +232,18 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) if (af6->ip6af_off == 0) { struct ip6_hdr *ip6; - /* adjust pointer */ + /* Adjust pointer. */ ip6 = mtod(m, struct ip6_hdr *); - /* restore source and destination addresses */ + /* Restore source and destination addresses. */ ip6->ip6_src = q6->ip6q_src; ip6->ip6_dst = q6->ip6q_dst; icmp6_error(m, ICMP6_TIME_EXCEEDED, - ICMP6_TIME_EXCEED_REASSEMBLY, 0); + ICMP6_TIME_EXCEED_REASSEMBLY, 0); } else m_freem(m); + free(af6, M_FRAG6); } frag6_remque(q6, bucket); @@ -258,27 +256,27 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) } /* - * In RFC2460, fragment and reassembly rule do not agree with each other, - * in terms of next header field handling in fragment header. + * Like in RFC2460, in RFC8200, fragment and reassembly rules do not agree with + * each other, in terms of next header field handling in fragment header. * While the sender will use the same value for all of the fragmented packets, - * receiver is suggested not to check the consistency. + * receiver is suggested not to check for consistency. * - * fragment rule (p20): - * (2) A Fragment header containing: - * The Next Header value that identifies the first header of - * the Fragmentable Part of the original packet. + * Fragment rules (p18,p19): + * (2) A Fragment header containing: + * The Next Header value that identifies the first header + * after the Per-Fragment headers of the original packet. * -> next header field is same for all fragments * - * reassembly rule (p21): - * The Next Header field of the last header of the Unfragmentable - * Part is obtained from the Next Header field of the first + * Reassembly rule (p20): + * The Next Header field of the last header of the Per-Fragment + * headers is obtained from the Next Header field of the first * fragment's Fragment header. * -> should grab it from the first fragment only * * The following note also contradicts with fragment rule - no one is going to * send different fragment with different next header field. * - * additional note (p22): + * Additional note (p22) [not an error]: * The Next Header values in the Fragment headers of different * fragments of the same original packet may differ. Only the value * from the Offset zero fragment packet is used for reassembly. @@ -287,7 +285,7 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) * There is no explicit reason given in the RFC. Historical reason maybe? */ /* - * Fragment input + * Fragment input. */ int frag6_input(struct mbuf **mp, int *offp, int proto) @@ -322,13 +320,14 @@ frag6_input(struct mbuf **mp, int *offp, int proto) #endif dstifp = NULL; - /* find the destination interface of the packet. */ + /* Find the destination interface of the packet. */ ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); if (ia != NULL) { dstifp = ia->ia_ifp; ifa_free(&ia->ia_ifa); } - /* jumbo payload can't contain a fragment header */ + + /* Jumbo payload cannot contain a fragment header. */ if (ip6->ip6_plen == 0) { icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset); in6_ifstat_inc(dstifp, ifs6_reass_fail); @@ -336,8 +335,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } /* - * check whether fragment packet's fragment length is - * multiple of 8 octets. + * Check whether fragment packet's fragment length is a + * multiple of 8 octets (unless it is the last one). * sizeof(struct ip6_frag) == 8 * sizeof(struct ip6_hdr) = 40 */ @@ -352,16 +351,17 @@ frag6_input(struct mbuf **mp, int *offp, int proto) IP6STAT_INC(ip6s_fragments); in6_ifstat_inc(dstifp, ifs6_reass_reqd); - /* offset now points to data portion */ + /* Offset now points to data portion. */ offset += sizeof(struct ip6_frag); /* * Handle "atomic" fragments (offset and m bit set to 0) upfront, - * unrelated to any reassembly (see RFC 6946 and section 4.5 of RFC - * 8200). Just skip the fragment header. + * unrelated to any reassembly. Still need to remove the frag hdr. + * See RFC 6946 and section 4.5 of RFC 8200. */ if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) { IP6STAT_INC(ip6s_atomicfrags); + /* XXX-BZ handle correctly. */ in6_ifstat_inc(dstifp, ifs6_reass_ok); *offp = offset; m->m_flags |= M_FRAGMENTED; @@ -378,6 +378,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) return IPPROTO_DONE; } + /* Generate a hash value for fragment bucket selection. */ hashkeyp = hashkey; memcpy(hashkeyp, &ip6->ip6_src, sizeof(struct in6_addr)); hashkeyp += sizeof(struct in6_addr) / sizeof(*hashkeyp); @@ -390,7 +391,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) IP6QB_LOCK(bucket); /* - * Enforce upper bound on number of fragments. + * Enforce upper bound on number of fragments for the entire system. * If maxfrag is 0, never accept fragments. * If maxfrag is -1, accept all fragments without limitation. */ @@ -410,9 +411,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto) break; if (q6 == head) { - /* - * the first fragment to arrive, create a reassembly queue. - */ + + /* The first fragment to arrive, create a reassembly queue. */ first_frag = 1; /* @@ -429,6 +429,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto) (u_int)V_ip6_maxfragpackets) goto dropfrag; atomic_add_int(&V_frag6_nfragpackets, 1); + + /* Allocate IPv6 fragement packet queue entry. */ q6 = (struct ip6q *)malloc(sizeof(struct ip6q), M_FRAG6, M_NOWAIT | M_ZERO); if (q6 == NULL) @@ -442,7 +444,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) #endif frag6_insque_head(q6, head, bucket); - /* ip6q_nxt will be filled afterwards, from 1st fragment */ + /* ip6q_nxt will be filled afterwards, from 1st fragment. */ q6->ip6q_down = q6->ip6q_up = (struct ip6asfrag *)q6; #ifdef notyet q6->ip6q_nxtp = (u_char *)nxtp; @@ -459,7 +461,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } /* - * If it's the 1st fragment, record the length of the + * If it is the 1st fragment, record the length of the * unfragmentable part and the next header of the fragment header. */ fragoff = ntohs(ip6f->ip6f_offlg & IP6F_OFF_MASK); @@ -491,7 +493,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) return (IPPROTO_DONE); } /* - * If it's the first fragment, do the above check for each + * If it is the first fragment, do the above check for each * fragment already stored in the reassembly queue. */ if (fragoff == 0) { @@ -505,11 +507,11 @@ frag6_input(struct mbuf **mp, int *offp, int proto) struct ip6_hdr *ip6err; int erroff = af6->ip6af_offset; - /* dequeue the fragment. */ + /* Dequeue the fragment. */ frag6_deq(af6, bucket); free(af6, M_FRAG6); - /* adjust pointer. */ + /* Adjust pointer. */ ip6err = mtod(merr, struct ip6_hdr *); /* @@ -527,6 +529,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) } } + /* Allocate an IPv6 fragement queue entry for this fragmented part. */ ip6af = (struct ip6asfrag *)malloc(sizeof(struct ip6asfrag), M_FRAG6, M_NOWAIT | M_ZERO); if (ip6af == NULL) @@ -542,10 +545,11 @@ frag6_input(struct mbuf **mp, int *offp, int proto) goto insert; } + /* Do duplicate, condition, and boundry checks. */ /* * Handle ECN by comparing this segment with the first one; * if CE is set, do not lose CE. - * drop if CE and not-ECT are mixed for the same packet. + * Drop if CE and not-ECT are mixed for the same packet. */ ecn = (ntohl(ip6->ip6_flow) >> 20) & IPTOS_ECN_MASK; ecn0 = q6->ip6q_ecn; @@ -562,9 +566,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) goto dropfrag; } - /* - * Find a segment which begins after this one does. - */ + /* Find a fragmented part which begins after this one does. */ for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = af6->ip6af_down) if (af6->ip6af_off > ip6af->ip6af_off) @@ -572,13 +574,11 @@ frag6_input(struct mbuf **mp, int *offp, int proto) /* * If the incoming framgent overlaps some existing fragments in - * the reassembly queue, drop it, since it is dangerous to override - * existing fragments from a security point of view. - * We don't know which fragment is the bad guy - here we trust - * fragment that came in earlier, with no real reason. - * - * Note: due to changes after disabling this part, mbuf passed to - * m_adj() below now does not meet the requirement. + * the reassembly queue, drop both the new fragment and the + * entire reassembly queue. However, if the new fragment + * is an exact duplicate of an existing fragment, only silently + * drop the existing fragment and leave the fragmentation queue + * unchanged, as allowed by the RFC. (RFC 8200, 4.5) */ if (af6->ip6af_up != (struct ip6asfrag *)q6) { i = af6->ip6af_up->ip6af_off + af6->ip6af_up->ip6af_frglen @@ -603,11 +603,9 @@ insert: #endif /* - * 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. + * 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. */ frag6_enq(ip6af, af6->ip6af_up, bucket); atomic_add_int(&frag6_nfrags, 1); @@ -634,9 +632,7 @@ insert: return IPPROTO_DONE; } - /* - * Reassembly is complete; concatenate fragments. - */ + /* Reassembly is complete; concatenate fragments. */ ip6af = q6->ip6q_down; t = m = IP6_REASS_MBUF(ip6af); af6 = ip6af->ip6af_down; @@ -662,7 +658,7 @@ insert: m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); - /* adjust offset to point where the original next header starts */ + /* Adjust offset to point where the original next header starts. */ offset = ip6af->ip6af_offset - sizeof(struct ip6_frag); free(ip6af, M_FRAG6); ip6 = mtod(m, struct ip6_hdr *); @@ -683,9 +679,7 @@ insert: goto dropfrag; } - /* - * Store NXT to the original. - */ + /* Set nxt(-hdr field value) to the original value. */ m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), (caddr_t)&nxt); @@ -723,17 +717,12 @@ insert: in6_ifstat_inc(dstifp, ifs6_reass_ok); #ifdef RSS - /* - * Queue/dispatch for reprocessing. - */ + /* Queue/dispatch for reprocessing. */ netisr_dispatch(NETISR_IPV6_DIRECT, m); return IPPROTO_DONE; #endif - /* - * Tell launch routine the next header - */ - + /* Tell launch routine the next header. */ *mp = m; *offp = offset; @@ -749,8 +738,7 @@ insert: /* * IPv6 reassembling timer processing; - * if a timer expires on a reassembly - * queue, discard it. + * if a timer expires on a reassembly queue, discard it. */ void frag6_slowtimo(void) @@ -790,7 +778,7 @@ frag6_slowtimo(void) * 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 + * and do not enforce a limit when maxfragpackets * is negative. */ while ((V_ip6_maxfragpackets == 0 || @@ -828,6 +816,9 @@ frag6_slowtimo(void) VNET_LIST_RUNLOCK_NOSLEEP(); } +/* + * Eventhandler to adjust limits in case nmbclusters change. + */ static void frag6_change(void *tag) { From owner-svn-src-all@freebsd.org Thu Aug 8 09:47:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FAB2C97D4; Thu, 8 Aug 2019 09:47:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4643S46CZBz45qH; Thu, 8 Aug 2019 09:47:00 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x52b.google.com with SMTP id r26so7827785pgl.10; Thu, 08 Aug 2019 02:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Saln8UERDn2b8ucAEk6bPXGchYkzEQo2xHutO/Fgx5s=; b=oAzs6Z40o1Dxtv20VeUHeHk4Ct4KcUfNuFyZq2uyKy7blAwdr1uSDp4h/6NKXca21H lj1LijV3OyPRq0I867yOVkGR5rbPOmRjpknOirzOFGU0JRVZvD9KDqBML7jyLrZTAtJx LUZFMNMcMj8el+jVkC5lxVfMlvH0KBBtFnVFSu6cnMl5eZZdjBwEbUy8zRXa/cwr1ZAw pWZ1qKC6gCbfeZHt4v8FA208ltiln4clwaxeKF37Zb1Ydx96gOXGIeGo0bpsnCDIBy9Z nvHjiD3AUy1RiMKWjUq5k33Fd1FQCUV/X+WhQZn6QB4kVubl49ieKb5Mlo03/R/Do2vp lQ1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Saln8UERDn2b8ucAEk6bPXGchYkzEQo2xHutO/Fgx5s=; b=A06hzhi8Lh194dWMsXaYw/s5f39liO/5+Fo6nH6rHUHhejjeSHtb/cRk1VabGN8z/q Xyd8OLuoLK2TaVvQ3aIuk3mzATDKHFBABcANrDkkEq1tzwvT9BwiQdYFvXtZuUyd7PJw cKai8un80PnZ/qmwgwaAsxf4SsEyJ0K6QhhQgiHauMc1mN0lnpgJwJQ9gUdsQ1xRGmz9 FqCqBzGRXron0BzdZRHQfp9u8jWEW162kMjHSR6bSut0h4rNNqcj3o0kl7vc8RmsuXeO xfW67H5Dgk7Dc6+aWZCuMH5G9vG24KS54qmpTkdzc1LlHnc1W8q9H4kUgNb0AjIXYVWC NWAA== X-Gm-Message-State: APjAAAVdPJ63BI0JKEbLj+6B2C3GB992MTDNU406GbsOuSjmETqkTFy3 EUdlKopVou2jY2/foL9CCInurNeL3zQ= X-Google-Smtp-Source: APXvYqybaQR4hZwBBVAe2KaLqoT8MxOwi9OKJbMuNhwMdprUvMc8KCz72UyMm+WaYZUxbbHyVUrqsQ== X-Received: by 2002:a17:90a:25c8:: with SMTP id k66mr3129999pje.129.1565257618586; Thu, 08 Aug 2019 02:46:58 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id n185sm81530960pga.16.2019.08.08.02.46.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 02:46:57 -0700 (PDT) From: Enji Cooper Message-Id: <50736BCD-21A8-4E59-92F7-DBFE60E652DA@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r350512 - head/tests/sys/kern Date: Thu, 8 Aug 2019 02:46:56 -0700 In-Reply-To: Cc: Mark Johnston , src-committers , svn-src-all , svn-src-head@freebsd.org To: Li-Wen Hsu References: <201908011819.x71IJG0M076399@repo.freebsd.org> <20190807202732.GD1377@raichu> X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 4643S46CZBz45qH X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 09:47:01 -0000 > On Aug 7, 2019, at 2:04 PM, Li-Wen Hsu wrote: >=20 > On Thu, Aug 8, 2019 at 4:27 AM Mark Johnston > wrote: >>=20 >> On Thu, Aug 01, 2019 at 06:19:16PM +0000, Li-Wen Hsu wrote: >>> Author: lwhsu >>> Date: Thu Aug 1 18:19:16 2019 >>> New Revision: 350512 >>> URL: https://svnweb.freebsd.org/changeset/base/350512 >>>=20 >>> Log: >>> Only skip test cases sometimes failing in CI when they are running = in CI >>>=20 >>> Suggested by: jhb >>> Sponsored by: The FreeBSD Foundation >>=20 >> This seems to break running the tests manually; atf dies because the >> "ci" variable is not defined. I have to use an invocation like this = to >> avoid that: >>=20 >> $ kyua -v test_suites.FreeBSD.ci=3Dfalse test ptrace_test >>=20 >> I suspect that share/mk/suite.test.mk needs to be augmented somehow = to >> set this variable to "false" by default, so that the CI = infrastructure >> can override that. >=20 > Thanks for catching this! I feel that the better approach is using > function that gets this variable with default value, for keeping > things simple. This is the right API to use: atf_tc_get_config_var_as_bool_wd(tc, variable_name, default_value); Just set the default to `false`. HTH, -Enji= From owner-svn-src-all@freebsd.org Thu Aug 8 10:15:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79E05CA0BC; Thu, 8 Aug 2019 10:15:48 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46445J2h6Yz47Zv; Thu, 8 Aug 2019 10:15:48 +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 3DC45239BA; Thu, 8 Aug 2019 10:15:48 +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 x78AFmvj017041; Thu, 8 Aug 2019 10:15:48 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78AFmxh017040; Thu, 8 Aug 2019 10:15:48 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201908081015.x78AFmxh017040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 8 Aug 2019 10:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350747 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 350747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 10:15:48 -0000 Author: bz Date: Thu Aug 8 10:15:47 2019 New Revision: 350747 URL: https://svnweb.freebsd.org/changeset/base/350747 Log: frag6.c: cleanup varaibles and return statements. Consitently put () around return values. Do not assign variables at the time of variable declaration. Sort variables. Rename ia to ia6, remove/reuse some variables used only once or twice for temporary calculations. No functional changes intended. MFC after: 3 months Sponsored by: Netflix Modified: head/sys/netinet6/frag6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Thu Aug 8 09:42:57 2019 (r350746) +++ head/sys/netinet6/frag6.c Thu Aug 8 10:15:47 2019 (r350747) @@ -186,17 +186,20 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGBUCKETSIZE, int ip6_deletefraghdr(struct mbuf *m, int offset, int wait) { - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ip6_hdr *ip6; struct mbuf *t; /* Delete frag6 header. */ if (m->m_len >= offset + sizeof(struct ip6_frag)) { + /* This is the only possible case with !PULLDOWN_TEST. */ + ip6 = mtod(m, struct ip6_hdr *); bcopy(ip6, (char *)ip6 + sizeof(struct ip6_frag), offset); m->m_data += sizeof(struct ip6_frag); m->m_len -= sizeof(struct ip6_frag); } else { + /* This comes with no copy if the boundary is on cluster. */ if ((t = m_split(m, offset, wait)) == NULL) return (ENOMEM); @@ -214,14 +217,16 @@ ip6_deletefraghdr(struct mbuf *m, int offset, int wait static void frag6_freef(struct ip6q *q6, uint32_t bucket) { + struct ip6_hdr *ip6; struct ip6asfrag *af6, *down6; + struct mbuf *m; IP6QB_LOCK_ASSERT(bucket); for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = down6) { - struct mbuf *m = IP6_REASS_MBUF(af6); + m = IP6_REASS_MBUF(af6); down6 = af6->ip6af_down; frag6_deq(af6, bucket); @@ -230,7 +235,6 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) * Just free other fragments. */ if (af6->ip6af_off == 0) { - struct ip6_hdr *ip6; /* Adjust pointer. */ ip6 = mtod(m, struct ip6_hdr *); @@ -290,25 +294,28 @@ frag6_freef(struct ip6q *q6, uint32_t bucket) int frag6_input(struct mbuf **mp, int *offp, int proto) { - struct mbuf *m = *mp, *t; + struct ifnet *dstifp; + struct in6_ifaddr *ia6; struct ip6_hdr *ip6; struct ip6_frag *ip6f; 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 */ + struct ip6asfrag *af6, *af6dwn, *ip6af; + struct mbuf *m, *t; uint32_t hashkey[(sizeof(struct in6_addr) * 2 + sizeof(ip6f->ip6f_ident)) / sizeof(uint32_t)]; uint32_t bucket, *hashkeyp; - struct ifnet *dstifp; - u_int8_t ecn, ecn0; + int fragoff, frgpartlen; /* Must be larger than uint16_t. */ + int nxt, offset, plen; + uint8_t ecn, ecn0; + bool only_frag; #ifdef RSS - struct m_tag *mtag; struct ip6_direct_ctx *ip6dc; + struct m_tag *mtag; #endif + m = *mp; + offset = *offp; + ip6 = mtod(m, struct ip6_hdr *); #ifndef PULLDOWN_TEST IP6_EXTHDR_CHECK(m, offset, sizeof(struct ip6_frag), IPPROTO_DONE); @@ -321,17 +328,17 @@ frag6_input(struct mbuf **mp, int *offp, int proto) dstifp = NULL; /* Find the destination interface of the packet. */ - ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); - if (ia != NULL) { - dstifp = ia->ia_ifp; - ifa_free(&ia->ia_ifa); + ia6 = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); + if (ia6 != NULL) { + dstifp = ia6->ia_ifp; + ifa_free(&ia6->ia_ifa); } /* Jumbo payload cannot contain a fragment header. */ if (ip6->ip6_plen == 0) { icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset); in6_ifstat_inc(dstifp, ifs6_reass_fail); - return IPPROTO_DONE; + return (IPPROTO_DONE); } /* @@ -345,7 +352,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offsetof(struct ip6_hdr, ip6_plen)); in6_ifstat_inc(dstifp, ifs6_reass_fail); - return IPPROTO_DONE; + return (IPPROTO_DONE); } IP6STAT_INC(ip6s_fragments); @@ -375,7 +382,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) offsetof(struct ip6_hdr, ip6_plen)); in6_ifstat_inc(dstifp, ifs6_reass_fail); IP6STAT_INC(ip6s_fragdropped); - return IPPROTO_DONE; + return (IPPROTO_DONE); } /* Generate a hash value for fragment bucket selection. */ @@ -410,10 +417,11 @@ frag6_input(struct mbuf **mp, int *offp, int proto) ) break; + only_frag = false; if (q6 == head) { - /* The first fragment to arrive, create a reassembly queue. */ - first_frag = 1; + /* A first fragment to arrive creates a reassembly queue. */ + only_frag = true; /* * Enforce upper bound on number of fragmented packets @@ -503,10 +511,13 @@ frag6_input(struct mbuf **mp, int *offp, int proto) if (q6->ip6q_unfrglen + af6->ip6af_off + af6->ip6af_frglen > IPV6_MAXPACKET) { - struct mbuf *merr = IP6_REASS_MBUF(af6); struct ip6_hdr *ip6err; - int erroff = af6->ip6af_offset; + struct mbuf *merr; + int erroff; + merr = IP6_REASS_MBUF(af6); + erroff = af6->ip6af_offset; + /* Dequeue the fragment. */ frag6_deq(af6, bucket); free(af6, M_FRAG6); @@ -540,7 +551,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) ip6af->ip6af_offset = offset; IP6_REASS_MBUF(ip6af) = m; - if (first_frag) { + if (only_frag) { af6 = (struct ip6asfrag *)q6; goto insert; } @@ -581,16 +592,15 @@ frag6_input(struct mbuf **mp, int *offp, int proto) * unchanged, as allowed by the RFC. (RFC 8200, 4.5) */ if (af6->ip6af_up != (struct ip6asfrag *)q6) { - i = af6->ip6af_up->ip6af_off + af6->ip6af_up->ip6af_frglen - - ip6af->ip6af_off; - if (i > 0) { + if (af6->ip6af_up->ip6af_off + af6->ip6af_up->ip6af_frglen - + ip6af->ip6af_off > 0) { free(ip6af, M_FRAG6); goto dropfrag; } } if (af6 != (struct ip6asfrag *)q6) { - i = (ip6af->ip6af_off + ip6af->ip6af_frglen) - af6->ip6af_off; - if (i > 0) { + if (ip6af->ip6af_off + ip6af->ip6af_frglen - + af6->ip6af_off > 0) { free(ip6af, M_FRAG6); goto dropfrag; } @@ -598,7 +608,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) insert: #ifdef MAC - if (!first_frag) + if (!only_frag) mac_ip6q_update(m, q6); #endif @@ -610,18 +620,18 @@ insert: frag6_enq(ip6af, af6->ip6af_up, bucket); atomic_add_int(&frag6_nfrags, 1); q6->ip6q_nfrag++; - next = 0; + plen = 0; for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6; af6 = af6->ip6af_down) { - if (af6->ip6af_off != next) { + if (af6->ip6af_off != plen) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag); frag6_freef(q6, bucket); } IP6QB_UNLOCK(bucket); - return IPPROTO_DONE; + return (IPPROTO_DONE); } - next += af6->ip6af_frglen; + plen += af6->ip6af_frglen; } if (af6->ip6af_up->ip6af_mff) { if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) { @@ -629,7 +639,7 @@ insert: frag6_freef(q6, bucket); } IP6QB_UNLOCK(bucket); - return IPPROTO_DONE; + return (IPPROTO_DONE); } /* Reassembly is complete; concatenate fragments. */ @@ -662,7 +672,7 @@ insert: offset = ip6af->ip6af_offset - sizeof(struct ip6_frag); free(ip6af, M_FRAG6); ip6 = mtod(m, struct ip6_hdr *); - ip6->ip6_plen = htons((u_short)next + offset - sizeof(struct ip6_hdr)); + ip6->ip6_plen = htons((u_short)plen + offset - sizeof(struct ip6_hdr)); if (q6->ip6q_ecn == IPTOS_ECN_CE) ip6->ip6_flow |= htonl(IPTOS_ECN_CE << 20); nxt = q6->ip6q_nxt; @@ -693,7 +703,8 @@ insert: atomic_subtract_int(&V_frag6_nfragpackets, 1); if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ - int plen = 0; + + plen = 0; for (t = m; t; t = t->m_next) plen += t->m_len; m->m_pkthdr.len = plen; @@ -719,21 +730,21 @@ insert: #ifdef RSS /* Queue/dispatch for reprocessing. */ netisr_dispatch(NETISR_IPV6_DIRECT, m); - return IPPROTO_DONE; + return (IPPROTO_DONE); #endif /* Tell launch routine the next header. */ *mp = m; *offp = offset; - return nxt; + return (nxt); - dropfrag: +dropfrag: IP6QB_UNLOCK(bucket); in6_ifstat_inc(dstifp, ifs6_reass_fail); IP6STAT_INC(ip6s_fragdropped); m_freem(m); - return IPPROTO_DONE; + return (IPPROTO_DONE); } /* From owner-svn-src-all@freebsd.org Thu Aug 8 10:55:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0AEFCAB18; Thu, 8 Aug 2019 10:55:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4644zV2GrGz49Gp; Thu, 8 Aug 2019 10:55:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 1922D3623A2; Thu, 8 Aug 2019 20:55:46 +1000 (AEST) Date: Thu, 8 Aug 2019 20:55:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350713 - head/sys/kern In-Reply-To: <201908080042.x780gThf078293@repo.freebsd.org> Message-ID: <20190808183733.O1073@besplex.bde.org> References: <201908080042.x780gThf078293@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=P6RKvmIu c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=s7fTf2Y6X_s07L22htsA:9 a=CjuIK1q_8ugA:10 X-Rspamd-Queue-Id: 4644zV2GrGz49Gp X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.76 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.76)[-0.757,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 10:55:50 -0000 On Thu, 8 Aug 2019, Conrad Meyer wrote: > Log: > ddb(4): Add 'sysctl' command > > Implement `sysctl` in `ddb` by overriding `SYSCTL_OUT`. When handling the > req, we install custom ddb in/out handlers. The out handler prints straight > to the debugger, while the in handler ignores all input. This is intended > to allow us to print just about any sysctl. > > There is a known issue when used from ddb(4) entered via 'sysctl > debug.kdb.enter=1'. The DDB mode does not quite prevent all lock > interactions, and it is possible for the recursive Giant lock to be unlocked > when the ddb(4) 'sysctl' command is used. This may result in a panic on > return from ddb(4) via 'c' (continue). Obviously, this is not a problem > when debugging already-paniced systems. Locking for kdb was grossly broken in r339917, by setting and unsetting the SCHEDULER_STOPPED() flag on entry and exit to kdb. This flag is only usable during panic() since when it is set all mutex operations potentially corrupt their mutex, and unsetting the flag doesn't undo the corruption. Many different types of corruption are possible, but my simplest example if like the one here for Giant, but for a spinlock. kdb runs happily while SCHEDULER_STOPPED() is set, but if it corrupts a mutex then the corruption is fatal later when SCHEDULER_STOPPED() is clear (setting SCHEDULER_STOPPED() breaks early detection of the corruption in most cases). kern_sysctl.c does only 1 pair of mutex calls. In sysctl_root_handle_locked(), it locks and unlocks Giant for the !MPSAFE case. If that is the only mutex call, then the problem is easy to fix by not making these calls if kdb_active. One of my versions of kdb asserts that no mutex calls are made if kdb_active. This makes it easy to find buggy mutex calls. Unfortunately, low-quality low level console drivers like vt make such calls unconditionally. I used this to avoid all the buggy calls in syscons (a typical error there was for to wander into wakeup or timeout code which uses mutexes. This was "fixed" by removing things like beeping for errors. The keyboard driver uses Giant fundamentally. This was "fixed" using the usual hack of not doing the mutex call if kdb_active). > ... > Modified: head/sys/kern/kern_sysctl.c > ============================================================================== > --- head/sys/kern/kern_sysctl.c Thu Aug 8 00:33:23 2019 (r350712) > +++ head/sys/kern/kern_sysctl.c Thu Aug 8 00:42:29 2019 (r350713) > ... > +/* > + * Run a sysctl handler with the DDB oldfunc and newfunc attached. > + * Instead of copying any output to a buffer we'll dump it right to > + * the console. > + */ > +static int > +db_sysctl(struct sysctl_oid *oidp, int *name, u_int namelen, > + void *old, size_t *oldlenp, size_t *retval, int flags) > +{ > + struct sysctl_req req; > + int error; > + > + /* Setup the request */ > + bzero(&req, sizeof req); > + req.td = kdb_thread; > + req.oldfunc = sysctl_old_ddb; > + req.newfunc = sysctl_new_ddb; > + req.lock = REQ_UNWIRED; > + if (oldlenp) { > + req.oldlen = *oldlenp; > + } > + req.validlen = req.oldlen; > + if (old) { > + req.oldptr = old; > + } > + > + /* Setup our globals for sysctl_old_ddb */ > + g_ddb_oid = oidp; > + g_ddb_sysctl_flags = flags; > + g_ddb_sysctl_printed = 0; This has many style bugs. So does the rest of the file. > + > + error = sysctl_root(0, name, namelen, &req); This makes invalid mutex calls for all !MPSAFE sysctls. Setting SCHEDULER_STOPPED() for kdb is only very broken for spin mutexes. Then for a contested mutex, mtx_lock_spin() ends up doing nothing except invalid lock and/or kdtrace profiling when it finds SCHEDULER_STOPPED() set. but mtx_unlock_spin() never checks SCHEDULER_STOPPED(), so it ends up corrupting the mutex and the spinlock state by attempting to unlock a mutex whose corresponding locking was not done. INVARIANTS causes similar bugs for recursed-on spin mutexes. Without INVARIANTS, everything is done inline without checking SCHEDULER_STOPPED(), so it works well enough in practice in uncontested non-recursive cases. With INVARIANTS, the null locking gives no increment of the recursion counter and no call to spinlock_enter(), but the non-null unlocking decrements the recursion counter and calls spinlock_exit(). For sleep mutexes, unlocking checks SCHEDULER_STOPPED() consistently with locking, so the bugs are smaller. The easiest way to demonstrate them is to configure INVARIANTS and WITNESS. Starting with Giant unheld, mtx_lock(&Giant) does nothing with the mutex except invalid lock and/or kdtrace profiling. mtx_unlock) calls __mtx_unlock_flags() which calls __mtx_assert(m, MA_OWNED), but this check is subverted by not doing it when SCHEDULER_STOPPED(). But before that, __mtx_unlock_flags() calls WITNESS_UNLOCK() and witness_unlock() is not similarly subverted. Also, WITNESS uses a critical spin mutex w_mtx, and this is corrupted as above. Bruce From owner-svn-src-all@freebsd.org Thu Aug 8 10:59:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67C18CAC2C; Thu, 8 Aug 2019 10:59:55 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46454C23s2z49Vg; Thu, 8 Aug 2019 10:59:55 +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 420FA240EF; Thu, 8 Aug 2019 10:59:55 +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 x78AxtIq040448; Thu, 8 Aug 2019 10:59:55 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Axsf0040447; Thu, 8 Aug 2019 10:59:54 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201908081059.x78Axsf0040447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 8 Aug 2019 10:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350748 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 350748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 10:59:55 -0000 Author: bz Date: Thu Aug 8 10:59:54 2019 New Revision: 350748 URL: https://svnweb.freebsd.org/changeset/base/350748 Log: frag6: move public structure into file local space. Move ip6asfrag and the accompanying IP6_REASS_MBUF macro from ip6_var.h into frag6.c as they are not used outside frag6.c. Sadly struct ip6q is all over the mac framework so we have to leave it public. This reduces the public KPI space. MFC after: 3 months X-MFC: possibly MFC the #define only to stable branches Sponsored by: Netflix Modified: head/sys/netinet6/frag6.c head/sys/netinet6/ip6_var.h Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Thu Aug 8 10:15:47 2019 (r350747) +++ head/sys/netinet6/frag6.c Thu Aug 8 10:59:54 2019 (r350748) @@ -86,6 +86,18 @@ struct ip6qbucket { int count; }; +struct ip6asfrag { + struct ip6asfrag *ip6af_down; + struct ip6asfrag *ip6af_up; + struct mbuf *ip6af_m; + int ip6af_offset; /* offset in ip6af_m to next header */ + int ip6af_frglen; /* fragmentable part length */ + int ip6af_off; /* fragment offset */ + u_int16_t ip6af_mff; /* more fragment bit in frag off */ +}; + +#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m)) + static MALLOC_DEFINE(M_FRAG6, "frag6", "IPv6 fragment reassembly header"); /* System wide (global) maximum and count of packets in reassembly queues. */ Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Thu Aug 8 10:15:47 2019 (r350747) +++ head/sys/netinet6/ip6_var.h Thu Aug 8 10:59:54 2019 (r350748) @@ -68,6 +68,7 @@ #include +struct ip6asfrag; /* * IP6 reassembly queue structure. Each fragment * being reassembled is attached to one of these structures. @@ -83,24 +84,9 @@ struct ip6q { struct ip6q *ip6q_next; struct ip6q *ip6q_prev; int ip6q_unfrglen; /* len of unfragmentable part */ -#ifdef notyet - u_char *ip6q_nxtp; -#endif int ip6q_nfrag; /* # of fragments */ struct label *ip6q_label; }; - -struct ip6asfrag { - struct ip6asfrag *ip6af_down; - struct ip6asfrag *ip6af_up; - struct mbuf *ip6af_m; - int ip6af_offset; /* offset in ip6af_m to next header */ - int ip6af_frglen; /* fragmentable part length */ - int ip6af_off; /* fragment offset */ - u_int16_t ip6af_mff; /* more fragment bit in frag off */ -}; - -#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m)) /* * IP6 reinjecting structure. From owner-svn-src-all@freebsd.org Thu Aug 8 11:43:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 298E8CBC70; Thu, 8 Aug 2019 11:43:10 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4646260LMQz4Cyp; Thu, 8 Aug 2019 11:43:10 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E233D24A21; Thu, 8 Aug 2019 11:43:09 +0000 (UTC) (envelope-from thj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78Bh9cI069980; Thu, 8 Aug 2019 11:43:09 GMT (envelope-from thj@FreeBSD.org) Received: (from thj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Bh9Cx069979; Thu, 8 Aug 2019 11:43:09 GMT (envelope-from thj@FreeBSD.org) Message-Id: <201908081143.x78Bh9Cx069979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: thj set sender to thj@FreeBSD.org using -f From: Tom Jones Date: Thu, 8 Aug 2019 11:43:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350749 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: thj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 350749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 11:43:10 -0000 Author: thj Date: Thu Aug 8 11:43:09 2019 New Revision: 350749 URL: https://svnweb.freebsd.org/changeset/base/350749 Log: Rename IPPROTO 33 from SEP to DCCP IPPROTO 33 is DCCP in the IANA Registry: https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml IPPROTO_SEP was added about 20 years ago in r33804. The entries were added straight from RFC1700, without regard to whether they were used. The reference in RFC1700 for SEP is '[JC120] ', this is an indication that the protocol number was probably in use in a private network. As RFC1700 is no longer the authoritative list of internet numbers and that IANA assinged 33 to DCCP in RFC4340, change the header to the actual authoritative source. Reviewed by: Richard Scheffenegger, bz Approved by: bz (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21178 Modified: head/sys/netinet/in.h Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Thu Aug 8 10:59:54 2019 (r350748) +++ head/sys/netinet/in.h Thu Aug 8 11:43:09 2019 (r350749) @@ -169,7 +169,7 @@ __END_DECLS #define IPPROTO_BLT 30 /* Bulk Data Transfer */ #define IPPROTO_NSP 31 /* Network Services */ #define IPPROTO_INP 32 /* Merit Internodal */ -#define IPPROTO_SEP 33 /* Sequential Exchange */ +#define IPPROTO_DCCP 33 /* Datagram Congestion Control Protocol */ #define IPPROTO_3PC 34 /* Third Party Connect */ #define IPPROTO_IDPR 35 /* InterDomain Policy Routing */ #define IPPROTO_XTP 36 /* XTP */ From owner-svn-src-all@freebsd.org Thu Aug 8 14:00:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D16A4CF79F for ; Thu, 8 Aug 2019 14:00:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46494N393Sz4MdM for ; Thu, 8 Aug 2019 14:00:20 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1565272819; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=kNDfYDUuioWp52cQcKSHJgpZsYgrFfptxia47iVxYGWhQTgQnhDStfAfjl7I4wunrB61Gw6V/qH75 fl2MsclPsr7vDFGjQYb16p2Zurvfsi0wwDLm6BN0KUg3cvg0ohtQLE/hJAthC2bqUO8BUNTKFS3J9R WRCBwMp1NlJb/lks7eUKk0UXaSb3Btoj9tNALvocRNHjFt5pKfwaaPM5GnXlmvdVtm0WteWNlGf/Mn EXuzlmodlfbHbJKps+ceR0Jl47Rg9FrXwO6uRhuvVamdkFMVbtmGPsO1uDNAkwUCss+owuIrAOGGWb /I/BLk3G9PMsYUu6ySGsMbV7TJHWgEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=8rC1AucEIp4ciCDtGzcTDhCSqgg78EwPkcKyjdoqtq4=; b=IsPPSJsQtUWXtdve4c3YJTPvvPzAks9JvPfR9n9lj/ryDv9aPbvPoC4NCP6mED7KmGg62HVMn1e8T MpYG6cWWVImJhdh6uuNlmFt3cTlra4ROOSXMKoWRlxzdEKR/EJZe/V8/+5TTqWX5RLbp4pqLWBZu1y GjkMYdn4Oke/GnSAqcy/+83OOT1zjykylHD+S37Wg8JcW7njzPXYT5bQ1tMvWSgJ6kpEgvHEtYahha dwb0wub4LGj7sVQrbMS8JShgbmXed8hEZP8HJEepum5dubF5v5qSeP3SxVbZlNC2Exm8OFTDPsMezS x+KdhXCGRgGQqzDwe2C39wYEgOSFosQ== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=8rC1AucEIp4ciCDtGzcTDhCSqgg78EwPkcKyjdoqtq4=; b=t3fcHj75oKoltBhmZEQvkP612M2tgX0EAwAhTSU9OEdL9LWUd0ASGztNkTFnLFSJivpuHSsvLDy8D Xduj35NSSy3g0tizVIPhnmybDHAZc+AvXl7/HOhOy8UMCAMtelBWiJBG4/JBZK0zKbzmw+oYVaq364 F6qZq/cz5YVA/TKNbtj5kQrj/SZi2NrAZlyvnXs/4QdgMghb74Txtd0HzB3s+pH4yJgFDZc4i6ii1g baFcyYtgtn4DfsR59HiKQN0U9VoO5pO91gWut6LUKcH+t7YHwB3SZtUjmRCfFSzoy1+F9yz328pYjx IGEeGpZ7cY9QCEgJw7sYwUtg9rHPy7g== X-MHO-RoutePath: aGlwcGll X-MHO-User: d99b2772-b9e4-11e9-85ec-13b9aae3a1d2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id d99b2772-b9e4-11e9-85ec-13b9aae3a1d2; Thu, 08 Aug 2019 14:00:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x78E0GE1029727; Thu, 8 Aug 2019 08:00:16 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <53d227e7f8535424c3abff229a41e9375b077dcc.camel@freebsd.org> Subject: Re: svn commit: r350737 - head/usr.sbin/autofs From: Ian Lepore To: Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 08 Aug 2019 08:00:16 -0600 In-Reply-To: <201908080316.x783GW3r070041@repo.freebsd.org> References: <201908080316.x783GW3r070041@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46494N393Sz4MdM X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 14:00:20 -0000 On Thu, 2019-08-08 at 03:16 +0000, Justin Hibbits wrote: > Author: jhibbits > Date: Thu Aug 8 03:16:32 2019 > New Revision: 350737 > URL: https://svnweb.freebsd.org/changeset/base/350737 > > Log: > Change autounmountd(8) to use time_t for duration instead of double > > Summary: > autounmountd(8) uses doubles to handle mount time durations. However, > it must convert to integer types, time_t in particular, to do anything > meaningful. Additionally, even though it's a floating-point value in > seconds, the sub-seconds component is never used, so it's unnecessary. > > Switching type to time_t fixes an assertion on powerpc64, which checks > that a sleep value that's not -1.0 is greater than 0. On powerpc64, it > happens that the value of -1.0 gets loaded as a float (perhaps a bug in > gcc), but gets compared to a double. This compares as false, so follows > through the 'sleep != -1.0' path, and fails the assert. Since the > sub-second component isn't used in the double, just drop it and deal > with whole-integer seconds. > > Reviewed by: trasz > Differential Revision: https://reviews.freebsd.org/D21109 > > Modified: > head/usr.sbin/autofs/autounmountd.c > > Modified: head/usr.sbin/autofs/autounmountd.c > ============================================================================== > --- head/usr.sbin/autofs/autounmountd.c Thu Aug 8 03:01:35 2019 (r350736) > +++ head/usr.sbin/autofs/autounmountd.c Thu Aug 8 03:16:32 2019 (r350737) > @@ -179,12 +179,12 @@ unmount_by_fsid(const fsid_t fsid, const char *mountpo > return (error); > } > > -static double > -expire_automounted(double expiration_time) > +static time_t > +expire_automounted(time_t expiration_time) > { > struct automounted_fs *af, *tmpaf; > time_t now; > - double mounted_for, mounted_max = -1.0; > + time_t mounted_for, mounted_max = -1; > int error; > > now = time(NULL); > @@ -196,9 +196,9 @@ expire_automounted(double expiration_time) > > if (mounted_for < expiration_time) { > log_debugx("skipping %s (FSID:%d:%d), mounted " > - "for %.0f seconds", af->af_mountpoint, > + "for %ld seconds", af->af_mountpoint, You can't print a time_t with %ld, it'll fail on 32-bit arches with 64- bit time_t. The usual incantation is %j and cast to intmax_t. -- Ian From owner-svn-src-all@freebsd.org Thu Aug 8 14:34:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7C24A8405; Thu, 8 Aug 2019 14:34:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4649rG3xYbz4PYd; Thu, 8 Aug 2019 14:34:54 +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 642622695F; Thu, 8 Aug 2019 14:34:54 +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 x78EYsrk070794; Thu, 8 Aug 2019 14:34:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78EYsdF070793; Thu, 8 Aug 2019 14:34:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201908081434.x78EYsdF070793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 8 Aug 2019 14:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350750 - head/sys/crypto/armv8 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/crypto/armv8 X-SVN-Commit-Revision: 350750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 14:34:54 -0000 Author: emaste Date: Thu Aug 8 14:34:53 2019 New Revision: 350750 URL: https://svnweb.freebsd.org/changeset/base/350750 Log: armv8crypto: add missing unlock for session (after r336439) Attempts to use cryptodev (e.g. tests at /usr/src/tests/sys/opencrypto with armv8crypto added to the module lists) were causing a panic. Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D21012 Modified: head/sys/crypto/armv8/armv8_crypto.c Modified: head/sys/crypto/armv8/armv8_crypto.c ============================================================================== --- head/sys/crypto/armv8/armv8_crypto.c Thu Aug 8 11:43:09 2019 (r350749) +++ head/sys/crypto/armv8/armv8_crypto.c Thu Aug 8 14:34:53 2019 (r350750) @@ -274,9 +274,11 @@ armv8_crypto_newsession(device_t dev, crypto_session_t error = armv8_crypto_cipher_setup(ses, encini); if (error != 0) { CRYPTDEB("setup failed"); + rw_wunlock(&sc->lock); return (error); } + rw_wunlock(&sc->lock); return (0); } From owner-svn-src-all@freebsd.org Thu Aug 8 15:11:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6859A912E; Thu, 8 Aug 2019 15:11:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Bfd5143z4RM8; Thu, 8 Aug 2019 15:11:37 +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 8D90926F68; Thu, 8 Aug 2019 15:11: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 x78FBbSi092154; Thu, 8 Aug 2019 15:11:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78FBb3u092153; Thu, 8 Aug 2019 15:11:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908081511.x78FBb3u092153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Aug 2019 15:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350751 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 350751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 15:11:37 -0000 Author: imp Date: Thu Aug 8 15:11:37 2019 New Revision: 350751 URL: https://svnweb.freebsd.org/changeset/base/350751 Log: Add TCP_RFC7413 We should be linting this This isn't enabled on all platforms, but compiles on them all. Noticed by: jhb in another review Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Aug 8 14:34:53 2019 (r350750) +++ head/sys/conf/NOTES Thu Aug 8 15:11:37 2019 (r350751) @@ -655,6 +655,7 @@ options ROUTETABLES=2 # allocated fibs up to 65536. # but that would be a bad idea as they are large. options TCP_OFFLOAD # TCP offload support. +options TCP_RFC7413 # TCP Fast Open options TCPHPTS From owner-svn-src-all@freebsd.org Thu Aug 8 15:30:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1D3FA9743; Thu, 8 Aug 2019 15:30:51 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464C4q5RYvz4SMK; Thu, 8 Aug 2019 15:30:51 +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 9C06E272C6; Thu, 8 Aug 2019 15:30:51 +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 x78FUpZK002333; Thu, 8 Aug 2019 15:30:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78FUnCn002325; Thu, 8 Aug 2019 15:30:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908081530.x78FUnCn002325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 15:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350752 - in vendor/zstd/dist: . doc examples lib lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy programs tests tests/fuzz tests/regression zlibWrapper X-SVN-Group: vendor X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in vendor/zstd/dist: . doc examples lib lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy programs tests tests/fuzz tests/regression zlibWrapper X-SVN-Commit-Revision: 350752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 15:30:51 -0000 Author: cem Date: Thu Aug 8 15:30:49 2019 New Revision: 350752 URL: https://svnweb.freebsd.org/changeset/base/350752 Log: import zstd 1.4.1 Added: vendor/zstd/dist/tests/bigdict.c (contents, props changed) vendor/zstd/dist/tests/fuzz/simple_compress.c (contents, props changed) vendor/zstd/dist/tests/fuzz/zstd_frame_info.c (contents, props changed) Deleted: vendor/zstd/dist/tests/fuzz/default.options Modified: vendor/zstd/dist/CHANGELOG vendor/zstd/dist/doc/zstd_compression_format.md vendor/zstd/dist/doc/zstd_manual.html vendor/zstd/dist/examples/Makefile vendor/zstd/dist/lib/Makefile vendor/zstd/dist/lib/common/compiler.h vendor/zstd/dist/lib/common/zstd_internal.h vendor/zstd/dist/lib/compress/zstd_compress.c vendor/zstd/dist/lib/compress/zstd_compress_internal.h vendor/zstd/dist/lib/compress/zstd_double_fast.c vendor/zstd/dist/lib/compress/zstd_fast.c vendor/zstd/dist/lib/compress/zstd_lazy.c vendor/zstd/dist/lib/compress/zstd_ldm.c vendor/zstd/dist/lib/compress/zstd_opt.c vendor/zstd/dist/lib/compress/zstdmt_compress.c vendor/zstd/dist/lib/compress/zstdmt_compress.h vendor/zstd/dist/lib/decompress/zstd_decompress.c vendor/zstd/dist/lib/decompress/zstd_decompress_block.c vendor/zstd/dist/lib/dictBuilder/cover.c vendor/zstd/dist/lib/dictBuilder/cover.h vendor/zstd/dist/lib/dictBuilder/fastcover.c vendor/zstd/dist/lib/dictBuilder/zdict.c vendor/zstd/dist/lib/dictBuilder/zdict.h vendor/zstd/dist/lib/legacy/zstd_legacy.h vendor/zstd/dist/lib/legacy/zstd_v01.c vendor/zstd/dist/lib/legacy/zstd_v02.c vendor/zstd/dist/lib/legacy/zstd_v03.c vendor/zstd/dist/lib/legacy/zstd_v04.c vendor/zstd/dist/lib/legacy/zstd_v05.c vendor/zstd/dist/lib/legacy/zstd_v06.c vendor/zstd/dist/lib/legacy/zstd_v07.c vendor/zstd/dist/lib/zstd.h vendor/zstd/dist/programs/.gitignore vendor/zstd/dist/programs/README.md vendor/zstd/dist/programs/benchfn.c vendor/zstd/dist/programs/fileio.c vendor/zstd/dist/programs/fileio.h vendor/zstd/dist/programs/util.c vendor/zstd/dist/programs/zstd.1 vendor/zstd/dist/programs/zstdcli.c vendor/zstd/dist/programs/zstdgrep vendor/zstd/dist/programs/zstdgrep.1 vendor/zstd/dist/programs/zstdless.1 vendor/zstd/dist/tests/.gitignore vendor/zstd/dist/tests/Makefile vendor/zstd/dist/tests/decodecorpus.c vendor/zstd/dist/tests/fullbench.c vendor/zstd/dist/tests/fuzz/Makefile vendor/zstd/dist/tests/fuzz/dictionary_decompress.c vendor/zstd/dist/tests/fuzz/fuzz.py vendor/zstd/dist/tests/fuzz/simple_decompress.c vendor/zstd/dist/tests/fuzzer.c vendor/zstd/dist/tests/paramgrill.c vendor/zstd/dist/tests/playTests.sh vendor/zstd/dist/tests/poolTests.c vendor/zstd/dist/tests/regression/results.csv vendor/zstd/dist/tests/zstreamtest.c vendor/zstd/dist/zlibWrapper/.gitignore Modified: vendor/zstd/dist/CHANGELOG ============================================================================== --- vendor/zstd/dist/CHANGELOG Thu Aug 8 15:11:37 2019 (r350751) +++ vendor/zstd/dist/CHANGELOG Thu Aug 8 15:30:49 2019 (r350752) @@ -1,3 +1,33 @@ +v1.4.1 +bug: Fix data corruption in niche use cases by @terrelln (#1659) +bug: Fuzz legacy modes, fix uncovered bugs by @terrelln (#1593, #1594, #1595) +bug: Fix out of bounds read by @terrelln (#1590) +perf: Improve decode speed by ~7% @mgrice (#1668) +perf: Slightly improved compression ratio of level 3 and 4 (ZSTD_dfast) by @cyan4973 (#1681) +perf: Slightly faster compression speed when re-using a context by @cyan4973 (#1658) +perf: Improve compression ratio for small windowLog by @cyan4973 (#1624) +perf: Faster compression speed in high compression mode for repetitive data by @terrelln (#1635) +api: Add parameter to generate smaller dictionaries by @tyler-tran (#1656) +cli: Recognize symlinks when built in C99 mode by @felixhandte (#1640) +cli: Expose cpu load indicator for each file on -vv mode by @ephiepark (#1631) +cli: Restrict read permissions on destination files by @chungy (#1644) +cli: zstdgrep: handle -f flag by @felixhandte (#1618) +cli: zstdcat: follow symlinks by @vejnar (#1604) +doc: Remove extra size limit on compressed blocks by @felixhandte (#1689) +doc: Fix typo by @yk-tanigawa (#1633) +doc: Improve documentation on streaming buffer sizes by @cyan4973 (#1629) +build: CMake: support building with LZ4 @leeyoung624 (#1626) +build: CMake: install zstdless and zstdgrep by @leeyoung624 (#1647) +build: CMake: respect existing uninstall target by @j301scott (#1619) +build: Make: skip multithread tests when built without support by @michaelforney (#1620) +build: Make: Fix examples/ test target by @sjnam (#1603) +build: Meson: rename options out of deprecated namespace by @lzutao (#1665) +build: Meson: fix build by @lzutao (#1602) +build: Visual Studio: don't export symbols in static lib by @scharan (#1650) +build: Visual Studio: fix linking by @absotively (#1639) +build: Fix MinGW-W64 build by @myzhang1029 (#1600) +misc: Expand decodecorpus coverage by @ephiepark (#1664) + v1.4.0 perf: Improve level 1 compression speed in most scenarios by 6% by @gbtucker and @terrelln api: Move the advanced API, including all functions in the staging section, to the stable section Modified: vendor/zstd/dist/doc/zstd_compression_format.md ============================================================================== --- vendor/zstd/dist/doc/zstd_compression_format.md Thu Aug 8 15:11:37 2019 (r350751) +++ vendor/zstd/dist/doc/zstd_compression_format.md Thu Aug 8 15:30:49 2019 (r350752) @@ -16,7 +16,7 @@ Distribution of this document is unlimited. ### Version -0.3.1 (25/10/18) +0.3.2 (17/07/19) Introduction @@ -390,9 +390,7 @@ A block can contain any number of bytes (even zero), u - Window_Size - 128 KB -A `Compressed_Block` has the extra restriction that `Block_Size` is always -strictly less than the decompressed size. -If this condition cannot be respected, +If this condition cannot be respected when generating a `Compressed_Block`, the block must be sent uncompressed instead (`Raw_Block`). @@ -1655,6 +1653,7 @@ or at least provide a meaningful error code explaining Version changes --------------- +- 0.3.2 : remove additional block size restriction on compressed blocks - 0.3.1 : minor clarification regarding offset history update rules - 0.3.0 : minor edits to match RFC8478 - 0.2.9 : clarifications for huffman weights direct representation, by Ulrich Kunitz Modified: vendor/zstd/dist/doc/zstd_manual.html ============================================================================== --- vendor/zstd/dist/doc/zstd_manual.html Thu Aug 8 15:11:37 2019 (r350751) +++ vendor/zstd/dist/doc/zstd_manual.html Thu Aug 8 15:30:49 2019 (r350752) @@ -1,46 +1,36 @@ -zstd 1.4.0 Manual +zstd 1.4.1 Manual -

zstd 1.4.0 Manual

+

zstd 1.4.1 Manual


Contents

  1. Introduction
  2. Version
  3. -
  4. Default constant
  5. -
  6. Constants
  7. -
  8. Simple API
  9. -
  10. Explicit context
  11. -
  12. Advanced compression API
  13. -
  14. Advanced decompression API
  15. -
  16. Streaming
  17. -
  18. Streaming compression - HowTo
  19. -
  20. This is a legacy streaming API, and can be replaced by ZSTD_CCtx_reset() and
  21. -
  22. Equivalent to:
  23. -
  24. Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).
  25. -
  26. Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).
  27. -
  28. Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).
  29. -
  30. Streaming decompression - HowTo
  31. -
  32. Simple dictionary API
  33. -
  34. Bulk processing dictionary API
  35. -
  36. Dictionary helper functions
  37. -
  38. Advanced dictionary and prefix API
  39. -
  40. ADVANCED AND EXPERIMENTAL FUNCTIONS
  41. -
  42. experimental API (static linking only)
  43. -
  44. Frame size functions
  45. -
  46. ZSTD_decompressBound() :
  47. -
  48. Memory management
  49. -
  50. Advanced compression functions
  51. -
  52. Advanced decompression functions
  53. -
  54. Advanced streaming functions
  55. -
  56. Buffer-less and synchronous inner streaming functions
  57. -
  58. Buffer-less streaming compression (synchronous mode)
  59. -
  60. Buffer-less streaming decompression (synchronous mode)
  61. -
  62. ZSTD_getFrameHeader() :
  63. -
  64. Block level API
  65. +
  66. Simple API
  67. +
  68. Explicit context
  69. +
  70. Advanced compression API
  71. +
  72. Advanced decompression API
  73. +
  74. Streaming
  75. +
  76. Streaming compression - HowTo
  77. +
  78. Streaming decompression - HowTo
  79. +
  80. Simple dictionary API
  81. +
  82. Bulk processing dictionary API
  83. +
  84. Dictionary helper functions
  85. +
  86. Advanced dictionary and prefix API
  87. +
  88. experimental API (static linking only)
  89. +
  90. Frame size functions
  91. +
  92. Memory management
  93. +
  94. Advanced compression functions
  95. +
  96. Advanced decompression functions
  97. +
  98. Advanced streaming functions
  99. +
  100. Buffer-less and synchronous inner streaming functions
  101. +
  102. Buffer-less streaming compression (synchronous mode)
  103. +
  104. Buffer-less streaming decompression (synchronous mode)
  105. +
  106. Block level API

Introduction

@@ -78,12 +68,8 @@
 
 
unsigned ZSTD_versionNumber(void);   /**< to check runtime library version */
 

-

Default constant


+

Simple API


 
-

Constants


-
-

Simple API


-
 
size_t ZSTD_compress( void* dst, size_t dstCapacity,
                 const void* src, size_t srcSize,
                       int compressionLevel);
@@ -152,12 +138,17 @@ const char* ZSTD_getErrorName(size_t code);     /*
 int         ZSTD_minCLevel(void);               /*!< minimum negative compression level allowed */
 int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */
 

-

Explicit context


+

Explicit context


 
 

Compression context

  When compressing many times,
-  it is recommended to allocate a context just once, and re-use it for each successive compression operation.
+  it is recommended to allocate a context just once,
+  and re-use it for each successive compression operation.
   This will make workload friendlier for system's memory.
-  Use one context per thread for parallel execution in multi-threaded environments. 
+  Note : re-using context is just a speed / resource optimization.
+         It doesn't change the compression ratio, which remains identical.
+  Note 2 : In multi-threaded environments,
+         use one different context per thread for parallel execution.
+ 
 
typedef struct ZSTD_CCtx_s ZSTD_CCtx;
 ZSTD_CCtx* ZSTD_createCCtx(void);
 size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);
@@ -189,7 +180,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
  
 


-

Advanced compression API


+

Advanced compression API


 
 
typedef enum { ZSTD_fast=1,
                ZSTD_dfast=2,
@@ -332,6 +323,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
      * ZSTD_c_forceMaxWindow
      * ZSTD_c_forceAttachDict
      * ZSTD_c_literalCompressionMode
+     * ZSTD_c_targetCBlockSize
      * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
      * note : never ever use experimentalParam? names directly;
      *        also, the enums values themselves are unstable and can still change.
@@ -341,6 +333,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
      ZSTD_c_experimentalParam3=1000,
      ZSTD_c_experimentalParam4=1001,
      ZSTD_c_experimentalParam5=1002,
+     ZSTD_c_experimentalParam6=1003,
 } ZSTD_cParameter;
 

typedef struct {
@@ -424,7 +417,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
  
 


-

Advanced decompression API


+

Advanced decompression API


 
 
typedef enum {
 
@@ -472,7 +465,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
  
 


-

Streaming


+

Streaming


 
 
typedef struct ZSTD_inBuffer_s {
   const void* src;    /**< start of input buffer */
@@ -486,7 +479,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
   size_t pos;         /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */
 } ZSTD_outBuffer;
 

-

Streaming compression - HowTo

+

Streaming compression - HowTo

   A ZSTD_CStream object is required to track streaming operation.
   Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources.
   ZSTD_CStream objects can be reused multiple times on consecutive compression operations.
@@ -592,31 +585,28 @@ size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
 
 
size_t ZSTD_CStreamInSize(void);    /**< recommended size for input buffer */
 

-
size_t ZSTD_CStreamOutSize(void);   /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block in all circumstances. */
+
size_t ZSTD_CStreamOutSize(void);   /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block. */
 

-

This is a legacy streaming API, and can be replaced by ZSTD_CCtx_reset() and

 ZSTD_compressStream2(). It is redundent, but is still fully supported.
- Advanced parameters and dictionary compression can only be used through the
- new API.
-
- -

Equivalent to:

+
size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
+/*!
+ * Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).
+ * NOTE: The return value is different. ZSTD_compressStream() returns a hint for
+ * the next read size (if non-zero and not an error). ZSTD_compressStream2()
+ * returns the minimum nb of bytes left to flush (if non-zero and not an error).
+ */
+size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
+/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush). */
+size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
+/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end). */
+size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
+

ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any) ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); -

+


-

Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).

 NOTE: The return value is different. ZSTD_compressStream() returns a hint for
- the next read size (if non-zero and not an error). ZSTD_compressStream2()
- returns the number of bytes left to flush (if non-zero and not an error).
- 
-
- -

Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).


-
-

Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).


-
-

Streaming decompression - HowTo

+

Streaming decompression - HowTo

   A ZSTD_DStream object is required to track streaming operations.
   Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources.
   ZSTD_DStream objects can be re-used multiple times.
@@ -647,14 +637,12 @@ size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
 

ZSTD_DStream management functions

ZSTD_DStream* ZSTD_createDStream(void);
 size_t ZSTD_freeDStream(ZSTD_DStream* zds);
 

-

Streaming decompression functions

size_t ZSTD_initDStream(ZSTD_DStream* zds);
-size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
-

+

Streaming decompression functions


size_t ZSTD_DStreamInSize(void);    /*!< recommended size for input buffer */
 

size_t ZSTD_DStreamOutSize(void);   /*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */
 

-

Simple dictionary API


+

Simple dictionary API


 
 
size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,
                                void* dst, size_t dstCapacity,
@@ -680,7 +668,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
   Note : When `dict == NULL || dictSize < 8` no dictionary is used. 
 


-

Bulk processing dictionary API


+

Bulk processing dictionary API


 
 
ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
                              int compressionLevel);
@@ -723,7 +711,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
   Recommended when same dictionary is used multiple times. 
 


-

Dictionary helper functions


+

Dictionary helper functions


 
 
unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);
 

Provides the dictID stored within dictionary. @@ -749,7 +737,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.


-

Advanced dictionary and prefix API

+

Advanced dictionary and prefix API

  This API allows dictionaries to be used with ZSTD_compress2(),
  ZSTD_compressStream2(), and ZSTD_decompress(). Dictionaries are sticky, and
  only reset with the context is reset with ZSTD_reset_parameters or
@@ -867,15 +855,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
   Note that object memory usage can evolve (increase or decrease) over time. 
 


-

ADVANCED AND EXPERIMENTAL FUNCTIONS

- The definitions in the following section are considered experimental.
- They are provided for advanced scenarios.
- They should never be used with a dynamic library, as prototypes may change in the future.
- Use them only in association with static linking.
- 
-
- -

experimental API (static linking only)

+

experimental API (static linking only)

  The following symbols and constants
  are not planned to join "stable API" status in the near future.
  They can still change in future versions.
@@ -973,7 +953,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
   ZSTD_lcm_uncompressed = 2,  /**< Always emit uncompressed literals. */
 } ZSTD_literalCompressionMode_e;
 

-

Frame size functions


+

Frame size functions


 
 
unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);
 

`src` should point to the start of a series of ZSTD encoded and/or skippable frames @@ -998,7 +978,8 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); however it does mean that all frame data must be present and valid.


-

ZSTD_decompressBound() :

  `src` should point to the start of a series of ZSTD encoded and/or skippable frames
+
unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize);
+

`src` should point to the start of a series of ZSTD encoded and/or skippable frames `srcSize` must be the _exact_ size of this series (i.e. there should be a frame boundary at `src + srcSize`) @return : - upper-bound for the decompressed size of all data in all successive frames @@ -1010,7 +991,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); note 3 : when the decompressed size field isn't available, the upper-bound for that frame is calculated by: upper-bound = # blocks * min(128 KB, Window_Size) -

+


size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
 

srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX. @@ -1018,7 +999,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); or an error code (if srcSize is too small)


-

Memory management


+

Memory management


 
 
size_t ZSTD_estimateCCtxSize(int compressionLevel);
 size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);
@@ -1098,7 +1079,7 @@ static ZSTD_customMem const ZSTD_defaultCMem = { NULL,
  
 


-

Advanced compression functions


+

Advanced compression functions


 
 
ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);
 

Create a digested dictionary for compression @@ -1243,7 +1224,7 @@ size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);


-

Advanced decompression functions


+

Advanced decompression functions


 
 
unsigned ZSTD_isFrame(const void* buffer, size_t size);
 

Tells if the content of `buffer` starts with a valid Frame Identifier. @@ -1305,7 +1286,7 @@ size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);


-

Advanced streaming functions

  Warning : most of these functions are now redundant with the Advanced API.
+

Advanced streaming functions

  Warning : most of these functions are now redundant with the Advanced API.
   Once Advanced API reaches "stable" status,
   redundant functions will be deprecated, and then at some point removed.
 
@@ -1407,18 +1388,41 @@ size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStre


-

Advanced Streaming decompression functions

size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: no dictionary will be used if dict == NULL or dictSize < 8 */
-size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);  /**< note : ddict is referenced, it must outlive decompression session */
-size_t ZSTD_resetDStream(ZSTD_DStream* zds);  /**< re-use decompression parameters from previous init; saves dictionary loading */
+

Advanced Streaming decompression functions

/**
+ * This function is deprecated, and is equivalent to:
+ *
+ *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);
+ *     ZSTD_DCtx_loadDictionary(zds, dict, dictSize);
+ *
+ * note: no dictionary will be used if dict == NULL or dictSize < 8
+ */
+size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);
+/**
+ * This function is deprecated, and is equivalent to:
+ *
+ *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);
+ *     ZSTD_DCtx_refDDict(zds, ddict);
+ *
+ * note : ddict is referenced, it must outlive decompression session
+ */
+size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);
+/**
+ * This function is deprecated, and is equivalent to:
+ *
+ *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);
+ *
+ * re-use decompression parameters from previous init; saves dictionary loading
+ */
+size_t ZSTD_resetDStream(ZSTD_DStream* zds);
 

-

Buffer-less and synchronous inner streaming functions

+

Buffer-less and synchronous inner streaming functions

   This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
   But it's also a complex one, with several restrictions, documented below.
   Prefer normal streaming API for an easier experience.
  
 
-

Buffer-less streaming compression (synchronous mode)

+

Buffer-less streaming compression (synchronous mode)

   A ZSTD_CCtx object is required to track streaming operations.
   Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.
   ZSTD_CCtx object can be re-used multiple times within successive compression operations.
@@ -1454,7 +1458,7 @@ size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, 
 size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);   /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */
 size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**<  note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */
 

-

Buffer-less streaming decompression (synchronous mode)

+

Buffer-less streaming decompression (synchronous mode)

   A ZSTD_DCtx object is required to track streaming operations.
   Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.
   A ZSTD_DCtx object can be re-used multiple times.
@@ -1536,23 +1540,21 @@ typedef struct {
     unsigned checksumFlag;
 } ZSTD_frameHeader;
 

-

ZSTD_getFrameHeader() :

  decode Frame Header, or requires larger `srcSize`.
+
size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */
+/*! ZSTD_getFrameHeader_advanced() :
+ *  same as ZSTD_getFrameHeader(),
+ *  with added capability to select a format (like ZSTD_f_zstd1_magicless) */
+size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format);
+size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);  /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */
+

decode Frame Header, or requires larger `srcSize`. @return : 0, `zfhPtr` is correctly filled, >0, `srcSize` is too small, value is wanted `srcSize` amount, or an error code, which can be tested using ZSTD_isError() -

- -
size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */
-

-
size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format);
-size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);  /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */
-

same as ZSTD_getFrameHeader(), - with added capability to select a format (like ZSTD_f_zstd1_magicless)


typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
 

-

Block level API


+

Block level API


 
 

Frame metadata cost is typically ~18 bytes, which can be non-negligible for very small blocks (< 100 bytes). User will have to take in charge required information to regenerate data, such as compressed and content sizes. Modified: vendor/zstd/dist/examples/Makefile ============================================================================== --- vendor/zstd/dist/examples/Makefile Thu Aug 8 15:11:37 2019 (r350751) +++ vendor/zstd/dist/examples/Makefile Thu Aug 8 15:30:49 2019 (r350752) @@ -77,7 +77,6 @@ test: all @echo -- Edge cases detection ! ./streaming_decompression tmp # invalid input, must fail ! ./simple_decompression tmp # invalid input, must fail - ! ./simple_decompression tmp.zst # unknown input size, must fail touch tmpNull # create 0-size file ./simple_compression tmpNull ./simple_decompression tmpNull.zst # 0-size frame : must work Modified: vendor/zstd/dist/lib/Makefile ============================================================================== --- vendor/zstd/dist/lib/Makefile Thu Aug 8 15:11:37 2019 (r350751) +++ vendor/zstd/dist/lib/Makefile Thu Aug 8 15:30:49 2019 (r350752) @@ -17,6 +17,7 @@ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT)) LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT)) LIBVER := $(shell echo $(LIBVER_SCRIPT)) VERSION?= $(LIBVER) +CCVER := $(shell $(CC) --version) CPPFLAGS+= -I. -I./common -DXXH_NAMESPACE=ZSTD_ ifeq ($(OS),Windows_NT) # MinGW assumed @@ -44,6 +45,10 @@ ZSTDDECOMP_FILES := $(sort $(wildcard decompress/*.c)) ZDICT_FILES := $(sort $(wildcard dictBuilder/*.c)) ZDEPR_FILES := $(sort $(wildcard deprecated/*.c)) ZSTD_FILES := $(ZSTDCOMMON_FILES) + +ifeq ($(findstring GCC,$(CCVER)),GCC) +decompress/zstd_decompress_block.o : CFLAGS+=-fno-tree-vectorize +endif ZSTD_LEGACY_SUPPORT ?= 5 ZSTD_LIB_COMPRESSION ?= 1 Modified: vendor/zstd/dist/lib/common/compiler.h ============================================================================== --- vendor/zstd/dist/lib/common/compiler.h Thu Aug 8 15:11:37 2019 (r350751) +++ vendor/zstd/dist/lib/common/compiler.h Thu Aug 8 15:30:49 2019 (r350752) @@ -127,6 +127,13 @@ } \ } +/* vectorization */ +#if !defined(__clang__) && defined(__GNUC__) +# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) +#else +# define DONT_VECTORIZE +#endif + /* disable warnings */ #ifdef _MSC_VER /* Visual Studio */ # include /* For Visual 2005 */ Modified: vendor/zstd/dist/lib/common/zstd_internal.h ============================================================================== --- vendor/zstd/dist/lib/common/zstd_internal.h Thu Aug 8 15:11:37 2019 (r350751) +++ vendor/zstd/dist/lib/common/zstd_internal.h Thu Aug 8 15:30:49 2019 (r350752) @@ -34,7 +34,6 @@ #endif #include "xxhash.h" /* XXH_reset, update, digest */ - #if defined (__cplusplus) extern "C" { #endif @@ -193,19 +192,72 @@ static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG * Shared functions to include for inlining *********************************************/ static void ZSTD_copy8(void* dst, const void* src) { memcpy(dst, src, 8); } + #define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; } +static void ZSTD_copy16(void* dst, const void* src) { memcpy(dst, src, 16); } +#define COPY16(d,s) { ZSTD_copy16(d,s); d+=16; s+=16; } +#define WILDCOPY_OVERLENGTH 8 +#define VECLEN 16 + +typedef enum { + ZSTD_no_overlap, + ZSTD_overlap_src_before_dst, + /* ZSTD_overlap_dst_before_src, */ +} ZSTD_overlap_e; + /*! ZSTD_wildcopy() : * custom version of memcpy(), can overwrite up to WILDCOPY_OVERLENGTH bytes (if length==0) */ -#define WILDCOPY_OVERLENGTH 8 -MEM_STATIC void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length) +MEM_STATIC FORCE_INLINE_ATTR DONT_VECTORIZE +void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e ovtype) { + ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src; const BYTE* ip = (const BYTE*)src; BYTE* op = (BYTE*)dst; BYTE* const oend = op + length; - do - COPY8(op, ip) - while (op < oend); + + assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff < -8)); + if (length < VECLEN || (ovtype == ZSTD_overlap_src_before_dst && diff < VECLEN)) { + do + COPY8(op, ip) + while (op < oend); + } + else { + if ((length & 8) == 0) + COPY8(op, ip); + do { + COPY16(op, ip); + } + while (op < oend); + } +} + +/*! ZSTD_wildcopy_16min() : + * same semantics as ZSTD_wilcopy() except guaranteed to be able to copy 16 bytes at the start */ +MEM_STATIC FORCE_INLINE_ATTR DONT_VECTORIZE +void ZSTD_wildcopy_16min(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e ovtype) +{ + ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src; + const BYTE* ip = (const BYTE*)src; + BYTE* op = (BYTE*)dst; + BYTE* const oend = op + length; + + assert(length >= 8); + assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff < -8)); + + if (ovtype == ZSTD_overlap_src_before_dst && diff < VECLEN) { + do + COPY8(op, ip) + while (op < oend); + } + else { + if ((length & 8) == 0) + COPY8(op, ip); + do { + COPY16(op, ip); + } + while (op < oend); + } } MEM_STATIC void ZSTD_wildcopy_e(void* dst, const void* src, void* dstEnd) /* should be faster for decoding, but strangely, not verified on all platform */ Modified: vendor/zstd/dist/lib/compress/zstd_compress.c ============================================================================== --- vendor/zstd/dist/lib/compress/zstd_compress.c Thu Aug 8 15:11:37 2019 (r350751) +++ vendor/zstd/dist/lib/compress/zstd_compress.c Thu Aug 8 15:30:49 2019 (r350752) @@ -385,6 +385,11 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter para bounds.upperBound = ZSTD_lcm_uncompressed; return bounds; + case ZSTD_c_targetCBlockSize: + bounds.lowerBound = ZSTD_TARGETCBLOCKSIZE_MIN; + bounds.upperBound = ZSTD_TARGETCBLOCKSIZE_MAX; + return bounds; + default: { ZSTD_bounds const boundError = { ERROR(parameter_unsupported), 0, 0 }; return boundError; @@ -452,6 +457,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter par case ZSTD_c_ldmHashRateLog: case ZSTD_c_forceAttachDict: case ZSTD_c_literalCompressionMode: + case ZSTD_c_targetCBlockSize: default: return 0; } @@ -497,6 +503,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cP case ZSTD_c_ldmHashLog: case ZSTD_c_ldmMinMatch: case ZSTD_c_ldmBucketSizeLog: + case ZSTD_c_targetCBlockSize: break; default: RETURN_ERROR(parameter_unsupported); @@ -671,6 +678,12 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams->ldmParams.hashRateLog = value; return CCtxParams->ldmParams.hashRateLog; + case ZSTD_c_targetCBlockSize : + if (value!=0) /* 0 ==> default */ + BOUNDCHECK(ZSTD_c_targetCBlockSize, value); + CCtxParams->targetCBlockSize = value; + return CCtxParams->targetCBlockSize; + default: RETURN_ERROR(parameter_unsupported, "unknown parameter"); } } @@ -692,13 +705,13 @@ size_t ZSTD_CCtxParams_getParameter( *value = CCtxParams->compressionLevel; break; case ZSTD_c_windowLog : - *value = CCtxParams->cParams.windowLog; + *value = (int)CCtxParams->cParams.windowLog; break; case ZSTD_c_hashLog : - *value = CCtxParams->cParams.hashLog; + *value = (int)CCtxParams->cParams.hashLog; break; case ZSTD_c_chainLog : - *value = CCtxParams->cParams.chainLog; + *value = (int)CCtxParams->cParams.chainLog; break; case ZSTD_c_searchLog : *value = CCtxParams->cParams.searchLog; @@ -773,6 +786,9 @@ size_t ZSTD_CCtxParams_getParameter( case ZSTD_c_ldmHashRateLog : *value = CCtxParams->ldmParams.hashRateLog; break; + case ZSTD_c_targetCBlockSize : + *value = (int)CCtxParams->targetCBlockSize; + break; default: RETURN_ERROR(parameter_unsupported, "unknown parameter"); } return 0; @@ -930,12 +946,12 @@ size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDire @return : 0, or an error code if one value is beyond authorized range */ size_t ZSTD_checkCParams(ZSTD_compressionParameters cParams) { - BOUNDCHECK(ZSTD_c_windowLog, cParams.windowLog); - BOUNDCHECK(ZSTD_c_chainLog, cParams.chainLog); - BOUNDCHECK(ZSTD_c_hashLog, cParams.hashLog); - BOUNDCHECK(ZSTD_c_searchLog, cParams.searchLog); - BOUNDCHECK(ZSTD_c_minMatch, cParams.minMatch); - BOUNDCHECK(ZSTD_c_targetLength,cParams.targetLength); + BOUNDCHECK(ZSTD_c_windowLog, (int)cParams.windowLog); + BOUNDCHECK(ZSTD_c_chainLog, (int)cParams.chainLog); + BOUNDCHECK(ZSTD_c_hashLog, (int)cParams.hashLog); + BOUNDCHECK(ZSTD_c_searchLog, (int)cParams.searchLog); + BOUNDCHECK(ZSTD_c_minMatch, (int)cParams.minMatch); + BOUNDCHECK(ZSTD_c_targetLength,(int)cParams.targetLength); BOUNDCHECK(ZSTD_c_strategy, cParams.strategy); return 0; } @@ -951,7 +967,7 @@ ZSTD_clampCParams(ZSTD_compressionParameters cParams) if ((int)valbounds.upperBound) val=(type)bounds.upperBound; \ } -# define CLAMP(cParam, val) CLAMP_TYPE(cParam, val, int) +# define CLAMP(cParam, val) CLAMP_TYPE(cParam, val, unsigned) CLAMP(ZSTD_c_windowLog, cParams.windowLog); CLAMP(ZSTD_c_chainLog, cParams.chainLog); CLAMP(ZSTD_c_hashLog, cParams.hashLog); @@ -1282,15 +1298,14 @@ static void ZSTD_reset_compressedBlockState(ZSTD_compr } /*! ZSTD_invalidateMatchState() - * Invalidate all the matches in the match finder tables. - * Requires nextSrc and base to be set (can be NULL). + * Invalidate all the matches in the match finder tables. + * Requires nextSrc and base to be set (can be NULL). */ static void ZSTD_invalidateMatchState(ZSTD_matchState_t* ms) { ZSTD_window_clear(&ms->window); ms->nextToUpdate = ms->window.dictLimit; - ms->nextToUpdate3 = ms->window.dictLimit; ms->loadedDictEnd = 0; ms->opt.litLengthSum = 0; /* force reset of btopt stats */ ms->dictMatchState = NULL; @@ -1327,15 +1342,17 @@ static size_t ZSTD_continueCCtx(ZSTD_CCtx* cctx, ZSTD_ typedef enum { ZSTDcrp_continue, ZSTDcrp_noMemset } ZSTD_compResetPolicy_e; +typedef enum { ZSTD_resetTarget_CDict, ZSTD_resetTarget_CCtx } ZSTD_resetTarget_e; + static void* ZSTD_reset_matchState(ZSTD_matchState_t* ms, void* ptr, const ZSTD_compressionParameters* cParams, - ZSTD_compResetPolicy_e const crp, U32 const forCCtx) + ZSTD_compResetPolicy_e const crp, ZSTD_resetTarget_e const forWho) { size_t const chainSize = (cParams->strategy == ZSTD_fast) ? 0 : ((size_t)1 << cParams->chainLog); size_t const hSize = ((size_t)1) << cParams->hashLog; - U32 const hashLog3 = (forCCtx && cParams->minMatch==3) ? MIN(ZSTD_HASHLOG3_MAX, cParams->windowLog) : 0; + U32 const hashLog3 = ((forWho == ZSTD_resetTarget_CCtx) && cParams->minMatch==3) ? MIN(ZSTD_HASHLOG3_MAX, cParams->windowLog) : 0; size_t const h3Size = ((size_t)1) << hashLog3; size_t const tableSpace = (chainSize + hSize + h3Size) * sizeof(U32); @@ -1349,7 +1366,7 @@ ZSTD_reset_matchState(ZSTD_matchState_t* ms, ZSTD_invalidateMatchState(ms); /* opt parser space */ - if (forCCtx && (cParams->strategy >= ZSTD_btopt)) { + if ((forWho == ZSTD_resetTarget_CCtx) && (cParams->strategy >= ZSTD_btopt)) { DEBUGLOG(4, "reserving optimal parser space"); ms->opt.litFreq = (unsigned*)ptr; ms->opt.litLengthFreq = ms->opt.litFreq + (1< (ZSTD_CURRENT_MAX - ZSTD_INDEXOVERFLOW_MARGIN); +} + #define ZSTD_WORKSPACETOOLARGE_FACTOR 3 /* define "workspace is too large" as this number of times larger than needed */ #define ZSTD_WORKSPACETOOLARGE_MAXDURATION 128 /* when workspace is continuously too large * during at least this number of times, @@ -1388,7 +1418,7 @@ ZSTD_reset_matchState(ZSTD_matchState_t* ms, note : `params` are assumed fully validated at this stage */ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, ZSTD_CCtx_params params, - U64 pledgedSrcSize, + U64 const pledgedSrcSize, ZSTD_compResetPolicy_e const crp, ZSTD_buffered_policy_e const zbuff) { @@ -1400,13 +1430,21 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, if (ZSTD_equivalentParams(zc->appliedParams, params, zc->inBuffSize, zc->seqStore.maxNbSeq, zc->seqStore.maxNbLit, - zbuff, pledgedSrcSize)) { - DEBUGLOG(4, "ZSTD_equivalentParams()==1 -> continue mode (wLog1=%u, blockSize1=%zu)", - zc->appliedParams.cParams.windowLog, zc->blockSize); + zbuff, pledgedSrcSize) ) { + DEBUGLOG(4, "ZSTD_equivalentParams()==1 -> consider continue mode"); zc->workSpaceOversizedDuration += (zc->workSpaceOversizedDuration > 0); /* if it was too large, it still is */ - if (zc->workSpaceOversizedDuration <= ZSTD_WORKSPACETOOLARGE_MAXDURATION) + if (zc->workSpaceOversizedDuration <= ZSTD_WORKSPACETOOLARGE_MAXDURATION) { + DEBUGLOG(4, "continue mode confirmed (wLog1=%u, blockSize1=%zu)", + zc->appliedParams.cParams.windowLog, zc->blockSize); + if (ZSTD_indexTooCloseToMax(zc->blockState.matchState.window)) { + /* prefer a reset, faster than a rescale */ + ZSTD_reset_matchState(&zc->blockState.matchState, + zc->entropyWorkspace + HUF_WORKSPACE_SIZE_U32, + ¶ms.cParams, + crp, ZSTD_resetTarget_CCtx); + } return ZSTD_continueCCtx(zc, params, pledgedSrcSize); - } } + } } } DEBUGLOG(4, "ZSTD_equivalentParams()==0 -> reset CCtx"); if (params.ldmParams.enableLdm) { @@ -1449,7 +1487,7 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, DEBUGLOG(4, "windowSize: %zu - blockSize: %zu", windowSize, blockSize); if (workSpaceTooSmall || workSpaceWasteful) { - DEBUGLOG(4, "Need to resize workSpaceSize from %zuKB to %zuKB", + DEBUGLOG(4, "Resize workSpaceSize from %zuKB to %zuKB", zc->workSpaceSize >> 10, neededSpace >> 10); @@ -1491,7 +1529,10 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, ZSTD_reset_compressedBlockState(zc->blockState.prevCBlock); - ptr = zc->entropyWorkspace + HUF_WORKSPACE_SIZE_U32; + ptr = ZSTD_reset_matchState(&zc->blockState.matchState, + zc->entropyWorkspace + HUF_WORKSPACE_SIZE_U32, + ¶ms.cParams, + crp, ZSTD_resetTarget_CCtx); /* ldm hash table */ /* initialize bucketOffsets table later for pointer alignment */ @@ -1509,8 +1550,6 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc, } assert(((size_t)ptr & 3) == 0); /* ensure ptr is properly aligned */ - ptr = ZSTD_reset_matchState(&zc->blockState.matchState, ptr, ¶ms.cParams, crp, /* forCCtx */ 1); - /* sequences storage */ zc->seqStore.maxNbSeq = maxNbSeq; zc->seqStore.sequencesStart = (seqDef*)ptr; @@ -1587,15 +1626,14 @@ static int ZSTD_shouldAttachDict(const ZSTD_CDict* cdi * handled in _enforceMaxDist */ } -static size_t ZSTD_resetCCtx_byAttachingCDict( - ZSTD_CCtx* cctx, - const ZSTD_CDict* cdict, - ZSTD_CCtx_params params, - U64 pledgedSrcSize, - ZSTD_buffered_policy_e zbuff) +static size_t +ZSTD_resetCCtx_byAttachingCDict(ZSTD_CCtx* cctx, + const ZSTD_CDict* cdict, + ZSTD_CCtx_params params, + U64 pledgedSrcSize, + ZSTD_buffered_policy_e zbuff) { - { - const ZSTD_compressionParameters *cdict_cParams = &cdict->matchState.cParams; + { const ZSTD_compressionParameters* const cdict_cParams = &cdict->matchState.cParams; unsigned const windowLog = params.cParams.windowLog; assert(windowLog != 0); /* Resize working context table params for input only, since the dict @@ -1607,8 +1645,7 @@ static size_t ZSTD_resetCCtx_byAttachingCDict( assert(cctx->appliedParams.cParams.strategy == cdict_cParams->strategy); } - { - const U32 cdictEnd = (U32)( cdict->matchState.window.nextSrc + { const U32 cdictEnd = (U32)( cdict->matchState.window.nextSrc - cdict->matchState.window.base); const U32 cdictLen = cdictEnd - cdict->matchState.window.dictLimit; if (cdictLen == 0) { @@ -1625,9 +1662,9 @@ static size_t ZSTD_resetCCtx_byAttachingCDict( cctx->blockState.matchState.window.base + cdictEnd; ZSTD_window_clear(&cctx->blockState.matchState.window); } + /* loadedDictEnd is expressed within the referential of the active context */ cctx->blockState.matchState.loadedDictEnd = cctx->blockState.matchState.window.dictLimit; - } - } + } } cctx->dictID = cdict->dictID; @@ -1681,7 +1718,6 @@ static size_t ZSTD_resetCCtx_byCopyingCDict(ZSTD_CCtx* ZSTD_matchState_t* dstMatchState = &cctx->blockState.matchState; dstMatchState->window = srcMatchState->window; dstMatchState->nextToUpdate = srcMatchState->nextToUpdate; - dstMatchState->nextToUpdate3= srcMatchState->nextToUpdate3; dstMatchState->loadedDictEnd= srcMatchState->loadedDictEnd; } @@ -1761,7 +1797,6 @@ static size_t ZSTD_copyCCtx_internal(ZSTD_CCtx* dstCCt ZSTD_matchState_t* dstMatchState = &dstCCtx->blockState.matchState; dstMatchState->window = srcMatchState->window; dstMatchState->nextToUpdate = srcMatchState->nextToUpdate; - dstMatchState->nextToUpdate3= srcMatchState->nextToUpdate3; dstMatchState->loadedDictEnd= srcMatchState->loadedDictEnd; } dstCCtx->dictID = srcCCtx->dictID; @@ -1831,16 +1866,15 @@ static void ZSTD_reduceTable_btlazy2(U32* const table, /*! ZSTD_reduceIndex() : * rescale all indexes to avoid future overflow (indexes are U32) */ -static void ZSTD_reduceIndex (ZSTD_CCtx* zc, const U32 reducerValue) +static void ZSTD_reduceIndex (ZSTD_matchState_t* ms, ZSTD_CCtx_params const* params, const U32 reducerValue) { - ZSTD_matchState_t* const ms = &zc->blockState.matchState; - { U32 const hSize = (U32)1 << zc->appliedParams.cParams.hashLog; + { U32 const hSize = (U32)1 << params->cParams.hashLog; ZSTD_reduceTable(ms->hashTable, hSize, reducerValue); } - if (zc->appliedParams.cParams.strategy != ZSTD_fast) { - U32 const chainSize = (U32)1 << zc->appliedParams.cParams.chainLog; - if (zc->appliedParams.cParams.strategy == ZSTD_btlazy2) + if (params->cParams.strategy != ZSTD_fast) { + U32 const chainSize = (U32)1 << params->cParams.chainLog; + if (params->cParams.strategy == ZSTD_btlazy2) ZSTD_reduceTable_btlazy2(ms->chainTable, chainSize, reducerValue); else ZSTD_reduceTable(ms->chainTable, chainSize, reducerValue); @@ -2524,6 +2558,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePt op[0] = (BYTE)((nbSeq>>8) + 0x80), op[1] = (BYTE)nbSeq, op+=2; else op[0]=0xFF, MEM_writeLE16(op+1, (U16)(nbSeq - LONGNBSEQ)), op+=3; + assert(op <= oend); if (nbSeq==0) { /* Copy the old tables over as if we repeated them */ memcpy(&nextEntropy->fse, &prevEntropy->fse, sizeof(prevEntropy->fse)); @@ -2532,6 +2567,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePt /* seqHead : flags for FSE encoding type */ seqHead = op++; + assert(op <= oend); /* convert length/distances into codes */ ZSTD_seqToCodes(seqStorePtr); @@ -2555,6 +2591,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePt if (LLtype == set_compressed) lastNCount = op; op += countSize; + assert(op <= oend); } } /* build CTable for Offsets */ { unsigned max = MaxOff; @@ -2577,6 +2614,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePt if (Offtype == set_compressed) lastNCount = op; op += countSize; + assert(op <= oend); } } /* build CTable for MatchLengths */ { unsigned max = MaxML; @@ -2597,6 +2635,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePt if (MLtype == set_compressed) lastNCount = op; op += countSize; + assert(op <= oend); } } *seqHead = (BYTE)((LLtype<<6) + (Offtype<<4) + (MLtype<<2)); @@ -2610,6 +2649,7 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePt longOffsets, bmi2); FORWARD_IF_ERROR(bitstreamSize); op += bitstreamSize; + assert(op <= oend); /* zstd versions <= 1.3.4 mistakenly report corruption when * FSE_readNCount() receives a buffer < 4 bytes. * Fixed by https://github.com/facebook/zstd/pull/1146. @@ -2721,30 +2761,24 @@ void ZSTD_resetSeqStore(seqStore_t* ssPtr) ssPtr->longLengthID = 0; } -static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc, - void* dst, size_t dstCapacity, - const void* src, size_t srcSize) +typedef enum { ZSTDbss_compress, ZSTDbss_noCompress } ZSTD_buildSeqStore_e; + +static size_t ZSTD_buildSeqStore(ZSTD_CCtx* zc, const void* src, size_t srcSize) { ZSTD_matchState_t* const ms = &zc->blockState.matchState; - size_t cSize; - DEBUGLOG(5, "ZSTD_compressBlock_internal (dstCapacity=%u, dictLimit=%u, nextToUpdate=%u)", - (unsigned)dstCapacity, (unsigned)ms->window.dictLimit, (unsigned)ms->nextToUpdate); + DEBUGLOG(5, "ZSTD_buildSeqStore (srcSize=%zu)", srcSize); assert(srcSize <= ZSTD_BLOCKSIZE_MAX); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 8 15:32:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA706A9951; Thu, 8 Aug 2019 15:32: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464C7952GSz4Sjm; Thu, 8 Aug 2019 15:32:53 +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 73F212749D; Thu, 8 Aug 2019 15:32:53 +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 x78FWrOh006920; Thu, 8 Aug 2019 15:32:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78FWr0e006919; Thu, 8 Aug 2019 15:32:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908081532.x78FWr0e006919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 15:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350753 - vendor/zstd/1.4.1 X-SVN-Group: vendor X-SVN-Commit-Author: cem X-SVN-Commit-Paths: vendor/zstd/1.4.1 X-SVN-Commit-Revision: 350753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 15:32:53 -0000 Author: cem Date: Thu Aug 8 15:32:53 2019 New Revision: 350753 URL: https://svnweb.freebsd.org/changeset/base/350753 Log: tag zstd 1.4.1 Added: vendor/zstd/1.4.1/ - copied from r350752, vendor/zstd/dist/ From owner-svn-src-all@freebsd.org Thu Aug 8 15:37:59 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D9ECA9B37; Thu, 8 Aug 2019 15:37:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464CF30drBz4T7b; Thu, 8 Aug 2019 15:37:59 +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 D1656274B4; Thu, 8 Aug 2019 15:37: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 x78Fbwv5008686; Thu, 8 Aug 2019 15:37:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78FbuwU008673; Thu, 8 Aug 2019 15:37:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908081537.x78FbuwU008673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 15:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350754 - in vendor/zstd/dist: . contrib/largeNbDicts contrib/seekable_format contrib/seekable_format/examples doc lib lib/compress lib/decompress lib/legacy programs tests X-SVN-Group: vendor X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in vendor/zstd/dist: . contrib/largeNbDicts contrib/seekable_format contrib/seekable_format/examples doc lib lib/compress lib/decompress lib/legacy programs tests X-SVN-Commit-Revision: 350754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 15:37:59 -0000 Author: cem Date: Thu Aug 8 15:37:56 2019 New Revision: 350754 URL: https://svnweb.freebsd.org/changeset/base/350754 Log: import zstd 1.4.2 Added: vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression_mem.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_compress_literals.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_compress_literals.h (contents, props changed) vendor/zstd/dist/lib/compress/zstd_compress_sequences.c (contents, props changed) vendor/zstd/dist/lib/compress/zstd_compress_sequences.h (contents, props changed) Modified: vendor/zstd/dist/CHANGELOG vendor/zstd/dist/contrib/largeNbDicts/largeNbDicts.c vendor/zstd/dist/contrib/seekable_format/examples/.gitignore vendor/zstd/dist/contrib/seekable_format/examples/Makefile vendor/zstd/dist/contrib/seekable_format/zstdseek_decompress.c vendor/zstd/dist/doc/zstd_manual.html vendor/zstd/dist/lib/compress/zstd_compress.c vendor/zstd/dist/lib/compress/zstd_compress_internal.h vendor/zstd/dist/lib/decompress/zstd_decompress.c vendor/zstd/dist/lib/legacy/zstd_v05.c vendor/zstd/dist/lib/zstd.h vendor/zstd/dist/programs/README.md vendor/zstd/dist/programs/util.c vendor/zstd/dist/programs/zstd.1 vendor/zstd/dist/programs/zstd.1.md vendor/zstd/dist/programs/zstdcli.c vendor/zstd/dist/programs/zstdgrep.1 vendor/zstd/dist/programs/zstdless.1 vendor/zstd/dist/tests/decodecorpus.c Modified: vendor/zstd/dist/CHANGELOG ============================================================================== --- vendor/zstd/dist/CHANGELOG Thu Aug 8 15:32:53 2019 (r350753) +++ vendor/zstd/dist/CHANGELOG Thu Aug 8 15:37:56 2019 (r350754) @@ -1,3 +1,9 @@ +v1.4.2 +bug: Fix bug in zstd-0.5 decoder by @terrelln (#1696) +bug: Fix seekable decompression in-memory API by @iburinoc (#1695) +misc: Validate blocks are smaller than size limit by @vivekmg (#1685) +misc: Restructure source files by @ephiepark (#1679) + v1.4.1 bug: Fix data corruption in niche use cases by @terrelln (#1659) bug: Fuzz legacy modes, fix uncovered bugs by @terrelln (#1593, #1594, #1595) Modified: vendor/zstd/dist/contrib/largeNbDicts/largeNbDicts.c ============================================================================== --- vendor/zstd/dist/contrib/largeNbDicts/largeNbDicts.c Thu Aug 8 15:32:53 2019 (r350753) +++ vendor/zstd/dist/contrib/largeNbDicts/largeNbDicts.c Thu Aug 8 15:37:56 2019 (r350754) @@ -559,7 +559,7 @@ static int benchMem(slice_collection_t dstBlocks, CONTROL(BMK_isSuccessful_runOutcome(outcome)); BMK_runTime_t const result = BMK_extract_runTime(outcome); - U64 const dTime_ns = result.nanoSecPerRun; + double const dTime_ns = result.nanoSecPerRun; double const dTime_sec = (double)dTime_ns / 1000000000; size_t const srcSize = result.sumOfReturn; double const dSpeed_MBps = (double)srcSize / dTime_sec / (1 MB); Modified: vendor/zstd/dist/contrib/seekable_format/examples/.gitignore ============================================================================== --- vendor/zstd/dist/contrib/seekable_format/examples/.gitignore Thu Aug 8 15:32:53 2019 (r350753) +++ vendor/zstd/dist/contrib/seekable_format/examples/.gitignore Thu Aug 8 15:37:56 2019 (r350754) @@ -1,4 +1,5 @@ seekable_compression seekable_decompression +seekable_decompression_mem parallel_processing parallel_compression Modified: vendor/zstd/dist/contrib/seekable_format/examples/Makefile ============================================================================== --- vendor/zstd/dist/contrib/seekable_format/examples/Makefile Thu Aug 8 15:32:53 2019 (r350753) +++ vendor/zstd/dist/contrib/seekable_format/examples/Makefile Thu Aug 8 15:37:56 2019 (r350754) @@ -24,7 +24,8 @@ SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_dec default: all -all: seekable_compression seekable_decompression parallel_processing +all: seekable_compression seekable_decompression seekable_decompression_mem \ + parallel_processing $(ZSTDLIB): make -C $(ZSTDLIB_PATH) $(ZSTDLIB_NAME) @@ -35,6 +36,9 @@ seekable_compression : seekable_compression.c $(SEEKAB seekable_decompression : seekable_decompression.c $(SEEKABLE_OBJS) $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ +seekable_decompression_mem : seekable_decompression_mem.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + parallel_processing : parallel_processing.c $(SEEKABLE_OBJS) $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ -pthread @@ -44,5 +48,6 @@ parallel_compression : parallel_compression.c $(SEEKAB clean: @rm -f core *.o tmp* result* *.zst \ seekable_compression seekable_decompression \ + seekable_decompression_mem \ parallel_processing parallel_compression @echo Cleaning completed Added: vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression_mem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression_mem.c Thu Aug 8 15:37:56 2019 (r350754) @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + + +#include // malloc, exit +#include // fprintf, perror, feof +#include // strerror +#include // errno +#define ZSTD_STATIC_LINKING_ONLY +#include // presumes zstd library is installed +#include + +#include "zstd_seekable.h" + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +#define MAX_FILE_SIZE (8 * 1024 * 1024) + +static void* malloc_orDie(size_t size) +{ + void* const buff = malloc(size); + if (buff) return buff; + /* error */ + perror("malloc"); + exit(1); +} + +static void* realloc_orDie(void* ptr, size_t size) +{ + ptr = realloc(ptr, size); + if (ptr) return ptr; + /* error */ + perror("realloc"); + exit(1); +} + +static FILE* fopen_orDie(const char *filename, const char *instruction) +{ + FILE* const inFile = fopen(filename, instruction); + if (inFile) return inFile; + /* error */ + perror(filename); + exit(3); +} + +static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) +{ + size_t const readSize = fread(buffer, 1, sizeToRead, file); + if (readSize == sizeToRead) return readSize; /* good */ + if (feof(file)) return readSize; /* good, reached end of file */ + /* error */ + perror("fread"); + exit(4); +} + +static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) +{ + size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); + if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ + /* error */ + perror("fwrite"); + exit(5); +} + +static size_t fclose_orDie(FILE* file) +{ + if (!fclose(file)) return 0; + /* error */ + perror("fclose"); + exit(6); +} + +static void fseek_orDie(FILE* file, long int offset, int origin) { + if (!fseek(file, offset, origin)) { + if (!fflush(file)) return; + } + /* error */ + perror("fseek"); + exit(7); +} + + +static void decompressFile_orDie(const char* fname, off_t startOffset, off_t endOffset) +{ + FILE* const fin = fopen_orDie(fname, "rb"); + FILE* const fout = stdout; + // Just for demo purposes, assume file is <= MAX_FILE_SIZE + void* const buffIn = malloc_orDie(MAX_FILE_SIZE); + size_t const inSize = fread_orDie(buffIn, MAX_FILE_SIZE, fin); + size_t const buffOutSize = ZSTD_DStreamOutSize(); /* Guarantee to successfully flush at least one complete compressed block in all circumstances. */ + void* const buffOut = malloc_orDie(buffOutSize); + + ZSTD_seekable* const seekable = ZSTD_seekable_create(); + if (seekable==NULL) { fprintf(stderr, "ZSTD_seekable_create() error \n"); exit(10); } + + size_t const initResult = ZSTD_seekable_initBuff(seekable, buffIn, inSize); + if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_seekable_init() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } + + while (startOffset < endOffset) { + size_t const result = ZSTD_seekable_decompress(seekable, buffOut, MIN(endOffset - startOffset, buffOutSize), startOffset); + + if (ZSTD_isError(result)) { + fprintf(stderr, "ZSTD_seekable_decompress() error : %s \n", + ZSTD_getErrorName(result)); + exit(12); + } + fwrite_orDie(buffOut, result, fout); + startOffset += result; + } + + ZSTD_seekable_free(seekable); + fclose_orDie(fin); + fclose_orDie(fout); + free(buffIn); + free(buffOut); +} + + +int main(int argc, const char** argv) +{ + const char* const exeName = argv[0]; + + if (argc!=4) { + fprintf(stderr, "wrong arguments\n"); + fprintf(stderr, "usage:\n"); + fprintf(stderr, "%s FILE START END\n", exeName); + return 1; + } + + { + const char* const inFilename = argv[1]; + off_t const startOffset = atoll(argv[2]); + off_t const endOffset = atoll(argv[3]); + decompressFile_orDie(inFilename, startOffset, endOffset); + } + + return 0; +} Modified: vendor/zstd/dist/contrib/seekable_format/zstdseek_decompress.c ============================================================================== --- vendor/zstd/dist/contrib/seekable_format/zstdseek_decompress.c Thu Aug 8 15:32:53 2019 (r350753) +++ vendor/zstd/dist/contrib/seekable_format/zstdseek_decompress.c Thu Aug 8 15:37:56 2019 (r350754) @@ -106,7 +106,7 @@ typedef struct { static int ZSTD_seekable_read_buff(void* opaque, void* buffer, size_t n) { buffWrapper_t* buff = (buffWrapper_t*) opaque; - if (buff->size + n > buff->pos) return -1; + if (buff->pos + n > buff->size) return -1; memcpy(buffer, (const BYTE*)buff->ptr + buff->pos, n); buff->pos += n; return 0; @@ -124,7 +124,7 @@ static int ZSTD_seekable_seek_buff(void* opaque, long newOffset = (unsigned long long)buff->pos + offset; break; case SEEK_END: - newOffset = (unsigned long long)buff->size - offset; + newOffset = (unsigned long long)buff->size + offset; break; default: assert(0); /* not possible */ Modified: vendor/zstd/dist/doc/zstd_manual.html ============================================================================== --- vendor/zstd/dist/doc/zstd_manual.html Thu Aug 8 15:32:53 2019 (r350753) +++ vendor/zstd/dist/doc/zstd_manual.html Thu Aug 8 15:37:56 2019 (r350754) @@ -1,10 +1,10 @@ -zstd 1.4.1 Manual +zstd 1.4.2 Manual -

zstd 1.4.1 Manual

+

zstd 1.4.2 Manual


Contents

    Modified: vendor/zstd/dist/lib/compress/zstd_compress.c ============================================================================== --- vendor/zstd/dist/lib/compress/zstd_compress.c Thu Aug 8 15:32:53 2019 (r350753) +++ vendor/zstd/dist/lib/compress/zstd_compress.c Thu Aug 8 15:37:56 2019 (r350754) @@ -21,6 +21,8 @@ #define HUF_STATIC_LINKING_ONLY #include "huf.h" #include "zstd_compress_internal.h" +#include "zstd_compress_sequences.h" +#include "zstd_compress_literals.h" #include "zstd_fast.h" #include "zstd_double_fast.h" #include "zstd_lazy.h" @@ -397,18 +399,6 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter para } } -/* ZSTD_cParam_withinBounds: - * @return 1 if value is within cParam bounds, - * 0 otherwise */ -static int ZSTD_cParam_withinBounds(ZSTD_cParameter cParam, int value) -{ - ZSTD_bounds const bounds = ZSTD_cParam_getBounds(cParam); - if (ZSTD_isError(bounds.error)) return 0; - if (value < bounds.lowerBound) return 0; - if (value > bounds.upperBound) return 0; - return 1; -} - /* ZSTD_cParam_clampBounds: * Clamps the value into the bounded range. */ @@ -1903,155 +1893,6 @@ static size_t ZSTD_noCompressBlock (void* dst, size_t return ZSTD_blockHeaderSize + srcSize; } -static size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void* src, size_t srcSize) -{ - BYTE* const ostart = (BYTE* const)dst; - U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); - - RETURN_ERROR_IF(srcSize + flSize > dstCapacity, dstSize_tooSmall); - - switch(flSize) - { - case 1: /* 2 - 1 - 5 */ - ostart[0] = (BYTE)((U32)set_basic + (srcSize<<3)); - break; - case 2: /* 2 - 2 - 12 */ - MEM_writeLE16(ostart, (U16)((U32)set_basic + (1<<2) + (srcSize<<4))); - break; - case 3: /* 2 - 2 - 20 */ - MEM_writeLE32(ostart, (U32)((U32)set_basic + (3<<2) + (srcSize<<4))); - break; - default: /* not necessary : flSize is {1,2,3} */ - assert(0); - } - - memcpy(ostart + flSize, src, srcSize); - return srcSize + flSize; -} - -static size_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize) -{ - BYTE* const ostart = (BYTE* const)dst; - U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); - - (void)dstCapacity; /* dstCapacity already guaranteed to be >=4, hence large enough */ - - switch(flSize) - { - case 1: /* 2 - 1 - 5 */ - ostart[0] = (BYTE)((U32)set_rle + (srcSize<<3)); - break; - case 2: /* 2 - 2 - 12 */ - MEM_writeLE16(ostart, (U16)((U32)set_rle + (1<<2) + (srcSize<<4))); - break; - case 3: /* 2 - 2 - 20 */ - MEM_writeLE32(ostart, (U32)((U32)set_rle + (3<<2) + (srcSize<<4))); - break; - default: /* not necessary : flSize is {1,2,3} */ - assert(0); - } - - ostart[flSize] = *(const BYTE*)src; - return flSize+1; -} - - -/* ZSTD_minGain() : - * minimum compression required - * to generate a compress block or a compressed literals section. - * note : use same formula for both situations */ -static size_t ZSTD_minGain(size_t srcSize, ZSTD_strategy strat) -{ - U32 const minlog = (strat>=ZSTD_btultra) ? (U32)(strat) - 1 : 6; - ZSTD_STATIC_ASSERT(ZSTD_btultra == 8); - assert(ZSTD_cParam_withinBounds(ZSTD_c_strategy, strat)); - return (srcSize >> minlog) + 2; -} - -static size_t ZSTD_compressLiterals (ZSTD_hufCTables_t const* prevHuf, - ZSTD_hufCTables_t* nextHuf, - ZSTD_strategy strategy, int disableLiteralCompression, - void* dst, size_t dstCapacity, - const void* src, size_t srcSize, - void* workspace, size_t wkspSize, - const int bmi2) -{ - size_t const minGain = ZSTD_minGain(srcSize, strategy); - size_t const lhSize = 3 + (srcSize >= 1 KB) + (srcSize >= 16 KB); - BYTE* const ostart = (BYTE*)dst; - U32 singleStream = srcSize < 256; - symbolEncodingType_e hType = set_compressed; - size_t cLitSize; - - DEBUGLOG(5,"ZSTD_compressLiterals (disableLiteralCompression=%i)", - disableLiteralCompression); - - /* Prepare nextEntropy assuming reusing the existing table */ - memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); - - if (disableLiteralCompression) - return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); - - /* small ? don't even attempt compression (speed opt) */ -# define COMPRESS_LITERALS_SIZE_MIN 63 - { size_t const minLitSize = (prevHuf->repeatMode == HUF_repeat_valid) ? 6 : COMPRESS_LITERALS_SIZE_MIN; - if (srcSize <= minLitSize) return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); - } - - RETURN_ERROR_IF(dstCapacity < lhSize+1, dstSize_tooSmall, "not enough space for compression"); - { HUF_repeat repeat = prevHuf->repeatMode; - int const preferRepeat = strategy < ZSTD_lazy ? srcSize <= 1024 : 0; - if (repeat == HUF_repeat_valid && lhSize == 3) singleStream = 1; - cLitSize = singleStream ? HUF_compress1X_repeat(ostart+lhSize, dstCapacity-lhSize, src, srcSize, 255, 11, - workspace, wkspSize, (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2) - : HUF_compress4X_repeat(ostart+lhSize, dstCapacity-lhSize, src, srcSize, 255, 11, - workspace, wkspSize, (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2); - if (repeat != HUF_repeat_none) { - /* reused the existing table */ - hType = set_repeat; - } - } - - if ((cLitSize==0) | (cLitSize >= srcSize - minGain) | ERR_isError(cLitSize)) { - memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); - return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); - } - if (cLitSize==1) { - memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); - return ZSTD_compressRleLiteralsBlock(dst, dstCapacity, src, srcSize); - } - - if (hType == set_compressed) { - /* using a newly constructed table */ - nextHuf->repeatMode = HUF_repeat_check; - } - - /* Build header */ - switch(lhSize) - { - case 3: /* 2 - 2 - 10 - 10 */ - { U32 const lhc = hType + ((!singleStream) << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<14); - MEM_writeLE24(ostart, lhc); - break; - } - case 4: /* 2 - 2 - 14 - 14 */ - { U32 const lhc = hType + (2 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<18); - MEM_writeLE32(ostart, lhc); - break; - } - case 5: /* 2 - 2 - 18 - 18 */ - { U32 const lhc = hType + (3 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<22); - MEM_writeLE32(ostart, lhc); - ostart[4] = (BYTE)(cLitSize >> 10); - break; - } - default: /* not possible : lhSize is {3,4,5} */ - assert(0); - } - return lhSize+cLitSize; -} - - void ZSTD_seqToCodes(const seqStore_t* seqStorePtr) { const seqDef* const sequences = seqStorePtr->sequencesStart; @@ -2074,418 +1915,6 @@ void ZSTD_seqToCodes(const seqStore_t* seqStorePtr) mlCodeTable[seqStorePtr->longLengthPos] = MaxML; } - -/** - * -log2(x / 256) lookup table for x in [0, 256). - * If x == 0: Return 0 - * Else: Return floor(-log2(x / 256) * 256) - */ -static unsigned const kInverseProbabilityLog256[256] = { - 0, 2048, 1792, 1642, 1536, 1453, 1386, 1329, 1280, 1236, 1197, 1162, - 1130, 1100, 1073, 1047, 1024, 1001, 980, 960, 941, 923, 906, 889, - 874, 859, 844, 830, 817, 804, 791, 779, 768, 756, 745, 734, - 724, 714, 704, 694, 685, 676, 667, 658, 650, 642, 633, 626, - 618, 610, 603, 595, 588, 581, 574, 567, 561, 554, 548, 542, - 535, 529, 523, 517, 512, 506, 500, 495, 489, 484, 478, 473, - 468, 463, 458, 453, 448, 443, 438, 434, 429, 424, 420, 415, - 411, 407, 402, 398, 394, 390, 386, 382, 377, 373, 370, 366, - 362, 358, 354, 350, 347, 343, 339, 336, 332, 329, 325, 322, - 318, 315, 311, 308, 305, 302, 298, 295, 292, 289, 286, 282, - 279, 276, 273, 270, 267, 264, 261, 258, 256, 253, 250, 247, - 244, 241, 239, 236, 233, 230, 228, 225, 222, 220, 217, 215, - 212, 209, 207, 204, 202, 199, 197, 194, 192, 190, 187, 185, - 182, 180, 178, 175, 173, 171, 168, 166, 164, 162, 159, 157, - 155, 153, 151, 149, 146, 144, 142, 140, 138, 136, 134, 132, - 130, 128, 126, 123, 121, 119, 117, 115, 114, 112, 110, 108, - 106, 104, 102, 100, 98, 96, 94, 93, 91, 89, 87, 85, - 83, 82, 80, 78, 76, 74, 73, 71, 69, 67, 66, 64, - 62, 61, 59, 57, 55, 54, 52, 50, 49, 47, 46, 44, - 42, 41, 39, 37, 36, 34, 33, 31, 30, 28, 26, 25, - 23, 22, 20, 19, 17, 16, 14, 13, 11, 10, 8, 7, - 5, 4, 2, 1, -}; - - -/** - * Returns the cost in bits of encoding the distribution described by count - * using the entropy bound. - */ -static size_t ZSTD_entropyCost(unsigned const* count, unsigned const max, size_t const total) -{ - unsigned cost = 0; - unsigned s; - for (s = 0; s <= max; ++s) { - unsigned norm = (unsigned)((256 * count[s]) / total); - if (count[s] != 0 && norm == 0) - norm = 1; - assert(count[s] < total); - cost += count[s] * kInverseProbabilityLog256[norm]; - } - return cost >> 8; -} - - -/** - * Returns the cost in bits of encoding the distribution in count using the - * table described by norm. The max symbol support by norm is assumed >= max. - * norm must be valid for every symbol with non-zero probability in count. - */ -static size_t ZSTD_crossEntropyCost(short const* norm, unsigned accuracyLog, - unsigned const* count, unsigned const max) -{ - unsigned const shift = 8 - accuracyLog; - size_t cost = 0; - unsigned s; - assert(accuracyLog <= 8); - for (s = 0; s <= max; ++s) { - unsigned const normAcc = norm[s] != -1 ? norm[s] : 1; - unsigned const norm256 = normAcc << shift; - assert(norm256 > 0); - assert(norm256 < 256); - cost += count[s] * kInverseProbabilityLog256[norm256]; - } - return cost >> 8; -} - - -static unsigned ZSTD_getFSEMaxSymbolValue(FSE_CTable const* ctable) { - void const* ptr = ctable; - U16 const* u16ptr = (U16 const*)ptr; - U32 const maxSymbolValue = MEM_read16(u16ptr + 1); - return maxSymbolValue; -} - - -/** - * Returns the cost in bits of encoding the distribution in count using ctable. - * Returns an error if ctable cannot represent all the symbols in count. - */ -static size_t ZSTD_fseBitCost( - FSE_CTable const* ctable, - unsigned const* count, - unsigned const max) -{ - unsigned const kAccuracyLog = 8; - size_t cost = 0; - unsigned s; - FSE_CState_t cstate; - FSE_initCState(&cstate, ctable); - RETURN_ERROR_IF(ZSTD_getFSEMaxSymbolValue(ctable) < max, GENERIC, - "Repeat FSE_CTable has maxSymbolValue %u < %u", - ZSTD_getFSEMaxSymbolValue(ctable), max); - for (s = 0; s <= max; ++s) { - unsigned const tableLog = cstate.stateLog; - unsigned const badCost = (tableLog + 1) << kAccuracyLog; - unsigned const bitCost = FSE_bitCost(cstate.symbolTT, tableLog, s, kAccuracyLog); - if (count[s] == 0) - continue; - RETURN_ERROR_IF(bitCost >= badCost, GENERIC, - "Repeat FSE_CTable has Prob[%u] == 0", s); - cost += count[s] * bitCost; - } - return cost >> kAccuracyLog; -} - -/** - * Returns the cost in bytes of encoding the normalized count header. - * Returns an error if any of the helper functions return an error. - */ -static size_t ZSTD_NCountCost(unsigned const* count, unsigned const max, - size_t const nbSeq, unsigned const FSELog) -{ - BYTE wksp[FSE_NCOUNTBOUND]; - S16 norm[MaxSeq + 1]; - const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); - FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq, max)); - return FSE_writeNCount(wksp, sizeof(wksp), norm, max, tableLog); -} - - -typedef enum { - ZSTD_defaultDisallowed = 0, - ZSTD_defaultAllowed = 1 -} ZSTD_defaultPolicy_e; - -MEM_STATIC symbolEncodingType_e -ZSTD_selectEncodingType( - FSE_repeat* repeatMode, unsigned const* count, unsigned const max, - size_t const mostFrequent, size_t nbSeq, unsigned const FSELog, - FSE_CTable const* prevCTable, - short const* defaultNorm, U32 defaultNormLog, - ZSTD_defaultPolicy_e const isDefaultAllowed, - ZSTD_strategy const strategy) -{ - ZSTD_STATIC_ASSERT(ZSTD_defaultDisallowed == 0 && ZSTD_defaultAllowed != 0); - if (mostFrequent == nbSeq) { - *repeatMode = FSE_repeat_none; - if (isDefaultAllowed && nbSeq <= 2) { - /* Prefer set_basic over set_rle when there are 2 or less symbols, - * since RLE uses 1 byte, but set_basic uses 5-6 bits per symbol. - * If basic encoding isn't possible, always choose RLE. - */ - DEBUGLOG(5, "Selected set_basic"); - return set_basic; - } - DEBUGLOG(5, "Selected set_rle"); - return set_rle; - } - if (strategy < ZSTD_lazy) { - if (isDefaultAllowed) { - size_t const staticFse_nbSeq_max = 1000; - size_t const mult = 10 - strategy; - size_t const baseLog = 3; - size_t const dynamicFse_nbSeq_min = (((size_t)1 << defaultNormLog) * mult) >> baseLog; /* 28-36 for offset, 56-72 for lengths */ - assert(defaultNormLog >= 5 && defaultNormLog <= 6); /* xx_DEFAULTNORMLOG */ - assert(mult <= 9 && mult >= 7); - if ( (*repeatMode == FSE_repeat_valid) - && (nbSeq < staticFse_nbSeq_max) ) { - DEBUGLOG(5, "Selected set_repeat"); - return set_repeat; - } - if ( (nbSeq < dynamicFse_nbSeq_min) - || (mostFrequent < (nbSeq >> (defaultNormLog-1))) ) { - DEBUGLOG(5, "Selected set_basic"); - /* The format allows default tables to be repeated, but it isn't useful. - * When using simple heuristics to select encoding type, we don't want - * to confuse these tables with dictionaries. When running more careful - * analysis, we don't need to waste time checking both repeating tables - * and default tables. - */ - *repeatMode = FSE_repeat_none; - return set_basic; - } - } - } else { - size_t const basicCost = isDefaultAllowed ? ZSTD_crossEntropyCost(defaultNorm, defaultNormLog, count, max) : ERROR(GENERIC); - size_t const repeatCost = *repeatMode != FSE_repeat_none ? ZSTD_fseBitCost(prevCTable, count, max) : ERROR(GENERIC); - size_t const NCountCost = ZSTD_NCountCost(count, max, nbSeq, FSELog); - size_t const compressedCost = (NCountCost << 3) + ZSTD_entropyCost(count, max, nbSeq); - - if (isDefaultAllowed) { - assert(!ZSTD_isError(basicCost)); - assert(!(*repeatMode == FSE_repeat_valid && ZSTD_isError(repeatCost))); - } - assert(!ZSTD_isError(NCountCost)); - assert(compressedCost < ERROR(maxCode)); - DEBUGLOG(5, "Estimated bit costs: basic=%u\trepeat=%u\tcompressed=%u", - (unsigned)basicCost, (unsigned)repeatCost, (unsigned)compressedCost); - if (basicCost <= repeatCost && basicCost <= compressedCost) { - DEBUGLOG(5, "Selected set_basic"); - assert(isDefaultAllowed); - *repeatMode = FSE_repeat_none; - return set_basic; - } - if (repeatCost <= compressedCost) { - DEBUGLOG(5, "Selected set_repeat"); - assert(!ZSTD_isError(repeatCost)); - return set_repeat; - } - assert(compressedCost < basicCost && compressedCost < repeatCost); - } - DEBUGLOG(5, "Selected set_compressed"); - *repeatMode = FSE_repeat_check; - return set_compressed; -} - -MEM_STATIC size_t -ZSTD_buildCTable(void* dst, size_t dstCapacity, - FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type, - unsigned* count, U32 max, - const BYTE* codeTable, size_t nbSeq, - const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax, - const FSE_CTable* prevCTable, size_t prevCTableSize, - void* workspace, size_t workspaceSize) -{ - BYTE* op = (BYTE*)dst; - const BYTE* const oend = op + dstCapacity; - DEBUGLOG(6, "ZSTD_buildCTable (dstCapacity=%u)", (unsigned)dstCapacity); - - switch (type) { - case set_rle: - FORWARD_IF_ERROR(FSE_buildCTable_rle(nextCTable, (BYTE)max)); - RETURN_ERROR_IF(dstCapacity==0, dstSize_tooSmall); - *op = codeTable[0]; - return 1; - case set_repeat: - memcpy(nextCTable, prevCTable, prevCTableSize); - return 0; - case set_basic: - FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, defaultNorm, defaultMax, defaultNormLog, workspace, workspaceSize)); /* note : could be pre-calculated */ - return 0; - case set_compressed: { - S16 norm[MaxSeq + 1]; - size_t nbSeq_1 = nbSeq; - const U32 tableLog = FSE_optimalTableLog(FSELog, nbSeq, max); - if (count[codeTable[nbSeq-1]] > 1) { - count[codeTable[nbSeq-1]]--; - nbSeq_1--; - } - assert(nbSeq_1 > 1); - FORWARD_IF_ERROR(FSE_normalizeCount(norm, tableLog, count, nbSeq_1, max)); - { size_t const NCountSize = FSE_writeNCount(op, oend - op, norm, max, tableLog); /* overflow protected */ - FORWARD_IF_ERROR(NCountSize); - FORWARD_IF_ERROR(FSE_buildCTable_wksp(nextCTable, norm, max, tableLog, workspace, workspaceSize)); - return NCountSize; - } - } - default: assert(0); RETURN_ERROR(GENERIC); - } -} - -FORCE_INLINE_TEMPLATE size_t -ZSTD_encodeSequences_body( - void* dst, size_t dstCapacity, - FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, - FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, - FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, - seqDef const* sequences, size_t nbSeq, int longOffsets) -{ - BIT_CStream_t blockStream; - FSE_CState_t stateMatchLength; - FSE_CState_t stateOffsetBits; - FSE_CState_t stateLitLength; - - RETURN_ERROR_IF( - ERR_isError(BIT_initCStream(&blockStream, dst, dstCapacity)), - dstSize_tooSmall, "not enough space remaining"); - DEBUGLOG(6, "available space for bitstream : %i (dstCapacity=%u)", - (int)(blockStream.endPtr - blockStream.startPtr), - (unsigned)dstCapacity); - - /* first symbols */ - FSE_initCState2(&stateMatchLength, CTable_MatchLength, mlCodeTable[nbSeq-1]); - FSE_initCState2(&stateOffsetBits, CTable_OffsetBits, ofCodeTable[nbSeq-1]); - FSE_initCState2(&stateLitLength, CTable_LitLength, llCodeTable[nbSeq-1]); - BIT_addBits(&blockStream, sequences[nbSeq-1].litLength, LL_bits[llCodeTable[nbSeq-1]]); - if (MEM_32bits()) BIT_flushBits(&blockStream); - BIT_addBits(&blockStream, sequences[nbSeq-1].matchLength, ML_bits[mlCodeTable[nbSeq-1]]); - if (MEM_32bits()) BIT_flushBits(&blockStream); - if (longOffsets) { - U32 const ofBits = ofCodeTable[nbSeq-1]; - int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); - if (extraBits) { - BIT_addBits(&blockStream, sequences[nbSeq-1].offset, extraBits); - BIT_flushBits(&blockStream); - } - BIT_addBits(&blockStream, sequences[nbSeq-1].offset >> extraBits, - ofBits - extraBits); - } else { - BIT_addBits(&blockStream, sequences[nbSeq-1].offset, ofCodeTable[nbSeq-1]); - } - BIT_flushBits(&blockStream); - - { size_t n; - for (n=nbSeq-2 ; n= 64-7-(LLFSELog+MLFSELog+OffFSELog))) - BIT_flushBits(&blockStream); /* (7)*/ - BIT_addBits(&blockStream, sequences[n].litLength, llBits); - if (MEM_32bits() && ((llBits+mlBits)>24)) BIT_flushBits(&blockStream); - BIT_addBits(&blockStream, sequences[n].matchLength, mlBits); - if (MEM_32bits() || (ofBits+mlBits+llBits > 56)) BIT_flushBits(&blockStream); - if (longOffsets) { - int const extraBits = ofBits - MIN(ofBits, STREAM_ACCUMULATOR_MIN-1); - if (extraBits) { - BIT_addBits(&blockStream, sequences[n].offset, extraBits); - BIT_flushBits(&blockStream); /* (7)*/ - } - BIT_addBits(&blockStream, sequences[n].offset >> extraBits, - ofBits - extraBits); /* 31 */ - } else { - BIT_addBits(&blockStream, sequences[n].offset, ofBits); /* 31 */ - } - BIT_flushBits(&blockStream); /* (7)*/ - DEBUGLOG(7, "remaining space : %i", (int)(blockStream.endPtr - blockStream.ptr)); - } } - - DEBUGLOG(6, "ZSTD_encodeSequences: flushing ML state with %u bits", stateMatchLength.stateLog); - FSE_flushCState(&blockStream, &stateMatchLength); - DEBUGLOG(6, "ZSTD_encodeSequences: flushing Off state with %u bits", stateOffsetBits.stateLog); - FSE_flushCState(&blockStream, &stateOffsetBits); - DEBUGLOG(6, "ZSTD_encodeSequences: flushing LL state with %u bits", stateLitLength.stateLog); - FSE_flushCState(&blockStream, &stateLitLength); - - { size_t const streamSize = BIT_closeCStream(&blockStream); - RETURN_ERROR_IF(streamSize==0, dstSize_tooSmall, "not enough space"); - return streamSize; - } -} - -static size_t -ZSTD_encodeSequences_default( - void* dst, size_t dstCapacity, - FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, - FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, - FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, - seqDef const* sequences, size_t nbSeq, int longOffsets) -{ - return ZSTD_encodeSequences_body(dst, dstCapacity, - CTable_MatchLength, mlCodeTable, - CTable_OffsetBits, ofCodeTable, - CTable_LitLength, llCodeTable, - sequences, nbSeq, longOffsets); -} - - -#if DYNAMIC_BMI2 - -static TARGET_ATTRIBUTE("bmi2") size_t -ZSTD_encodeSequences_bmi2( - void* dst, size_t dstCapacity, - FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, - FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, - FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, - seqDef const* sequences, size_t nbSeq, int longOffsets) -{ - return ZSTD_encodeSequences_body(dst, dstCapacity, - CTable_MatchLength, mlCodeTable, - CTable_OffsetBits, ofCodeTable, - CTable_LitLength, llCodeTable, - sequences, nbSeq, longOffsets); -} - -#endif - -static size_t ZSTD_encodeSequences( - void* dst, size_t dstCapacity, - FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable, - FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable, - FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable, - seqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2) -{ - DEBUGLOG(5, "ZSTD_encodeSequences: dstCapacity = %u", (unsigned)dstCapacity); -#if DYNAMIC_BMI2 - if (bmi2) { - return ZSTD_encodeSequences_bmi2(dst, dstCapacity, - CTable_MatchLength, mlCodeTable, - CTable_OffsetBits, ofCodeTable, - CTable_LitLength, llCodeTable, - sequences, nbSeq, longOffsets); - } -#endif - (void)bmi2; - return ZSTD_encodeSequences_default(dst, dstCapacity, - CTable_MatchLength, mlCodeTable, - CTable_OffsetBits, ofCodeTable, - CTable_LitLength, llCodeTable, - sequences, nbSeq, longOffsets); -} - static int ZSTD_disableLiteralsCompression(const ZSTD_CCtx_params* cctxParams) { switch (cctxParams->literalCompressionMode) { @@ -2530,8 +1959,8 @@ ZSTD_compressSequences_internal(seqStore_t* seqStorePt BYTE* seqHead; BYTE* lastNCount = NULL; + DEBUGLOG(5, "ZSTD_compressSequences_internal (nbSeq=%zu)", nbSeq); ZSTD_STATIC_ASSERT(HUF_WORKSPACE_SIZE >= (1<litStart; Modified: vendor/zstd/dist/lib/compress/zstd_compress_internal.h ============================================================================== --- vendor/zstd/dist/lib/compress/zstd_compress_internal.h Thu Aug 8 15:32:53 2019 (r350753) +++ vendor/zstd/dist/lib/compress/zstd_compress_internal.h Thu Aug 8 15:37:56 2019 (r350754) @@ -307,6 +307,30 @@ MEM_STATIC U32 ZSTD_MLcode(U32 mlBase) return (mlBase > 127) ? ZSTD_highbit32(mlBase) + ML_deltaCode : ML_Code[mlBase]; } +/* ZSTD_cParam_withinBounds: + * @return 1 if value is within cParam bounds, + * 0 otherwise */ +MEM_STATIC int ZSTD_cParam_withinBounds(ZSTD_cParameter cParam, int value) +{ + ZSTD_bounds const bounds = ZSTD_cParam_getBounds(cParam); + if (ZSTD_isError(bounds.error)) return 0; + if (value < bounds.lowerBound) return 0; + if (value > bounds.upperBound) return 0; + return 1; +} + +/* ZSTD_minGain() : + * minimum compression required + * to generate a compress block or a compressed literals section. + * note : use same formula for both situations */ +MEM_STATIC size_t ZSTD_minGain(size_t srcSize, ZSTD_strategy strat) +{ + U32 const minlog = (strat>=ZSTD_btultra) ? (U32)(strat) - 1 : 6; + ZSTD_STATIC_ASSERT(ZSTD_btultra == 8); + assert(ZSTD_cParam_withinBounds(ZSTD_c_strategy, strat)); + return (srcSize >> minlog) + 2; +} + /*! ZSTD_storeSeq() : * Store a sequence (literal length, literals, offset code and match length code) into seqStore_t. * `offsetCode` : distance to match + 3 (values 1-3 are repCodes). Added: vendor/zstd/dist/lib/compress/zstd_compress_literals.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/zstd/dist/lib/compress/zstd_compress_literals.c Thu Aug 8 15:37:56 2019 (r350754) @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2016-present, Yann Collet, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + * You may select, at your option, one of the above-listed licenses. + */ + + /*-************************************* + * Dependencies + ***************************************/ +#include "zstd_compress_literals.h" + +size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void* src, size_t srcSize) +{ + BYTE* const ostart = (BYTE* const)dst; + U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); + + RETURN_ERROR_IF(srcSize + flSize > dstCapacity, dstSize_tooSmall); + + switch(flSize) + { + case 1: /* 2 - 1 - 5 */ + ostart[0] = (BYTE)((U32)set_basic + (srcSize<<3)); + break; + case 2: /* 2 - 2 - 12 */ + MEM_writeLE16(ostart, (U16)((U32)set_basic + (1<<2) + (srcSize<<4))); + break; + case 3: /* 2 - 2 - 20 */ + MEM_writeLE32(ostart, (U32)((U32)set_basic + (3<<2) + (srcSize<<4))); + break; + default: /* not necessary : flSize is {1,2,3} */ + assert(0); + } + + memcpy(ostart + flSize, src, srcSize); + return srcSize + flSize; +} + +size_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize) +{ + BYTE* const ostart = (BYTE* const)dst; + U32 const flSize = 1 + (srcSize>31) + (srcSize>4095); + + (void)dstCapacity; /* dstCapacity already guaranteed to be >=4, hence large enough */ + + switch(flSize) + { + case 1: /* 2 - 1 - 5 */ + ostart[0] = (BYTE)((U32)set_rle + (srcSize<<3)); + break; + case 2: /* 2 - 2 - 12 */ + MEM_writeLE16(ostart, (U16)((U32)set_rle + (1<<2) + (srcSize<<4))); + break; + case 3: /* 2 - 2 - 20 */ + MEM_writeLE32(ostart, (U32)((U32)set_rle + (3<<2) + (srcSize<<4))); + break; + default: /* not necessary : flSize is {1,2,3} */ + assert(0); + } + + ostart[flSize] = *(const BYTE*)src; + return flSize+1; +} + +size_t ZSTD_compressLiterals (ZSTD_hufCTables_t const* prevHuf, + ZSTD_hufCTables_t* nextHuf, + ZSTD_strategy strategy, int disableLiteralCompression, + void* dst, size_t dstCapacity, + const void* src, size_t srcSize, + void* workspace, size_t wkspSize, + const int bmi2) +{ + size_t const minGain = ZSTD_minGain(srcSize, strategy); + size_t const lhSize = 3 + (srcSize >= 1 KB) + (srcSize >= 16 KB); + BYTE* const ostart = (BYTE*)dst; + U32 singleStream = srcSize < 256; + symbolEncodingType_e hType = set_compressed; + size_t cLitSize; + + DEBUGLOG(5,"ZSTD_compressLiterals (disableLiteralCompression=%i)", + disableLiteralCompression); + + /* Prepare nextEntropy assuming reusing the existing table */ + memcpy(nextHuf, prevHuf, sizeof(*prevHuf)); + + if (disableLiteralCompression) + return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); + + /* small ? don't even attempt compression (speed opt) */ +# define COMPRESS_LITERALS_SIZE_MIN 63 + { size_t const minLitSize = (prevHuf->repeatMode == HUF_repeat_valid) ? 6 : COMPRESS_LITERALS_SIZE_MIN; + if (srcSize <= minLitSize) return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize); + } + + RETURN_ERROR_IF(dstCapacity < lhSize+1, dstSize_tooSmall, "not enough space for compression"); + { HUF_repeat repeat = prevHuf->repeatMode; + int const preferRepeat = strategy < ZSTD_lazy ? srcSize <= 1024 : 0; + if (repeat == HUF_repeat_valid && lhSize == 3) singleStream = 1; + cLitSize = singleStream ? HUF_compress1X_repeat(ostart+lhSize, dstCapacity-lhSize, src, srcSize, 255, 11, + workspace, wkspSize, (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2) + : HUF_compress4X_repeat(ostart+lhSize, dstCapacity-lhSize, src, srcSize, 255, 11, + workspace, wkspSize, (HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2); + if (repeat != HUF_repeat_none) { + /* reused the existing table */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 8 15:38:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2788CA9BA2; Thu, 8 Aug 2019 15:38: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464CGB0CfHz4TFn; Thu, 8 Aug 2019 15:38: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 C364E274B5; Thu, 8 Aug 2019 15:38:57 +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 x78Fcv6P008768; Thu, 8 Aug 2019 15:38:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78FcvfT008767; Thu, 8 Aug 2019 15:38:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908081538.x78FcvfT008767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 15:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r350755 - vendor/zstd/1.4.2 X-SVN-Group: vendor X-SVN-Commit-Author: cem X-SVN-Commit-Paths: vendor/zstd/1.4.2 X-SVN-Commit-Revision: 350755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 15:38:58 -0000 Author: cem Date: Thu Aug 8 15:38:57 2019 New Revision: 350755 URL: https://svnweb.freebsd.org/changeset/base/350755 Log: tag zstd 1.4.2 Added: vendor/zstd/1.4.2/ - copied from r350754, vendor/zstd/dist/ From owner-svn-src-all@freebsd.org Thu Aug 8 15:46:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 487F6A9EA9; Thu, 8 Aug 2019 15:46:36 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464CR01B3bz4Th6; Thu, 8 Aug 2019 15:46:35 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-ot1-x344.google.com with SMTP id n5so120497015otk.1; Thu, 08 Aug 2019 08:46:35 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=8OD/tFb2EeDF0jwqBWeX0y9j7ssUHU9/YhFfBWTeDNE=; b=iHbyFYAL5MuGoAhQHvId99a8SMOVhsFTpWfbgCZx34fkDzw9mg32FfRsOiIg5Q+wKF Eq/cUE6TBJV9j5mGA0d7h94SJBsuFtaf06rSJnBHaNb02amd8rXJAm/Vp9uKT5l47hdb wkWk6QvlfEZ9lXaxJu+7MKCaqrm1tiCIlOytZKPhT9TkinE9oMQwLUtUN9tS+iDirA8/ bCDHesm9e4GKVJ2EugtbI6SaeB7OwVwhXIPzq1IM69BoRmsKuwU4nH6rJ2j6tPuoi8Lq r2bXN0C6tLQdU4JuizQJYpihqDUSSTk6DUr9ZCEEP9x2iMDgO17LHDReylRHgfKiwLOv QqJA== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=8OD/tFb2EeDF0jwqBWeX0y9j7ssUHU9/YhFfBWTeDNE=; b=ITylBAU12bKzSnoyq/O2UgpC3ZGOAwCCgS1dNIy84MwYjAlZn2z9YuT00mOtllMZTf TeJF09L+kGFkdZvZeo4Gmh4tpKMjAmYGDLUwqZAyIZkfQhBkZz9MBtIiomz77aEY41q9 lLKb8W9mYVwjrlwRx9X+0D3mQjrnlYBz6TnnsVrLjC0t+5Xe2xVfkBtcqHqmTgvZh60a T040rLhWSlsjXqo0tDKZXo4x1o66LsqfQ9yP785NaxHihqZBDn735yrI0CPiIti6rFjC z4hdnGrg3XLofPgieiIg+eOQLXJdn8fApFymmyzeyJTB6LXnotnZkkh2e3B1pCS/pVaw a6xg== X-Gm-Message-State: APjAAAWnG3WZ78sdCWg04xdDZD+EwQrMtgRdF8bQdWkGIcORpBE872qg TO9vnU5sV+LrW7DAWG0iwtBWNGbZprQ= X-Google-Smtp-Source: APXvYqxZf+vRWTYRIK46N3VGjytKl5fRL6ncawPFrUMRW1zVCfOOl5AzGCGmUYq83iJJLHBpfp8Cag== X-Received: by 2002:a6b:b804:: with SMTP id i4mr4243190iof.205.1565279194051; Thu, 08 Aug 2019 08:46:34 -0700 (PDT) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id l6sm5376466ioc.15.2019.08.08.08.46.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 08:46:33 -0700 (PDT) Sender: Justin Hibbits Date: Thu, 8 Aug 2019 10:46:29 -0500 From: Justin Hibbits To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350737 - head/usr.sbin/autofs Message-ID: <20190808104629.405a5c0b@ralga.knownspace> In-Reply-To: <53d227e7f8535424c3abff229a41e9375b077dcc.camel@freebsd.org> References: <201908080316.x783GW3r070041@repo.freebsd.org> <53d227e7f8535424c3abff229a41e9375b077dcc.camel@freebsd.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 464CR01B3bz4Th6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 15:46:36 -0000 On Thu, 08 Aug 2019 08:00:16 -0600 Ian Lepore wrote: > On Thu, 2019-08-08 at 03:16 +0000, Justin Hibbits wrote: > > Author: jhibbits > > Date: Thu Aug 8 03:16:32 2019 > > New Revision: 350737 > > URL: https://svnweb.freebsd.org/changeset/base/350737 > > > > Log: > > Change autounmountd(8) to use time_t for duration instead of > > double > > Summary: > > autounmountd(8) uses doubles to handle mount time durations. > > However, it must convert to integer types, time_t in particular, to > > do anything meaningful. Additionally, even though it's a > > floating-point value in seconds, the sub-seconds component is never > > used, so it's unnecessary. > > Switching type to time_t fixes an assertion on powerpc64, which > > checks that a sleep value that's not -1.0 is greater than 0. On > > powerpc64, it happens that the value of -1.0 gets loaded as a float > > (perhaps a bug in gcc), but gets compared to a double. This > > compares as false, so follows through the 'sleep != -1.0' path, and > > fails the assert. Since the sub-second component isn't used in the > > double, just drop it and deal with whole-integer seconds. > > > > Reviewed by: trasz > > Differential Revision: https://reviews.freebsd.org/D21109 > > > > Modified: > > head/usr.sbin/autofs/autounmountd.c > > > > Modified: head/usr.sbin/autofs/autounmountd.c > > ============================================================================== > > --- head/usr.sbin/autofs/autounmountd.c Thu Aug 8 03:01:35 > > 2019 (r350736) +++ > > head/usr.sbin/autofs/autounmountd.c Thu Aug 8 03:16:32 > > 2019 (r350737) @@ -179,12 +179,12 @@ unmount_by_fsid(const > > fsid_t fsid, const char *mountpo return (error); } > > > > -static double > > -expire_automounted(double expiration_time) > > +static time_t > > +expire_automounted(time_t expiration_time) > > { > > struct automounted_fs *af, *tmpaf; > > time_t now; > > - double mounted_for, mounted_max = -1.0; > > + time_t mounted_for, mounted_max = -1; > > int error; > > > > now = time(NULL); > > @@ -196,9 +196,9 @@ expire_automounted(double expiration_time) > > > > if (mounted_for < expiration_time) { > > log_debugx("skipping %s (FSID:%d:%d), > > mounted " > > - "for %.0f seconds", af->af_mountpoint, > > + "for %ld seconds", af->af_mountpoint, > > > > You can't print a time_t with %ld, it'll fail on 32-bit arches with > 64- bit time_t. The usual incantation is %j and cast to intmax_t. > > -- Ian > > I cast it to a long already, so it prints as a long for all archs. I guess intmax_t might be better, but I figured nobody would hold a mount for more than 2**31 seconds (the argument is for duration, not absolute time). - Justin From owner-svn-src-all@freebsd.org Thu Aug 8 16:37:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17B2BAB054; Thu, 8 Aug 2019 16:37:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464DYm6t5tz4X38; Thu, 8 Aug 2019 16:37:32 +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 CD19F27F51; Thu, 8 Aug 2019 16:37:32 +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 x78GbWjc043956; Thu, 8 Aug 2019 16:37:32 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78GbW4s043955; Thu, 8 Aug 2019 16:37:32 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908081637.x78GbW4s043955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 8 Aug 2019 16:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350756 - head/lib/libproc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/lib/libproc X-SVN-Commit-Revision: 350756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 16:37:33 -0000 Author: jhibbits Date: Thu Aug 8 16:37:32 2019 New Revision: 350756 URL: https://svnweb.freebsd.org/changeset/base/350756 Log: mips: Fix register target for SP setting in libproc Copy-paste-o from r233042 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D21188 Modified: head/lib/libproc/proc_regs.c Modified: head/lib/libproc/proc_regs.c ============================================================================== --- head/lib/libproc/proc_regs.c Thu Aug 8 15:38:57 2019 (r350755) +++ head/lib/libproc/proc_regs.c Thu Aug 8 16:37:32 2019 (r350756) @@ -138,7 +138,7 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, #elif defined(__i386__) regs.r_esp = regvalue; #elif defined(__mips__) - regs.r_regs[PC] = regvalue; + regs.r_regs[SP] = regvalue; #elif defined(__powerpc__) regs.fixreg[1] = regvalue; #elif defined(__riscv) From owner-svn-src-all@freebsd.org Thu Aug 8 16:39:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56976AB12C; Thu, 8 Aug 2019 16:39:22 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Dbs0BTWz4XHJ; Thu, 8 Aug 2019 16:39:20 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-ot1-x330.google.com with SMTP id r21so115140968otq.6; Thu, 08 Aug 2019 09:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=glQceNDgE9VyxJ3acnVwXSBPTemKzFXytiVxd/yuVBQ=; b=tgj7ENte499C0umB1PuixHWfFeWCztex/0XADthuSHjVakvmGggFmPVzF1BzqqsB1r nrVSnZuYJUqhqt+7gz7CtgIfXkJNAiP219WJy09v6Z5kcFXHR7mVHYoZz+aOki5gGBIS KZvQHaV2dvZIEtQjyLxdwVPsb2lQB826VfF02et9TK41Q9Buboz7rqVw362GSAbdyNFK YhlwlUJq5Il4UQTlJCDZLi7ywWsrxaf4KAMS8SxieN9CBw7rRIGJAw5E6pb8pxPEqrax E/39ny7RePXK1t4AGModvr0o+zi9YXq71VXPx74nYXXSAW3Rml23CfBzUKJU39nJut0L yPog== 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:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=glQceNDgE9VyxJ3acnVwXSBPTemKzFXytiVxd/yuVBQ=; b=Jd8hvo8Wq5drO+YtlaQCwPHT3Br0c+UpBmOIVByZmbgZhHRwxdylx6oeWfyMFBfVaF 8FENlXTXn+mZfZWf89LqgZ2J6Hzcg9e5vcxMMX7PFDF++V47Drg9HUA1PHgsSIQKP4Lq oRqaU1ovrMfvsr8gFEKfv1ZhOmEeg1edyWhu8Q/fBxJy70449EFJoj/Dn7EzH24V1MYj A6Sayxt9Fu6cUEJBP3PxsfIbSLzocHyxo4ZnIybgQZA0UWlrWeqAyfA/dR3fD1VD74TV ZP9NcuBzm3qvufQAuh4x6f+0KEa4vgEYsOdUwsuU0SSM7K6MvgTktAt90gqIIFw80XTO p/pg== X-Gm-Message-State: APjAAAXitBrb7nDSIGurcC967EJ/+5Vbi48OXjcsmHFMXJwEvouPcI+u DkOadNZ0qgPH84pYAC6dLRcWyCAdCpM= X-Google-Smtp-Source: APXvYqxNX7apKUZ0BbGnhcRxYKMUFxYZ/rs9TsP8YYOMGYNR9BVyTl/XPbrINXyRSLekawVvBTNj4w== X-Received: by 2002:a6b:917:: with SMTP id t23mr1871096ioi.174.1565282359058; Thu, 08 Aug 2019 09:39:19 -0700 (PDT) Received: from ralga.knownspace (173-25-245-129.client.mchsi.com. [173.25.245.129]) by smtp.gmail.com with ESMTPSA id j25sm127892854ioj.67.2019.08.08.09.39.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 09:39:18 -0700 (PDT) Date: Thu, 8 Aug 2019 11:39:03 -0500 From: Justin Hibbits To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350756 - head/lib/libproc Message-ID: <20190808113903.364451d7@ralga.knownspace> In-Reply-To: <201908081637.x78GbW4s043955@repo.freebsd.org> References: <201908081637.x78GbW4s043955@repo.freebsd.org> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 464Dbs0BTWz4XHJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=tgj7ENte; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 2607:f8b0:4864:20::330 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-0.999,0]; RECEIVED_SPAMHAUS_PBL(0.00)[129.245.25.173.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; IP_SCORE(0.00)[ip: (-9.05), ipnet: 2607:f8b0::/32(-3.03), asn: 15169(-2.43), country: US(-0.05)]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[0.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 16:39:22 -0000 On Thu, 8 Aug 2019 16:37:32 +0000 (UTC) Justin Hibbits wrote: > Author: jhibbits > Date: Thu Aug 8 16:37:32 2019 > New Revision: 350756 > URL: https://svnweb.freebsd.org/changeset/base/350756 > > Log: > mips: Fix register target for SP setting in libproc > > Copy-paste-o from r233042 > Reviewed by: imp Sponsored by: Juniper Networks > Differential Revision: https://reviews.freebsd.org/D21188 > > Modified: > head/lib/libproc/proc_regs.c > > Modified: head/lib/libproc/proc_regs.c > ============================================================================== > --- head/lib/libproc/proc_regs.c Thu Aug 8 15:38:57 > 2019 (r350755) +++ head/lib/libproc/proc_regs.c Thu Aug > 8 16:37:32 2019 (r350756) @@ -138,7 +138,7 @@ > proc_regset(struct proc_handle *phdl, proc_reg_t reg, #elif > defined(__i386__) regs.r_esp = regvalue; > #elif defined(__mips__) > - regs.r_regs[PC] = regvalue; > + regs.r_regs[SP] = regvalue; > #elif defined(__powerpc__) > regs.fixreg[1] = regvalue; > #elif defined(__riscv) > From owner-svn-src-all@freebsd.org Thu Aug 8 16:42:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BFB7AB3F3; Thu, 8 Aug 2019 16:42:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Dgy2g5Vz4Xh8; Thu, 8 Aug 2019 16:42:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CC2D156; Thu, 8 Aug 2019 16:42:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78Ggsto049505; Thu, 8 Aug 2019 16:42:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Ggsmu049504; Thu, 8 Aug 2019 16:42:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908081642.x78Ggsmu049504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Aug 2019 16:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350757 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 16:42:54 -0000 Author: kib Date: Thu Aug 8 16:42:53 2019 New Revision: 350757 URL: https://svnweb.freebsd.org/changeset/base/350757 Log: Update comment explaining create_init(). Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu Aug 8 16:37:32 2019 (r350756) +++ head/sys/kern/init_main.c Thu Aug 8 16:42:53 2019 (r350757) @@ -797,11 +797,9 @@ start_init(void *dummy) } /* - * Like kproc_create(), but runs in its own address space. - * We do this early to reserve pid 1. - * - * Note special case - do not make it runnable yet. Other work - * in progress will change this more. + * Like kproc_create(), but runs in its own address space. We do this + * early to reserve pid 1. Note special case - do not make it + * runnable yet, init execution is started when userspace can be served. */ static void create_init(const void *udata __unused) From owner-svn-src-all@freebsd.org Thu Aug 8 16:48:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 845E4AB50A; Thu, 8 Aug 2019 16:48:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464DpD2w9Lz4Xtn; Thu, 8 Aug 2019 16:48: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 45CA7175; Thu, 8 Aug 2019 16:48: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 x78GmKkQ049810; Thu, 8 Aug 2019 16:48:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78GmKe7049809; Thu, 8 Aug 2019 16:48:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908081648.x78GmKe7049809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Aug 2019 16:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350758 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 350758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 16:48:20 -0000 Author: kib Date: Thu Aug 8 16:48:19 2019 New Revision: 350758 URL: https://svnweb.freebsd.org/changeset/base/350758 Log: Fix stack grow for init. During early stages of kern_exec(), including strings copyout, p_textvp for init is NULL. This prevented stack grow from working for init execution. Without stack gap enabled, initial stack segment size is enough for strings passed by kernel to init. With the gap enabled, the used address might fall out of the initial segment, which kills init. Exclude initproc from the check for contexts which should not cause stack grow in the target map. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Aug 8 16:42:53 2019 (r350757) +++ head/sys/vm/vm_map.c Thu Aug 8 16:48:19 2019 (r350758) @@ -4217,7 +4217,8 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_ma * debugger or AIO daemon. The reason is that the wrong * resource limits are applied. */ - if (map != &p->p_vmspace->vm_map || p->p_textvp == NULL) + if (p != initproc && (map != &p->p_vmspace->vm_map || + p->p_textvp == NULL)) return (KERN_FAILURE); MPASS(!map->system_map); From owner-svn-src-all@freebsd.org Thu Aug 8 16:51:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0FA4AB735; Thu, 8 Aug 2019 16:51:49 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464DtF5Czwz4YLl; Thu, 8 Aug 2019 16:51:49 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94C0C203; Thu, 8 Aug 2019 16:51:49 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78GpnLh054915; Thu, 8 Aug 2019 16:51:49 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78GpnaY054914; Thu, 8 Aug 2019 16:51:49 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201908081651.x78GpnaY054914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 8 Aug 2019 16:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350759 - head/sys/security/mac_veriexec_parser X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/security/mac_veriexec_parser X-SVN-Commit-Revision: 350759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 16:51:49 -0000 Author: mw Date: Thu Aug 8 16:51:49 2019 New Revision: 350759 URL: https://svnweb.freebsd.org/changeset/base/350759 Log: Fix mac_veriexec_parser build after r347938 In r347938 the definition of mac_veriexec_metadata_add_file so adjust the argument list accordingly. Submitted by: Kornel Duleba Modified: head/sys/security/mac_veriexec_parser/mac_veriexec_parser.c Modified: head/sys/security/mac_veriexec_parser/mac_veriexec_parser.c ============================================================================== --- head/sys/security/mac_veriexec_parser/mac_veriexec_parser.c Thu Aug 8 16:48:19 2019 (r350758) +++ head/sys/security/mac_veriexec_parser/mac_veriexec_parser.c Thu Aug 8 16:51:49 2019 (r350759) @@ -364,7 +364,9 @@ parse_entry(char *entry, char *prefix) rc = mac_veriexec_metadata_add_file( is_exec == 0, va.va_fsid, va.va_fileid, va.va_gen, - digest, flags, fp_type, 1); + digest, + NULL, 0, + flags, fp_type, 1); mtx_unlock(&ve_mutex); out: From owner-svn-src-all@freebsd.org Thu Aug 8 16:54:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C0BDAB94A; Thu, 8 Aug 2019 16:54:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464DxG0pHhz4Yf0; Thu, 8 Aug 2019 16:54:26 +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 F0A35370; Thu, 8 Aug 2019 16:54:25 +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 x78GsPFX056013; Thu, 8 Aug 2019 16:54:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78GsMU6055994; Thu, 8 Aug 2019 16:54:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908081654.x78GsMU6055994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Aug 2019 16:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350760 - in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/largeNbDicts sys/contrib/zstd/contrib/seekable_format sys/contrib/zstd/contrib/seekable_format/examples... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/largeNbDicts sys/contrib/zstd/contrib/seekable_format sys/contrib/zstd/contrib/seekable_format/examples sys/contrib/zstd/doc sys... X-SVN-Commit-Revision: 350760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 16:54:26 -0000 Author: cem Date: Thu Aug 8 16:54:22 2019 New Revision: 350760 URL: https://svnweb.freebsd.org/changeset/base/350760 Log: Update to Zstandard 1.4.2 The full release notes for 1.4.1 (skipped) and 1.4.2 can be found on Github: https://github.com/facebook/zstd/releases/tag/v1.4.1 https://github.com/facebook/zstd/releases/tag/v1.4.2 These are mostly minor updates; 1.4.1 purportedly brings something like 7% faster decompression speed. Relnotes: yes Added: head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression_mem.c - copied unchanged from r350755, vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression_mem.c head/sys/contrib/zstd/lib/compress/zstd_compress_literals.c - copied unchanged from r350755, vendor/zstd/dist/lib/compress/zstd_compress_literals.c head/sys/contrib/zstd/lib/compress/zstd_compress_literals.h - copied unchanged from r350755, vendor/zstd/dist/lib/compress/zstd_compress_literals.h head/sys/contrib/zstd/lib/compress/zstd_compress_sequences.c - copied unchanged from r350755, vendor/zstd/dist/lib/compress/zstd_compress_sequences.c head/sys/contrib/zstd/lib/compress/zstd_compress_sequences.h - copied unchanged from r350755, vendor/zstd/dist/lib/compress/zstd_compress_sequences.h head/sys/contrib/zstd/tests/bigdict.c - copied unchanged from r350755, vendor/zstd/dist/tests/bigdict.c head/sys/contrib/zstd/tests/fuzz/simple_compress.c - copied unchanged from r350755, vendor/zstd/dist/tests/fuzz/simple_compress.c head/sys/contrib/zstd/tests/fuzz/zstd_frame_info.c - copied unchanged from r350755, vendor/zstd/dist/tests/fuzz/zstd_frame_info.c Deleted: head/sys/contrib/zstd/tests/fuzz/default.options Modified: head/lib/libzstd/Makefile head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/contrib/zstd/CHANGELOG head/sys/contrib/zstd/contrib/largeNbDicts/largeNbDicts.c head/sys/contrib/zstd/contrib/seekable_format/examples/.gitignore head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c head/sys/contrib/zstd/doc/zstd_compression_format.md head/sys/contrib/zstd/doc/zstd_manual.html head/sys/contrib/zstd/examples/Makefile head/sys/contrib/zstd/lib/Makefile head/sys/contrib/zstd/lib/common/compiler.h head/sys/contrib/zstd/lib/common/zstd_internal.h head/sys/contrib/zstd/lib/compress/zstd_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h head/sys/contrib/zstd/lib/compress/zstd_double_fast.c head/sys/contrib/zstd/lib/compress/zstd_fast.c head/sys/contrib/zstd/lib/compress/zstd_lazy.c head/sys/contrib/zstd/lib/compress/zstd_ldm.c head/sys/contrib/zstd/lib/compress/zstd_opt.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.h head/sys/contrib/zstd/lib/decompress/zstd_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_decompress_block.c head/sys/contrib/zstd/lib/dictBuilder/cover.c head/sys/contrib/zstd/lib/dictBuilder/cover.h head/sys/contrib/zstd/lib/dictBuilder/fastcover.c head/sys/contrib/zstd/lib/dictBuilder/zdict.c head/sys/contrib/zstd/lib/dictBuilder/zdict.h head/sys/contrib/zstd/lib/legacy/zstd_legacy.h head/sys/contrib/zstd/lib/legacy/zstd_v01.c head/sys/contrib/zstd/lib/legacy/zstd_v02.c head/sys/contrib/zstd/lib/legacy/zstd_v03.c head/sys/contrib/zstd/lib/legacy/zstd_v04.c head/sys/contrib/zstd/lib/legacy/zstd_v05.c head/sys/contrib/zstd/lib/legacy/zstd_v06.c head/sys/contrib/zstd/lib/legacy/zstd_v07.c head/sys/contrib/zstd/lib/zstd.h head/sys/contrib/zstd/programs/.gitignore head/sys/contrib/zstd/programs/README.md head/sys/contrib/zstd/programs/benchfn.c head/sys/contrib/zstd/programs/fileio.c head/sys/contrib/zstd/programs/fileio.h head/sys/contrib/zstd/programs/util.c head/sys/contrib/zstd/programs/zstd.1 head/sys/contrib/zstd/programs/zstd.1.md head/sys/contrib/zstd/programs/zstdcli.c head/sys/contrib/zstd/programs/zstdgrep head/sys/contrib/zstd/programs/zstdgrep.1 head/sys/contrib/zstd/programs/zstdless.1 head/sys/contrib/zstd/tests/.gitignore head/sys/contrib/zstd/tests/Makefile head/sys/contrib/zstd/tests/decodecorpus.c head/sys/contrib/zstd/tests/fullbench.c head/sys/contrib/zstd/tests/fuzz/Makefile head/sys/contrib/zstd/tests/fuzz/dictionary_decompress.c head/sys/contrib/zstd/tests/fuzz/fuzz.py head/sys/contrib/zstd/tests/fuzz/simple_decompress.c head/sys/contrib/zstd/tests/fuzzer.c head/sys/contrib/zstd/tests/paramgrill.c head/sys/contrib/zstd/tests/playTests.sh head/sys/contrib/zstd/tests/poolTests.c head/sys/contrib/zstd/tests/regression/results.csv head/sys/contrib/zstd/tests/zstreamtest.c head/sys/contrib/zstd/zlibWrapper/.gitignore Directory Properties: head/sys/contrib/zstd/ (props changed) Modified: head/lib/libzstd/Makefile ============================================================================== --- head/lib/libzstd/Makefile Thu Aug 8 16:51:49 2019 (r350759) +++ head/lib/libzstd/Makefile Thu Aug 8 16:54:22 2019 (r350760) @@ -11,6 +11,8 @@ SRCS= entropy_common.c \ fse_compress.c \ huf_compress.c \ zstd_compress.c \ + zstd_compress_literals.c \ + zstd_compress_sequences.c \ zstdmt_compress.c \ huf_decompress.c \ zstd_ddict.c \ @@ -43,7 +45,20 @@ ZSTDDIR= ${SRCTOP}/sys/contrib/zstd ${ZSTDDIR}/lib/decompress ${ZSTDDIR}/lib/deprecated \ ${ZSTDDIR}/lib/dictBuilder ${ZSTDDIR}/lib +.include + +# https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1] +# "Note that [GCC] autovectorization still does not do a good job on the +# optimized version, so it's turned off via attribute and flag. I found +# that neither attribute nor command-line flag were entirely successful in +# turning off vectorization, which is why there were both." +.if ${COMPILER_TYPE} == "gcc" +CFLAGS.zstd_decompress_block.c+= -fno-tree-vectorize +.endif + # Work around for LLVM bug 35023, https://bugs.llvm.org/show_bug.cgi?id=35023 +# Fixed in https://reviews.llvm.org/rL349935 ; not sure if we have that version +# in our LLVM or not yet. .if ${MACHINE_ARCH:Marm*} != "" CFLAGS.zstd_compress.c+= -O0 .endif Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/conf/files Thu Aug 8 16:54:22 2019 (r350760) @@ -648,6 +648,8 @@ contrib/zstd/lib/common/entropy_common.c optional zstd contrib/zstd/lib/common/error_private.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/common/xxhash.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_compress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress_literals.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/compress/zstd_compress_sequences.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/fse_compress.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/hist.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/huf_compress.c optional zstdio compile-with ${ZSTD_C} @@ -658,7 +660,9 @@ contrib/zstd/lib/compress/zstd_ldm.c optional zstdio contrib/zstd/lib/compress/zstd_opt.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/decompress/zstd_ddict.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/decompress/zstd_decompress.c optional zstdio compile-with ${ZSTD_C} -contrib/zstd/lib/decompress/zstd_decompress_block.c optional zstdio compile-with ${ZSTD_C} +# See comment in sys/conf/kern.pre.mk +contrib/zstd/lib/decompress/zstd_decompress_block.c optional zstdio \ + compile-with "${ZSTD_C} ${ZSTD_DECOMPRESS_BLOCK_FLAGS}" contrib/zstd/lib/decompress/huf_decompress.c optional zstdio compile-with ${ZSTD_C} # Blake 2 contrib/libb2/blake2b-ref.c optional crypto | ipsec | ipsec_support \ Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/conf/kern.pre.mk Thu Aug 8 16:54:22 2019 (r350760) @@ -175,6 +175,14 @@ NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -war # for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} -Wno-inline -Wno-missing-prototypes ${PROF} -U__BMI__ ${.IMPSRC} +# https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1] +# "Note that [GCC] autovectorization still does not do a good job on the +# optimized version, so it's turned off via attribute and flag. I found +# that neither attribute nor command-line flag were entirely successful in +# turning off vectorization, which is why there were both." +.if ${COMPILER_TYPE} == "gcc" +ZSTD_DECOMPRESS_BLOCK_FLAGS= -fno-tree-vectorize +.endif # Common for dtrace / zfs CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas Modified: head/sys/contrib/zstd/CHANGELOG ============================================================================== --- head/sys/contrib/zstd/CHANGELOG Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/CHANGELOG Thu Aug 8 16:54:22 2019 (r350760) @@ -1,3 +1,39 @@ +v1.4.2 +bug: Fix bug in zstd-0.5 decoder by @terrelln (#1696) +bug: Fix seekable decompression in-memory API by @iburinoc (#1695) +misc: Validate blocks are smaller than size limit by @vivekmg (#1685) +misc: Restructure source files by @ephiepark (#1679) + +v1.4.1 +bug: Fix data corruption in niche use cases by @terrelln (#1659) +bug: Fuzz legacy modes, fix uncovered bugs by @terrelln (#1593, #1594, #1595) +bug: Fix out of bounds read by @terrelln (#1590) +perf: Improve decode speed by ~7% @mgrice (#1668) +perf: Slightly improved compression ratio of level 3 and 4 (ZSTD_dfast) by @cyan4973 (#1681) +perf: Slightly faster compression speed when re-using a context by @cyan4973 (#1658) +perf: Improve compression ratio for small windowLog by @cyan4973 (#1624) +perf: Faster compression speed in high compression mode for repetitive data by @terrelln (#1635) +api: Add parameter to generate smaller dictionaries by @tyler-tran (#1656) +cli: Recognize symlinks when built in C99 mode by @felixhandte (#1640) +cli: Expose cpu load indicator for each file on -vv mode by @ephiepark (#1631) +cli: Restrict read permissions on destination files by @chungy (#1644) +cli: zstdgrep: handle -f flag by @felixhandte (#1618) +cli: zstdcat: follow symlinks by @vejnar (#1604) +doc: Remove extra size limit on compressed blocks by @felixhandte (#1689) +doc: Fix typo by @yk-tanigawa (#1633) +doc: Improve documentation on streaming buffer sizes by @cyan4973 (#1629) +build: CMake: support building with LZ4 @leeyoung624 (#1626) +build: CMake: install zstdless and zstdgrep by @leeyoung624 (#1647) +build: CMake: respect existing uninstall target by @j301scott (#1619) +build: Make: skip multithread tests when built without support by @michaelforney (#1620) +build: Make: Fix examples/ test target by @sjnam (#1603) +build: Meson: rename options out of deprecated namespace by @lzutao (#1665) +build: Meson: fix build by @lzutao (#1602) +build: Visual Studio: don't export symbols in static lib by @scharan (#1650) +build: Visual Studio: fix linking by @absotively (#1639) +build: Fix MinGW-W64 build by @myzhang1029 (#1600) +misc: Expand decodecorpus coverage by @ephiepark (#1664) + v1.4.0 perf: Improve level 1 compression speed in most scenarios by 6% by @gbtucker and @terrelln api: Move the advanced API, including all functions in the staging section, to the stable section Modified: head/sys/contrib/zstd/contrib/largeNbDicts/largeNbDicts.c ============================================================================== --- head/sys/contrib/zstd/contrib/largeNbDicts/largeNbDicts.c Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/contrib/largeNbDicts/largeNbDicts.c Thu Aug 8 16:54:22 2019 (r350760) @@ -559,7 +559,7 @@ static int benchMem(slice_collection_t dstBlocks, CONTROL(BMK_isSuccessful_runOutcome(outcome)); BMK_runTime_t const result = BMK_extract_runTime(outcome); - U64 const dTime_ns = result.nanoSecPerRun; + double const dTime_ns = result.nanoSecPerRun; double const dTime_sec = (double)dTime_ns / 1000000000; size_t const srcSize = result.sumOfReturn; double const dSpeed_MBps = (double)srcSize / dTime_sec / (1 MB); Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/.gitignore ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/examples/.gitignore Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/contrib/seekable_format/examples/.gitignore Thu Aug 8 16:54:22 2019 (r350760) @@ -1,4 +1,5 @@ seekable_compression seekable_decompression +seekable_decompression_mem parallel_processing parallel_compression Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/contrib/seekable_format/examples/Makefile Thu Aug 8 16:54:22 2019 (r350760) @@ -24,7 +24,8 @@ SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_dec default: all -all: seekable_compression seekable_decompression parallel_processing +all: seekable_compression seekable_decompression seekable_decompression_mem \ + parallel_processing $(ZSTDLIB): make -C $(ZSTDLIB_PATH) $(ZSTDLIB_NAME) @@ -35,6 +36,9 @@ seekable_compression : seekable_compression.c $(SEEKAB seekable_decompression : seekable_decompression.c $(SEEKABLE_OBJS) $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ +seekable_decompression_mem : seekable_decompression_mem.c $(SEEKABLE_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ + parallel_processing : parallel_processing.c $(SEEKABLE_OBJS) $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@ -pthread @@ -44,5 +48,6 @@ parallel_compression : parallel_compression.c $(SEEKAB clean: @rm -f core *.o tmp* result* *.zst \ seekable_compression seekable_decompression \ + seekable_decompression_mem \ parallel_processing parallel_compression @echo Cleaning completed Copied: head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression_mem.c (from r350755, vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression_mem.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/zstd/contrib/seekable_format/examples/seekable_decompression_mem.c Thu Aug 8 16:54:22 2019 (r350760, copy of r350755, vendor/zstd/dist/contrib/seekable_format/examples/seekable_decompression_mem.c) @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under both the BSD-style license (found in the + * LICENSE file in the root directory of this source tree) and the GPLv2 (found + * in the COPYING file in the root directory of this source tree). + */ + + +#include // malloc, exit +#include // fprintf, perror, feof +#include // strerror +#include // errno +#define ZSTD_STATIC_LINKING_ONLY +#include // presumes zstd library is installed +#include + +#include "zstd_seekable.h" + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +#define MAX_FILE_SIZE (8 * 1024 * 1024) + +static void* malloc_orDie(size_t size) +{ + void* const buff = malloc(size); + if (buff) return buff; + /* error */ + perror("malloc"); + exit(1); +} + +static void* realloc_orDie(void* ptr, size_t size) +{ + ptr = realloc(ptr, size); + if (ptr) return ptr; + /* error */ + perror("realloc"); + exit(1); +} + +static FILE* fopen_orDie(const char *filename, const char *instruction) +{ + FILE* const inFile = fopen(filename, instruction); + if (inFile) return inFile; + /* error */ + perror(filename); + exit(3); +} + +static size_t fread_orDie(void* buffer, size_t sizeToRead, FILE* file) +{ + size_t const readSize = fread(buffer, 1, sizeToRead, file); + if (readSize == sizeToRead) return readSize; /* good */ + if (feof(file)) return readSize; /* good, reached end of file */ + /* error */ + perror("fread"); + exit(4); +} + +static size_t fwrite_orDie(const void* buffer, size_t sizeToWrite, FILE* file) +{ + size_t const writtenSize = fwrite(buffer, 1, sizeToWrite, file); + if (writtenSize == sizeToWrite) return sizeToWrite; /* good */ + /* error */ + perror("fwrite"); + exit(5); +} + +static size_t fclose_orDie(FILE* file) +{ + if (!fclose(file)) return 0; + /* error */ + perror("fclose"); + exit(6); +} + +static void fseek_orDie(FILE* file, long int offset, int origin) { + if (!fseek(file, offset, origin)) { + if (!fflush(file)) return; + } + /* error */ + perror("fseek"); + exit(7); +} + + +static void decompressFile_orDie(const char* fname, off_t startOffset, off_t endOffset) +{ + FILE* const fin = fopen_orDie(fname, "rb"); + FILE* const fout = stdout; + // Just for demo purposes, assume file is <= MAX_FILE_SIZE + void* const buffIn = malloc_orDie(MAX_FILE_SIZE); + size_t const inSize = fread_orDie(buffIn, MAX_FILE_SIZE, fin); + size_t const buffOutSize = ZSTD_DStreamOutSize(); /* Guarantee to successfully flush at least one complete compressed block in all circumstances. */ + void* const buffOut = malloc_orDie(buffOutSize); + + ZSTD_seekable* const seekable = ZSTD_seekable_create(); + if (seekable==NULL) { fprintf(stderr, "ZSTD_seekable_create() error \n"); exit(10); } + + size_t const initResult = ZSTD_seekable_initBuff(seekable, buffIn, inSize); + if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_seekable_init() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } + + while (startOffset < endOffset) { + size_t const result = ZSTD_seekable_decompress(seekable, buffOut, MIN(endOffset - startOffset, buffOutSize), startOffset); + + if (ZSTD_isError(result)) { + fprintf(stderr, "ZSTD_seekable_decompress() error : %s \n", + ZSTD_getErrorName(result)); + exit(12); + } + fwrite_orDie(buffOut, result, fout); + startOffset += result; + } + + ZSTD_seekable_free(seekable); + fclose_orDie(fin); + fclose_orDie(fout); + free(buffIn); + free(buffOut); +} + + +int main(int argc, const char** argv) +{ + const char* const exeName = argv[0]; + + if (argc!=4) { + fprintf(stderr, "wrong arguments\n"); + fprintf(stderr, "usage:\n"); + fprintf(stderr, "%s FILE START END\n", exeName); + return 1; + } + + { + const char* const inFilename = argv[1]; + off_t const startOffset = atoll(argv[2]); + off_t const endOffset = atoll(argv[3]); + decompressFile_orDie(inFilename, startOffset, endOffset); + } + + return 0; +} Modified: head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Thu Aug 8 16:54:22 2019 (r350760) @@ -106,7 +106,7 @@ typedef struct { static int ZSTD_seekable_read_buff(void* opaque, void* buffer, size_t n) { buffWrapper_t* buff = (buffWrapper_t*) opaque; - if (buff->size + n > buff->pos) return -1; + if (buff->pos + n > buff->size) return -1; memcpy(buffer, (const BYTE*)buff->ptr + buff->pos, n); buff->pos += n; return 0; @@ -124,7 +124,7 @@ static int ZSTD_seekable_seek_buff(void* opaque, long newOffset = (unsigned long long)buff->pos + offset; break; case SEEK_END: - newOffset = (unsigned long long)buff->size - offset; + newOffset = (unsigned long long)buff->size + offset; break; default: assert(0); /* not possible */ Modified: head/sys/contrib/zstd/doc/zstd_compression_format.md ============================================================================== --- head/sys/contrib/zstd/doc/zstd_compression_format.md Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/doc/zstd_compression_format.md Thu Aug 8 16:54:22 2019 (r350760) @@ -16,7 +16,7 @@ Distribution of this document is unlimited. ### Version -0.3.1 (25/10/18) +0.3.2 (17/07/19) Introduction @@ -390,9 +390,7 @@ A block can contain any number of bytes (even zero), u - Window_Size - 128 KB -A `Compressed_Block` has the extra restriction that `Block_Size` is always -strictly less than the decompressed size. -If this condition cannot be respected, +If this condition cannot be respected when generating a `Compressed_Block`, the block must be sent uncompressed instead (`Raw_Block`). @@ -1655,6 +1653,7 @@ or at least provide a meaningful error code explaining Version changes --------------- +- 0.3.2 : remove additional block size restriction on compressed blocks - 0.3.1 : minor clarification regarding offset history update rules - 0.3.0 : minor edits to match RFC8478 - 0.2.9 : clarifications for huffman weights direct representation, by Ulrich Kunitz Modified: head/sys/contrib/zstd/doc/zstd_manual.html ============================================================================== --- head/sys/contrib/zstd/doc/zstd_manual.html Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/doc/zstd_manual.html Thu Aug 8 16:54:22 2019 (r350760) @@ -1,46 +1,36 @@ -zstd 1.4.0 Manual +zstd 1.4.2 Manual -

    zstd 1.4.0 Manual

    +

    zstd 1.4.2 Manual


    Contents

    1. Introduction
    2. Version
    3. -
    4. Default constant
    5. -
    6. Constants
    7. -
    8. Simple API
    9. -
    10. Explicit context
    11. -
    12. Advanced compression API
    13. -
    14. Advanced decompression API
    15. -
    16. Streaming
    17. -
    18. Streaming compression - HowTo
    19. -
    20. This is a legacy streaming API, and can be replaced by ZSTD_CCtx_reset() and
    21. -
    22. Equivalent to:
    23. -
    24. Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).
    25. -
    26. Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).
    27. -
    28. Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).
    29. -
    30. Streaming decompression - HowTo
    31. -
    32. Simple dictionary API
    33. -
    34. Bulk processing dictionary API
    35. -
    36. Dictionary helper functions
    37. -
    38. Advanced dictionary and prefix API
    39. -
    40. ADVANCED AND EXPERIMENTAL FUNCTIONS
    41. -
    42. experimental API (static linking only)
    43. -
    44. Frame size functions
    45. -
    46. ZSTD_decompressBound() :
    47. -
    48. Memory management
    49. -
    50. Advanced compression functions
    51. -
    52. Advanced decompression functions
    53. -
    54. Advanced streaming functions
    55. -
    56. Buffer-less and synchronous inner streaming functions
    57. -
    58. Buffer-less streaming compression (synchronous mode)
    59. -
    60. Buffer-less streaming decompression (synchronous mode)
    61. -
    62. ZSTD_getFrameHeader() :
    63. -
    64. Block level API
    65. +
    66. Simple API
    67. +
    68. Explicit context
    69. +
    70. Advanced compression API
    71. +
    72. Advanced decompression API
    73. +
    74. Streaming
    75. +
    76. Streaming compression - HowTo
    77. +
    78. Streaming decompression - HowTo
    79. +
    80. Simple dictionary API
    81. +
    82. Bulk processing dictionary API
    83. +
    84. Dictionary helper functions
    85. +
    86. Advanced dictionary and prefix API
    87. +
    88. experimental API (static linking only)
    89. +
    90. Frame size functions
    91. +
    92. Memory management
    93. +
    94. Advanced compression functions
    95. +
    96. Advanced decompression functions
    97. +
    98. Advanced streaming functions
    99. +
    100. Buffer-less and synchronous inner streaming functions
    101. +
    102. Buffer-less streaming compression (synchronous mode)
    103. +
    104. Buffer-less streaming decompression (synchronous mode)
    105. +
    106. Block level API

    Introduction

    @@ -78,12 +68,8 @@
     
     
    unsigned ZSTD_versionNumber(void);   /**< to check runtime library version */
     

    -

    Default constant

    
    +

    Simple API

    
     
    -

    Constants

    
    -
    -

    Simple API

    
    -
     
    size_t ZSTD_compress( void* dst, size_t dstCapacity,
                     const void* src, size_t srcSize,
                           int compressionLevel);
    @@ -152,12 +138,17 @@ const char* ZSTD_getErrorName(size_t code);     /*
     int         ZSTD_minCLevel(void);               /*!< minimum negative compression level allowed */
     int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */
     

    -

    Explicit context

    
    +

    Explicit context

    
     
     

    Compression context

      When compressing many times,
    -  it is recommended to allocate a context just once, and re-use it for each successive compression operation.
    +  it is recommended to allocate a context just once,
    +  and re-use it for each successive compression operation.
       This will make workload friendlier for system's memory.
    -  Use one context per thread for parallel execution in multi-threaded environments. 
    +  Note : re-using context is just a speed / resource optimization.
    +         It doesn't change the compression ratio, which remains identical.
    +  Note 2 : In multi-threaded environments,
    +         use one different context per thread for parallel execution.
    + 
     
    typedef struct ZSTD_CCtx_s ZSTD_CCtx;
     ZSTD_CCtx* ZSTD_createCCtx(void);
     size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);
    @@ -189,7 +180,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
      
     


    -

    Advanced compression API

    
    +

    Advanced compression API

    
     
     
    typedef enum { ZSTD_fast=1,
                    ZSTD_dfast=2,
    @@ -332,6 +323,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
          * ZSTD_c_forceMaxWindow
          * ZSTD_c_forceAttachDict
          * ZSTD_c_literalCompressionMode
    +     * ZSTD_c_targetCBlockSize
          * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
          * note : never ever use experimentalParam? names directly;
          *        also, the enums values themselves are unstable and can still change.
    @@ -341,6 +333,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
          ZSTD_c_experimentalParam3=1000,
          ZSTD_c_experimentalParam4=1001,
          ZSTD_c_experimentalParam5=1002,
    +     ZSTD_c_experimentalParam6=1003,
     } ZSTD_cParameter;
     

    typedef struct {
    @@ -424,7 +417,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
      
     


    -

    Advanced decompression API

    
    +

    Advanced decompression API

    
     
     
    typedef enum {
     
    @@ -472,7 +465,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
      
     


    -

    Streaming

    
    +

    Streaming

    
     
     
    typedef struct ZSTD_inBuffer_s {
       const void* src;    /**< start of input buffer */
    @@ -486,7 +479,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
       size_t pos;         /**< position where writing stopped. Will be updated. Necessarily 0 <= pos <= size */
     } ZSTD_outBuffer;
     

    -

    Streaming compression - HowTo

    +

    Streaming compression - HowTo

       A ZSTD_CStream object is required to track streaming operation.
       Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources.
       ZSTD_CStream objects can be reused multiple times on consecutive compression operations.
    @@ -592,31 +585,28 @@ size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
     
     
    size_t ZSTD_CStreamInSize(void);    /**< recommended size for input buffer */
     

    -
    size_t ZSTD_CStreamOutSize(void);   /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block in all circumstances. */
    +
    size_t ZSTD_CStreamOutSize(void);   /**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block. */
     

    -

    This is a legacy streaming API, and can be replaced by ZSTD_CCtx_reset() and

     ZSTD_compressStream2(). It is redundent, but is still fully supported.
    - Advanced parameters and dictionary compression can only be used through the
    - new API.
    -
    - -

    Equivalent to:

    +
    size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
    +/*!
    + * Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).
    + * NOTE: The return value is different. ZSTD_compressStream() returns a hint for
    + * the next read size (if non-zero and not an error). ZSTD_compressStream2()
    + * returns the minimum nb of bytes left to flush (if non-zero and not an error).
    + */
    +size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
    +/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush). */
    +size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
    +/*! Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end). */
    +size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
    +

    ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any) ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); -

    +


    -

    Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue).

     NOTE: The return value is different. ZSTD_compressStream() returns a hint for
    - the next read size (if non-zero and not an error). ZSTD_compressStream2()
    - returns the number of bytes left to flush (if non-zero and not an error).
    - 
    -
    - -

    Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).

    
    -
    -

    Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).

    
    -
    -

    Streaming decompression - HowTo

    +

    Streaming decompression - HowTo

       A ZSTD_DStream object is required to track streaming operations.
       Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources.
       ZSTD_DStream objects can be re-used multiple times.
    @@ -647,14 +637,12 @@ size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
     

    ZSTD_DStream management functions

    ZSTD_DStream* ZSTD_createDStream(void);
     size_t ZSTD_freeDStream(ZSTD_DStream* zds);
     

    -

    Streaming decompression functions

    size_t ZSTD_initDStream(ZSTD_DStream* zds);
    -size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
    -

    +

    Streaming decompression functions


    size_t ZSTD_DStreamInSize(void);    /*!< recommended size for input buffer */
     

    size_t ZSTD_DStreamOutSize(void);   /*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */
     

    -

    Simple dictionary API

    
    +

    Simple dictionary API

    
     
     
    size_t ZSTD_compress_usingDict(ZSTD_CCtx* ctx,
                                    void* dst, size_t dstCapacity,
    @@ -680,7 +668,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
       Note : When `dict == NULL || dictSize < 8` no dictionary is used. 
     


    -

    Bulk processing dictionary API

    
    +

    Bulk processing dictionary API

    
     
     
    ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
                                  int compressionLevel);
    @@ -723,7 +711,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
       Recommended when same dictionary is used multiple times. 
     


    -

    Dictionary helper functions

    
    +

    Dictionary helper functions

    
     
     
    unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);
     

    Provides the dictID stored within dictionary. @@ -749,7 +737,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.


    -

    Advanced dictionary and prefix API

    +

    Advanced dictionary and prefix API

      This API allows dictionaries to be used with ZSTD_compress2(),
      ZSTD_compressStream2(), and ZSTD_decompress(). Dictionaries are sticky, and
      only reset with the context is reset with ZSTD_reset_parameters or
    @@ -867,15 +855,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
       Note that object memory usage can evolve (increase or decrease) over time. 
     


    -

    ADVANCED AND EXPERIMENTAL FUNCTIONS

    - The definitions in the following section are considered experimental.
    - They are provided for advanced scenarios.
    - They should never be used with a dynamic library, as prototypes may change in the future.
    - Use them only in association with static linking.
    - 
    -
    - -

    experimental API (static linking only)

    +

    experimental API (static linking only)

      The following symbols and constants
      are not planned to join "stable API" status in the near future.
      They can still change in future versions.
    @@ -973,7 +953,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
       ZSTD_lcm_uncompressed = 2,  /**< Always emit uncompressed literals. */
     } ZSTD_literalCompressionMode_e;
     

    -

    Frame size functions

    
    +

    Frame size functions

    
     
     
    unsigned long long ZSTD_findDecompressedSize(const void* src, size_t srcSize);
     

    `src` should point to the start of a series of ZSTD encoded and/or skippable frames @@ -998,7 +978,8 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); however it does mean that all frame data must be present and valid.


    -

    ZSTD_decompressBound() :

      `src` should point to the start of a series of ZSTD encoded and/or skippable frames
    +
    unsigned long long ZSTD_decompressBound(const void* src, size_t srcSize);
    +

    `src` should point to the start of a series of ZSTD encoded and/or skippable frames `srcSize` must be the _exact_ size of this series (i.e. there should be a frame boundary at `src + srcSize`) @return : - upper-bound for the decompressed size of all data in all successive frames @@ -1010,7 +991,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); note 3 : when the decompressed size field isn't available, the upper-bound for that frame is calculated by: upper-bound = # blocks * min(128 KB, Window_Size) -

    +


    size_t ZSTD_frameHeaderSize(const void* src, size_t srcSize);
     

    srcSize must be >= ZSTD_FRAMEHEADERSIZE_PREFIX. @@ -1018,7 +999,7 @@ size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict); or an error code (if srcSize is too small)


    -

    Memory management

    
    +

    Memory management

    
     
     
    size_t ZSTD_estimateCCtxSize(int compressionLevel);
     size_t ZSTD_estimateCCtxSize_usingCParams(ZSTD_compressionParameters cParams);
    @@ -1098,7 +1079,7 @@ static ZSTD_customMem const ZSTD_defaultCMem = { NULL,
      
     


    -

    Advanced compression functions

    
    +

    Advanced compression functions

    
     
     
    ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);
     

    Create a digested dictionary for compression @@ -1243,7 +1224,7 @@ size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);


    -

    Advanced decompression functions

    
    +

    Advanced decompression functions

    
     
     
    unsigned ZSTD_isFrame(const void* buffer, size_t size);
     

    Tells if the content of `buffer` starts with a valid Frame Identifier. @@ -1305,7 +1286,7 @@ size_t ZSTD_freeCCtxParams(ZSTD_CCtx_params* params);


    -

    Advanced streaming functions

      Warning : most of these functions are now redundant with the Advanced API.
    +

    Advanced streaming functions

      Warning : most of these functions are now redundant with the Advanced API.
       Once Advanced API reaches "stable" status,
       redundant functions will be deprecated, and then at some point removed.
     
    @@ -1407,18 +1388,41 @@ size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStre


    -

    Advanced Streaming decompression functions

    size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: no dictionary will be used if dict == NULL or dictSize < 8 */
    -size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);  /**< note : ddict is referenced, it must outlive decompression session */
    -size_t ZSTD_resetDStream(ZSTD_DStream* zds);  /**< re-use decompression parameters from previous init; saves dictionary loading */
    +

    Advanced Streaming decompression functions

    /**
    + * This function is deprecated, and is equivalent to:
    + *
    + *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);
    + *     ZSTD_DCtx_loadDictionary(zds, dict, dictSize);
    + *
    + * note: no dictionary will be used if dict == NULL or dictSize < 8
    + */
    +size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize);
    +/**
    + * This function is deprecated, and is equivalent to:
    + *
    + *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);
    + *     ZSTD_DCtx_refDDict(zds, ddict);
    + *
    + * note : ddict is referenced, it must outlive decompression session
    + */
    +size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);
    +/**
    + * This function is deprecated, and is equivalent to:
    + *
    + *     ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);
    + *
    + * re-use decompression parameters from previous init; saves dictionary loading
    + */
    +size_t ZSTD_resetDStream(ZSTD_DStream* zds);
     

    -

    Buffer-less and synchronous inner streaming functions

    +

    Buffer-less and synchronous inner streaming functions

       This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
       But it's also a complex one, with several restrictions, documented below.
       Prefer normal streaming API for an easier experience.
      
     
    -

    Buffer-less streaming compression (synchronous mode)

    +

    Buffer-less streaming compression (synchronous mode)

       A ZSTD_CCtx object is required to track streaming operations.
       Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.
       ZSTD_CCtx object can be re-used multiple times within successive compression operations.
    @@ -1454,7 +1458,7 @@ size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, 
     size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);   /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */
     size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**<  note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */
     

    -

    Buffer-less streaming decompression (synchronous mode)

    +

    Buffer-less streaming decompression (synchronous mode)

       A ZSTD_DCtx object is required to track streaming operations.
       Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.
       A ZSTD_DCtx object can be re-used multiple times.
    @@ -1536,23 +1540,21 @@ typedef struct {
         unsigned checksumFlag;
     } ZSTD_frameHeader;
     

    -

    ZSTD_getFrameHeader() :

      decode Frame Header, or requires larger `srcSize`.
    +
    size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */
    +/*! ZSTD_getFrameHeader_advanced() :
    + *  same as ZSTD_getFrameHeader(),
    + *  with added capability to select a format (like ZSTD_f_zstd1_magicless) */
    +size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format);
    +size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);  /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */
    +

    decode Frame Header, or requires larger `srcSize`. @return : 0, `zfhPtr` is correctly filled, >0, `srcSize` is too small, value is wanted `srcSize` amount, or an error code, which can be tested using ZSTD_isError() -

    - -
    size_t ZSTD_getFrameHeader(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize);   /**< doesn't consume input */
    -

    -
    size_t ZSTD_getFrameHeader_advanced(ZSTD_frameHeader* zfhPtr, const void* src, size_t srcSize, ZSTD_format_e format);
    -size_t ZSTD_decodingBufferSize_min(unsigned long long windowSize, unsigned long long frameContentSize);  /**< when frame content size is not known, pass in frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN */
    -

    same as ZSTD_getFrameHeader(), - with added capability to select a format (like ZSTD_f_zstd1_magicless)


    typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
     

    -

    Block level API

    
    +

    Block level API

    
     
     

    Frame metadata cost is typically ~18 bytes, which can be non-negligible for very small blocks (< 100 bytes). User will have to take in charge required information to regenerate data, such as compressed and content sizes. Modified: head/sys/contrib/zstd/examples/Makefile ============================================================================== --- head/sys/contrib/zstd/examples/Makefile Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/examples/Makefile Thu Aug 8 16:54:22 2019 (r350760) @@ -77,7 +77,6 @@ test: all @echo -- Edge cases detection ! ./streaming_decompression tmp # invalid input, must fail ! ./simple_decompression tmp # invalid input, must fail - ! ./simple_decompression tmp.zst # unknown input size, must fail touch tmpNull # create 0-size file ./simple_compression tmpNull ./simple_decompression tmpNull.zst # 0-size frame : must work Modified: head/sys/contrib/zstd/lib/Makefile ============================================================================== --- head/sys/contrib/zstd/lib/Makefile Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/lib/Makefile Thu Aug 8 16:54:22 2019 (r350760) @@ -17,6 +17,7 @@ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT)) LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT)) LIBVER := $(shell echo $(LIBVER_SCRIPT)) VERSION?= $(LIBVER) +CCVER := $(shell $(CC) --version) CPPFLAGS+= -I. -I./common -DXXH_NAMESPACE=ZSTD_ ifeq ($(OS),Windows_NT) # MinGW assumed @@ -44,6 +45,10 @@ ZSTDDECOMP_FILES := $(sort $(wildcard decompress/*.c)) ZDICT_FILES := $(sort $(wildcard dictBuilder/*.c)) ZDEPR_FILES := $(sort $(wildcard deprecated/*.c)) ZSTD_FILES := $(ZSTDCOMMON_FILES) + +ifeq ($(findstring GCC,$(CCVER)),GCC) +decompress/zstd_decompress_block.o : CFLAGS+=-fno-tree-vectorize +endif ZSTD_LEGACY_SUPPORT ?= 5 ZSTD_LIB_COMPRESSION ?= 1 Modified: head/sys/contrib/zstd/lib/common/compiler.h ============================================================================== --- head/sys/contrib/zstd/lib/common/compiler.h Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/lib/common/compiler.h Thu Aug 8 16:54:22 2019 (r350760) @@ -127,6 +127,13 @@ } \ } +/* vectorization */ +#if !defined(__clang__) && defined(__GNUC__) +# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) +#else +# define DONT_VECTORIZE +#endif + /* disable warnings */ #ifdef _MSC_VER /* Visual Studio */ # include /* For Visual 2005 */ Modified: head/sys/contrib/zstd/lib/common/zstd_internal.h ============================================================================== --- head/sys/contrib/zstd/lib/common/zstd_internal.h Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/lib/common/zstd_internal.h Thu Aug 8 16:54:22 2019 (r350760) @@ -34,7 +34,6 @@ #endif #include "xxhash.h" /* XXH_reset, update, digest */ - #if defined (__cplusplus) extern "C" { #endif @@ -193,19 +192,72 @@ static const U32 OF_defaultNormLog = OF_DEFAULTNORMLOG * Shared functions to include for inlining *********************************************/ static void ZSTD_copy8(void* dst, const void* src) { memcpy(dst, src, 8); } + #define COPY8(d,s) { ZSTD_copy8(d,s); d+=8; s+=8; } +static void ZSTD_copy16(void* dst, const void* src) { memcpy(dst, src, 16); } +#define COPY16(d,s) { ZSTD_copy16(d,s); d+=16; s+=16; } +#define WILDCOPY_OVERLENGTH 8 +#define VECLEN 16 + +typedef enum { + ZSTD_no_overlap, + ZSTD_overlap_src_before_dst, + /* ZSTD_overlap_dst_before_src, */ +} ZSTD_overlap_e; + /*! ZSTD_wildcopy() : * custom version of memcpy(), can overwrite up to WILDCOPY_OVERLENGTH bytes (if length==0) */ -#define WILDCOPY_OVERLENGTH 8 -MEM_STATIC void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length) +MEM_STATIC FORCE_INLINE_ATTR DONT_VECTORIZE +void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e ovtype) { + ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src; const BYTE* ip = (const BYTE*)src; BYTE* op = (BYTE*)dst; BYTE* const oend = op + length; - do - COPY8(op, ip) - while (op < oend); + + assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff < -8)); + if (length < VECLEN || (ovtype == ZSTD_overlap_src_before_dst && diff < VECLEN)) { + do + COPY8(op, ip) + while (op < oend); + } + else { + if ((length & 8) == 0) + COPY8(op, ip); + do { + COPY16(op, ip); + } + while (op < oend); + } +} + +/*! ZSTD_wildcopy_16min() : + * same semantics as ZSTD_wilcopy() except guaranteed to be able to copy 16 bytes at the start */ +MEM_STATIC FORCE_INLINE_ATTR DONT_VECTORIZE +void ZSTD_wildcopy_16min(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e ovtype) +{ + ptrdiff_t diff = (BYTE*)dst - (const BYTE*)src; + const BYTE* ip = (const BYTE*)src; + BYTE* op = (BYTE*)dst; + BYTE* const oend = op + length; + + assert(length >= 8); + assert(diff >= 8 || (ovtype == ZSTD_no_overlap && diff < -8)); + + if (ovtype == ZSTD_overlap_src_before_dst && diff < VECLEN) { + do + COPY8(op, ip) + while (op < oend); + } + else { + if ((length & 8) == 0) + COPY8(op, ip); + do { + COPY16(op, ip); + } + while (op < oend); + } } MEM_STATIC void ZSTD_wildcopy_e(void* dst, const void* src, void* dstEnd) /* should be faster for decoding, but strangely, not verified on all platform */ Modified: head/sys/contrib/zstd/lib/compress/zstd_compress.c ============================================================================== --- head/sys/contrib/zstd/lib/compress/zstd_compress.c Thu Aug 8 16:51:49 2019 (r350759) +++ head/sys/contrib/zstd/lib/compress/zstd_compress.c Thu Aug 8 16:54:22 2019 (r350760) @@ -21,6 +21,8 @@ #define HUF_STATIC_LINKING_ONLY #include "huf.h" #include "zstd_compress_internal.h" +#include "zstd_compress_sequences.h" +#include "zstd_compress_literals.h" #include "zstd_fast.h" #include "zstd_double_fast.h" #include "zstd_lazy.h" @@ -385,6 +387,11 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter para bounds.upperBound = ZSTD_lcm_uncompressed; return bounds; + case ZSTD_c_targetCBlockSize: + bounds.lowerBound = ZSTD_TARGETCBLOCKSIZE_MIN; + bounds.upperBound = ZSTD_TARGETCBLOCKSIZE_MAX; + return bounds; + default: { ZSTD_bounds const boundError = { ERROR(parameter_unsupported), 0, 0 }; return boundError; @@ -392,18 +399,6 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter para } } -/* ZSTD_cParam_withinBounds: - * @return 1 if value is within cParam bounds, - * 0 otherwise */ -static int ZSTD_cParam_withinBounds(ZSTD_cParameter cParam, int value) -{ - ZSTD_bounds const bounds = ZSTD_cParam_getBounds(cParam); - if (ZSTD_isError(bounds.error)) return 0; - if (value < bounds.lowerBound) return 0; - if (value > bounds.upperBound) return 0; - return 1; -} - /* ZSTD_cParam_clampBounds: * Clamps the value into the bounded range. */ @@ -452,6 +447,7 @@ static int ZSTD_isUpdateAuthorized(ZSTD_cParameter par case ZSTD_c_ldmHashRateLog: case ZSTD_c_forceAttachDict: case ZSTD_c_literalCompressionMode: + case ZSTD_c_targetCBlockSize: default: return 0; } @@ -497,6 +493,7 @@ size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cP case ZSTD_c_ldmHashLog: case ZSTD_c_ldmMinMatch: case ZSTD_c_ldmBucketSizeLog: + case ZSTD_c_targetCBlockSize: break; default: RETURN_ERROR(parameter_unsupported); @@ -671,6 +668,12 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams->ldmParams.hashRateLog = value; return CCtxParams->ldmParams.hashRateLog; + case ZSTD_c_targetCBlockSize : + if (value!=0) /* 0 ==> default */ + BOUNDCHECK(ZSTD_c_targetCBlockSize, value); + CCtxParams->targetCBlockSize = value; + return CCtxParams->targetCBlockSize; + default: RETURN_ERROR(parameter_unsupported, "unknown parameter"); } } @@ -692,13 +695,13 @@ size_t ZSTD_CCtxParams_getParameter( *value = CCtxParams->compressionLevel; break; case ZSTD_c_windowLog : - *value = CCtxParams->cParams.windowLog; + *value = (int)CCtxParams->cParams.windowLog; break; case ZSTD_c_hashLog : - *value = CCtxParams->cParams.hashLog; + *value = (int)CCtxParams->cParams.hashLog; break; case ZSTD_c_chainLog : - *value = CCtxParams->cParams.chainLog; + *value = (int)CCtxParams->cParams.chainLog; break; case ZSTD_c_searchLog : *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 8 17:03:31 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0BFD9ABC29; Thu, 8 Aug 2019 17:03:31 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464F7k6WGcz4ZC9; Thu, 8 Aug 2019 17:03:30 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0FF3555; Thu, 8 Aug 2019 17:03:30 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78H3U5B062114; Thu, 8 Aug 2019 17:03:30 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78H3UQW062112; Thu, 8 Aug 2019 17:03:30 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201908081703.x78H3UQW062112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 8 Aug 2019 17:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350761 - in head/stand: efi/loader i386/loader X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/stand: efi/loader i386/loader X-SVN-Commit-Revision: 350761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:03:31 -0000 Author: mw Date: Thu Aug 8 17:03:30 2019 New Revision: 350761 URL: https://svnweb.freebsd.org/changeset/base/350761 Log: Verify files loaded in chain command. The chain command can be used to chain load another binary. If veriexec is enabled we should verify it first. Note that on EFI systems the verification was already done through firmware, assuming that Secure Boot was enabled there. Submitted by: Kornel Duleba Reviewed by: sjg MFC after: 1 week Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D20952 Modified: head/stand/efi/loader/main.c head/stand/i386/loader/chain.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Aug 8 16:54:22 2019 (r350760) +++ head/stand/efi/loader/main.c Thu Aug 8 17:03:30 2019 (r350761) @@ -1440,6 +1440,14 @@ command_chain(int argc, char *argv[]) return (CMD_ERROR); } +#ifdef LOADER_VERIEXEC + if (verify_file(fd, name, 0, VE_MUST) < 0) { + sprintf(command_errbuf, "can't verify: %s", name); + close(fd); + return (CMD_ERROR); + } +#endif + if (fstat(fd, &st) < -1) { command_errmsg = "stat failed"; close(fd); Modified: head/stand/i386/loader/chain.c ============================================================================== --- head/stand/i386/loader/chain.c Thu Aug 8 16:54:22 2019 (r350760) +++ head/stand/i386/loader/chain.c Thu Aug 8 17:03:30 2019 (r350761) @@ -75,6 +75,14 @@ command_chain(int argc, char *argv[]) return (CMD_ERROR); } +#ifdef LOADER_VERIEXEC + if (verify_file(fd, argv[1], 0, VE_MUST) < 0) { + sprintf(command_errbuf, "can't verify: %s", argv[1]); + close(fd); + return (CMD_ERROR); + } +#endif + len = strlen(argv[1]); if (argv[1][len-1] != ':') { if (fstat(fd, &st) == -1) { From owner-svn-src-all@freebsd.org Thu Aug 8 17:28:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC6EDAC441; Thu, 8 Aug 2019 17:28:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Fj34Sksz4bM9; Thu, 8 Aug 2019 17:28:55 +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 76E7292B; Thu, 8 Aug 2019 17:28:55 +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 x78HStVu073801; Thu, 8 Aug 2019 17:28:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78HStFw073800; Thu, 8 Aug 2019 17:28:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081728.x78HStFw073800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 17:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350762 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ctl X-SVN-Commit-Revision: 350762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:28:55 -0000 Author: mav Date: Thu Aug 8 17:28:55 2019 New Revision: 350762 URL: https://svnweb.freebsd.org/changeset/base/350762 Log: MFC r327239 (by manu): ctl: Correct comment in ctl_worker_thread The incoming queue is handled before the RtR one. No functional change. Modified: stable/11/sys/cam/ctl/ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Thu Aug 8 17:03:30 2019 (r350761) +++ stable/11/sys/cam/ctl/ctl.c Thu Aug 8 17:28:55 2019 (r350762) @@ -13249,8 +13249,8 @@ ctl_work_thread(void *arg) * We handle the queues in this order: * - ISC * - done queue (to free up resources, unblock other commands) - * - RtR queue * - incoming queue + * - RtR queue * * If those queues are empty, we break out of the loop and * go to sleep. From owner-svn-src-all@freebsd.org Thu Aug 8 17:30:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FE9DAC500; Thu, 8 Aug 2019 17:30:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464FlJ0yCmz4bWd; Thu, 8 Aug 2019 17:30:52 +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 0397C940; Thu, 8 Aug 2019 17:30:52 +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 x78HUpSI074923; Thu, 8 Aug 2019 17:30:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78HUpx0074922; Thu, 8 Aug 2019 17:30:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081730.x78HUpx0074922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 17:30:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350763 - stable/11/sys/cam/ata X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ata X-SVN-Commit-Revision: 350763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:30:52 -0000 Author: mav Date: Thu Aug 8 17:30:51 2019 New Revision: 350763 URL: https://svnweb.freebsd.org/changeset/base/350763 Log: MFC r327577 (by eadler): cam/da: QUIRK: Add 4K quirks for WD Red and Black MHDDs PR: 188685 Modified: stable/11/sys/cam/ata/ata_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Thu Aug 8 17:28:55 2019 (r350762) +++ stable/11/sys/cam/ata/ata_da.c Thu Aug 8 17:30:51 2019 (r350763) @@ -357,7 +357,12 @@ static struct ada_quirk_entry ada_quirk_table[] = }, { /* WDC Caviar Black Advanced Format (4k) drives */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD??????EX*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD????AZEX*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* WDC Caviar Black Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "WDC WD????FZEX*", "*" }, /*quirks*/ADA_Q_4K }, { From owner-svn-src-all@freebsd.org Thu Aug 8 17:48:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B595AD4B8; Thu, 8 Aug 2019 17:48:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464G7C710yz4cvH; Thu, 8 Aug 2019 17:48:07 +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 D2170CC0; Thu, 8 Aug 2019 17:48:07 +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 x78Hm7l4085761; Thu, 8 Aug 2019 17:48:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Hm79V085760; Thu, 8 Aug 2019 17:48:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908081748.x78Hm79V085760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Aug 2019 17:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350764 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 350764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:48:08 -0000 Author: imp Date: Thu Aug 8 17:48:07 2019 New Revision: 350764 URL: https://svnweb.freebsd.org/changeset/base/350764 Log: Make arm64 32-bit mode compile with COMPAT_43 The COMPAT_43 option isn't quite like the other compat options, and arm64 makes attempts to support it in 64-bit mode. In 32-bit compat mode, however, two syscall implementations that COMPAT_FREEBSD32 assumes will be there are missing. Provide implementations for these: ofreebsd32_sigreturn (which we'll never encounter, so implement it as nosys as is done in kern_sig.c) and ofreebsd32_getpagesize, where we'll always return 4096 since that's the only PAGE_SIZE we support, similar to how the ia32 implementation does things. Reviewed by: manu@ Differential Revision: https://reviews.freebsd.org/D21192 Modified: head/sys/arm64/arm64/freebsd32_machdep.c Modified: head/sys/arm64/arm64/freebsd32_machdep.c ============================================================================== --- head/sys/arm64/arm64/freebsd32_machdep.c Thu Aug 8 17:30:51 2019 (r350763) +++ head/sys/arm64/arm64/freebsd32_machdep.c Thu Aug 8 17:48:07 2019 (r350764) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef VFP #include @@ -410,3 +411,30 @@ freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigs mtx_lock(&psp->ps_mtx); } + +#ifdef COMPAT_43 +/* + * COMPAT_FREEBSD32 assumes we have this system call when COMPAT_43 is defined. + * FreeBSD/arm provies a similar getpagesize() syscall. + */ +#define ARM32_PAGE_SIZE 4096 +int +ofreebsd32_getpagesize(struct thread *td, + struct ofreebsd32_getpagesize_args *uap) +{ + + td->td_retval[0] = ARM32_PAGE_SIZE; + return (0); +} + +/* + * Mirror the osigreturn definition in kern_sig.c for !i386 platforms. This + * mirrors what's connected to the FreeBSD/arm syscall. + */ +int +ofreebsd32_sigreturn(struct thread *td, struct ofreebsd32_sigreturn_args *uap) +{ + + return (nosys(td, (struct nosys_args *)uap)); +} +#endif From owner-svn-src-all@freebsd.org Thu Aug 8 17:55:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F78CAD80C; Thu, 8 Aug 2019 17:55:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464GHV1mnvz4dSV; Thu, 8 Aug 2019 17:55:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 201DFE98; Thu, 8 Aug 2019 17:55:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78HtIhq091507; Thu, 8 Aug 2019 17:55:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78HtHVP091506; Thu, 8 Aug 2019 17:55:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081755.x78HtHVP091506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 17:55: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: r350765 - stable/11/sys/cam/ata X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ata X-SVN-Commit-Revision: 350765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:55:18 -0000 Author: mav Date: Thu Aug 8 17:55:17 2019 New Revision: 350765 URL: https://svnweb.freebsd.org/changeset/base/350765 Log: MFC r343129 (by gonzo): [ata] Add workaround for KingDian S200 SSD crash on receiving TRIM command - Add ADA_Q_NO_TRIM quirk to be used with the device that falsely advertise TRIM support - Add ADA_Q_NO_TRIM entry for KingDian S200 SSD PR: 222802 Modified: stable/11/sys/cam/ata/ata_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Thu Aug 8 17:48:07 2019 (r350764) +++ stable/11/sys/cam/ata/ata_da.c Thu Aug 8 17:55:17 2019 (r350765) @@ -116,7 +116,8 @@ typedef enum { ADA_Q_4K = 0x01, ADA_Q_NCQ_TRIM_BROKEN = 0x02, ADA_Q_LOG_BROKEN = 0x04, - ADA_Q_SMR_DM = 0x08 + ADA_Q_SMR_DM = 0x08, + ADA_Q_NO_TRIM = 0x10 } ada_quirks; #define ADA_Q_BIT_STRING \ @@ -124,7 +125,8 @@ typedef enum { "\0014K" \ "\002NCQ_TRIM_BROKEN" \ "\003LOG_BROKEN" \ - "\004SMR_DM" + "\004SMR_DM" \ + "\005NO_TRIM" typedef enum { ADA_CCB_RAHEAD = 0x01, @@ -534,6 +536,14 @@ static struct ada_quirk_entry ada_quirk_table[] = }, { /* + * KingDian S200 60GB P0921B + * Trimming crash the SSD + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "KingDian S200 *", "*" }, + /*quirks*/ADA_Q_NO_TRIM + }, + { + /* * Kingston E100 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ @@ -1803,6 +1813,10 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + /* Device lies about TRIM capability. */ + if ((softc->quirks & ADA_Q_NO_TRIM) && + (softc->flags & ADA_FLAG_CAN_TRIM)) + softc->flags &= ~ADA_FLAG_CAN_TRIM; if (softc->flags & ADA_FLAG_CAN_TRIM) { softc->disk->d_flags |= DISKFLAG_CANDELETE; softc->disk->d_delmaxsize = softc->params.secsize * From owner-svn-src-all@freebsd.org Thu Aug 8 17:55:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BF44AD856; Thu, 8 Aug 2019 17:55:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464GHX180tz4dSl; Thu, 8 Aug 2019 17:55:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A611E9A; Thu, 8 Aug 2019 17:55:20 +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 x78HtJk3091566; Thu, 8 Aug 2019 17:55:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78HtJH9091565; Thu, 8 Aug 2019 17:55:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908081755.x78HtJH9091565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Aug 2019 17:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350766 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 350766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:55:20 -0000 Author: imp Date: Thu Aug 8 17:55:19 2019 New Revision: 350766 URL: https://svnweb.freebsd.org/changeset/base/350766 Log: First pass at a LINT for arm64. Create a rough and ready NOTES file from GENERIC, remove the duplication from sys/conf/NOTES and add relevant no* directives to make this compile. Reviewed by: jhb, manu (earlier versions that differed only in comments) Differential Revision: https://reviews.freebsd.org/D21184 Added: head/sys/arm64/conf/Makefile (contents, props changed) head/sys/arm64/conf/NOTES (contents, props changed) Added: head/sys/arm64/conf/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/conf/Makefile Thu Aug 8 17:55:19 2019 (r350766) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +TARGET=arm64 + +.include "${.CURDIR}/../../conf/makeLINT.mk" Added: head/sys/arm64/conf/NOTES ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/conf/NOTES Thu Aug 8 17:55:19 2019 (r350766) @@ -0,0 +1,245 @@ +# +# NOTES -- Lines that can be cut/pasted into kernel and hints configs. +# +# This file contains machine dependent kernel configuration notes. For +# machine independent notes, look in /sys/conf/NOTES. +# +# $FreeBSD$ +# + +# +# We want LINT to cover profiling as well. +# Except it's broken. +#profile 2 + +# +# Enable the kernel DTrace hooks which are required to load the DTrace +# kernel modules. +# +options KDTRACE_HOOKS + +# +# Most of the following is copied from ARM64 GENERIC. +cpu ARM64 + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support + +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. +options KDTRACE_FRAME # Ensure frames are compiled in +options VFP # Floating-point support +options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default +options INTRNG + +nooptions GDB # Support remote GDB -- not supported + +# SoC support +options SOC_ALLWINNER_A64 +options SOC_ALLWINNER_H5 +options SOC_CAVM_THUNDERX +options SOC_HISI_HI6220 +options SOC_BRCM_BCM2837 +options SOC_MARVELL_8K +options SOC_ROCKCHIP_RK3328 +options SOC_ROCKCHIP_RK3399 +options SOC_XILINX_ZYNQ + +# Timer drivers +device a10_timer + +# Annapurna Alpine drivers +device al_ccu # Alpine Cache Coherency Unit +device al_nb_service # Alpine North Bridge Service +device al_iofic # I/O Fabric Interrupt Controller +device al_serdes # Serializer/Deserializer +device al_udma # Universal DMA + +# Qualcomm Snapdragon drivers +device qcom_gcc # Global Clock Controller + +# VirtIO support +device virtio +device virtio_pci +device virtio_mmio +device virtio_blk +device vtnet + +# CPU frequency control +device cpufreq + +# Bus drivers +device al_pci # Annapurna Alpine PCI-E +options PCI_HP # PCI-Express native HotPlug +options PCI_IOV # PCI SR-IOV support + +# Ethernet NICs +device mdio +device awg # Allwinner EMAC Gigabit Ethernet +device axgbe # AMD Opteron A1100 integrated NIC +device neta # Marvell Armada 370/38x/XP/3700 NIC +device smc # SMSC LAN91C111 +device vnic # Cavium ThunderX NIC +device al_eth # Annapurna Alpine Ethernet NIC +device dwc_rk # Rockchip Designware +device dwc_socfpga # Altera SOCFPGA Ethernet MAC + +# Etherswitch devices +device e6000sw # Marvell mv88e6085 based switches + +# NVM Express (NVMe) support +device nvme # base NVMe driver +options NVME_USE_NVD=0 # prefer the cam(4) based nda(4) driver +device nvd # expose NVMe namespaces as disks, depends on nvme + +# MMC/SD/SDIO Card slot support +device sdhci_xenon # Marvell Xenon SD/MMC controller +device aw_mmc # Allwinner SD/MMC controller +device dwmmc +device dwmmc_altera +device rk_emmcphy + +# Serial (COM) ports +device uart_msm # Qualcomm MSM UART driver +device uart_mu # RPI3 aux port +device uart_mvebu # Armada 3700 UART driver +device uart_ns8250 # ns8250-type UART driver +device uart_snps +device pl011 + +# USB support +device aw_ehci # Allwinner EHCI USB interface (USB 2.0) +device aw_usbphy # Allwinner USB PHY +device dwcotg # DWC OTG controller +device ehci_mv # Marvell EHCI USB interface + +# USB ethernet support +device muge +device smsc + +# Sound support +device a10_codec + +# DMA controller +device a31_dmac + +# GPIO / PINCTRL +device a37x0_gpio # Marvell Armada 37x0 GPIO controller +device aw_gpio # Allwinner GPIO controller +device fdt_pinctrl +device mv_gpio # Marvell GPIO controller +device mvebu_pinctrl # Marvell Pinmux Controller +device rk_gpio # RockChip GPIO Controller +device rk_pinctrl # RockChip Pinmux Controller + +# I2C +device aw_rsb # Allwinner Reduced Serial Bus +device bcm2835_bsc # Broadcom BCM283x I2C bus +device twsi # Allwinner I2C controller +device rk_i2c # RockChip I2C controller + +# Clock and reset controllers +device aw_ccu # Allwinner clock controller + +# Interrupt controllers +device aw_nmi # Allwinner NMI support +device mv_cp110_icu # Marvell CP110 ICU +device mv_ap806_gicp # Marvell AP806 GICP + +# Real-time clock support +device aw_rtc # Allwinner Real-time Clock +device mv_rtc # Marvell Real-time Clock + +# Watchdog controllers +device aw_wdog # Allwinner Watchdog + +# Power management controllers +device axp81x # X-Powers AXP81x PMIC +device rk805 # RockChip RK805 PMIC + +# EFUSE +device aw_sid # Allwinner Secure ID EFUSE + +# Thermal sensors +device aw_thermal # Allwinner Thermal Sensor Controller +device mv_thermal # Marvell Thermal Sensor Controller + +# SPI +device bcm2835_spi # Broadcom BCM283x SPI bus + +# PWM +device pwm +device aw_pwm + +device vt_efifb + +# EVDEV support +options EVDEV_SUPPORT # evdev support in legacy drivers +device aw_cir + +# Pseudo devices. +options EFIRT # EFI Runtime Services + +# EXT_RESOURCES pseudo devices +options EXT_RESOURCES +device clk +device phy +device hwreset +device nvmem +device regulator +device syscon +device aw_syscon + +# Chip-specific errata +options THUNDERX_PASS_1_1_ERRATA + +options FDT +device acpi + +# DTBs +makeoptions MODULES_EXTRA="dtb/allwinner dtb/rockchip dtb/rpi" + +# Add CAMDEBUG stuff +options CAMDEBUG +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) + +# bring in camified MMC too +options MMCCAM + +# No support for floppies on arm64 +nodevice fdc + +# arm64 doesn't support inb/outb, so disable chipset probing which needs it +nooptions PPC_PROBE_CHIPSET + +# can't support syscons, no inb/outb, ditto for the screen savers +nodevice sc +nodevice blank_saver +nodevice daemon_saver +nodevice dragon_saver +nodevice fade_saver +nodevice fire_saver +nodevice green_saver +nodevice logo_saver +nodevice rain_saver +nodevice snake_saver +nodevice star_saver +nodevice warp_saver + +# These cause weird issues, not sure why +nodevice ukbd +nooptions DEBUG + +# Makes assumptions about bus tags that aren't true on arm64 +nodevice snd_cmi + +# arm64 didn't exist for these releases, so doesn't have the required compat +# support. Just disable them because they are meaningless. +nooptions COMPAT_FREEBSD4 +nooptions COMPAT_FREEBSD5 +nooptions COMPAT_FREEBSD6 +nooptions COMPAT_FREEBSD7 +nooptions COMPAT_FREEBSD9 +nooptions COMPAT_FREEBSD10 + +# arm64 supports 32-bit FreeBSD/arm binaries (armv[67] ABIs) +options COMPAT_FREEBSD32 # Compatible with FreeBSD/arm From owner-svn-src-all@freebsd.org Thu Aug 8 17:56:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62E74AD90B; Thu, 8 Aug 2019 17:56:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464GJf1x1kz4dkZ; Thu, 8 Aug 2019 17:56:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 240F0EA8; Thu, 8 Aug 2019 17:56:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78HuILY091678; Thu, 8 Aug 2019 17:56:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78HuHJR091677; Thu, 8 Aug 2019 17:56:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081756.x78HuHJR091677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 17:56: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: r350767 - in stable/11/sys/cam: ata scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys/cam: ata scsi X-SVN-Commit-Revision: 350767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:56:18 -0000 Author: mav Date: Thu Aug 8 17:56:17 2019 New Revision: 350767 URL: https://svnweb.freebsd.org/changeset/base/350767 Log: MFC r343814 (by imp): Add quirk for Sansisk X400 drives Certain versions of Sandisk x400 firmware can hang under extremely heavly load of large I/Os for prolonged periods of time. Newer / current versions work fine, and should be used where possible. Where not possible, this quirk ensures that I/O requests are limited to 128k to avoids the bug, even under extreme load. Since MAXPHYS is 128k, only users with custom kernels are at risk on the older firmware. Once all known users of the older firmware have upgraded, this quirk will be removed. Modified: stable/11/sys/cam/ata/ata_da.c stable/11/sys/cam/scsi/scsi_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Thu Aug 8 17:55:19 2019 (r350766) +++ stable/11/sys/cam/ata/ata_da.c Thu Aug 8 17:56:17 2019 (r350767) @@ -117,7 +117,8 @@ typedef enum { ADA_Q_NCQ_TRIM_BROKEN = 0x02, ADA_Q_LOG_BROKEN = 0x04, ADA_Q_SMR_DM = 0x08, - ADA_Q_NO_TRIM = 0x10 + ADA_Q_NO_TRIM = 0x10, + ADA_Q_128KB = 0x20 } ada_quirks; #define ADA_Q_BIT_STRING \ @@ -126,7 +127,8 @@ typedef enum { "\002NCQ_TRIM_BROKEN" \ "\003LOG_BROKEN" \ "\004SMR_DM" \ - "\005NO_TRIM" + "\005NO_TRIM" \ + "\006128KB" typedef enum { ADA_CCB_RAHEAD = 0x01, @@ -268,6 +270,11 @@ struct ada_quirk_entry { static struct ada_quirk_entry ada_quirk_table[] = { { + /* Sandisk X400 */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SanDisk?SD8SB8U1T00*", "X4162000*" }, + /*quirks*/ADA_Q_128KB + }, + { /* Hitachi Advanced Format (4k) drives */ { T_DIRECT, SIP_MEDIA_FIXED, "*", "Hitachi H??????????E3*", "*" }, /*quirks*/ADA_Q_4K @@ -1808,6 +1815,8 @@ adaregister(struct cam_periph *periph, void *arg) maxio = min(maxio, 65536 * softc->params.secsize); else /* 28bit ATA command limit */ maxio = min(maxio, 256 * softc->params.secsize); + if (softc->quirks & ADA_Q_128KB) + maxio = min(maxio, 128 * 1024); softc->disk->d_maxsize = maxio; softc->disk->d_unit = periph->unit_number; softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Thu Aug 8 17:55:19 2019 (r350766) +++ stable/11/sys/cam/scsi/scsi_da.c Thu Aug 8 17:56:17 2019 (r350767) @@ -125,7 +125,8 @@ typedef enum { DA_Q_NO_UNMAP = 0x20, DA_Q_RETRY_BUSY = 0x40, DA_Q_SMR_DM = 0x80, - DA_Q_STRICT_UNMAP = 0x100 + DA_Q_STRICT_UNMAP = 0x100, + DA_Q_128KB = 0x200 } da_quirks; #define DA_Q_BIT_STRING \ @@ -138,7 +139,8 @@ typedef enum { "\006NO_UNMAP" \ "\007RETRY_BUSY" \ "\010SMR_DM" \ - "\011STRICT_UNMAP" + "\011STRICT_UNMAP" \ + "\012128KB" typedef enum { DA_CCB_PROBE_RC = 0x01, @@ -847,6 +849,11 @@ static struct da_quirk_entry da_quirk_table[] = }, /* ATA/SATA devices over SAS/USB/... */ { + /* Sandisk X400 */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SanDisk SD8SB8U1*", "*" }, + /*quirks*/DA_Q_128KB + }, + { /* Hitachi Advanced Format (4k) drives */ { T_DIRECT, SIP_MEDIA_FIXED, "Hitachi", "H??????????E3*", "*" }, /*quirks*/DA_Q_4K @@ -2612,6 +2619,8 @@ daregister(struct cam_periph *periph, void *arg) softc->maxio = MAXPHYS; /* for safety */ else softc->maxio = cpi.maxio; + if (softc->quirks & DA_Q_128KB) + softc->maxio = min(softc->maxio, 128 * 1024); softc->disk->d_maxsize = softc->maxio; softc->disk->d_unit = periph->unit_number; softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; From owner-svn-src-all@freebsd.org Thu Aug 8 17:58:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A42C9ADA04; Thu, 8 Aug 2019 17:58:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464GLv3vT9z4dt5; Thu, 8 Aug 2019 17:58: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 678B9EB1; Thu, 8 Aug 2019 17:58:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78HwFdT091849; Thu, 8 Aug 2019 17:58:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78HwFEI091848; Thu, 8 Aug 2019 17:58:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081758.x78HwFEI091848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 17:58: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: r350768 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:58:15 -0000 Author: mav Date: Thu Aug 8 17:58:14 2019 New Revision: 350768 URL: https://svnweb.freebsd.org/changeset/base/350768 Log: MFC r344701 (by smh): Fix incorrect / unused sector_count for identify requests Fix incorrect / unused sector_count for identify requests from camcontrol. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 17:56:17 2019 (r350767) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 17:58:14 2019 (r350768) @@ -2125,7 +2125,7 @@ ata_do_identify(struct cam_device *device, int retry_c /*command*/command, /*features*/0, /*lba*/0, - /*sector_count*/(u_int8_t)sizeof(struct ata_params), + /*sector_count*/0, /*data_ptr*/(u_int8_t *)ptr, /*dxfer_len*/sizeof(struct ata_params), /*timeout*/timeout ? timeout : 30 * 1000, @@ -2145,8 +2145,7 @@ ata_do_identify(struct cam_device *device, int retry_c /*command*/retry_command, /*features*/0, /*lba*/0, - /*sector_count*/(u_int8_t) - sizeof(struct ata_params), + /*sector_count*/0, /*data_ptr*/(u_int8_t *)ptr, /*dxfer_len*/sizeof(struct ata_params), /*timeout*/timeout ? timeout : 30 * 1000, From owner-svn-src-all@freebsd.org Thu Aug 8 17:59:04 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF3DBADAC2; Thu, 8 Aug 2019 17:59:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464GMr59Gfz4f5v; Thu, 8 Aug 2019 17:59:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9311FEB7; Thu, 8 Aug 2019 17:59:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78Hx499092083; Thu, 8 Aug 2019 17:59:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Hx48A092081; Thu, 8 Aug 2019 17:59:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081759.x78Hx48A092081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 17:59: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: r350769 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 17:59:04 -0000 Author: mav Date: Thu Aug 8 17:59:03 2019 New Revision: 350769 URL: https://svnweb.freebsd.org/changeset/base/350769 Log: MFC r345051 (by imp): Add -l to camcontrol readcap. The -l flag sends only the READ CAPACITY (16) sevice action. Normally we send the READ CAPACITY (10) command, and only send RC16 when the capacity is larger than 2TB (since that's the max RC10 can report). However, some badly programmed drives report different numbers for RC10 and RC16. This can be hard to diagnose, but generally there's a "Logical block address out of range" error when RC16 reports a larger number than RC10 and the RC10 number is the correct one. By comparing the output of readcap with and without the -l argmuent, one can determine if there's a mismatch and if the DA_Q_NO_RC16 quirk is needed. Modified: stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 17:58:14 2019 (r350768) +++ stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 17:59:03 2019 (r350769) @@ -78,6 +78,7 @@ .Op Fl b .Op Fl h .Op Fl H +.Op Fl l .Op Fl N .Op Fl q .Op Fl s @@ -544,6 +545,11 @@ or .Fl b . .It Fl H Print out the device size in human readable (base 10, 1K == 1000) format. +.It Fl l +Skip sending the SCSI READ CAPACITY (10) command. +Send only the SCSI READ CAPACITY (16) service action and report +its results. +When the two do not match, a quirk is needed to resolve the ambiguity. .It Fl N Print out the number of blocks in the device instead of the last logical block. Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 17:58:14 2019 (r350768) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 17:59:03 2019 (r350769) @@ -198,7 +198,7 @@ static struct camcontrol_opts option_table[] = { {"load", CAM_CMD_STARTSTOP, CAM_ARG_START_UNIT | CAM_ARG_EJECT, NULL}, {"eject", CAM_CMD_STARTSTOP, CAM_ARG_EJECT, NULL}, {"reportluns", CAM_CMD_REPORTLUNS, CAM_ARG_NONE, "clr:"}, - {"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHNqs"}, + {"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHlNqs"}, {"reprobe", CAM_CMD_REPROBE, CAM_ARG_NONE, NULL}, #endif /* MINIMALISTIC */ {"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL}, @@ -6947,7 +6947,7 @@ scsireadcapacity(struct cam_device *device, int argc, char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; - int blocksizeonly, humanize, numblocks, quiet, sizeonly, baseten; + int blocksizeonly, humanize, numblocks, quiet, sizeonly, baseten, longonly; struct scsi_read_capacity_data rcap; struct scsi_read_capacity_data_long rcaplong; uint64_t maxsector; @@ -6957,6 +6957,7 @@ scsireadcapacity(struct cam_device *device, int argc, blocksizeonly = 0; humanize = 0; + longonly = 0; numblocks = 0; quiet = 0; sizeonly = 0; @@ -6985,6 +6986,9 @@ scsireadcapacity(struct cam_device *device, int argc, humanize++; baseten++; break; + case 'l': + longonly++; + break; case 'N': numblocks++; break; @@ -7027,6 +7031,9 @@ scsireadcapacity(struct cam_device *device, int argc, goto bailout; } + if (longonly != 0) + goto long_only; + scsi_read_capacity(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, @@ -7069,6 +7076,7 @@ scsireadcapacity(struct cam_device *device, int argc, if (maxsector != 0xffffffff) goto do_print; +long_only: scsi_read_capacity_16(&ccb->csio, /*retries*/ retry_count, /*cbfcnp*/ NULL, @@ -9017,7 +9025,7 @@ usage(int printlong) " camcontrol identify [dev_id][generic args] [-v]\n" " camcontrol reportluns [dev_id][generic args] [-c] [-l] [-r report]\n" " camcontrol readcap [dev_id][generic args] [-b] [-h] [-H] [-N]\n" -" [-q] [-s]\n" +" [-q] [-s] [-l]\n" " camcontrol start [dev_id][generic args]\n" " camcontrol stop [dev_id][generic args]\n" " camcontrol load [dev_id][generic args]\n" From owner-svn-src-all@freebsd.org Thu Aug 8 18:00:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F14B6ADB5F; Thu, 8 Aug 2019 18:00:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464GNw67cJz4fDL; Thu, 8 Aug 2019 18:00:00 +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 B5BC6EC2; Thu, 8 Aug 2019 18:00:00 +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 x78I00I4092249; Thu, 8 Aug 2019 18:00:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78I00Dr092248; Thu, 8 Aug 2019 18:00:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081800.x78I00Dr092248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 18:00:00 +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: r350770 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 18:00:01 -0000 Author: mav Date: Thu Aug 8 18:00:00 2019 New Revision: 350770 URL: https://svnweb.freebsd.org/changeset/base/350770 Log: MFC r345060 (by 0mp): camcontrol.8: Bump date after r345051 Modified: stable/11/sbin/camcontrol/camcontrol.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 17:59:03 2019 (r350769) +++ stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 18:00:00 2019 (r350770) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2017 +.Dd March 12, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Thu Aug 8 18:00:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD1C0ADBF4; Thu, 8 Aug 2019 18:00:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464GPd4Cq6z4fM0; Thu, 8 Aug 2019 18:00:37 +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 72396EC4; Thu, 8 Aug 2019 18:00:37 +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 x78I0bD3093129; Thu, 8 Aug 2019 18:00:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78I0b91093128; Thu, 8 Aug 2019 18:00:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081800.x78I0b91093128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 18:00: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: r350771 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 18:00:37 -0000 Author: mav Date: Thu Aug 8 18:00:37 2019 New Revision: 350771 URL: https://svnweb.freebsd.org/changeset/base/350771 Log: MFC r345363 (by imp): Make WD and WDC aliases for HGST. HGST was bought by WDC. Over the years, it has sold different drives branded as HGST, WD or WDC. All of them need the HGST workaround of sending 4k-sized packets (or multiples of 4k). And the ones that don't really need this aren't broken by this change. Submitter is the vendor who has tested these changes on a number of drives. I've simplified it slightly, since we don't need additional vendors for this at this time. Modified: stable/11/sbin/camcontrol/fwdownload.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/11/sbin/camcontrol/fwdownload.c Thu Aug 8 18:00:00 2019 (r350770) +++ stable/11/sbin/camcontrol/fwdownload.c Thu Aug 8 18:00:37 2019 (r350771) @@ -212,6 +212,10 @@ static struct fw_vendor vendors_list[] = { 0x8000, 0x07, 0x07, 0, 1, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT}, {VENDOR_SMART, "SmrtStor", T_DIRECT, 0x8000, 0x07, 0x07, 0, 1, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT}, + {VENDOR_HGST, "WD", T_DIRECT, + 0x1000, 0x07, 0x07, 1, 0, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT}, + {VENDOR_HGST, "WDC", T_DIRECT, + 0x1000, 0x07, 0x07, 1, 0, FW_TUR_READY, WB_TIMEOUT, FW_TIMEOUT_DEFAULT}, /* * We match any ATA device. This is really just a placeholder, From owner-svn-src-all@freebsd.org Thu Aug 8 18:08:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75216ADE40; Thu, 8 Aug 2019 18:08:15 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464GZR35Djz4flk; Thu, 8 Aug 2019 18:08:15 +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 4B86A1094; Thu, 8 Aug 2019 18:08:15 +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 x78I8Fxk098406; Thu, 8 Aug 2019 18:08:15 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78I8E50098399; Thu, 8 Aug 2019 18:08:14 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201908081808.x78I8E50098399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 8 Aug 2019 18:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350772 - in head: cddl/contrib/opensolaris/lib/libzfs/common stand/efi/boot1 stand/i386/gptzfsboot stand/i386/zfsboot stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/uts... X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libzfs/common stand/efi/boot1 stand/i386/gptzfsboot stand/i386/zfsboot stand/libsa/zfs sys/cddl/boot/zfs sys/cddl/contrib/opensolaris/uts/common/os sys/cddl/contr... X-SVN-Commit-Revision: 350772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 18:08:15 -0000 Author: tsoome Date: Thu Aug 8 18:08:13 2019 New Revision: 350772 URL: https://svnweb.freebsd.org/changeset/base/350772 Log: loader: support com.delphix:removing We should support removing vdev from boot pool. Update loader zfs reader to support com.delphix:removing. Reviewed by: allanjude MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18901 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/stand/efi/boot1/Makefile head/stand/i386/gptzfsboot/Makefile head/stand/i386/zfsboot/Makefile head/stand/libsa/zfs/Makefile.inc head/stand/libsa/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/contrib/opensolaris/uts/common/os/list.c head/sys/cddl/contrib/opensolaris/uts/common/sys/list.h head/sys/cddl/contrib/opensolaris/uts/common/sys/list_impl.h head/sys/cddl/contrib/opensolaris/uts/common/sys/note.h head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Aug 8 18:00:37 2019 (r350771) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Thu Aug 8 18:08:13 2019 (r350772) @@ -3300,13 +3300,6 @@ zpool_vdev_remove(zpool_handle_t *zhp, const char *pat return (zfs_error(hdl, EZFS_BADVERSION, msg)); } - if (!islog && !avail_spare && !l2cache && zpool_is_bootable(zhp)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "root pool can not have removed devices, " - "because GRUB does not understand them")); - return (zfs_error(hdl, EINVAL, msg)); - } - zc.zc_guid = fnvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID); if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0) Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Thu Aug 8 18:00:37 2019 (r350771) +++ head/stand/efi/boot1/Makefile Thu Aug 8 18:08:13 2019 (r350772) @@ -36,6 +36,8 @@ SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs CFLAGS.zfs_module.c+= -I${SYSDIR}/crypto/skein +CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common + CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/stand/i386/gptzfsboot/Makefile ============================================================================== --- head/stand/i386/gptzfsboot/Makefile Thu Aug 8 18:00:37 2019 (r350771) +++ head/stand/i386/gptzfsboot/Makefile Thu Aug 8 18:08:13 2019 (r350772) @@ -28,6 +28,7 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -I${ZFSSRC} \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ -I${BOOTSRC}/i386/btx/lib \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast \ Modified: head/stand/i386/zfsboot/Makefile ============================================================================== --- head/stand/i386/zfsboot/Makefile Thu Aug 8 18:00:37 2019 (r350771) +++ head/stand/i386/zfsboot/Makefile Thu Aug 8 18:08:13 2019 (r350772) @@ -27,6 +27,7 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${ZFSSRC} \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ Modified: head/stand/libsa/zfs/Makefile.inc ============================================================================== --- head/stand/libsa/zfs/Makefile.inc Thu Aug 8 18:00:37 2019 (r350771) +++ head/stand/libsa/zfs/Makefile.inc Thu Aug 8 18:08:13 2019 (r350772) @@ -1,13 +1,15 @@ # $FreeBSD$ .PATH: ${ZFSSRC} -SRCS+= zfs.c skein.c skein_block.c +SRCS+= zfs.c skein.c skein_block.c list.c # Do not unroll skein loops, reduce code size CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${SYSDIR}/crypto/skein +.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/os CFLAGS+= -I${LDRSRC} CFLAGS+= -I${SYSDIR}/cddl/boot/zfs +CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/common CFLAGS+= -I${SYSDIR}/crypto/skein CFLAGS+= -Wformat -Wall Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Thu Aug 8 18:00:37 2019 (r350771) +++ head/stand/libsa/zfs/zfsimpl.c Thu Aug 8 18:08:13 2019 (r350772) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "zfsimpl.h" #include "zfssubr.c" @@ -47,6 +48,58 @@ struct zfsmount { static struct zfsmount zfsmount __unused; /* + * The indirect_child_t represents the vdev that we will read from, when we + * need to read all copies of the data (e.g. for scrub or reconstruction). + * For plain (non-mirror) top-level vdevs (i.e. is_vdev is not a mirror), + * ic_vdev is the same as is_vdev. However, for mirror top-level vdevs, + * ic_vdev is a child of the mirror. + */ +typedef struct indirect_child { + void *ic_data; + vdev_t *ic_vdev; +} indirect_child_t; + +/* + * The indirect_split_t represents one mapped segment of an i/o to the + * indirect vdev. For non-split (contiguously-mapped) blocks, there will be + * only one indirect_split_t, with is_split_offset==0 and is_size==io_size. + * For split blocks, there will be several of these. + */ +typedef struct indirect_split { + list_node_t is_node; /* link on iv_splits */ + + /* + * is_split_offset is the offset into the i/o. + * This is the sum of the previous splits' is_size's. + */ + uint64_t is_split_offset; + + vdev_t *is_vdev; /* top-level vdev */ + uint64_t is_target_offset; /* offset on is_vdev */ + uint64_t is_size; + int is_children; /* number of entries in is_child[] */ + + /* + * is_good_child is the child that we are currently using to + * attempt reconstruction. + */ + int is_good_child; + + indirect_child_t is_child[1]; /* variable-length */ +} indirect_split_t; + +/* + * The indirect_vsd_t is associated with each i/o to the indirect vdev. + * It is the "Vdev-Specific Data" in the zio_t's io_vsd. + */ +typedef struct indirect_vsd { + boolean_t iv_split_block; + boolean_t iv_reconstruct; + + list_t iv_splits; /* list of indirect_split_t's */ +} indirect_vsd_t; + +/* * List of all vdevs, chained through v_alllink. */ static vdev_list_t zfs_vdevs; @@ -70,6 +123,8 @@ static const char *features_for_read[] = { "com.datto:encryption", "org.zfsonlinux:allocation_classes", "com.datto:resilver_defer", + "com.delphix:device_removal", + "com.delphix:obsolete_counts", NULL }; @@ -92,6 +147,18 @@ static int zfs_rlookup(const spa_t *spa, uint64_t objn static int zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t integer_size, uint64_t num_integers, void *value); +static int objset_get_dnode(const spa_t *, const objset_phys_t *, uint64_t, + dnode_phys_t *); +static int dnode_read(const spa_t *, const dnode_phys_t *, off_t, void *, + size_t); +static int vdev_indirect_read(vdev_t *, const blkptr_t *, void *, off_t, + size_t); +static int vdev_mirror_read(vdev_t *, const blkptr_t *, void *, off_t, size_t); +vdev_indirect_mapping_t *vdev_indirect_mapping_open(spa_t *, objset_phys_t *, + uint64_t); +vdev_indirect_mapping_entry_phys_t * + vdev_indirect_mapping_duplicate_adjacent_entries(vdev_t *, uint64_t, + uint64_t, uint64_t *); static void zfs_init(void) @@ -161,7 +228,7 @@ xdr_uint64_t(const unsigned char **xdr, uint64_t *lp) static int nvlist_find(const unsigned char *nvlist, const char *name, int type, - int* elementsp, void *valuep) + int *elementsp, void *valuep) { const unsigned char *p, *pair; int junk; @@ -426,13 +493,500 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_verify(vdev->spa, bp, buf)) - return (EIO); + if (bp != NULL) + return (zio_checksum_verify(vdev->spa, bp, buf)); return (0); } +typedef struct remap_segment { + vdev_t *rs_vd; + uint64_t rs_offset; + uint64_t rs_asize; + uint64_t rs_split_offset; + list_node_t rs_node; +} remap_segment_t; + +static remap_segment_t * +rs_alloc(vdev_t *vd, uint64_t offset, uint64_t asize, uint64_t split_offset) +{ + remap_segment_t *rs = malloc(sizeof (remap_segment_t)); + + if (rs != NULL) { + rs->rs_vd = vd; + rs->rs_offset = offset; + rs->rs_asize = asize; + rs->rs_split_offset = split_offset; + } + + return (rs); +} + +vdev_indirect_mapping_t * +vdev_indirect_mapping_open(spa_t *spa, objset_phys_t *os, + uint64_t mapping_object) +{ + vdev_indirect_mapping_t *vim; + vdev_indirect_mapping_phys_t *vim_phys; + int rc; + + vim = calloc(1, sizeof (*vim)); + if (vim == NULL) + return (NULL); + + vim->vim_dn = calloc(1, sizeof (*vim->vim_dn)); + if (vim->vim_dn == NULL) { + free(vim); + return (NULL); + } + + rc = objset_get_dnode(spa, os, mapping_object, vim->vim_dn); + if (rc != 0) { + free(vim->vim_dn); + free(vim); + return (NULL); + } + + vim->vim_spa = spa; + vim->vim_phys = malloc(sizeof (*vim->vim_phys)); + if (vim->vim_phys == NULL) { + free(vim->vim_dn); + free(vim); + return (NULL); + } + + vim_phys = (vdev_indirect_mapping_phys_t *)DN_BONUS(vim->vim_dn); + *vim->vim_phys = *vim_phys; + + vim->vim_objset = os; + vim->vim_object = mapping_object; + vim->vim_entries = NULL; + + vim->vim_havecounts = + (vim->vim_dn->dn_bonuslen > VDEV_INDIRECT_MAPPING_SIZE_V0); + return (vim); +} + +/* + * Compare an offset with an indirect mapping entry; there are three + * possible scenarios: + * + * 1. The offset is "less than" the mapping entry; meaning the + * offset is less than the source offset of the mapping entry. In + * this case, there is no overlap between the offset and the + * mapping entry and -1 will be returned. + * + * 2. The offset is "greater than" the mapping entry; meaning the + * offset is greater than the mapping entry's source offset plus + * the entry's size. In this case, there is no overlap between + * the offset and the mapping entry and 1 will be returned. + * + * NOTE: If the offset is actually equal to the entry's offset + * plus size, this is considered to be "greater" than the entry, + * and this case applies (i.e. 1 will be returned). Thus, the + * entry's "range" can be considered to be inclusive at its + * start, but exclusive at its end: e.g. [src, src + size). + * + * 3. The last case to consider is if the offset actually falls + * within the mapping entry's range. If this is the case, the + * offset is considered to be "equal to" the mapping entry and + * 0 will be returned. + * + * NOTE: If the offset is equal to the entry's source offset, + * this case applies and 0 will be returned. If the offset is + * equal to the entry's source plus its size, this case does + * *not* apply (see "NOTE" above for scenario 2), and 1 will be + * returned. + */ static int +dva_mapping_overlap_compare(const void *v_key, const void *v_array_elem) +{ + const uint64_t *key = v_key; + const vdev_indirect_mapping_entry_phys_t *array_elem = + v_array_elem; + uint64_t src_offset = DVA_MAPPING_GET_SRC_OFFSET(array_elem); + + if (*key < src_offset) { + return (-1); + } else if (*key < src_offset + DVA_GET_ASIZE(&array_elem->vimep_dst)) { + return (0); + } else { + return (1); + } +} + +/* + * Return array entry. + */ +static vdev_indirect_mapping_entry_phys_t * +vdev_indirect_mapping_entry(vdev_indirect_mapping_t *vim, uint64_t index) +{ + uint64_t size; + off_t offset = 0; + int rc; + + if (vim->vim_phys->vimp_num_entries == 0) + return (NULL); + + if (vim->vim_entries == NULL) { + uint64_t bsize; + + bsize = vim->vim_dn->dn_datablkszsec << SPA_MINBLOCKSHIFT; + size = vim->vim_phys->vimp_num_entries * + sizeof (*vim->vim_entries); + if (size > bsize) { + size = bsize / sizeof (*vim->vim_entries); + size *= sizeof (*vim->vim_entries); + } + vim->vim_entries = malloc(size); + if (vim->vim_entries == NULL) + return (NULL); + vim->vim_num_entries = size / sizeof (*vim->vim_entries); + offset = index * sizeof (*vim->vim_entries); + } + + /* We have data in vim_entries */ + if (offset == 0) { + if (index >= vim->vim_entry_offset && + index <= vim->vim_entry_offset + vim->vim_num_entries) { + index -= vim->vim_entry_offset; + return (&vim->vim_entries[index]); + } + offset = index * sizeof (*vim->vim_entries); + } + + vim->vim_entry_offset = index; + size = vim->vim_num_entries * sizeof (*vim->vim_entries); + rc = dnode_read(vim->vim_spa, vim->vim_dn, offset, vim->vim_entries, + size); + if (rc != 0) { + /* Read error, invalidate vim_entries. */ + free(vim->vim_entries); + vim->vim_entries = NULL; + return (NULL); + } + index -= vim->vim_entry_offset; + return (&vim->vim_entries[index]); +} + +/* + * Returns the mapping entry for the given offset. + * + * It's possible that the given offset will not be in the mapping table + * (i.e. no mapping entries contain this offset), in which case, the + * return value value depends on the "next_if_missing" parameter. + * + * If the offset is not found in the table and "next_if_missing" is + * B_FALSE, then NULL will always be returned. The behavior is intended + * to allow consumers to get the entry corresponding to the offset + * parameter, iff the offset overlaps with an entry in the table. + * + * If the offset is not found in the table and "next_if_missing" is + * B_TRUE, then the entry nearest to the given offset will be returned, + * such that the entry's source offset is greater than the offset + * passed in (i.e. the "next" mapping entry in the table is returned, if + * the offset is missing from the table). If there are no entries whose + * source offset is greater than the passed in offset, NULL is returned. + */ +static vdev_indirect_mapping_entry_phys_t * +vdev_indirect_mapping_entry_for_offset(vdev_indirect_mapping_t *vim, + uint64_t offset) +{ + ASSERT(vim->vim_phys->vimp_num_entries > 0); + + vdev_indirect_mapping_entry_phys_t *entry; + + uint64_t last = vim->vim_phys->vimp_num_entries - 1; + uint64_t base = 0; + + /* + * We don't define these inside of the while loop because we use + * their value in the case that offset isn't in the mapping. + */ + uint64_t mid; + int result; + + while (last >= base) { + mid = base + ((last - base) >> 1); + + entry = vdev_indirect_mapping_entry(vim, mid); + if (entry == NULL) + break; + result = dva_mapping_overlap_compare(&offset, entry); + + if (result == 0) { + break; + } else if (result < 0) { + last = mid - 1; + } else { + base = mid + 1; + } + } + return (entry); +} + +/* + * Given an indirect vdev and an extent on that vdev, it duplicates the + * physical entries of the indirect mapping that correspond to the extent + * to a new array and returns a pointer to it. In addition, copied_entries + * is populated with the number of mapping entries that were duplicated. + * + * Finally, since we are doing an allocation, it is up to the caller to + * free the array allocated in this function. + */ +vdev_indirect_mapping_entry_phys_t * +vdev_indirect_mapping_duplicate_adjacent_entries(vdev_t *vd, uint64_t offset, + uint64_t asize, uint64_t *copied_entries) +{ + vdev_indirect_mapping_entry_phys_t *duplicate_mappings = NULL; + vdev_indirect_mapping_t *vim = vd->v_mapping; + uint64_t entries = 0; + + vdev_indirect_mapping_entry_phys_t *first_mapping = + vdev_indirect_mapping_entry_for_offset(vim, offset); + ASSERT3P(first_mapping, !=, NULL); + + vdev_indirect_mapping_entry_phys_t *m = first_mapping; + while (asize > 0) { + uint64_t size = DVA_GET_ASIZE(&m->vimep_dst); + uint64_t inner_offset = offset - DVA_MAPPING_GET_SRC_OFFSET(m); + uint64_t inner_size = MIN(asize, size - inner_offset); + + offset += inner_size; + asize -= inner_size; + entries++; + m++; + } + + size_t copy_length = entries * sizeof (*first_mapping); + duplicate_mappings = malloc(copy_length); + if (duplicate_mappings != NULL) + bcopy(first_mapping, duplicate_mappings, copy_length); + else + entries = 0; + + *copied_entries = entries; + + return (duplicate_mappings); +} + +static vdev_t * +vdev_lookup_top(spa_t *spa, uint64_t vdev) +{ + vdev_t *rvd; + + STAILQ_FOREACH(rvd, &spa->spa_vdevs, v_childlink) + if (rvd->v_id == vdev) + break; + + return (rvd); +} + +/* + * This is a callback for vdev_indirect_remap() which allocates an + * indirect_split_t for each split segment and adds it to iv_splits. + */ +static void +vdev_indirect_gather_splits(uint64_t split_offset, vdev_t *vd, uint64_t offset, + uint64_t size, void *arg) +{ + int n = 1; + zio_t *zio = arg; + indirect_vsd_t *iv = zio->io_vsd; + + if (vd->v_read == vdev_indirect_read) + return; + + if (vd->v_read == vdev_mirror_read) + n = vd->v_nchildren; + + indirect_split_t *is = + malloc(offsetof(indirect_split_t, is_child[n])); + if (is == NULL) { + zio->io_error = ENOMEM; + return; + } + bzero(is, offsetof(indirect_split_t, is_child[n])); + + is->is_children = n; + is->is_size = size; + is->is_split_offset = split_offset; + is->is_target_offset = offset; + is->is_vdev = vd; + + /* + * Note that we only consider multiple copies of the data for + * *mirror* vdevs. We don't for "replacing" or "spare" vdevs, even + * though they use the same ops as mirror, because there's only one + * "good" copy under the replacing/spare. + */ + if (vd->v_read == vdev_mirror_read) { + int i = 0; + vdev_t *kid; + + STAILQ_FOREACH(kid, &vd->v_children, v_childlink) { + is->is_child[i++].ic_vdev = kid; + } + } else { + is->is_child[0].ic_vdev = vd; + } + + list_insert_tail(&iv->iv_splits, is); +} + +static void +vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint64_t asize, void *arg) +{ + list_t stack; + spa_t *spa = vd->spa; + + list_create(&stack, sizeof (remap_segment_t), + offsetof(remap_segment_t, rs_node)); + + for (remap_segment_t *rs = rs_alloc(vd, offset, asize, 0); + rs != NULL; rs = list_remove_head(&stack)) { + vdev_t *v = rs->rs_vd; + uint64_t num_entries = 0; + /* vdev_indirect_mapping_t *vim = v->v_mapping; */ + vdev_indirect_mapping_entry_phys_t *mapping = + vdev_indirect_mapping_duplicate_adjacent_entries(v, + rs->rs_offset, rs->rs_asize, &num_entries); + + for (uint64_t i = 0; i < num_entries; i++) { + vdev_indirect_mapping_entry_phys_t *m = &mapping[i]; + uint64_t size = DVA_GET_ASIZE(&m->vimep_dst); + uint64_t dst_offset = DVA_GET_OFFSET(&m->vimep_dst); + uint64_t dst_vdev = DVA_GET_VDEV(&m->vimep_dst); + uint64_t inner_offset = rs->rs_offset - + DVA_MAPPING_GET_SRC_OFFSET(m); + uint64_t inner_size = + MIN(rs->rs_asize, size - inner_offset); + vdev_t *dst_v = vdev_lookup_top(spa, dst_vdev); + + if (dst_v->v_read == vdev_indirect_read) { + list_insert_head(&stack, + rs_alloc(dst_v, dst_offset + inner_offset, + inner_size, rs->rs_split_offset)); + } + vdev_indirect_gather_splits(rs->rs_split_offset, dst_v, + dst_offset + inner_offset, + inner_size, arg); + + rs->rs_offset += inner_size; + rs->rs_asize -= inner_size; + rs->rs_split_offset += inner_size; + } + + free(mapping); + free(rs); + } + + list_destroy(&stack); +} + +static void +vdev_indirect_map_free(zio_t *zio) +{ + indirect_vsd_t *iv = zio->io_vsd; + indirect_split_t *is; + + while ((is = list_head(&iv->iv_splits)) != NULL) { + for (int c = 0; c < is->is_children; c++) { + indirect_child_t *ic = &is->is_child[c]; + free(ic->ic_data); + } + list_remove(&iv->iv_splits, is); + free(is); + } + free(iv); +} + +static int +vdev_indirect_read(vdev_t *vdev, const blkptr_t *bp, void *buf, + off_t offset, size_t bytes) +{ + zio_t zio = { 0 }; + spa_t *spa = vdev->spa; + indirect_vsd_t *iv = malloc(sizeof (*iv)); + indirect_split_t *first; + int rc = EIO; + + if (iv == NULL) + return (ENOMEM); + bzero(iv, sizeof (*iv)); + + list_create(&iv->iv_splits, + sizeof (indirect_split_t), offsetof(indirect_split_t, is_node)); + + zio.io_spa = spa; + zio.io_bp = (blkptr_t *)bp; + zio.io_data = buf; + zio.io_size = bytes; + zio.io_offset = offset; + zio.io_vd = vdev; + zio.io_vsd = iv; + + if (vdev->v_mapping == NULL) { + vdev_indirect_config_t *vic; + + vic = &vdev->vdev_indirect_config; + vdev->v_mapping = vdev_indirect_mapping_open(spa, + &spa->spa_mos, vic->vic_mapping_object); + } + + vdev_indirect_remap(vdev, offset, bytes, &zio); + + first = list_head(&iv->iv_splits); + if (first->is_size == zio.io_size) { + /* + * This is not a split block; we are pointing to the entire + * data, which will checksum the same as the original data. + * Pass the BP down so that the child i/o can verify the + * checksum, and try a different location if available + * (e.g. on a mirror). + * + * While this special case could be handled the same as the + * general (split block) case, doing it this way ensures + * that the vast majority of blocks on indirect vdevs + * (which are not split) are handled identically to blocks + * on non-indirect vdevs. This allows us to be less strict + * about performance in the general (but rare) case. + */ + rc = first->is_vdev->v_read(first->is_vdev, zio.io_bp, + zio.io_data, first->is_target_offset, bytes); + } else { + iv->iv_split_block = B_TRUE; + /* + * Read one copy of each split segment, from the + * top-level vdev. Since we don't know the + * checksum of each split individually, the child + * zio can't ensure that we get the right data. + * E.g. if it's a mirror, it will just read from a + * random (healthy) leaf vdev. We have to verify + * the checksum in vdev_indirect_io_done(). + */ + for (indirect_split_t *is = list_head(&iv->iv_splits); + is != NULL; is = list_next(&iv->iv_splits, is)) { + char *ptr = zio.io_data; + + rc = is->is_vdev->v_read(is->is_vdev, zio.io_bp, + ptr + is->is_split_offset, is->is_target_offset, + is->is_size); + } + if (zio_checksum_verify(spa, zio.io_bp, zio.io_data)) + rc = ECKSUM; + else + rc = 0; + } + + vdev_indirect_map_free(&zio); + if (rc == 0) + rc = zio.io_error; + + return (rc); +} + +static int vdev_disk_read(vdev_t *vdev, const blkptr_t *bp, void *buf, off_t offset, size_t bytes) { @@ -498,6 +1052,7 @@ static vdev_t * vdev_create(uint64_t guid, vdev_read_t *_read) { vdev_t *vdev; + vdev_indirect_config_t *vic; vdev = malloc(sizeof(vdev_t)); memset(vdev, 0, sizeof(vdev_t)); @@ -505,8 +1060,9 @@ vdev_create(uint64_t guid, vdev_read_t *_read) vdev->v_guid = guid; vdev->v_state = VDEV_STATE_OFFLINE; vdev->v_read = _read; - vdev->v_phys_read = 0; - vdev->v_read_priv = 0; + + vic = &vdev->vdev_indirect_config; + vic->vic_prev_indirect_vdev = UINT64_MAX; STAILQ_INSERT_TAIL(&zfs_vdevs, vdev, v_alllink); return (vdev); @@ -540,6 +1096,7 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde && strcmp(type, VDEV_TYPE_FILE) #endif && strcmp(type, VDEV_TYPE_RAIDZ) + && strcmp(type, VDEV_TYPE_INDIRECT) && strcmp(type, VDEV_TYPE_REPLACING)) { printf("ZFS: can only boot from disk, mirror, raidz1, raidz2 and raidz3 vdevs\n"); return (EIO); @@ -568,7 +1125,23 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde vdev = vdev_create(guid, vdev_raidz_read); else if (!strcmp(type, VDEV_TYPE_REPLACING)) vdev = vdev_create(guid, vdev_replacing_read); - else + else if (!strcmp(type, VDEV_TYPE_INDIRECT)) { + vdev_indirect_config_t *vic; + + vdev = vdev_create(guid, vdev_indirect_read); + vdev->v_state = VDEV_STATE_HEALTHY; + vic = &vdev->vdev_indirect_config; + + nvlist_find(nvlist, + ZPOOL_CONFIG_INDIRECT_OBJECT, DATA_TYPE_UINT64, + NULL, &vic->vic_mapping_object); + nvlist_find(nvlist, + ZPOOL_CONFIG_INDIRECT_BIRTHS, DATA_TYPE_UINT64, + NULL, &vic->vic_births_object); + nvlist_find(nvlist, + ZPOOL_CONFIG_PREV_INDIRECT_VDEV, DATA_TYPE_UINT64, + NULL, &vic->vic_prev_indirect_vdev); + } else vdev = vdev_create(guid, vdev_disk_read); vdev->v_id = id; @@ -591,20 +1164,24 @@ vdev_init_from_nvlist(const unsigned char *nvlist, vde path += 5; vdev->v_name = strdup(path); } else { + char *name; + if (!strcmp(type, "raidz")) { - if (vdev->v_nparity == 1) - vdev->v_name = "raidz1"; - else if (vdev->v_nparity == 2) - vdev->v_name = "raidz2"; - else if (vdev->v_nparity == 3) - vdev->v_name = "raidz3"; - else { - printf("ZFS: can only boot from disk, mirror, raidz1, raidz2 and raidz3 vdevs\n"); + if (vdev->v_nparity < 1 || + vdev->v_nparity > 3) { + printf("ZFS: can only boot from disk, " + "mirror, raidz1, raidz2 and raidz3 " + "vdevs\n"); return (EIO); } + asprintf(&name, "%s%d-%jd", type, + vdev->v_nparity, id); } else { - vdev->v_name = strdup(type); + asprintf(&name, "%s-%jd", type, id); } + if (name == NULL) + return (ENOMEM); + vdev->v_name = name; } } else { is_new = 0; @@ -2227,11 +2804,49 @@ check_mos_features(const spa_t *spa) } static int -zfs_spa_init(spa_t *spa) +load_nvlist(spa_t *spa, uint64_t obj, unsigned char **value) { dnode_phys_t dir; + size_t size; int rc; + unsigned char *nv; + *value = NULL; + if ((rc = objset_get_dnode(spa, &spa->spa_mos, obj, &dir)) != 0) + return (rc); + if (dir.dn_type != DMU_OT_PACKED_NVLIST && + dir.dn_bonustype != DMU_OT_PACKED_NVLIST_SIZE) { + return (EIO); + } + + if (dir.dn_bonuslen != sizeof (uint64_t)) + return (EIO); + + size = *(uint64_t *)DN_BONUS(&dir); + nv = malloc(size); + if (nv == NULL) + return (ENOMEM); + + rc = dnode_read(spa, &dir, 0, nv, size); + if (rc != 0) { + free(nv); + nv = NULL; + return (rc); + } + *value = nv; + return (rc); +} + +static int +zfs_spa_init(spa_t *spa) +{ + dnode_phys_t dir; + uint64_t config_object; + unsigned char *nvlist; + char *type; + const unsigned char *nv; + int nkids, rc; + if (zio_read(spa, &spa->spa_uberblock.ub_rootbp, &spa->spa_mos)) { printf("ZFS: can't read MOS of pool %s\n", spa->spa_name); return (EIO); @@ -2255,8 +2870,77 @@ zfs_spa_init(spa_t *spa) rc = check_mos_features(spa); if (rc != 0) { printf("ZFS: pool %s is not supported\n", spa->spa_name); + return (rc); } + rc = zap_lookup(spa, &dir, DMU_POOL_CONFIG, + sizeof (config_object), 1, &config_object); + if (rc != 0) { + printf("ZFS: can not read MOS %s\n", DMU_POOL_CONFIG); + return (EIO); + } + rc = load_nvlist(spa, config_object, &nvlist); + if (rc != 0) + return (rc); + + /* Update vdevs from MOS config. */ + if (nvlist_find(nvlist + 4, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, + NULL, &nv)) { + rc = EIO; + goto done; + } + + if (nvlist_find(nv, ZPOOL_CONFIG_TYPE, DATA_TYPE_STRING, + NULL, &type)) { + printf("ZFS: can't find vdev details\n"); + rc = ENOENT; + goto done; + } + if (strcmp(type, VDEV_TYPE_ROOT) != 0) { + rc = ENOENT; + goto done; + } + + rc = nvlist_find(nv, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, + &nkids, &nv); + if (rc != 0) + goto done; + + for (int i = 0; i < nkids; i++) { + vdev_t *vd, *prev, *kid = NULL; + rc = vdev_init_from_nvlist(nv, NULL, &kid, 0); + if (rc != 0) { + printf("vdev_init_from_nvlist: %d\n", rc); + break; + } + kid->spa = spa; + prev = NULL; + STAILQ_FOREACH(vd, &spa->spa_vdevs, v_childlink) { + /* Already present? */ + if (kid->v_id == vd->v_id) { + kid = NULL; + break; + } + if (vd->v_id > kid->v_id) { + if (prev == NULL) { + STAILQ_INSERT_HEAD(&spa->spa_vdevs, + kid, v_childlink); + } else { + STAILQ_INSERT_AFTER(&spa->spa_vdevs, + prev, kid, v_childlink); + } + kid = NULL; + break; + } + prev = vd; + } + if (kid != NULL) + STAILQ_INSERT_TAIL(&spa->spa_vdevs, kid, v_childlink); + nv = nvlist_next(nv); + } + rc = 0; +done: + free(nvlist); return (rc); } Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Thu Aug 8 18:00:37 2019 (r350771) +++ head/sys/cddl/boot/zfs/zfsimpl.h Thu Aug 8 18:08:13 2019 (r350772) @@ -715,6 +715,9 @@ typedef enum { #define ZPOOL_CONFIG_CHILDREN "children" #define ZPOOL_CONFIG_ID "id" #define ZPOOL_CONFIG_GUID "guid" +#define ZPOOL_CONFIG_INDIRECT_OBJECT "com.delphix:indirect_object" +#define ZPOOL_CONFIG_INDIRECT_BIRTHS "com.delphix:indirect_births" +#define ZPOOL_CONFIG_PREV_INDIRECT_VDEV "com.delphix:prev_indirect_vdev" #define ZPOOL_CONFIG_PATH "path" #define ZPOOL_CONFIG_DEVID "devid" #define ZPOOL_CONFIG_METASLAB_ARRAY "metaslab_array" @@ -758,6 +761,7 @@ typedef enum { #define VDEV_TYPE_SPARE "spare" #define VDEV_TYPE_LOG "log" #define VDEV_TYPE_L2CACHE "l2cache" +#define VDEV_TYPE_INDIRECT "indirect" /* * This is needed in userland to report the minimum necessary device size. @@ -850,7 +854,7 @@ struct uberblock { */ #define DNODE_SHIFT 9 /* 512 bytes */ #define DN_MIN_INDBLKSHIFT 12 /* 4k */ -#define DN_MAX_INDBLKSHIFT 14 /* 16k */ +#define DN_MAX_INDBLKSHIFT 17 /* 128k */ #define DNODE_BLOCK_SHIFT 14 /* 16k */ #define DNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ #define DN_MAX_OBJECT_SHIFT 48 /* 256 trillion (zfs_fid_t limit) */ @@ -1217,6 +1221,9 @@ typedef struct dsl_dataset_phys { #define DMU_POOL_HISTORY "history" #define DMU_POOL_PROPS "pool_props" #define DMU_POOL_CHECKSUM_SALT "org.illumos:checksum_salt" +#define DMU_POOL_REMOVING "com.delphix:removing" +#define DMU_POOL_OBSOLETE_BPOBJ "com.delphix:obsolete_bpobj" +#define DMU_POOL_CONDENSING_INDIRECT "com.delphix:condensing_indirect" #define ZAP_MAGIC 0x2F52AB2ABULL @@ -1530,6 +1537,116 @@ typedef int vdev_read_t(struct vdev *vdev, const blkpt typedef STAILQ_HEAD(vdev_list, vdev) vdev_list_t; +typedef struct vdev_indirect_mapping_entry_phys { + /* + * Decode with DVA_MAPPING_* macros. + * Contains: + * the source offset (low 63 bits) + * the one-bit "mark", used for garbage collection (by zdb) + */ + uint64_t vimep_src; + + /* + * Note: the DVA's asize is 24 bits, and can thus store ranges + * up to 8GB. + */ + dva_t vimep_dst; +} vdev_indirect_mapping_entry_phys_t; + +#define DVA_MAPPING_GET_SRC_OFFSET(vimep) \ + BF64_GET_SB((vimep)->vimep_src, 0, 63, SPA_MINBLOCKSHIFT, 0) +#define DVA_MAPPING_SET_SRC_OFFSET(vimep, x) \ + BF64_SET_SB((vimep)->vimep_src, 0, 63, SPA_MINBLOCKSHIFT, 0, x) + +typedef struct vdev_indirect_mapping_entry { + vdev_indirect_mapping_entry_phys_t vime_mapping; + uint32_t vime_obsolete_count; + list_node_t vime_node; +} vdev_indirect_mapping_entry_t; + +/* + * This is stored in the bonus buffer of the mapping object, see comment of + * vdev_indirect_config for more details. + */ +typedef struct vdev_indirect_mapping_phys { + uint64_t vimp_max_offset; + uint64_t vimp_bytes_mapped; + uint64_t vimp_num_entries; /* number of v_i_m_entry_phys_t's */ + + /* + * For each entry in the mapping object, this object contains an + * entry representing the number of bytes of that mapping entry + * that were no longer in use by the pool at the time this indirect + * vdev was last condensed. + */ + uint64_t vimp_counts_object; +} vdev_indirect_mapping_phys_t; + +#define VDEV_INDIRECT_MAPPING_SIZE_V0 (3 * sizeof (uint64_t)) + +typedef struct vdev_indirect_mapping { + uint64_t vim_object; + boolean_t vim_havecounts; + + /* vim_entries segment offset currently in memory. */ + uint64_t vim_entry_offset; + /* vim_entries segment size. */ + size_t vim_num_entries; + + /* Needed by dnode_read() */ + const void *vim_spa; + dnode_phys_t *vim_dn; + + /* + * An ordered array of mapping entries, sorted by source offset. + * Note that vim_entries is needed during a removal (and contains + * mappings that have been synced to disk so far) to handle frees + * from the removing device. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 8 18:42:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74283AED09; Thu, 8 Aug 2019 18:42:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464HL83441z4hfm; Thu, 8 Aug 2019 18:42:40 +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 4A87717BB; Thu, 8 Aug 2019 18:42:40 +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 x78Igegx021413; Thu, 8 Aug 2019 18:42:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78IgeYv021412; Thu, 8 Aug 2019 18:42:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081842.x78IgeYv021412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 18:42: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: r350773 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 18:42:40 -0000 Author: mav Date: Thu Aug 8 18:42:39 2019 New Revision: 350773 URL: https://svnweb.freebsd.org/changeset/base/350773 Log: MFC r320861 (by ngie): Fix whitespace bugs - Delete trailing whitespace. - Replace 8 single column spaces with hard tabs. - Delete lines with consisting purely of blank space. - Add space between `return` and `(`, per style(9). Special care was taken to not blindly replace 8 single column spaces with tabs; doing so could break tools that do strict string comparisons with camcontrol output. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 18:08:13 2019 (r350772) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 18:42:39 2019 (r350773) @@ -375,14 +375,14 @@ getoption(struct camcontrol_opts *table, char *arg, ui *argnum = opts->argnum; *subopt = opts->subopt; if (++num_matches > 1) - return(CC_OR_AMBIGUOUS); + return (CC_OR_AMBIGUOUS); } } if (num_matches > 0) - return(CC_OR_FOUND); + return (CC_OR_FOUND); else - return(CC_OR_NOT_FOUND); + return (CC_OR_NOT_FOUND); } #ifndef MINIMALISTIC @@ -404,7 +404,7 @@ getdevlist(struct cam_device *device) if (cam_send_ccb(device, ccb) < 0) { perror("error getting device list"); cam_freeccb(ccb); - return(1); + return (1); } status[0] = '\0'; @@ -442,7 +442,7 @@ getdevlist(struct cam_device *device) cam_freeccb(ccb); - return(error); + return (error); } #endif /* MINIMALISTIC */ @@ -471,7 +471,7 @@ getdevtree(int argc, char **argv, char *combinedopt) if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { warn("couldn't open %s", XPT_DEVICE); - return(1); + return (1); } bzero(&ccb, sizeof(union ccb)); @@ -487,7 +487,7 @@ getdevtree(int argc, char **argv, char *combinedopt) if (ccb.cdm.matches == NULL) { warnx("can't malloc memory for matches"); close(fd); - return(1); + return (1); } ccb.cdm.num_matches = 0; @@ -663,7 +663,7 @@ getdevtree(int argc, char **argv, char *combinedopt) close(fd); - return(error); + return (error); } #ifndef MINIMALISTIC @@ -699,7 +699,7 @@ testunitready(struct cam_device *device, int task_attr } cam_freeccb(ccb); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) { @@ -718,7 +718,7 @@ testunitready(struct cam_device *device, int task_attr cam_freeccb(ccb); - return(error); + return (error); } static int @@ -768,7 +768,7 @@ scsistart(struct cam_device *device, int startstop, in } cam_freeccb(ccb); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) @@ -802,7 +802,7 @@ scsistart(struct cam_device *device, int startstop, in cam_freeccb(ccb); - return(error); + return (error); } int @@ -839,7 +839,7 @@ scsidoinquiry(struct cam_device *device, int argc, cha error = scsiinquiry(device, task_attr, retry_count, timeout); if (error != 0) - return(error); + return (error); if (arglist & CAM_ARG_GET_SERIAL) scsiserial(device, task_attr, retry_count, timeout); @@ -847,7 +847,7 @@ scsidoinquiry(struct cam_device *device, int argc, cha if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); - return(error); + return (error); } static int @@ -862,7 +862,7 @@ scsiinquiry(struct cam_device *device, int task_attr, if (ccb == NULL) { warnx("couldn't allocate CCB"); - return(1); + return (1); } /* cam_getccb cleans up the header, caller has to zero the payload */ @@ -874,7 +874,7 @@ scsiinquiry(struct cam_device *device, int task_attr, if (inq_buf == NULL) { cam_freeccb(ccb); warnx("can't malloc memory for inquiry\n"); - return(1); + return (1); } bzero(inq_buf, sizeof(*inq_buf)); @@ -937,7 +937,7 @@ scsiinquiry(struct cam_device *device, int task_attr, } cam_freeccb(ccb); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -953,7 +953,7 @@ scsiinquiry(struct cam_device *device, int task_attr, if (error != 0) { free(inq_buf); - return(error); + return (error); } fprintf(stdout, "%s%d: ", device->device_name, @@ -962,7 +962,7 @@ scsiinquiry(struct cam_device *device, int task_attr, free(inq_buf); - return(0); + return (0); } static int @@ -978,7 +978,7 @@ scsiserial(struct cam_device *device, int task_attr, i if (ccb == NULL) { warnx("couldn't allocate CCB"); - return(1); + return (1); } /* cam_getccb cleans up the header, caller has to zero the payload */ @@ -990,7 +990,7 @@ scsiserial(struct cam_device *device, int task_attr, i if (serial_buf == NULL) { cam_freeccb(ccb); warnx("can't malloc memory for serial number"); - return(1); + return (1); } scsi_inquiry(&ccb->csio, @@ -1020,7 +1020,7 @@ scsiserial(struct cam_device *device, int task_attr, i cam_freeccb(ccb); free(serial_buf); - return(1); + return (1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1036,7 +1036,7 @@ scsiserial(struct cam_device *device, int task_attr, i if (error != 0) { free(serial_buf); - return(error); + return (error); } bcopy(serial_buf->serial_num, serial_num, serial_buf->length); @@ -1051,7 +1051,7 @@ scsiserial(struct cam_device *device, int task_attr, i free(serial_buf); - return(0); + return (0); } int @@ -1071,7 +1071,7 @@ camxferrate(struct cam_device *device) if (ccb == NULL) { warnx("couldn't allocate CCB"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); @@ -1210,13 +1210,13 @@ camxferrate(struct cam_device *device) } } - fprintf(stdout, "\n"); + fprintf(stdout, "\n"); xferrate_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } static void @@ -1239,7 +1239,7 @@ atahpa_print(struct ata_params *parm, u_int64_t hpasiz if (parm->support.command1 & ATA_SUPPORT_PROTECTED) { u_int64_t lba = lbasize48 ? lbasize48 : lbasize; printf("yes %s %ju/%ju\n", (hpasize > lba) ? "yes" : "no ", - lba, hpasize); + lba, hpasize); printf("HPA - Security "); if (parm->support.command1 & ATA_SUPPORT_MAXSECURITY) @@ -3040,8 +3040,7 @@ atasecurity(struct cam_device *device, int retry_count } error = atasecurity_erase(device, ccb, retry_count, - timeout, erase_timeout, &pwd, - quiet); + timeout, erase_timeout, &pwd, quiet); } else { warnx("Can't secure erase (security is disabled)"); error = 1; @@ -3134,7 +3133,7 @@ dorescan_or_reset(int argc, char **argv, int rescan) if (argc < 3) { warnx(must, rescan? "rescan" : "reset"); - return(1); + return (1); } tstr = argv[optind]; @@ -3146,7 +3145,7 @@ dorescan_or_reset(int argc, char **argv, int rescan) rv = parse_btl(argv[optind], &bus, &target, &lun, &arglist); if (rv != 1 && rv != 3) { warnx(must, rescan? "rescan" : "reset"); - return(1); + return (1); } } else { char name[30]; @@ -3254,7 +3253,7 @@ dorescan_or_reset(int argc, char **argv, int rescan) bailout: - return(error); + return (error); } static int @@ -3269,7 +3268,7 @@ rescan_or_reset_bus(path_id_t bus, int rescan) if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { warnx("error opening transport layer device %s", XPT_DEVICE); warn("%s", XPT_DEVICE); - return(1); + return (1); } ccb = malloc(sizeof(*ccb)); @@ -3434,7 +3433,7 @@ bailout: } free(ccb); - return(retval); + return (retval); } static int @@ -3448,17 +3447,17 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target if (bus == CAM_BUS_WILDCARD) { warnx("invalid bus number %d", bus); - return(1); + return (1); } if (target == CAM_TARGET_WILDCARD) { warnx("invalid target number %d", target); - return(1); + return (1); } if (lun == CAM_LUN_WILDCARD) { warnx("invalid lun number %jx", (uintmax_t)lun); - return(1); + return (1); } fd = -1; @@ -3470,13 +3469,13 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target warnx("error opening transport layer device %s\n", XPT_DEVICE); warn("%s", XPT_DEVICE); - return(1); + return (1); } } else { device = cam_open_btl(bus, target, lun, O_RDWR, NULL); if (device == NULL) { warnx("%s", cam_errbuf); - return(1); + return (1); } } @@ -3494,13 +3493,13 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target if (ioctl(fd, CAMIOCOMMAND, &ccb) < 0) { warn("CAMIOCOMMAND ioctl failed"); close(fd); - return(1); + return (1); } } else { if (cam_send_ccb(device, &ccb) < 0) { warn("error sending XPT_RESET_DEV CCB"); cam_close_device(device); - return(1); + return (1); } } @@ -3517,12 +3516,12 @@ scanlun_or_reset_dev(path_id_t bus, target_id_t target && ((ccb.ccb_h.status & CAM_STATUS_MASK) == CAM_BDR_SENT))) { fprintf(stdout, "%s of %d:%d:%jx was successful\n", scan? "Re-scan" : "Reset", bus, target, (uintmax_t)lun); - return(0); + return (0); } else { fprintf(stdout, "%s of %d:%d:%jx returned error %#x\n", scan? "Re-scan" : "Reset", bus, target, (uintmax_t)lun, ccb.ccb_h.status & CAM_STATUS_MASK); - return(1); + return (1); } } @@ -3754,7 +3753,7 @@ next_batch: error = 1; goto defect_bailout; break; - } + } max_possible_size = (hdr_max / entry_size) * entry_size; num_returned = returned_length / entry_size; @@ -4100,7 +4099,7 @@ defect_bailout: if (ccb != NULL) cam_freeccb(ccb); - return(error); + return (error); } #endif /* MINIMALISTIC */ @@ -4301,7 +4300,7 @@ scsicmd(struct cam_device *device, int argc, char **ar if (ccb == NULL) { warnx("scsicmd: error allocating ccb"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(ccb); @@ -4501,7 +4500,7 @@ scsicmd(struct cam_device *device, int argc, char **ar case 3: case 6: case 7: - /* computed by buff_encode_visit */ + /* computed by buff_encode_visit */ break; case 4: cdb_len = 16; @@ -4630,7 +4629,7 @@ scsicmd_bailout: cam_freeccb(ccb); - return(error); + return (error); } static int @@ -4684,7 +4683,7 @@ camdebug(int argc, char **argv, char *combinedopt) if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { warnx("error opening transport layer device %s", XPT_DEVICE); warn("%s", XPT_DEVICE); - return(1); + return (1); } argc -= optind; argv += optind; @@ -4693,7 +4692,7 @@ camdebug(int argc, char **argv, char *combinedopt) warnx("you must specify \"off\", \"all\" or a bus,"); warnx("bus:target, or bus:target:lun"); close(fd); - return(1); + return (1); } tstr = *argv; @@ -4767,7 +4766,7 @@ camdebug(int argc, char **argv, char *combinedopt) close(fd); } - return(error); + return (error); } static int @@ -4785,7 +4784,7 @@ tagcontrol(struct cam_device *device, int argc, char * if (ccb == NULL) { warnx("tagcontrol: error allocating ccb"); - return(1); + return (1); } while ((c = getopt(argc, argv, combinedopt)) != -1) { @@ -4881,7 +4880,7 @@ tagcontrol(struct cam_device *device, int argc, char * tagcontrol_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } static void @@ -5034,7 +5033,7 @@ get_cpi(struct cam_device *device, struct ccb_pathinq ccb = cam_getccb(device); if (ccb == NULL) { warnx("get_cpi: couldn't allocate CCB"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cpi); ccb->ccb_h.func_code = XPT_PATH_INQ; @@ -5057,7 +5056,7 @@ get_cpi(struct cam_device *device, struct ccb_pathinq get_cpi_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } /* @@ -5072,7 +5071,7 @@ get_cgd(struct cam_device *device, struct ccb_getdev * ccb = cam_getccb(device); if (ccb == NULL) { warnx("get_cgd: couldn't allocate CCB"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cgd); ccb->ccb_h.func_code = XPT_GDEV_TYPE; @@ -5095,7 +5094,7 @@ get_cgd(struct cam_device *device, struct ccb_getdev * get_cgd_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } /* @@ -5117,7 +5116,7 @@ dev_has_vpd_page(struct cam_device *dev, uint8_t page_ retval = -1; goto bailout; } - + /* cam_getccb cleans up the header, caller has to zero the payload */ CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); @@ -5164,7 +5163,7 @@ dev_has_vpd_page(struct cam_device *dev, uint8_t page_ bailout: if (ccb != NULL) cam_freeccb(ccb); - + return (retval); } @@ -5194,7 +5193,7 @@ get_device_type(struct cam_device *dev, int retry_coun break; /*NOTREACHED*/ default: *devtype = CC_DT_UNKNOWN; - goto bailout; + goto bailout; break; /*NOTREACHED*/ } @@ -5269,7 +5268,7 @@ build_ata_cmd(union ccb *ccb, uint32_t retry_count, ui /*protocol*/ protocol, /*ata_flags*/ ata_flags, /*features*/ features, - /*sector_count*/ sector_count, + /*sector_count*/ sector_count, /*lba*/ lba, /*command*/ command, /*device*/ 0, @@ -5301,7 +5300,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, /* * In this case, we have SCSI ATA PASS-THROUGH command, 12 - * or 16 byte, and need to see what + * or 16 byte, and need to see what */ if (ccb->ccb_h.flags & CAM_CDB_POINTER) opcode = ccb->csio.cdb_io.cdb_ptr[0]; @@ -5351,7 +5350,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, ((uint64_t)desc->lba_31_24 << 24) | (desc->lba_23_16 << 16) | (desc->lba_15_8 << 8) | - desc->lba_7_0; + desc->lba_7_0; *device = desc->device; *status = desc->status; @@ -5402,7 +5401,7 @@ get_ata_status(struct cam_device *dev, union ccb *ccb, res = &ccb->ataio.res; *error = res->error; *status = res->status; - *device = res->device; + *device = res->device; *count = res->sector_count; *lba = (res->lba_high << 16) | (res->lba_mid << 8) | @@ -5602,7 +5601,7 @@ get_print_cts(struct cam_device *device, int user_sett if (ccb == NULL) { warnx("get_print_cts: error allocating ccb"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->cts); @@ -5642,7 +5641,7 @@ get_print_cts_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } static int @@ -5665,7 +5664,7 @@ ratecontrol(struct cam_device *device, int task_attr, ccb = cam_getccb(device); if (ccb == NULL) { warnx("ratecontrol: error allocating ccb"); - return(1); + return (1); } while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c){ @@ -5997,7 +5996,7 @@ ratecontrol(struct cam_device *device, int task_attr, ratecontrol_bailout: cam_freeccb(ccb); - return(retval); + return (retval); } static int @@ -6021,7 +6020,7 @@ scsiformat(struct cam_device *device, int argc, char * if (ccb == NULL) { warnx("scsiformat: error allocating ccb"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); @@ -6287,7 +6286,7 @@ scsiformat_bailout: cam_freeccb(ccb); - return(error); + return (error); } static int @@ -6316,7 +6315,7 @@ scsisanitize(struct cam_device *device, int argc, char if (ccb == NULL) { warnx("scsisanitize: error allocating ccb"); - return(1); + return (1); } CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); @@ -6697,7 +6696,7 @@ scsisanitize_bailout: free(data_ptr); cam_freeccb(ccb); - return(error); + return (error); } static int @@ -7335,7 +7334,7 @@ smpcmd(struct cam_device *device, int argc, char **arg } else if ((amt_written == 0) && (amt_to_write > 0)) { warnx("only wrote %u bytes out of %u", - response_size - amt_to_write, + response_size - amt_to_write, response_size); } } @@ -7945,7 +7944,7 @@ buildbusdevlist(struct cam_devlist *devlist) if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { warn("couldn't open %s", XPT_DEVICE); - return(1); + return (1); } bzero(&ccb, sizeof(union ccb)); @@ -7961,7 +7960,7 @@ buildbusdevlist(struct cam_devlist *devlist) if (ccb.cdm.matches == NULL) { warnx("can't malloc memory for matches"); close(fd); - return(1); + return (1); } ccb.cdm.num_matches = 0; ccb.cdm.num_patterns = 2; @@ -8012,7 +8011,7 @@ buildbusdevlist(struct cam_devlist *devlist) case DEV_MATCH_DEVICE: { struct device_match_result *dev_result; - dev_result = + dev_result = &ccb.cdm.matches[i].result.device_result; if (dev_result->flags & @@ -8363,7 +8362,7 @@ smpphylist(struct cam_device *device, int argc, char * fprintf(stdout, "%s%d", item->periph_matches[j].periph_name, item->periph_matches[j].unit_number); - + } fprintf(stdout, ")\n"); } @@ -8565,7 +8564,7 @@ scsigetopcodes(struct cam_device *device, int opcode_s alloc_len += num_opcodes * sizeof(struct scsi_report_supported_opcodes_timeout); } - + if (sa_set != 0) { options |= RSO_OPTIONS_OC_SA; if (show_sa_errors != 0) @@ -8576,7 +8575,7 @@ retry_alloc: if (buf != NULL) { free(buf); buf = NULL; - } + } buf = malloc(alloc_len); if (buf == NULL) { @@ -8613,7 +8612,6 @@ retry_alloc: if (verbosemode != 0) cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); - retval = 1; goto bailout; } @@ -9599,167 +9597,167 @@ main(int argc, char **argv) switch(cmdlist) { #ifndef MINIMALISTIC - case CAM_CMD_DEVLIST: - error = getdevlist(cam_dev); - break; - case CAM_CMD_HPA: - error = atahpa(cam_dev, retry_count, timeout, - argc, argv, combinedopt); - break; + case CAM_CMD_DEVLIST: + error = getdevlist(cam_dev); + break; + case CAM_CMD_HPA: + error = atahpa(cam_dev, retry_count, timeout, + argc, argv, combinedopt); + break; #endif /* MINIMALISTIC */ - case CAM_CMD_DEVTREE: - error = getdevtree(argc, argv, combinedopt); - break; + case CAM_CMD_DEVTREE: + error = getdevtree(argc, argv, combinedopt); + break; #ifndef MINIMALISTIC - case CAM_CMD_TUR: - error = testunitready(cam_dev, task_attr, retry_count, - timeout, 0); - break; - case CAM_CMD_INQUIRY: - error = scsidoinquiry(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout); - break; - case CAM_CMD_IDENTIFY: - error = ataidentify(cam_dev, retry_count, timeout); - break; - case CAM_CMD_STARTSTOP: - error = scsistart(cam_dev, arglist & CAM_ARG_START_UNIT, - arglist & CAM_ARG_EJECT, task_attr, - retry_count, timeout); - break; + case CAM_CMD_TUR: + error = testunitready(cam_dev, task_attr, retry_count, + timeout, 0); + break; + case CAM_CMD_INQUIRY: + error = scsidoinquiry(cam_dev, argc, argv, combinedopt, + task_attr, retry_count, timeout); + break; + case CAM_CMD_IDENTIFY: + error = ataidentify(cam_dev, retry_count, timeout); + break; + case CAM_CMD_STARTSTOP: + error = scsistart(cam_dev, arglist & CAM_ARG_START_UNIT, + arglist & CAM_ARG_EJECT, task_attr, + retry_count, timeout); + break; #endif /* MINIMALISTIC */ - case CAM_CMD_RESCAN: - error = dorescan_or_reset(argc, argv, 1); - break; - case CAM_CMD_RESET: - error = dorescan_or_reset(argc, argv, 0); - break; + case CAM_CMD_RESCAN: + error = dorescan_or_reset(argc, argv, 1); + break; + case CAM_CMD_RESET: + error = dorescan_or_reset(argc, argv, 0); + break; #ifndef MINIMALISTIC - case CAM_CMD_READ_DEFECTS: - error = readdefects(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout); - break; - case CAM_CMD_MODE_PAGE: - modepage(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout); - break; - case CAM_CMD_SCSI_CMD: - error = scsicmd(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout); - break; - case CAM_CMD_SMP_CMD: - error = smpcmd(cam_dev, argc, argv, combinedopt, + case CAM_CMD_READ_DEFECTS: + error = readdefects(cam_dev, argc, argv, combinedopt, + task_attr, retry_count, timeout); + break; + case CAM_CMD_MODE_PAGE: + modepage(cam_dev, argc, argv, combinedopt, + task_attr, retry_count, timeout); + break; + case CAM_CMD_SCSI_CMD: + error = scsicmd(cam_dev, argc, argv, combinedopt, + task_attr, retry_count, timeout); + break; + case CAM_CMD_SMP_CMD: + error = smpcmd(cam_dev, argc, argv, combinedopt, + retry_count, timeout); + break; + case CAM_CMD_SMP_RG: + error = smpreportgeneral(cam_dev, argc, argv, + combinedopt, retry_count, + timeout); + break; + case CAM_CMD_SMP_PC: + error = smpphycontrol(cam_dev, argc, argv, combinedopt, + retry_count, timeout); + break; + case CAM_CMD_SMP_PHYLIST: + error = smpphylist(cam_dev, argc, argv, combinedopt, + retry_count, timeout); + break; + case CAM_CMD_SMP_MANINFO: + error = smpmaninfo(cam_dev, argc, argv, combinedopt, + retry_count, timeout); + break; + case CAM_CMD_DEBUG: + error = camdebug(argc, argv, combinedopt); + break; + case CAM_CMD_TAG: + error = tagcontrol(cam_dev, argc, argv, combinedopt); + break; + case CAM_CMD_RATE: + error = ratecontrol(cam_dev, task_attr, retry_count, + timeout, argc, argv, combinedopt); + break; + case CAM_CMD_FORMAT: + error = scsiformat(cam_dev, argc, argv, + combinedopt, task_attr, retry_count, + timeout); + break; + case CAM_CMD_REPORTLUNS: + error = scsireportluns(cam_dev, argc, argv, + combinedopt, task_attr, retry_count, timeout); - break; - case CAM_CMD_SMP_RG: - error = smpreportgeneral(cam_dev, argc, argv, - combinedopt, retry_count, - timeout); - break; - case CAM_CMD_SMP_PC: - error = smpphycontrol(cam_dev, argc, argv, combinedopt, - retry_count, timeout); - break; - case CAM_CMD_SMP_PHYLIST: - error = smpphylist(cam_dev, argc, argv, combinedopt, - retry_count, timeout); - break; - case CAM_CMD_SMP_MANINFO: - error = smpmaninfo(cam_dev, argc, argv, combinedopt, - retry_count, timeout); - break; - case CAM_CMD_DEBUG: - error = camdebug(argc, argv, combinedopt); - break; - case CAM_CMD_TAG: - error = tagcontrol(cam_dev, argc, argv, combinedopt); - break; - case CAM_CMD_RATE: - error = ratecontrol(cam_dev, task_attr, retry_count, - timeout, argc, argv, combinedopt); - break; - case CAM_CMD_FORMAT: - error = scsiformat(cam_dev, argc, argv, - combinedopt, task_attr, retry_count, - timeout); - break; - case CAM_CMD_REPORTLUNS: - error = scsireportluns(cam_dev, argc, argv, - combinedopt, task_attr, - retry_count, timeout); - break; - case CAM_CMD_READCAP: - error = scsireadcapacity(cam_dev, argc, argv, - combinedopt, task_attr, - retry_count, timeout); - break; - case CAM_CMD_IDLE: - case CAM_CMD_STANDBY: - case CAM_CMD_SLEEP: - error = atapm(cam_dev, argc, argv, - combinedopt, retry_count, timeout); - break; - case CAM_CMD_APM: - case CAM_CMD_AAM: - error = ataaxm(cam_dev, argc, argv, - combinedopt, retry_count, timeout); - break; - case CAM_CMD_SECURITY: - error = atasecurity(cam_dev, retry_count, timeout, - argc, argv, combinedopt); - break; - case CAM_CMD_DOWNLOAD_FW: - error = fwdownload(cam_dev, argc, argv, combinedopt, - arglist & CAM_ARG_VERBOSE, task_attr, retry_count, - timeout); - break; - case CAM_CMD_SANITIZE: - error = scsisanitize(cam_dev, argc, argv, - combinedopt, task_attr, - retry_count, timeout); - break; - case CAM_CMD_PERSIST: - error = scsipersist(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout, - arglist & CAM_ARG_VERBOSE, - arglist & CAM_ARG_ERR_RECOVER); - break; - case CAM_CMD_ATTRIB: - error = scsiattrib(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout, - arglist & CAM_ARG_VERBOSE, - arglist & CAM_ARG_ERR_RECOVER); - break; - case CAM_CMD_OPCODES: - error = scsiopcodes(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout, - arglist & CAM_ARG_VERBOSE); - break; - case CAM_CMD_REPROBE: - error = scsireprobe(cam_dev); - break; - case CAM_CMD_ZONE: - error = zone(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout, - arglist & CAM_ARG_VERBOSE); - break; - case CAM_CMD_EPC: - error = epc(cam_dev, argc, argv, combinedopt, - retry_count, timeout, arglist & CAM_ARG_VERBOSE); - break; - case CAM_CMD_TIMESTAMP: - error = timestamp(cam_dev, argc, argv, combinedopt, - task_attr, retry_count, timeout, - arglist & CAM_ARG_VERBOSE); - break; + break; + case CAM_CMD_READCAP: + error = scsireadcapacity(cam_dev, argc, argv, + combinedopt, task_attr, + retry_count, timeout); + break; + case CAM_CMD_IDLE: + case CAM_CMD_STANDBY: + case CAM_CMD_SLEEP: + error = atapm(cam_dev, argc, argv, + combinedopt, retry_count, timeout); + break; + case CAM_CMD_APM: + case CAM_CMD_AAM: + error = ataaxm(cam_dev, argc, argv, + combinedopt, retry_count, timeout); + break; + case CAM_CMD_SECURITY: + error = atasecurity(cam_dev, retry_count, timeout, + argc, argv, combinedopt); + break; + case CAM_CMD_DOWNLOAD_FW: + error = fwdownload(cam_dev, argc, argv, combinedopt, + arglist & CAM_ARG_VERBOSE, task_attr, retry_count, + timeout); + break; + case CAM_CMD_SANITIZE: + error = scsisanitize(cam_dev, argc, argv, + combinedopt, task_attr, + retry_count, timeout); + break; + case CAM_CMD_PERSIST: + error = scsipersist(cam_dev, argc, argv, combinedopt, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE, + arglist & CAM_ARG_ERR_RECOVER); + break; + case CAM_CMD_ATTRIB: + error = scsiattrib(cam_dev, argc, argv, combinedopt, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE, + arglist & CAM_ARG_ERR_RECOVER); + break; + case CAM_CMD_OPCODES: + error = scsiopcodes(cam_dev, argc, argv, combinedopt, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); + break; + case CAM_CMD_REPROBE: + error = scsireprobe(cam_dev); + break; + case CAM_CMD_ZONE: + error = zone(cam_dev, argc, argv, combinedopt, + task_attr, retry_count, timeout, + arglist & CAM_ARG_VERBOSE); + break; + case CAM_CMD_EPC: + error = epc(cam_dev, argc, argv, combinedopt, + retry_count, timeout, arglist & CAM_ARG_VERBOSE); + break; + case CAM_CMD_TIMESTAMP: + error = timestamp(cam_dev, argc, argv, combinedopt, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 8 18:48:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B787DAF10E; Thu, 8 Aug 2019 18:48:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464HTF4LPnz4jD6; Thu, 8 Aug 2019 18:48:49 +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 76A1517CA; Thu, 8 Aug 2019 18:48:49 +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 x78ImnWa021862; Thu, 8 Aug 2019 18:48:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Imn7i021860; Thu, 8 Aug 2019 18:48:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081848.x78Imn7i021860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 18:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350774 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 18:48:49 -0000 Author: mav Date: Thu Aug 8 18:48:48 2019 New Revision: 350774 URL: https://svnweb.freebsd.org/changeset/base/350774 Log: MFC r346594 (by smh): Add ATA power mode support to camcontrol Add the ability to report ATA device power mode with the cmmand 'powermode' to compliment the existing ability to set it using idle, standby and sleep commands. Modified: stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 18:42:39 2019 (r350773) +++ stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 18:48:48 2019 (r350774) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2019 +.Dd April 22, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -243,6 +243,10 @@ .Op device id .Op generic args .Nm +.Ic powermode +.Op device id +.Op generic args +.Nm .Ic apm .Op device id .Op generic args @@ -1388,6 +1392,8 @@ Value 0 disables timer. Put ATA device into SLEEP state. Note that the only way get device out of this state may be reset. +.It Ic powermode +Report ATA device power mode. .It Ic apm It optional parameter .Pq Fl l Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 18:42:39 2019 (r350773) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 18:48:48 2019 (r350774) @@ -104,7 +104,8 @@ typedef enum { CAM_CMD_REPROBE = 0x00000025, CAM_CMD_ZONE = 0x00000026, CAM_CMD_EPC = 0x00000027, - CAM_CMD_TIMESTAMP = 0x00000028 + CAM_CMD_TIMESTAMP = 0x00000028, + CAM_CMD_POWER_MODE = 0x0000002a, } cam_cmdmask; typedef enum { @@ -230,6 +231,7 @@ static struct camcontrol_opts option_table[] = { {"idle", CAM_CMD_IDLE, CAM_ARG_NONE, "t:"}, {"standby", CAM_CMD_STANDBY, CAM_ARG_NONE, "t:"}, {"sleep", CAM_CMD_SLEEP, CAM_ARG_NONE, ""}, + {"powermode", CAM_CMD_POWER_MODE, CAM_ARG_NONE, ""}, {"apm", CAM_CMD_APM, CAM_ARG_NONE, "l:"}, {"aam", CAM_CMD_AAM, CAM_ARG_NONE, "l:"}, {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:qsy"}, @@ -8384,6 +8386,61 @@ bailout: } static int +atapm_proc_resp(struct cam_device *device, union ccb *ccb) +{ + struct ata_res *res; + + res = &ccb->ataio.res; + if (res->status & ATA_STATUS_ERROR) { + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + printf("error = 0x%02x, sector_count = 0x%04x, " + "device = 0x%02x, status = 0x%02x\n", + res->error, res->sector_count, + res->device, res->status); + } + + return (1); + } + + if (arglist & CAM_ARG_VERBOSE) { + fprintf(stdout, "%s%d: Raw native check power data:\n", + device->device_name, device->dev_unit_num); + /* res is 4 byte aligned */ + dump_data((uint16_t*)(uintptr_t)res, sizeof(struct ata_res)); + + printf("error = 0x%02x, sector_count = 0x%04x, device = 0x%02x, " + "status = 0x%02x\n", res->error, res->sector_count, + res->device, res->status); + } + + printf("%s%d: ", device->device_name, device->dev_unit_num); + switch (res->sector_count) { + case 0x00: + printf("Standby mode\n"); + break; + case 0x40: + printf("NV Cache Power Mode and the spindle is spun down or spinning down\n"); + break; + case 0x41: + printf("NV Cache Power Mode and the spindle is spun up or spinning up\n"); + break; + case 0x80: + printf("Idle mode\n"); + break; + case 0xff: + printf("Active or Idle mode\n"); + break; + default: + printf("Unknown mode 0x%02x\n", res->sector_count); + break; + } + + return (0); +} + +static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { @@ -8391,6 +8448,7 @@ atapm(struct cam_device *device, int argc, char **argv int retval = 0; int t = -1; int c; + u_int8_t ata_flags = 0; u_char cmd, sc; ccb = cam_getccb(device); @@ -8419,6 +8477,10 @@ atapm(struct cam_device *device, int argc, char **argv cmd = ATA_STANDBY_IMMEDIATE; else cmd = ATA_STANDBY_CMD; + } else if (strcmp(argv[1], "powermode") == 0) { + cmd = ATA_CHECK_POWER_MODE; + ata_flags = AP_FLAG_CHK_COND; + t = -1; } else { cmd = ATA_SLEEP; t = -1; @@ -8436,11 +8498,12 @@ atapm(struct cam_device *device, int argc, char **argv else sc = 253; - retval = ata_do_28bit_cmd(device, + retval = ata_do_cmd(device, ccb, /*retries*/retry_count, /*flags*/CAM_DIR_NONE, /*protocol*/AP_PROTO_NON_DATA, + /*ata_flags*/ata_flags, /*tag_action*/MSG_SIMPLE_Q_TAG, /*command*/cmd, /*features*/0, @@ -8452,7 +8515,11 @@ atapm(struct cam_device *device, int argc, char **argv /*quiet*/1); cam_freeccb(ccb); - return (retval); + + if (retval || cmd != ATA_CHECK_POWER_MODE) + return (retval); + + return (atapm_proc_resp(device, ccb)); } static int @@ -9065,6 +9132,7 @@ usage(int printlong) " camcontrol idle [dev_id][generic args][-t time]\n" " camcontrol standby [dev_id][generic args][-t time]\n" " camcontrol sleep [dev_id][generic args]\n" +" camcontrol powermode [dev_id][generic args]\n" " camcontrol apm [dev_id][generic args][-l level]\n" " camcontrol aam [dev_id][generic args][-l level]\n" " camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-q]\n" @@ -9128,6 +9196,7 @@ usage(int printlong) "idle send the ATA IDLE command to the named device\n" "standby send the ATA STANDBY command to the named device\n" "sleep send the ATA SLEEP command to the named device\n" +"powermode send the ATA CHECK POWER MODE command to the named device\n" "fwdownload program firmware of the named device with the given image\n" "security report or send ATA security commands to the named device\n" "persist send the SCSI PERSISTENT RESERVE IN or OUT commands\n" @@ -9694,6 +9763,7 @@ main(int argc, char **argv) case CAM_CMD_IDLE: case CAM_CMD_STANDBY: case CAM_CMD_SLEEP: + case CAM_CMD_POWER_MODE: error = atapm(cam_dev, argc, argv, combinedopt, retry_count, timeout); break; From owner-svn-src-all@freebsd.org Thu Aug 8 18:52:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A285AF4CD; Thu, 8 Aug 2019 18:52:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464HYy0mJMz4jl6; Thu, 8 Aug 2019 18:52:54 +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 EFCF8198E; Thu, 8 Aug 2019 18:52:53 +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 x78Iqrpp027547; Thu, 8 Aug 2019 18:52:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78IqruA027546; Thu, 8 Aug 2019 18:52:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908081852.x78IqruA027546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 18:52: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: r350775 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 350775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 18:52:54 -0000 Author: mav Date: Thu Aug 8 18:52:53 2019 New Revision: 350775 URL: https://svnweb.freebsd.org/changeset/base/350775 Log: MFC r348111: Simplify math added in r310524. Should be no functional change. Modified: stable/11/sys/cam/scsi/scsi_all.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Thu Aug 8 18:48:48 2019 (r350774) +++ stable/11/sys/cam/scsi/scsi_all.c Thu Aug 8 18:52:53 2019 (r350775) @@ -3941,7 +3941,7 @@ scsi_set_sense_data_fixed_va(struct scsi_sense_data *s } if (len > sizeof(sense->cmd_spec_info)) { data += len - sizeof(sense->cmd_spec_info); - len -= len - sizeof(sense->cmd_spec_info); + len = sizeof(sense->cmd_spec_info); } bcopy(data, &sense->cmd_spec_info[ sizeof(sense->cmd_spec_info) - len], len); From owner-svn-src-all@freebsd.org Thu Aug 8 19:49:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC9BEB1076; Thu, 8 Aug 2019 19:49:12 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Jpv4DZ6z4mqr; Thu, 8 Aug 2019 19:49:11 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ot1-f51.google.com with SMTP id l15so66224233oth.7; Thu, 08 Aug 2019 12:49:11 -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=L+tMFQfDDFLQBXM2tgaYOrvkfEybiz+VsLOTxXdXZEk=; b=Zt2gqSNOVM6O1BSXEyYfyDl5DtPWhXU6rLDO1hhFD7+XEWcytfaiZKas1jAX3wPBrF iR4Z/4QScGTIJTEpiKWYUi8K0546bIAA6MBP3BHHnkxQEQZe5zsCwztOhyNmEffMl4U4 f1h0KKycu2Ij6Sd83eCFlwWo/7ONzMnZLBt766JMA0l1YOupiiKSXvLSmzhqItIgUbRK /ADM9EglgPseZt1qeEplyn6ai8TH1c3QSpPAhFX0R3/7Uye82KwKcrsK/5XEv7l4/MAg 9TXHU93vHjmVHJ0LM2KRf/EYrAXDhn7+tWllp6hORZghk0tdN0XPWjpeCFp53kttBfmg Xa5Q== X-Gm-Message-State: APjAAAX7GqVRnodGwYgIwH0wO193uhXvoIpT/ktr8FY8eDSYYOhCXhXg RnDerfJE8hyxKRnXIwG669fuIUiY7Z6fJFlj7SXlMQ== X-Google-Smtp-Source: APXvYqwldHHqVNhunSwwVh5+JkoOVGX/wjFpBEWjBhykL9bBrB5imr2Yomg/sL7TkDnle9QvEn3xdF/WcjpivYOeTLY= X-Received: by 2002:a02:aa0d:: with SMTP id r13mr18639173jam.129.1565293749602; Thu, 08 Aug 2019 12:49:09 -0700 (PDT) MIME-Version: 1.0 References: <201908071619.x77GJ6qq067924@repo.freebsd.org> In-Reply-To: <201908071619.x77GJ6qq067924@repo.freebsd.org> From: Ed Maste Date: Thu, 8 Aug 2019 01:52:19 -0400 Message-ID: Subject: Re: svn commit: r350678 - head/share/mk To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 464Jpv4DZ6z4mqr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.210.51 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-4.43 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; RWL_MAILSPIKE_GOOD(0.00)[51.210.85.209.rep.mailspike.net : 127.0.0.18]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.44)[ip: (-1.34), ipnet: 209.85.128.0/17(-3.38), asn: 15169(-2.43), country: US(-0.05)]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; RCVD_IN_DNSWL_NONE(0.00)[51.210.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 19:49:12 -0000 On Wed, 7 Aug 2019 at 12:19, Warner Losh wrote: > > Author: imp > Date: Wed Aug 7 16:19:06 2019 > New Revision: 350678 > URL: https://svnweb.freebsd.org/changeset/base/350678 > > Log: > Enable nvme on aarch64 > > Don't mark nvme as broken on aarch64. It compiles, at least, and people are > testing it out. This only enables the userland parts of the nvme stack. For BROKEN_OPTIONS we should probably list the archs where it is known to be broken instead? From owner-svn-src-all@freebsd.org Thu Aug 8 19:53:08 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29005B12C9; Thu, 8 Aug 2019 19:53:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464JvS0HcVz4nD4; Thu, 8 Aug 2019 19:53:08 +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 E0359248B; Thu, 8 Aug 2019 19:53: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 x78Jr7tg062675; Thu, 8 Aug 2019 19:53:07 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Jr7XW062674; Thu, 8 Aug 2019 19:53:07 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201908081953.x78Jr7XW062674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 8 Aug 2019 19:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350776 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 19:53:08 -0000 Author: rmacklem Date: Thu Aug 8 19:53:07 2019 New Revision: 350776 URL: https://svnweb.freebsd.org/changeset/base/350776 Log: Fix copy_file_range(2) for an unlikely race during hole finding. Since the VOP_IOCTL(FIOSEEKDATA/FIOSEEKHOLE) calls are done with the vnode unlocked, it is possible for another thread to do: - truncate(), lseek(), write() between the two calls and create a hole where FIOSEEKDATA returned the start of data. For this case, VOP_IOCTL(FIOSEEKHOLE) will return the same offset for the hole location. This could result in an infinite loop in the copy code, since copylen is set to 0 and the copy doesn't advance. Usually, this race is avoided because of the use of rangelocks, but the NFS server does not do range locking and could do a sequence like the above to create the hole. This patch checks for this case and makes the hole search fail, to avoid the infinite loop. At this time, it is an open question as to whether or not the NFS server should do range locking to avoid this race. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Aug 8 18:52:53 2019 (r350775) +++ head/sys/kern/vfs_vnops.c Thu Aug 8 19:53:07 2019 (r350776) @@ -2895,6 +2895,17 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * endoff = startoff; error = VOP_IOCTL(invp, FIOSEEKHOLE, &endoff, 0, incred, curthread); + /* + * Since invp is unlocked, it may be possible for + * another thread to do a truncate(), lseek(), write() + * creating a hole at startoff between the above + * VOP_IOCTL() calls, if the other thread does not do + * rangelocking. + * If that happens, startoff == endoff and finding + * the hole has failed, so set an error. + */ + if (error == 0 && startoff == endoff) + error = EINVAL; /* Any error. Reset to 0. */ } if (error == 0) { if (startoff > *inoffp) { From owner-svn-src-all@freebsd.org Thu Aug 8 20:07:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 989E5B159B; Thu, 8 Aug 2019 20:07: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464KDC3Y2Qz4nmm; Thu, 8 Aug 2019 20:07:39 +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 5B8E62665; Thu, 8 Aug 2019 20:07:39 +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 x78K7dRb068997; Thu, 8 Aug 2019 20:07:39 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78K7dLB068996; Thu, 8 Aug 2019 20:07:39 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201908082007.x78K7dLB068996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 8 Aug 2019 20:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350777 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 20:07:39 -0000 Author: rmacklem Date: Thu Aug 8 20:07:38 2019 New Revision: 350777 URL: https://svnweb.freebsd.org/changeset/base/350777 Log: Remove some harmless cruft from vn_generic_copy_file_range(). An earlier version of the patch had code that set "error" between line#s 2797-2799. When that code was moved, the second check for "error != 0" could never be true and the check became harmless cruft. This patch removes the cruft, mainly to make Coverity happy. Reported by: asomers, cem Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Thu Aug 8 19:53:07 2019 (r350776) +++ head/sys/kern/vfs_vnops.c Thu Aug 8 20:07:38 2019 (r350777) @@ -2798,8 +2798,6 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * if (VOP_PATHCONF(invp, _PC_MIN_HOLE_SIZE, &holein) != 0) holein = 0; VOP_UNLOCK(invp, 0); - if (error != 0) - goto out; mp = NULL; error = vn_start_write(outvp, &mp, V_WAIT); From owner-svn-src-all@freebsd.org Thu Aug 8 20:09:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75762B166E; Thu, 8 Aug 2019 20:09:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464KGT2Vk1z4p1S; Thu, 8 Aug 2019 20:09:37 +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 3894E2673; Thu, 8 Aug 2019 20:09: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 x78K9b94069232; Thu, 8 Aug 2019 20:09:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78K9bCV069231; Thu, 8 Aug 2019 20:09:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908082009.x78K9bCV069231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Aug 2019 20:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350778 - head/sys/contrib/zstd/lib/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/contrib/zstd/lib/common X-SVN-Commit-Revision: 350778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 20:09:37 -0000 Author: imp Date: Thu Aug 8 20:09:36 2019 New Revision: 350778 URL: https://svnweb.freebsd.org/changeset/base/350778 Log: Stopgap fix for gcc platforms. Our in-tree gcc doesn't have a no-tree-vectorize optimization knob, so we get a warning that it's unused. This causes the build to fail on all our gcc platforms. Add a quick version check as a stop-gap measure to get CI building again. Modified: head/sys/contrib/zstd/lib/common/compiler.h Modified: head/sys/contrib/zstd/lib/common/compiler.h ============================================================================== --- head/sys/contrib/zstd/lib/common/compiler.h Thu Aug 8 20:07:38 2019 (r350777) +++ head/sys/contrib/zstd/lib/common/compiler.h Thu Aug 8 20:09:36 2019 (r350778) @@ -128,7 +128,7 @@ } /* vectorization */ -#if !defined(__clang__) && defined(__GNUC__) +#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ > 5 # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) #else # define DONT_VECTORIZE From owner-svn-src-all@freebsd.org Thu Aug 8 20:56:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6C47B278A; Thu, 8 Aug 2019 20:56:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464LK14fypz4r7T; Thu, 8 Aug 2019 20:56:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81BC92F68; Thu, 8 Aug 2019 20:56:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78Kur3j098321; Thu, 8 Aug 2019 20:56:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Kurvi098320; Thu, 8 Aug 2019 20:56:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908082056.x78Kurvi098320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 8 Aug 2019 20:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350779 - head/sbin/iscontrol X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/iscontrol X-SVN-Commit-Revision: 350779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 20:56:53 -0000 Author: markj Date: Thu Aug 8 20:56:52 2019 New Revision: 350779 URL: https://svnweb.freebsd.org/changeset/base/350779 Log: Fix formatting. PR: 239726 Submitted by: Gordon Bergling MFC after: 3 days Modified: head/sbin/iscontrol/iscontrol.8 Modified: head/sbin/iscontrol/iscontrol.8 ============================================================================== --- head/sbin/iscontrol/iscontrol.8 Thu Aug 8 20:09:36 2019 (r350778) +++ head/sbin/iscontrol/iscontrol.8 Thu Aug 8 20:56:52 2019 (r350779) @@ -129,7 +129,7 @@ RFC 3720 The .Nm utility appeared in -Fx 7.0 . +.Fx 7.0 . .Sh BUGS .Nm should probably load the iscsi_initiator module if needed. From owner-svn-src-all@freebsd.org Thu Aug 8 21:08:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE80B2C01; Thu, 8 Aug 2019 21:08:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464LZ60RJYz4rmv; Thu, 8 Aug 2019 21:08:14 +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 E622D3148; Thu, 8 Aug 2019 21:08:13 +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 x78L8D5t004931; Thu, 8 Aug 2019 21:08:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78L8Dnx004930; Thu, 8 Aug 2019 21:08:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908082108.x78L8Dnx004930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 8 Aug 2019 21:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350780 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 350780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:08:14 -0000 Author: markj Date: Thu Aug 8 21:08:13 2019 New Revision: 350780 URL: https://svnweb.freebsd.org/changeset/base/350780 Log: Add a reference to the NFSv3 RFC. PR: 239721 Submitted by: Gordon Bergling MFC after: 3 days Modified: head/usr.sbin/mountd/mountd.8 Modified: head/usr.sbin/mountd/mountd.8 ============================================================================== --- head/usr.sbin/mountd/mountd.8 Thu Aug 8 20:56:52 2019 (r350779) +++ head/usr.sbin/mountd/mountd.8 Thu Aug 8 21:08:13 2019 (r350780) @@ -28,7 +28,7 @@ .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd October 24, 2016 +.Dd August 1, 2019 .Dt MOUNTD 8 .Os .Sh NAME @@ -54,7 +54,7 @@ server specification; see .%T "Network File System Protocol Specification" , RFC1094, Appendix A and .%T "NFS: Network File System Version 3 Protocol Specification" , -Appendix I. +RFC1813, Appendix I. .Pp The following options are available: .Bl -tag -width indent From owner-svn-src-all@freebsd.org Thu Aug 8 21:13:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33EB5B2F05 for ; Thu, 8 Aug 2019 21:13:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Lgh31mQz4sDk for ; Thu, 8 Aug 2019 21:13:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x829.google.com with SMTP id j15so160415qtl.13 for ; Thu, 08 Aug 2019 14:13:04 -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=AxVcmUF62D0g/P7OQHs5QkDB6mbefUoPRNw7HPLuA68=; b=i2wCZieinXNrNxUO5J/aN/338mP+X61QBjmn7J/OFcBwQqe2qnlOuCs/qniq/IRtM6 PhQJezHEziQFEzehphv0wVDKk2FKwoPypt03ni6A77KbjKMaDV/QZTf5Ys2rl8VkreXn 8KC7MK+agGHprfCCNB3kij1x3QDKo8TFRkhAMw7EIHpeS/7gqUaf48/m7uPK3MlRntx9 jSrgIZ5SjWwHFIL4piXyHQXQkCSiv3po4faHKVKfR6u1WIGd0VGjeMQ7jvaFJe2b/zMQ +Jm05LZnXGCd1AJSQlIee9QGTblC8NqzrKJq3JImUP5gOOcrh2ltE52A37A9V85T5Hd1 gcaw== 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=AxVcmUF62D0g/P7OQHs5QkDB6mbefUoPRNw7HPLuA68=; b=dskNixYi++AZd5Rkut6uNwwvoktE/aXxsql7IICOH6bLyvvl645L01vDWL74rBn61s kIAjPjst/zvKLvzr/THqYGBjlWBSXbhsGYguhmCirvXLfUcc53n/EeO9RST+9JtcgYn7 oruj2VjAg3RDi+nRyLck40tZ1YVP3ImvC4N+ibSZt3oXyAerKbvAHGiy7TqNn1KAW8cg +UQUYnQCsZb59Z2AB+UkReTzZcfqBGmEkGkNJnp4F03T5YH7DBhKvge8VPPICcoAVoJX 30EcI8UxkoKQ6vYIZr+97M45t0jqBN135oVPQHMo6rmQUwbpUo+i8CKKzNP0tvjAV6PW QFGw== X-Gm-Message-State: APjAAAVL5/Dgv19jMiESRJW/eRAog27zHkYXLnufP/81gy/bPZNmtfMp fT5xbFztrsNudLTnCos/ghKIiiXGs+DQMPQL/fSzww== X-Google-Smtp-Source: APXvYqxrMYhpNLzmMP2EAJnr219F1zkcHhQBzj1diLoh+9NlRvHC06zxjBmdcKVRBZmijBvULLLwPEuQvA/xjBtCB40= X-Received: by 2002:ac8:244f:: with SMTP id d15mr14359491qtd.32.1565298783430; Thu, 08 Aug 2019 14:13:03 -0700 (PDT) MIME-Version: 1.0 References: <201908071619.x77GJ6qq067924@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 8 Aug 2019 15:12:52 -0600 Message-ID: Subject: Re: svn commit: r350678 - head/share/mk To: Ed Maste Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 464Lgh31mQz4sDk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=i2wCZiei; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::829) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.97 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.99)[-0.991,0]; RCVD_IN_DNSWL_NONE(0.00)[9.2.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.98)[ip: (-9.40), ipnet: 2607:f8b0::/32(-3.03), asn: 15169(-2.43), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 21:13:05 -0000 On Thu, Aug 8, 2019 at 1:49 PM Ed Maste wrote: > On Wed, 7 Aug 2019 at 12:19, Warner Losh wrote: > > > > Author: imp > > Date: Wed Aug 7 16:19:06 2019 > > New Revision: 350678 > > URL: https://svnweb.freebsd.org/changeset/base/350678 > > > > Log: > > Enable nvme on aarch64 > > > > Don't mark nvme as broken on aarch64. It compiles, at least, and > people are > > testing it out. This only enables the userland parts of the nvme stack. > > For BROKEN_OPTIONS we should probably list the archs where it is known > to be broken instead? > Generally. At first, this was known working only on x86 due to how the driver was written, so it made sense to whitelist. We're likely getting close to black-listing in this case. Warner From owner-svn-src-all@freebsd.org Thu Aug 8 21:15:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A24CBB3025; Thu, 8 Aug 2019 21:15:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Ljz3nx9z4sNp; Thu, 8 Aug 2019 21:15:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6411332F6; Thu, 8 Aug 2019 21:15:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78LF3Po010458; Thu, 8 Aug 2019 21:15:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LF3p5010457; Thu, 8 Aug 2019 21:15:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908082115.x78LF3p5010457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 8 Aug 2019 21:15:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350781 - head/usr.bin/whois X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/whois X-SVN-Commit-Revision: 350781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:15:03 -0000 Author: markj Date: Thu Aug 8 21:15:02 2019 New Revision: 350781 URL: https://svnweb.freebsd.org/changeset/base/350781 Log: Update RFC references in the whois(1) man page. PR: 239720 Submitted by: Gordon Bergling MFC after: 3 days Modified: head/usr.bin/whois/whois.1 Modified: head/usr.bin/whois/whois.1 ============================================================================== --- head/usr.bin/whois/whois.1 Thu Aug 8 21:08:13 2019 (r350780) +++ head/usr.bin/whois/whois.1 Thu Aug 8 21:15:02 2019 (r350781) @@ -28,7 +28,7 @@ .\" From: @(#)whois.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd April 25, 2016 +.Dd August 1, 2019 .Dt WHOIS 1 .Os .Sh NAME @@ -272,13 +272,21 @@ to return a brief description of its object type: .Pp .Dl Ic whois -r -- '-t domain' -.Sh SEE ALSO +.Sh STANDARDS .Rs -.%A Ken Harrenstien -.%A Vic White +.%A K. Harrenstien +.%A M. Stahl +.%A E. Feinler +.%D October 1985 +.%R RFC 954 .%T NICNAME/WHOIS -.%D 1 March 1982 -.%O RFC 812 +.Re +.Pp +.Rs +.%A L. Daigle +.%D September 2004 +.%R RFC 3912 +.%T WHOIS Protocol Specification .Re .Sh HISTORY The From owner-svn-src-all@freebsd.org Thu Aug 8 21:16:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39B29B31C1; Thu, 8 Aug 2019 21:16:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464LlN0nNZz4sh2; Thu, 8 Aug 2019 21:16:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0B2E330A; Thu, 8 Aug 2019 21:16:15 +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 x78LGFHg010708; Thu, 8 Aug 2019 21:16:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LGFCU010707; Thu, 8 Aug 2019 21:16:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201908082116.x78LGFCU010707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 8 Aug 2019 21:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350782 - head/usr.bin/du X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/du X-SVN-Commit-Revision: 350782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:16:16 -0000 Author: markj Date: Thu Aug 8 21:16:15 2019 New Revision: 350782 URL: https://svnweb.freebsd.org/changeset/base/350782 Log: Flesh out the STANDARDS and AUTHORS sections in the du(1) man page. PR: 239722 Submitted by: Gordon Bergling MFC after: 3 days Modified: head/usr.bin/du/du.1 Modified: head/usr.bin/du/du.1 ============================================================================== --- head/usr.bin/du/du.1 Thu Aug 8 21:15:02 2019 (r350781) +++ head/usr.bin/du/du.1 Thu Aug 8 21:16:15 2019 (r350782) @@ -28,7 +28,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd August 8, 2017 +.Dd August 1, 2019 .Dt DU 1 .Os .Sh NAME @@ -221,8 +221,78 @@ Also display a grand total at the end: .Xr fts 3 , .Xr symlink 7 , .Xr quot 8 +.Sh STANDARDS +The +.Nm +utility is compliant with the +.St -p1003.1-2008 +specification. +.Pp +The flags +.Op Fl cdhP , +as well as the +.Ev BLOCKSIZE +environment variable, +are extensions to that specification. +.Pp +The flag +.Op Fl r +is accepted but ignored, for compatibility with systems implementing +the obsolete +.St -xcu5 +standard. .Sh HISTORY -A +The .Nm -command appeared in +utility and its +.Fl a +and +.Fl s +options first appeared in .At v1 . +.Pp +The +.Fl r +option first appeared in +.At III +and is available since +.Fx 3.5 . +The +.Fl k +and +.Fl x +options first appeared in +.Bx 4.3 Reno +and +.Fl H +in +.Bx 4.4 . +The +.Fl c +and +.Fl L +options first appeared in the GNU fileutils; +.Fl L +and +.Fl P +are available since +.Bx 4.4 Lite1 , +.Fl c +since +.Fx 2.2.6 . +The +.Fl d +option first appeared in +.Fx 2.2 , +.Fl h +first appeared in +.Fx 4.0 . +.Sh AUTHORS +.An -nosplit +This version of +.Nm +was written by +.An Chris Newcomb +for +.Bx 4.3 Reno +in 1989. From owner-svn-src-all@freebsd.org Thu Aug 8 21:29:34 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCA59B3823; Thu, 8 Aug 2019 21:29:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464M2k4xL8z4tSW; Thu, 8 Aug 2019 21:29:34 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f43.google.com with SMTP id q20so124450684otl.0; Thu, 08 Aug 2019 14:29:34 -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=9zHpbiguCj1Wvo8MSrdICwzUZTuUjI09Upu8gZLRLYk=; b=Lsnedcx3NwyAGelV/aSw9p210AOMN+yx0kgqI2buWztEBQBTBjxe3fIRn/74QgPmHQ rapZ4MdrIy7KUFvH70NrRkL1vrnnBjQHiRbOGAp+wFUGxfeWiZeyePE+5OjSktyG7LCS r1XiJ8+Pd3cmklBRD822a6N8gGTQcZhclACcz3eRo22qiQjZLDCk1IktrcDCL3CsSXJ+ s9CGM9AWV6GEi+JSPeS+9k2lAARllCztjEHtcKGFM/H6zxlyG7cdHKAxBJgJp+AY+oN5 cx2GN9Mt+AUJtHGSas+6zYccg0VlS6FQm/stcgii9QEKYeT3xbvXvu329Z7bXlcvYmgs WEVw== X-Gm-Message-State: APjAAAXQ501zFCx17e0lpjjt6BpItoPPA3HcuxQPsWyjqwjWS0XUcc0C rilPo8U2qsNhSrxMPRguVfQ6Uw9V X-Google-Smtp-Source: APXvYqwWDAI3EFFw4/eTjZ4JfZ2aBpnLne7/yrjZdFimFbSgmncPO5VMLY1d91c0QPBMrrqOv1OL6A== X-Received: by 2002:aca:4ad2:: with SMTP id x201mr4243929oia.129.1565299772167; Thu, 08 Aug 2019 14:29:32 -0700 (PDT) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com. [209.85.210.42]) by smtp.gmail.com with ESMTPSA id 132sm31833716oid.47.2019.08.08.14.29.31 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 14:29:31 -0700 (PDT) Received: by mail-ot1-f42.google.com with SMTP id n5so124658123otk.1; Thu, 08 Aug 2019 14:29:31 -0700 (PDT) X-Received: by 2002:a5d:8253:: with SMTP id n19mr6625806ioo.80.1565299771496; Thu, 08 Aug 2019 14:29:31 -0700 (PDT) MIME-Version: 1.0 References: <201908082009.x78K9bCV069231@repo.freebsd.org> In-Reply-To: <201908082009.x78K9bCV069231@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 8 Aug 2019 14:29:20 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r350778 - head/sys/contrib/zstd/lib/common To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 464M2k4xL8z4tSW X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 21:29:34 -0000 Thanks Warner for noticing and fixing this. I've sent the patch upstream to hopefully be addressed there as well: https://github.com/facebook/zstd/pull/1713 Best, Conrad On Thu, Aug 8, 2019 at 1:09 PM Warner Losh wrote: > > Author: imp > Date: Thu Aug 8 20:09:36 2019 > New Revision: 350778 > URL: https://svnweb.freebsd.org/changeset/base/350778 > > Log: > Stopgap fix for gcc platforms. > > Our in-tree gcc doesn't have a no-tree-vectorize optimization knob, so we get a > warning that it's unused. This causes the build to fail on all our gcc platforms. > Add a quick version check as a stop-gap measure to get CI building again. > > Modified: > head/sys/contrib/zstd/lib/common/compiler.h > > Modified: head/sys/contrib/zstd/lib/common/compiler.h > ============================================================================== > --- head/sys/contrib/zstd/lib/common/compiler.h Thu Aug 8 20:07:38 2019 (r350777) > +++ head/sys/contrib/zstd/lib/common/compiler.h Thu Aug 8 20:09:36 2019 (r350778) > @@ -128,7 +128,7 @@ > } > > /* vectorization */ > -#if !defined(__clang__) && defined(__GNUC__) > +#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ > 5 > # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) > #else > # define DONT_VECTORIZE > From owner-svn-src-all@freebsd.org Thu Aug 8 21:30:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34A44B38AF for ; Thu, 8 Aug 2019 21:30:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464M3R3XKcz4tbG for ; Thu, 8 Aug 2019 21:30:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x734.google.com with SMTP id d15so70046820qkl.4 for ; Thu, 08 Aug 2019 14:30:11 -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=d4gx8YmMMGr6DsOP0/f2GIlqcpTANeVnebBk4mVjNcQ=; b=T8Sc4H2NglztldqrV/55no9vtpz08OBrwUBmXugAdM03rBcFaC75AZctnDD3VZpsZF c6gNVoesjCx/DWyPNtqsnui28PJqqsX7t6vuy9XmkPR0ure5rmCFUbhVH/do3ni752Qt Y+TL3UHsaJ8SqlSKS4hFCGWI9vK4SoVL8fFCG+Tn52oNws480sejZ8WYbPAzwR/3LFtw 08Im+R/vA8W0jH92qnArGjx1eQg9yfuTWkiZGCSFW9E00OvkT5bTALHwyAqdK3XJOUga 6JvEfog21APLCcN0NneNXp/vT+8ZA3vbviZwbrBVN6e4m6hUTKtB65mfJvLL8qviMJBb 0Cng== 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=d4gx8YmMMGr6DsOP0/f2GIlqcpTANeVnebBk4mVjNcQ=; b=Rn+enjGe9c7G82XZNkLwSwqz26JDP4uZ9X9G6VamQvlutcBr338wlgQTl8jfKniADr MpEvSkyue84iae4asaEzdy2K204Sj0Dwb/DQzlZ8mzN8vpX+7DCULg4t/f9YEli9ff7n NB4bKj6wpquGQj2zowrN1VWnv8NzQxdK6RK4F5FRgcn1zMZeC8aHvr1/aNungwI6e2Qb vnsoOzaL2zyMnmSnSO837HtuBG0ZlP59bMWUkcHLf2pxmutgW8rSee9QWzsiVd0ho1GD zl2aD1AxpF5RP1QnAO5R5NVFZBAahWy188MLqnCII2CCbHykOt3jaGzROifTbBSAWf16 hX8w== X-Gm-Message-State: APjAAAWdy953zfmsi5UZ97fcbF5oIX57afTdbmmIMFaMhb3THccaPz01 29gTobUOfRoOtq0hBZ0+6AfT3A9YPIwRxpo7McNHlQ== X-Google-Smtp-Source: APXvYqyfkB9UfT38rCojBLofn3ZrXqKHcHtD3qQXAT0Ric9Ntm6JwxOiJ4J5R2u3t+0OJQKsnrHByDNWMcnBJ3HmcxA= X-Received: by 2002:a37:9307:: with SMTP id v7mr8455100qkd.495.1565299810059; Thu, 08 Aug 2019 14:30:10 -0700 (PDT) MIME-Version: 1.0 References: <201908082009.x78K9bCV069231@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 8 Aug 2019 15:29:59 -0600 Message-ID: Subject: Re: svn commit: r350778 - head/sys/contrib/zstd/lib/common To: "Conrad E. Meyer" Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 464M3R3XKcz4tbG X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=T8Sc4H2N; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::734) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-5.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; RCVD_IN_DNSWL_NONE(0.00)[4.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.99)[ip: (-9.45), ipnet: 2607:f8b0::/32(-3.03), asn: 15169(-2.43), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 21:30:12 -0000 Thanks Conrad for upstreaming... Warner On Thu, Aug 8, 2019 at 3:29 PM Conrad Meyer wrote: > Thanks Warner for noticing and fixing this. > > I've sent the patch upstream to hopefully be addressed there as well: > > https://github.com/facebook/zstd/pull/1713 > > Best, > Conrad > > On Thu, Aug 8, 2019 at 1:09 PM Warner Losh wrote: > > > > Author: imp > > Date: Thu Aug 8 20:09:36 2019 > > New Revision: 350778 > > URL: https://svnweb.freebsd.org/changeset/base/350778 > > > > Log: > > Stopgap fix for gcc platforms. > > > > Our in-tree gcc doesn't have a no-tree-vectorize optimization knob, so > we get a > > warning that it's unused. This causes the build to fail on all our gcc > platforms. > > Add a quick version check as a stop-gap measure to get CI building > again. > > > > Modified: > > head/sys/contrib/zstd/lib/common/compiler.h > > > > Modified: head/sys/contrib/zstd/lib/common/compiler.h > > > ============================================================================== > > --- head/sys/contrib/zstd/lib/common/compiler.h Thu Aug 8 20:07:38 > 2019 (r350777) > > +++ head/sys/contrib/zstd/lib/common/compiler.h Thu Aug 8 20:09:36 > 2019 (r350778) > > @@ -128,7 +128,7 @@ > > } > > > > /* vectorization */ > > -#if !defined(__clang__) && defined(__GNUC__) > > +#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ > 5 > > # define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) > > #else > > # define DONT_VECTORIZE > > > From owner-svn-src-all@freebsd.org Thu Aug 8 21:30:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75601B3930; Thu, 8 Aug 2019 21:30:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464M452YG0z4tkT; Thu, 8 Aug 2019 21:30:45 +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 391AB3656; Thu, 8 Aug 2019 21:30:45 +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 x78LUjcx017848; Thu, 8 Aug 2019 21:30:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LUjmB017832; Thu, 8 Aug 2019 21:30:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082130.x78LUjmB017832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:30:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350783 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 350783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:30:45 -0000 Author: mav Date: Thu Aug 8 21:30:44 2019 New Revision: 350783 URL: https://svnweb.freebsd.org/changeset/base/350783 Log: MFC r348963 (by imp): Minor white space changes. Remove trailing white space that's crept into this file. Modified: stable/11/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_xpt.c Thu Aug 8 21:16:15 2019 (r350782) +++ stable/11/sys/cam/scsi/scsi_xpt.c Thu Aug 8 21:30:44 2019 (r350783) @@ -1601,7 +1601,7 @@ probe_device_check: start = strspn(serial_buf->serial_num, " "); slen = serial_buf->length - start; if (slen <= 0) { - /* + /* * SPC5r05 says that an all-space serial * number means no product serial number * is available @@ -2115,7 +2115,7 @@ scsi_scan_bus(struct cam_periph *periph, union ccb *re CAM_GET_LUN(target->luns, 0, first); if (first == 0 && scan_info->lunindex[target_id] == 0) { scan_info->lunindex[target_id]++; - } + } /* * Skip any LUNs that the HBA can't deal with. @@ -2600,7 +2600,7 @@ scsi_dev_advinfo(union ccb *start_ccb) * We fetch extended inquiry data during probe, if * available. We don't allow changing it. */ - if (cdai->flags & CDAI_FLAG_STORE) + if (cdai->flags & CDAI_FLAG_STORE) return; cdai->provsiz = device->ext_inq_len; if (device->ext_inq_len == 0) @@ -2992,7 +2992,7 @@ scsi_dev_async(u_int32_t async_code, struct cam_eb *bu */ if (async_code == AC_SENT_BDR || async_code == AC_BUS_RESET) { - cam_freeze_devq(&newpath); + cam_freeze_devq(&newpath); cam_release_devq(&newpath, RELSIM_RELEASE_AFTER_TIMEOUT, /*reduction*/0, @@ -3052,7 +3052,7 @@ scsi_announce_periph(struct cam_periph *periph) xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - /* Report connection speed */ + /* Report connection speed */ speed = cpi.base_transfer_speed; freq = 0; if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SPI) { From owner-svn-src-all@freebsd.org Thu Aug 8 21:31:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33BDEB39B6; Thu, 8 Aug 2019 21:31:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464M4r0ccwz4ttZ; Thu, 8 Aug 2019 21:31:24 +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 EBE5637E9; Thu, 8 Aug 2019 21:31:23 +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 x78LVNVO018719; Thu, 8 Aug 2019 21:31:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LVNao018718; Thu, 8 Aug 2019 21:31:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082131.x78LVNao018718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:31: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: r350784 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:31:24 -0000 Author: mav Date: Thu Aug 8 21:31:23 2019 New Revision: 350784 URL: https://svnweb.freebsd.org/changeset/base/350784 Log: MFC r349010 (by imp): Increase the timeout for READ NATIVE MAX READ NATIVE MAX can take longer than a second if the queued NCQ I/Os take longer than a second to drain. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 21:30:44 2019 (r350783) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 21:31:23 2019 (r350784) @@ -1892,7 +1892,7 @@ ata_read_native_max(struct cam_device *device, int ret /*sector_count*/0, /*data_ptr*/NULL, /*dxfer_len*/0, - timeout ? timeout : 1000, + timeout ? timeout : 5000, is48bit); if (error) From owner-svn-src-all@freebsd.org Thu Aug 8 21:32:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2FDDB3BA2; Thu, 8 Aug 2019 21:32:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464M634rGyz4v4D; Thu, 8 Aug 2019 21:32:27 +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 87DA83836; Thu, 8 Aug 2019 21:32:27 +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 x78LWRwP022465; Thu, 8 Aug 2019 21:32:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LWRmR022464; Thu, 8 Aug 2019 21:32:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082132.x78LWRmR022464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:32: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: r350785 - stable/11/sys/cam X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam X-SVN-Commit-Revision: 350785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:32:27 -0000 Author: mav Date: Thu Aug 8 21:32:26 2019 New Revision: 350785 URL: https://svnweb.freebsd.org/changeset/base/350785 Log: MFC r349243: Optimize xpt_getattr(). Do not allocate temporary buffer for attributes we are going to return as-is, just make sure to NUL-terminate them. Do not zero temporary 64KB buffer for CDAI_TYPE_SCSI_DEVID, XPT tells us how much data it filled and there are also length fields inside the returned data also. Modified: stable/11/sys/cam/cam_xpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/cam_xpt.c ============================================================================== --- stable/11/sys/cam/cam_xpt.c Thu Aug 8 21:31:23 2019 (r350784) +++ stable/11/sys/cam/cam_xpt.c Thu Aug 8 21:32:26 2019 (r350785) @@ -1120,6 +1120,7 @@ xpt_getattr(char *buf, size_t len, const char *attr, s cdai.ccb_h.func_code = XPT_DEV_ADVINFO; cdai.flags = CDAI_FLAG_NONE; cdai.bufsiz = len; + cdai.buf = buf; if (!strcmp(attr, "GEOM::ident")) cdai.buftype = CDAI_TYPE_SERIAL_NUM; @@ -1129,14 +1130,14 @@ xpt_getattr(char *buf, size_t len, const char *attr, s strcmp(attr, "GEOM::lunname") == 0) { cdai.buftype = CDAI_TYPE_SCSI_DEVID; cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; + cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT); + if (cdai.buf == NULL) { + ret = ENOMEM; + goto out; + } } else goto out; - cdai.buf = malloc(cdai.bufsiz, M_CAMXPT, M_NOWAIT|M_ZERO); - if (cdai.buf == NULL) { - ret = ENOMEM; - goto out; - } xpt_action((union ccb *)&cdai); /* can only be synchronous */ if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); @@ -1201,13 +1202,15 @@ xpt_getattr(char *buf, size_t len, const char *attr, s ret = EFAULT; } } else { - ret = 0; - if (strlcpy(buf, cdai.buf, len) >= len) + if (cdai.provsiz < len) { + cdai.buf[cdai.provsiz] = 0; + ret = 0; + } else ret = EFAULT; } out: - if (cdai.buf != NULL) + if ((char *)cdai.buf != buf) free(cdai.buf, M_CAMXPT); return ret; } From owner-svn-src-all@freebsd.org Thu Aug 8 21:33:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C11E3B3C2D; Thu, 8 Aug 2019 21:33:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464M6y4g2hz4vJj; Thu, 8 Aug 2019 21:33:14 +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 81EC8384B; Thu, 8 Aug 2019 21:33: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 x78LXECw022582; Thu, 8 Aug 2019 21:33:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LXECi022581; Thu, 8 Aug 2019 21:33:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082133.x78LXECi022581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:33:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350786 - stable/11/sys/cam X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam X-SVN-Commit-Revision: 350786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:33:14 -0000 Author: mav Date: Thu Aug 8 21:33:14 2019 New Revision: 350786 URL: https://svnweb.freebsd.org/changeset/base/350786 Log: MFC r349283 (by scottl): Refactor xpt_getattr() to make it more readable. No outwardly visible functional changes, though code flow was modified a bit internally to lessen the need for goto jumps and chained if conditionals. Modified: stable/11/sys/cam/cam_xpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/cam_xpt.c ============================================================================== --- stable/11/sys/cam/cam_xpt.c Thu Aug 8 21:32:26 2019 (r350785) +++ stable/11/sys/cam/cam_xpt.c Thu Aug 8 21:33:14 2019 (r350786) @@ -1111,6 +1111,7 @@ xpt_getattr(char *buf, size_t len, const char *attr, s { int ret = -1, l, o; struct ccb_dev_advinfo cdai; + struct scsi_vpd_device_id *did; struct scsi_vpd_id_descriptor *idd; xpt_path_assert(path, MA_OWNED); @@ -1143,31 +1144,36 @@ xpt_getattr(char *buf, size_t len, const char *attr, s cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); if (cdai.provsiz == 0) goto out; - if (cdai.buftype == CDAI_TYPE_SCSI_DEVID) { + switch(cdai.buftype) { + case CDAI_TYPE_SCSI_DEVID: + did = (struct scsi_vpd_device_id *)cdai.buf; if (strcmp(attr, "GEOM::lunid") == 0) { - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_naa); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_naa); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_eui64); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_eui64); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_uuid); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_uuid); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_md5); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_md5); } else idd = NULL; + if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_t10); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_t10); if (idd == NULL) - idd = scsi_get_devid((struct scsi_vpd_device_id *)cdai.buf, - cdai.provsiz, scsi_devid_is_lun_name); + idd = scsi_get_devid(did, cdai.provsiz, + scsi_devid_is_lun_name); if (idd == NULL) - goto out; + break; + ret = 0; - if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_ASCII) { + if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == + SVPD_ID_CODESET_ASCII) { if (idd->length < len) { for (l = 0; l < idd->length; l++) buf[l] = idd->identifier[l] ? @@ -1175,38 +1181,46 @@ xpt_getattr(char *buf, size_t len, const char *attr, s buf[l] = 0; } else ret = EFAULT; - } else if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_UTF8) { + break; + } + if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == + SVPD_ID_CODESET_UTF8) { l = strnlen(idd->identifier, idd->length); if (l < len) { bcopy(idd->identifier, buf, l); buf[l] = 0; } else ret = EFAULT; - } else if ((idd->id_type & SVPD_ID_TYPE_MASK) == SVPD_ID_TYPE_UUID - && idd->identifier[0] == 0x10) { - if ((idd->length - 2) * 2 + 4 < len) { - for (l = 2, o = 0; l < idd->length; l++) { - if (l == 6 || l == 8 || l == 10 || l == 12) - o += sprintf(buf + o, "-"); - o += sprintf(buf + o, "%02x", - idd->identifier[l]); - } - } else + break; + } + if ((idd->id_type & SVPD_ID_TYPE_MASK) == + SVPD_ID_TYPE_UUID && idd->identifier[0] == 0x10) { + if ((idd->length - 2) * 2 + 4 >= len) { ret = EFAULT; - } else { - if (idd->length * 2 < len) { - for (l = 0; l < idd->length; l++) - sprintf(buf + l * 2, "%02x", - idd->identifier[l]); - } else - ret = EFAULT; + break; + } + for (l = 2, o = 0; l < idd->length; l++) { + if (l == 6 || l == 8 || l == 10 || l == 12) + o += sprintf(buf + o, "-"); + o += sprintf(buf + o, "%02x", + idd->identifier[l]); + } + break; } - } else { + if (idd->length * 2 < len) { + for (l = 0; l < idd->length; l++) + sprintf(buf + l * 2, "%02x", + idd->identifier[l]); + } else + ret = EFAULT; + break; + default: if (cdai.provsiz < len) { cdai.buf[cdai.provsiz] = 0; ret = 0; } else ret = EFAULT; + break; } out: From owner-svn-src-all@freebsd.org Thu Aug 8 21:33:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F0D1B3CB1; Thu, 8 Aug 2019 21:33: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464M7g1Q6rz4vQq; Thu, 8 Aug 2019 21:33:51 +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 12246384C; Thu, 8 Aug 2019 21:33:51 +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 x78LXoXg022674; Thu, 8 Aug 2019 21:33:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LXoD3022673; Thu, 8 Aug 2019 21:33:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082133.x78LXoD3022673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350787 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ctl X-SVN-Commit-Revision: 350787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:33:51 -0000 Author: mav Date: Thu Aug 8 21:33:50 2019 New Revision: 350787 URL: https://svnweb.freebsd.org/changeset/base/350787 Log: MFC r349246: SPC-3 and up require some UAs to be returned as fixed. Modified: stable/11/sys/cam/ctl/ctl_error.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_error.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_error.c Thu Aug 8 21:33:14 2019 (r350786) +++ stable/11/sys/cam/ctl/ctl_error.c Thu Aug 8 21:33:50 2019 (r350787) @@ -79,6 +79,12 @@ ctl_set_sense_data_va(struct scsi_sense_data *sense_da */ if (sense_format == SSD_TYPE_NONE) { /* + * SPC-3 and up require some UAs to be returned as fixed. + */ + if (asc == 0x29 || (asc == 0x2A && ascq == 0x01)) + sense_format = SSD_TYPE_FIXED; + else + /* * If the format isn't specified, we only return descriptor * sense if the LUN exists and descriptor sense is turned * on for that LUN. From owner-svn-src-all@freebsd.org Thu Aug 8 21:37:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFFDAB3D7D; Thu, 8 Aug 2019 21:37:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MCq48vRz4vZR; Thu, 8 Aug 2019 21:37:27 +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 6BE9C3871; Thu, 8 Aug 2019 21:37:27 +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 x78LbRDq022912; Thu, 8 Aug 2019 21:37:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LbRK5022911; Thu, 8 Aug 2019 21:37:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082137.x78LbRK5022911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:37: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: r350788 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 350788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:37:27 -0000 Author: mav Date: Thu Aug 8 21:37:26 2019 New Revision: 350788 URL: https://svnweb.freebsd.org/changeset/base/350788 Log: MFC r349284: Make ELEMENT INDEX validation more strict. SES specifications tell: "The Additional Element Status descriptors shall be in the same order as the status elements in the Enclosure Status diagnostic page". It allows us to question ELEMENT INDEX that is lower then values we already processed. There are many SAS2 enclosures with this kind of problem. While there, add more specific error messages for cases when ELEMENT INDEX is obviously wrong. Also skip elements with INVALID bit set. Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Thu Aug 8 21:33:50 2019 (r350787) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Thu Aug 8 21:37:26 2019 (r350788) @@ -1679,7 +1679,6 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en struct ses_iterator iter, titer; int eip; int err; - int ignore_index = 0; int length; int offset; enc_cache_t *enc_cache; @@ -1750,7 +1749,7 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en elm_hdr = (struct ses_elm_addlstatus_base_hdr *)&buf[offset]; eip = ses_elm_addlstatus_eip(elm_hdr); - if (eip && !ignore_index) { + if (eip) { struct ses_elm_addlstatus_eip_hdr *eip_hdr; int expected_index, index; ses_elem_index_type_t index_type; @@ -1763,17 +1762,44 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en index_type = SES_ELEM_INDEX_INDIVIDUAL; expected_index = iter.individual_element_index; } + if (eip_hdr->element_index < expected_index) { + ENC_VLOG(enc, "%s: provided %selement index " + "%d is lower then expected %d\n", + __func__, (eip_hdr->byte2 & + SES_ADDL_EIP_EIIOE) ? "global " : "", + eip_hdr->element_index, expected_index); + goto badindex; + } titer = iter; telement = ses_iter_seek_to(&titer, eip_hdr->element_index, index_type); - if (telement != NULL && - (ses_typehasaddlstatus(enc, titer.type_index) != - TYPE_ADDLSTATUS_NONE || - titer.type_index > ELMTYP_SAS_CONN)) { + if (telement == NULL) { + ENC_VLOG(enc, "%s: provided %selement index " + "%d does not exist\n", __func__, + (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) ? + "global " : "", eip_hdr->element_index); + goto badindex; + } + if (ses_typehasaddlstatus(enc, titer.type_index) == + TYPE_ADDLSTATUS_NONE) { + ENC_VLOG(enc, "%s: provided %selement index " + "%d can't have additional status\n", + __func__, + (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) ? + "global " : "", eip_hdr->element_index); +badindex: + /* + * If we expected mandatory element, we may + * guess it was just a wrong index and we may + * use the status. If element was optional, + * then we have no idea where status belongs. + */ + if (status_type == TYPE_ADDLSTATUS_OPTIONAL) + break; + } else { iter = titer; element = telement; - } else - ignore_index = 1; + } if (eip_hdr->byte2 & SES_ADDL_EIP_EIIOE) index = iter.global_element_index; @@ -1795,35 +1821,41 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en "type element index=%d, offset=0x%x, " "byte0=0x%x, length=0x%x\n", __func__, iter.global_element_index, iter.type_index, - iter.type_element_index, offset, elmpriv->addl.hdr->byte0, - elmpriv->addl.hdr->length); + iter.type_element_index, offset, elm_hdr->byte0, + elm_hdr->length); /* Skip to after the length field */ offset += sizeof(struct ses_elm_addlstatus_base_hdr); /* Make sure the descriptor is within bounds */ - if ((offset + elmpriv->addl.hdr->length) > length) { + if ((offset + elm_hdr->length) > length) { ENC_VLOG(enc, "Element %d Beyond End " "of Additional Element Status Descriptors\n", iter.global_element_index); break; } + /* Skip elements marked as invalid. */ + if (ses_elm_addlstatus_invalid(elm_hdr)) { + offset += elm_hdr->length; + continue; + } + /* Advance to the protocol data, skipping eip bytes if needed */ offset += (eip * SES_EIP_HDR_EXTRA_LEN); - proto_info_len = elmpriv->addl.hdr->length + proto_info_len = elm_hdr->length - (eip * SES_EIP_HDR_EXTRA_LEN); /* Errors in this block are ignored as they are non-fatal */ - switch(ses_elm_addlstatus_proto(elmpriv->addl.hdr)) { + switch(ses_elm_addlstatus_proto(elm_hdr)) { case SPSP_PROTO_FC: - if (elmpriv->addl.hdr->length == 0) + if (elm_hdr->length == 0) break; ses_get_elm_addlstatus_fc(enc, enc_cache, &buf[offset], proto_info_len); break; case SPSP_PROTO_SAS: - if (elmpriv->addl.hdr->length <= 2) + if (elm_hdr->length <= 2) break; ses_get_elm_addlstatus_sas(enc, enc_cache, &buf[offset], @@ -1834,7 +1866,7 @@ ses_process_elm_addlstatus(enc_softc_t *enc, struct en default: ENC_VLOG(enc, "Element %d: Unknown Additional Element " "Protocol 0x%x\n", iter.global_element_index, - ses_elm_addlstatus_proto(elmpriv->addl.hdr)); + ses_elm_addlstatus_proto(elm_hdr)); break; } From owner-svn-src-all@freebsd.org Thu Aug 8 21:38:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBF84B3E01; Thu, 8 Aug 2019 21:38:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MDk4YRYz4vhq; Thu, 8 Aug 2019 21:38:14 +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 7E0283879; Thu, 8 Aug 2019 21:38: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 x78LcEeZ023002; Thu, 8 Aug 2019 21:38:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LcEK1023001; Thu, 8 Aug 2019 21:38:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082138.x78LcEK1023001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350789 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 350789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:38:14 -0000 Author: mav Date: Thu Aug 8 21:38:13 2019 New Revision: 350789 URL: https://svnweb.freebsd.org/changeset/base/350789 Log: MFC r349287: Remove ancient SCSI-2/3 mentioning. Modified: stable/11/sys/cam/scsi/scsi_enc.c stable/11/sys/cam/scsi/scsi_enc_internal.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc.c Thu Aug 8 21:37:26 2019 (r350788) +++ stable/11/sys/cam/scsi/scsi_enc.c Thu Aug 8 21:38:13 2019 (r350789) @@ -683,14 +683,8 @@ enc_type(struct ccb_getdev *cgd) buflen = min(sizeof(cgd->inq_data), SID_ADDITIONAL_LENGTH(&cgd->inq_data)); - if ((iqd[0] & 0x1f) == T_ENCLOSURE) { - if ((iqd[2] & 0x7) > 2) { - return (ENC_SES); - } else { - return (ENC_SES_SCSI2); - } - return (ENC_NONE); - } + if ((iqd[0] & 0x1f) == T_ENCLOSURE) + return (ENC_SES); #ifdef SES_ENABLE_PASSTHROUGH if ((iqd[6] & 0x40) && (iqd[2] & 0x7) >= 2) { @@ -926,7 +920,6 @@ enc_ctor(struct cam_periph *periph, void *arg) switch (enc->enc_type) { case ENC_SES: - case ENC_SES_SCSI2: case ENC_SES_PASSTHROUGH: case ENC_SEMB_SES: err = ses_softc_init(enc); @@ -1015,17 +1008,14 @@ enc_ctor(struct cam_periph *periph, void *arg) case ENC_NONE: tname = "No ENC device"; break; - case ENC_SES_SCSI2: - tname = "SCSI-2 ENC Device"; - break; case ENC_SES: - tname = "SCSI-3 ENC Device"; + tname = "SES Device"; break; case ENC_SES_PASSTHROUGH: - tname = "ENC Passthrough Device"; + tname = "SES Passthrough Device"; break; case ENC_SAFT: - tname = "SAF-TE Compliant Device"; + tname = "SAF-TE Device"; break; case ENC_SEMB_SES: tname = "SEMB SES Device"; Modified: stable/11/sys/cam/scsi/scsi_enc_internal.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_internal.h Thu Aug 8 21:37:26 2019 (r350788) +++ stable/11/sys/cam/scsi/scsi_enc_internal.h Thu Aug 8 21:38:13 2019 (r350789) @@ -53,10 +53,8 @@ typedef struct enc_element { typedef enum { ENC_NONE, - ENC_SES_SCSI2, ENC_SES, ENC_SES_PASSTHROUGH, - ENC_SEN, ENC_SAFT, ENC_SEMB_SES, ENC_SEMB_SAFT From owner-svn-src-all@freebsd.org Thu Aug 8 21:38:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4CB2EB3E79; Thu, 8 Aug 2019 21:38:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MFV1B8mz4vpw; Thu, 8 Aug 2019 21:38:54 +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 E448F387A; Thu, 8 Aug 2019 21:38:53 +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 x78LcrEv023084; Thu, 8 Aug 2019 21:38:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LcrqS023082; Thu, 8 Aug 2019 21:38:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082138.x78LcrqS023082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:38: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: r350790 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/scsi X-SVN-Commit-Revision: 350790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:38:54 -0000 Author: mav Date: Thu Aug 8 21:38:53 2019 New Revision: 350790 URL: https://svnweb.freebsd.org/changeset/base/350790 Log: MFC r349292: Decouple enc/ses verbosity from bootverbose. I don't want to be regularly notified that my enclosure violates standards until there is some real problem I want to debug. Modified: stable/11/sys/cam/scsi/scsi_enc.c stable/11/sys/cam/scsi/scsi_enc_internal.h stable/11/sys/cam/scsi/scsi_enc_safte.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc.c Thu Aug 8 21:38:13 2019 (r350789) +++ stable/11/sys/cam/scsi/scsi_enc.c Thu Aug 8 21:38:53 2019 (r350790) @@ -80,6 +80,14 @@ static enctyp enc_type(struct ccb_getdev *); SYSCTL_NODE(_kern_cam, OID_AUTO, enc, CTLFLAG_RD, 0, "CAM Enclosure Services driver"); +#if defined(DEBUG) || defined(ENC_DEBUG) +int enc_verbose = 1; +#else +int enc_verbose = 0; +#endif +SYSCTL_INT(_kern_cam_enc, OID_AUTO, verbose, CTLFLAG_RWTUN, + &enc_verbose, 0, "Enable verbose logging"); + static struct periph_driver encdriver = { enc_init, "ses", TAILQ_HEAD_INITIALIZER(encdriver.units), /* generation */ 0 Modified: stable/11/sys/cam/scsi/scsi_enc_internal.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_internal.h Thu Aug 8 21:38:13 2019 (r350789) +++ stable/11/sys/cam/scsi/scsi_enc_internal.h Thu Aug 8 21:38:53 2019 (r350790) @@ -34,6 +34,8 @@ #ifndef __SCSI_ENC_INTERNAL_H__ #define __SCSI_ENC_INTERNAL_H__ +#include + typedef struct enc_element { uint32_t enctype : 8, /* enclosure type */ @@ -199,6 +201,9 @@ enc_softc_init_t ses_softc_init; /* SAF-TE interface */ enc_softc_init_t safte_softc_init; +SYSCTL_DECL(_kern_cam_enc); +extern int enc_verbose; + /* Helper macros */ MALLOC_DECLARE(M_SCSIENC); #define ENC_CFLAGS CAM_RETRY_SELTO @@ -211,7 +216,7 @@ MALLOC_DECLARE(M_SCSIENC); #else #define ENC_DLOG if (0) enc_log #endif -#define ENC_VLOG if (bootverbose) enc_log +#define ENC_VLOG if (enc_verbose) enc_log #define ENC_MALLOC(amt) malloc(amt, M_SCSIENC, M_NOWAIT) #define ENC_MALLOCZ(amt) malloc(amt, M_SCSIENC, M_ZERO|M_NOWAIT) /* Cast away const avoiding GCC warnings. */ Modified: stable/11/sys/cam/scsi/scsi_enc_safte.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_safte.c Thu Aug 8 21:38:13 2019 (r350789) +++ stable/11/sys/cam/scsi/scsi_enc_safte.c Thu Aug 8 21:38:53 2019 (r350790) @@ -225,7 +225,6 @@ static char *safte_2little = "Too Little Data Returned } int emulate_array_devices = 1; -SYSCTL_DECL(_kern_cam_enc); SYSCTL_INT(_kern_cam_enc, OID_AUTO, emulate_array_devices, CTLFLAG_RWTUN, &emulate_array_devices, 0, "Emulate Array Devices for SAF-TE"); From owner-svn-src-all@freebsd.org Thu Aug 8 21:43:01 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44D8FB40DD; Thu, 8 Aug 2019 21:43:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MLF14D8z3C1y; Thu, 8 Aug 2019 21:43:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E112D3AC2; Thu, 8 Aug 2019 21:43:00 +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 x78Lh0QV028993; Thu, 8 Aug 2019 21:43:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Lh0VZ028992; Thu, 8 Aug 2019 21:43:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082143.x78Lh0VZ028992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:43:00 +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: r350791 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ahci X-SVN-Commit-Revision: 350791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:43:01 -0000 Author: mav Date: Thu Aug 8 21:43:00 2019 New Revision: 350791 URL: https://svnweb.freebsd.org/changeset/base/350791 Log: MFC r336760 (by luporl): Fixed endianess issue in AHCI driver There were some bits that were being set in cmd_flags (a field of AHCI's command list structure) after cmd_flags was converted to little endian. On a big endian host, such as PowerPC, this would set the wrong bits. This was preventing AHCI driver from working on these hosts. Modified: stable/11/sys/dev/ahci/ahci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Thu Aug 8 21:38:53 2019 (r350790) +++ stable/11/sys/dev/ahci/ahci.c Thu Aug 8 21:43:00 2019 (r350791) @@ -1528,6 +1528,7 @@ ahci_execute_transaction(struct ahci_slot *slot) int fis_size, i, softreset; uint8_t *fis = ch->dma.rfis + 0x40; uint8_t val; + uint16_t cmd_flags; /* Get a piece of the workspace for this request */ ctp = (struct ahci_cmd_tab *) @@ -1541,12 +1542,12 @@ ahci_execute_transaction(struct ahci_slot *slot) /* Setup the command list entry */ clp = (struct ahci_cmd_list *) (ch->dma.work + AHCI_CL_OFFSET + (AHCI_CL_SIZE * slot->slot)); - clp->cmd_flags = htole16( + cmd_flags = (ccb->ccb_h.flags & CAM_DIR_OUT ? AHCI_CMD_WRITE : 0) | (ccb->ccb_h.func_code == XPT_SCSI_IO ? (AHCI_CMD_ATAPI | AHCI_CMD_PREFETCH) : 0) | (fis_size / sizeof(u_int32_t)) | - (port << 12)); + (port << 12); clp->prd_length = htole16(slot->dma.nsegs); /* Special handling for Soft Reset command. */ if ((ccb->ccb_h.func_code == XPT_ATA_IO) && @@ -1557,7 +1558,7 @@ ahci_execute_transaction(struct ahci_slot *slot) ahci_stop(ch); ahci_clo(ch); ahci_start(ch, 0); - clp->cmd_flags |= AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY; + cmd_flags |= AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY; } else { softreset = 2; /* Prepare FIS receive area for check. */ @@ -1567,6 +1568,7 @@ ahci_execute_transaction(struct ahci_slot *slot) } else softreset = 0; clp->bytecount = 0; + clp->cmd_flags = htole16(cmd_flags); clp->cmd_table_phys = htole64(ch->dma.work_bus + AHCI_CT_OFFSET + (AHCI_CT_SIZE * slot->slot)); bus_dmamap_sync(ch->dma.work_tag, ch->dma.work_map, From owner-svn-src-all@freebsd.org Thu Aug 8 21:44:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34899B4170; Thu, 8 Aug 2019 21:44:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MN60KlXz3C9S; Thu, 8 Aug 2019 21:44:38 +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 E115B3AD4; Thu, 8 Aug 2019 21:44:37 +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 x78LiboX029149; Thu, 8 Aug 2019 21:44:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Lib09029148; Thu, 8 Aug 2019 21:44:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082144.x78Lib09029148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:44: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: r350792 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ahci X-SVN-Commit-Revision: 350792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:44:38 -0000 Author: mav Date: Thu Aug 8 21:44:37 2019 New Revision: 350792 URL: https://svnweb.freebsd.org/changeset/base/350792 Log: MFC r340092 (by imp): Implement ability to turn on/off PHYs for AHCI devices. As part of Chuck's work on fixing kernel crashes caused by disk I/O errors, it is useful to be able to trigger various kinds of errors. This patch allows causing an AHCI-attached disk to disappear, by having the driver keep the PHY disabled when the driver would otherwise enable the PHY. It also allows making the disk reappear by having the driver go back to setting the PHY enable/disable state as it normal would and simulating the hardware event that causes a bus rescan. Modified: stable/11/sys/dev/ahci/ahci.c stable/11/sys/dev/ahci/ahci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Thu Aug 8 21:43:00 2019 (r350791) +++ stable/11/sys/dev/ahci/ahci.c Thu Aug 8 21:44:37 2019 (r350792) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -78,6 +79,8 @@ static void ahci_stop(struct ahci_channel *ch); static void ahci_clo(struct ahci_channel *ch); static void ahci_start_fr(struct ahci_channel *ch); static void ahci_stop_fr(struct ahci_channel *ch); +static int ahci_phy_check_events(struct ahci_channel *ch, u_int32_t serr); +static uint32_t ahci_ch_detval(struct ahci_channel *ch, uint32_t val); static int ahci_sata_connect(struct ahci_channel *ch); static int ahci_sata_phy_reset(struct ahci_channel *ch); @@ -98,6 +101,13 @@ static MALLOC_DEFINE(M_AHCI, "AHCI driver", "AHCI driv #define RECOVERY_REQUEST_SENSE 2 #define recovery_slot spriv_field1 +static uint32_t +ahci_ch_detval(struct ahci_channel *ch, uint32_t val) +{ + + return ch->disablephy ? ATA_SC_DET_DISABLE : val; +} + int ahci_ctlr_setup(device_t dev) { @@ -662,11 +672,38 @@ ahci_ch_probe(device_t dev) } static int +ahci_ch_disablephy_proc(SYSCTL_HANDLER_ARGS) +{ + struct ahci_channel *ch; + int error, value; + + ch = arg1; + value = ch->disablephy; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error != 0 || req->newptr == NULL || (value != 0 && value != 1)) + return (error); + + mtx_lock(&ch->mtx); + ch->disablephy = value; + if (value) { + ahci_ch_deinit(ch->dev); + } else { + ahci_ch_init(ch->dev); + ahci_phy_check_events(ch, ATA_SE_PHY_CHANGED | ATA_SE_EXCHANGED); + } + mtx_unlock(&ch->mtx); + + return (0); +} + +static int ahci_ch_attach(device_t dev) { struct ahci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ahci_channel *ch = device_get_softc(dev); struct cam_devq *devq; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; int rid, error, i, sata_rev = 0; u_int32_t version; @@ -784,6 +821,11 @@ ahci_ch_attach(device_t dev) ahci_ch_pm, ch); } mtx_unlock(&ch->mtx); + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "disable_phy", + CTLFLAG_RW | CTLTYPE_UINT, ch, 0, ahci_ch_disablephy_proc, "IU", + "Disable PHY"); return (0); err3: @@ -2494,7 +2536,7 @@ static int ahci_sata_phy_reset(struct ahci_channel *ch) { int sata_rev; - uint32_t val; + uint32_t val, detval; if (ch->listening) { val = ATA_INL(ch->r_mem, AHCI_P_CMD); @@ -2511,12 +2553,14 @@ ahci_sata_phy_reset(struct ahci_channel *ch) val = ATA_SC_SPD_SPEED_GEN3; else val = 0; + detval = ahci_ch_detval(ch, ATA_SC_DET_RESET); ATA_OUTL(ch->r_mem, AHCI_P_SCTL, - ATA_SC_DET_RESET | val | + detval | val | ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER); DELAY(1000); + detval = ahci_ch_detval(ch, ATA_SC_DET_IDLE); ATA_OUTL(ch->r_mem, AHCI_P_SCTL, - ATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 : + detval | val | ((ch->pm_level > 0) ? 0 : (ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))); if (!ahci_sata_connect(ch)) { if (ch->caps & AHCI_CAP_SSS) { Modified: stable/11/sys/dev/ahci/ahci.h ============================================================================== --- stable/11/sys/dev/ahci/ahci.h Thu Aug 8 21:43:00 2019 (r350791) +++ stable/11/sys/dev/ahci/ahci.h Thu Aug 8 21:44:37 2019 (r350792) @@ -459,6 +459,8 @@ struct ahci_channel { struct mtx_padalign mtx; /* state lock */ STAILQ_HEAD(, ccb_hdr) doneq; /* queue of completed CCBs */ int batch; /* doneq is in use */ + + int disablephy; /* keep PHY disabled */ }; struct ahci_enclosure { From owner-svn-src-all@freebsd.org Thu Aug 8 21:46:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47999B422B; Thu, 8 Aug 2019 21:46:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MQR1sy8z3CJS; Thu, 8 Aug 2019 21:46:39 +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 071F13ADF; Thu, 8 Aug 2019 21:46:39 +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 x78LkdCs029316; Thu, 8 Aug 2019 21:46:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LkbUq029306; Thu, 8 Aug 2019 21:46:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082146.x78LkbUq029306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:46: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: r350793 - in stable/11/sys: cam/scsi dev/ahci X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys: cam/scsi dev/ahci X-SVN-Commit-Revision: 350793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:46:39 -0000 Author: mav Date: Thu Aug 8 21:46:36 2019 New Revision: 350793 URL: https://svnweb.freebsd.org/changeset/base/350793 Log: MFC r349321: Improve AHCI Enclosure Management and SES interoperation. Since SES specs do not define mechanism to map enclosure slots to SATA disks, AHCI EM code I written many years ago appeared quite useless, that always bugged me. I was thinking whether it was a good idea, but if LSI HBAs do that, why I shouldn't? This change introduces simple non-standard mechanism for the mapping into both AHCI EM and SES code, that makes AHCI EM on capable controllers (most of Intel's) a first-class SES citizen, allowing it to report disk physical path to GEOM, show devices inserted into each enclosure slot in `sesutil map` and `getencstat`, control locate and fault LEDs for specific devices with `sesutil locate adaX on` and `sesutil fault adaX on`, etc. I've successfully tested this on Supermicro X10DRH-i motherboard connected with sideband cable of its S-SATA Mini-SAS connector to SAS815TQ backplane. It can indicate with LEDs Locate, Fault and Rebuild/Remap SES statuses for each disk identical to real SES of Supermicro SAS2 backplanes. Modified: stable/11/sys/cam/scsi/scsi_all.c stable/11/sys/cam/scsi/scsi_enc.c stable/11/sys/cam/scsi/scsi_enc.h stable/11/sys/cam/scsi/scsi_enc_internal.h stable/11/sys/cam/scsi/scsi_enc_safte.c stable/11/sys/cam/scsi/scsi_enc_ses.c stable/11/sys/cam/scsi/scsi_ses.h stable/11/sys/dev/ahci/ahci.c stable/11/sys/dev/ahci/ahci.h stable/11/sys/dev/ahci/ahciem.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/cam/scsi/scsi_all.c Thu Aug 8 21:46:36 2019 (r350793) @@ -5559,6 +5559,7 @@ scsi_devid_is_naa_ieee_reg(uint8_t *bufp) { struct scsi_vpd_id_descriptor *descr; struct scsi_vpd_id_naa_basic *naa; + int n; descr = (struct scsi_vpd_id_descriptor *)bufp; naa = (struct scsi_vpd_id_naa_basic *)descr->identifier; @@ -5566,7 +5567,8 @@ scsi_devid_is_naa_ieee_reg(uint8_t *bufp) return 0; if (descr->length < sizeof(struct scsi_vpd_id_naa_ieee_reg)) return 0; - if ((naa->naa >> SVPD_ID_NAA_NAA_SHIFT) != SVPD_ID_NAA_IEEE_REG) + n = naa->naa >> SVPD_ID_NAA_NAA_SHIFT; + if (n != SVPD_ID_NAA_LOCAL_REG && n != SVPD_ID_NAA_IEEE_REG) return 0; return 1; } Modified: stable/11/sys/cam/scsi/scsi_enc.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc.c Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/cam/scsi/scsi_enc.c Thu Aug 8 21:46:36 2019 (r350793) @@ -88,6 +88,9 @@ int enc_verbose = 0; SYSCTL_INT(_kern_cam_enc, OID_AUTO, verbose, CTLFLAG_RWTUN, &enc_verbose, 0, "Enable verbose logging"); +const char *elm_type_names[] = ELM_TYPE_NAMES; +CTASSERT(nitems(elm_type_names) - 1 == ELMTYP_LAST); + static struct periph_driver encdriver = { enc_init, "ses", TAILQ_HEAD_INITIALIZER(encdriver.units), /* generation */ 0 @@ -239,13 +242,19 @@ enc_async(void *callback_arg, uint32_t code, struct ca struct enc_softc *softc; softc = (struct enc_softc *)periph->softc; - if (xpt_path_path_id(periph->path) != path_id - || softc == NULL - || (softc->enc_flags & ENC_FLAG_INITIALIZED) - == 0 - || softc->enc_vec.device_found == NULL) + + /* Check this SEP is ready. */ + if (softc == NULL || (softc->enc_flags & + ENC_FLAG_INITIALIZED) == 0 || + softc->enc_vec.device_found == NULL) continue; + /* Check this SEP may manage this device. */ + if (xpt_path_path_id(periph->path) != path_id && + (softc->enc_type != ENC_SEMB_SES || + cgd->protocol != PROTO_ATA)) + continue; + softc->enc_vec.device_found(softc); } xpt_unlock_buses(); @@ -439,7 +448,7 @@ enc_ioctl(struct cdev *dev, u_long cmd, caddr_t arg_ad encioc_element_t kelm; kelm.elm_idx = i; kelm.elm_subenc_id = cache->elm_map[i].subenclosure; - kelm.elm_type = cache->elm_map[i].enctype; + kelm.elm_type = cache->elm_map[i].elm_type; error = copyout(&kelm, &uelm[i], sizeof(kelm)); if (error) break; Modified: stable/11/sys/cam/scsi/scsi_enc.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc.h Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/cam/scsi/scsi_enc.h Thu Aug 8 21:46:36 2019 (r350793) @@ -118,9 +118,41 @@ typedef enum { ELMTYP_SCSI_INI = 0x15, ELMTYP_SUBENC = 0x16, ELMTYP_ARRAY_DEV = 0x17, - ELMTYP_SAS_EXP = 0x18, /* SAS expander */ - ELMTYP_SAS_CONN = 0x19 /* SAS connector */ + ELMTYP_SAS_EXP = 0x18, /* SAS Expander */ + ELMTYP_SAS_CONN = 0x19, /* SAS Connector */ + ELMTYP_LAST = ELMTYP_SAS_CONN } elm_type_t; + +#define ELM_TYPE_NAMES { \ + "Unspecified", \ + "Device Slot", \ + "Power Supply", \ + "Cooling", \ + "Temperature Sensors", \ + "Door", \ + "Audible alarm", \ + "Enclosure Services Controller Electronics", \ + "SCC Controller Electronics", \ + "Nonvolatile Cache", \ + "Invalid Operation Reason", \ + "Uninterruptible Power Supply", \ + "Display", \ + "Key Pad Entry", \ + "Enclosure", \ + "SCSI Port/Transceiver", \ + "Language", \ + "Communication Port", \ + "Voltage Sensor", \ + "Current Sensor", \ + "SCSI Target Port", \ + "SCSI Initiator Port", \ + "Simple Subenclosure", \ + "Array Device Slot", \ + "SAS Expander", \ + "SAS Connector" \ +} + +extern const char *elm_type_names[]; typedef struct encioc_element { /* Element Index */ Modified: stable/11/sys/cam/scsi/scsi_enc_internal.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_internal.h Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/cam/scsi/scsi_enc_internal.h Thu Aug 8 21:46:36 2019 (r350793) @@ -37,16 +37,12 @@ #include typedef struct enc_element { - uint32_t - enctype : 8, /* enclosure type */ - subenclosure : 8, /* subenclosure id */ - svalid : 1, /* enclosure information valid */ - overall_status_elem: 1,/* - * This object represents generic - * status about all objects of this - * type. - */ - priv : 14; /* private data, per object */ + uint8_t elm_idx; /* index of element */ + uint8_t elm_type; /* element type */ + uint8_t subenclosure; /* subenclosure id */ + uint8_t type_elm_idx; /* index of element within type */ + uint8_t svalid; /* enclosure information valid */ + uint16_t priv; /* private data, per object */ uint8_t encstat[4]; /* state && stats */ uint8_t *physical_path; /* Device physical path data. */ u_int physical_path_len; /* Length of device path data. */ Modified: stable/11/sys/cam/scsi/scsi_enc_safte.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_safte.c Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/cam/scsi/scsi_enc_safte.c Thu Aug 8 21:46:36 2019 (r350793) @@ -299,21 +299,21 @@ safte_process_config(enc_softc_t *enc, struct enc_fsm_ * in later fetches of status. */ for (i = 0; i < cfg->Nfans; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_FAN; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_FAN; cfg->pwroff = (uint8_t) r; for (i = 0; i < cfg->Npwr; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_POWER; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_POWER; for (i = 0; i < cfg->DoorLock; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_DOORLOCK; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_DOORLOCK; if (cfg->Nspkrs > 0) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_ALARM; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_ALARM; for (i = 0; i < cfg->Ntherm; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_THERM; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_THERM; for (i = 0; i <= cfg->Ntstats; i++) - enc->enc_cache.elm_map[r++].enctype = ELMTYP_THERM; + enc->enc_cache.elm_map[r++].elm_type = ELMTYP_THERM; cfg->slotoff = (uint8_t) r; for (i = 0; i < cfg->Nslots; i++) - enc->enc_cache.elm_map[r++].enctype = + enc->enc_cache.elm_map[r++].elm_type = emulate_array_devices ? ELMTYP_ARRAY_DEV : ELMTYP_DEVICE; @@ -503,7 +503,7 @@ safte_process_status(enc_softc_t *enc, struct enc_fsm_ */ for (i = 0; i < cfg->Nslots; i++) { SAFT_BAIL(r, xfer_len); - if (cache->elm_map[cfg->slotoff + i].enctype == ELMTYP_DEVICE) + if (cache->elm_map[cfg->slotoff + i].elm_type == ELMTYP_DEVICE) cache->elm_map[cfg->slotoff + i].encstat[1] = buf[r]; r++; } @@ -676,7 +676,7 @@ safte_process_slotstatus(enc_softc_t *enc, struct enc_ oid = cfg->slotoff; for (r = i = 0; i < cfg->Nslots; i++, r += 4) { SAFT_BAIL(r+3, xfer_len); - if (cache->elm_map[oid].enctype == ELMTYP_ARRAY_DEV) + if (cache->elm_map[oid].elm_type == ELMTYP_ARRAY_DEV) cache->elm_map[oid].encstat[1] = 0; cache->elm_map[oid].encstat[2] &= SESCTL_RQSID; cache->elm_map[oid].encstat[3] = 0; @@ -703,7 +703,7 @@ safte_process_slotstatus(enc_softc_t *enc, struct enc_ cache->elm_map[oid].encstat[3] |= SESCTL_RQSFLT; if (buf[r+0] & 0x40) cache->elm_map[oid].encstat[0] |= SESCTL_PRDFAIL; - if (cache->elm_map[oid].enctype == ELMTYP_ARRAY_DEV) { + if (cache->elm_map[oid].elm_type == ELMTYP_ARRAY_DEV) { if (buf[r+0] & 0x01) cache->elm_map[oid].encstat[1] |= 0x80; if (buf[r+0] & 0x04) @@ -769,7 +769,7 @@ safte_fill_control_request(enc_softc_t *enc, struct en } else { ep = &enc->enc_cache.elm_map[idx]; - switch (ep->enctype) { + switch (ep->elm_type) { case ELMTYP_DEVICE: case ELMTYP_ARRAY_DEV: switch (cfg->current_request_stage) { @@ -779,7 +779,7 @@ safte_fill_control_request(enc_softc_t *enc, struct en ep->priv |= 0x40; if (req->elm_stat[3] & SESCTL_RQSFLT) ep->priv |= 0x02; - if (ep->enctype == ELMTYP_ARRAY_DEV) { + if (ep->elm_type == ELMTYP_ARRAY_DEV) { if (req->elm_stat[1] & 0x01) ep->priv |= 0x200; if (req->elm_stat[1] & 0x02) @@ -968,7 +968,7 @@ safte_process_control_request(enc_softc_t *enc, struct if (idx == SES_SETSTATUS_ENC_IDX) type = -1; else - type = enc->enc_cache.elm_map[idx].enctype; + type = enc->enc_cache.elm_map[idx].elm_type; if (type == ELMTYP_DEVICE || type == ELMTYP_ARRAY_DEV) enc_update_request(enc, SAFTE_UPDATE_READSLOTSTATUS); else Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Thu Aug 8 21:46:36 2019 (r350793) @@ -100,6 +100,7 @@ typedef struct ses_addl_status { union { union ses_fcobj_hdr *fc; union ses_elm_sas_hdr *sas; + struct ses_elm_ata_hdr *ata; } proto_hdr; union ses_addl_data proto_data; /* array sizes stored in header */ } ses_add_status_t; @@ -823,14 +824,6 @@ ses_devids_iter(enc_softc_t *enc, enc_element_t *elm, elmpriv = elm->elm_private; addl = &(elmpriv->addl); - /* - * Don't assume this object has additional status information, or - * that it is a SAS device, or that it is a device slot device. - */ - if (addl->hdr == NULL || addl->proto_hdr.sas == NULL - || addl->proto_data.sasdev_phys == NULL) - return; - devid_record_size = SVPD_DEVICE_ID_DESC_HDR_LEN + sizeof(struct scsi_vpd_id_naa_ieee_reg); for (i = 0; i < addl->proto_hdr.sas->base_hdr.num_phys; i++) { @@ -948,11 +941,40 @@ static void ses_paths_iter(enc_softc_t *enc, enc_element_t *elm, ses_path_callback_t *callback, void *callback_arg) { - ses_path_iter_args_t args; + ses_element_t *elmpriv; + struct ses_addl_status *addl; - args.callback = callback; - args.callback_arg = callback_arg; - ses_devids_iter(enc, elm, ses_path_iter_devid_callback, &args); + elmpriv = elm->elm_private; + addl = &(elmpriv->addl); + + if (addl->hdr == NULL) + return; + + if (addl->proto_hdr.sas != NULL && + addl->proto_data.sasdev_phys != NULL) { + ses_path_iter_args_t args; + + args.callback = callback; + args.callback_arg = callback_arg; + ses_devids_iter(enc, elm, ses_path_iter_devid_callback, &args); + } else if (addl->proto_hdr.ata != NULL) { + struct cam_path *path; + struct ccb_getdev cgd; + + if (xpt_create_path(&path, /*periph*/NULL, + scsi_4btoul(addl->proto_hdr.ata->bus), + scsi_4btoul(addl->proto_hdr.ata->target), 0) + != CAM_REQ_CMP) + return; + + xpt_setup_ccb(&cgd.ccb_h, path, CAM_PRIORITY_NORMAL); + cgd.ccb_h.func_code = XPT_GDEV_TYPE; + xpt_action((union ccb *)&cgd); + if (cgd.ccb_h.status == CAM_REQ_CMP) + callback(enc, elm, path, callback_arg); + + xpt_free_path(path); + } } /** @@ -1057,6 +1079,10 @@ ses_set_physpath(enc_softc_t *enc, enc_element_t *elm, ret = EIO; devid = NULL; + elmpriv = elm->elm_private; + if (elmpriv->addl.hdr == NULL) + goto out; + /* * Assemble the components of the physical path starting with * the device ID of the enclosure itself. @@ -1089,7 +1115,6 @@ ses_set_physpath(enc_softc_t *enc, enc_element_t *elm, scsi_8btou64(idd->identifier), iter->type_index, iter->type_element_index); /* Append the element descriptor if one exists */ - elmpriv = elm->elm_private; if (elmpriv->descr != NULL && elmpriv->descr_len > 0) { sbuf_cat(&sb, "/elmdesc@"); for (i = 0, c = elmpriv->descr; i < elmpriv->descr_len; @@ -1455,9 +1480,10 @@ ses_process_config(enc_softc_t *enc, struct enc_fsm_st iter.global_element_index, iter.type_index, nelm, iter.type_element_index); thdr = ses_cache->ses_types[iter.type_index].hdr; + element->elm_idx = iter.global_element_index; + element->elm_type = thdr->etype_elm_type; element->subenclosure = thdr->etype_subenc; - element->enctype = thdr->etype_elm_type; - element->overall_status_elem = iter.type_element_index == 0; + element->type_elm_idx = iter.type_element_index; element->elm_private = malloc(sizeof(ses_element_t), M_SCSIENC, M_WAITOK|M_ZERO); ENC_DLOG(enc, "%s: creating elmpriv %d(%d,%d) subenc %d " @@ -1661,6 +1687,8 @@ static int ses_get_elm_addlstatus_fc(enc_softc_t *, en uint8_t *, int); static int ses_get_elm_addlstatus_sas(enc_softc_t *, enc_cache_t *, uint8_t *, int, int, int, int); +static int ses_get_elm_addlstatus_ata(enc_softc_t *, enc_cache_t *, uint8_t *, + int, int, int, int); /** * \brief Parse the additional status element data for each object. @@ -1816,7 +1844,6 @@ badindex: } } elmpriv = element->elm_private; - elmpriv->addl.hdr = elm_hdr; ENC_DLOG(enc, "%s: global element index=%d, type index=%d " "type element index=%d, offset=0x%x, " "byte0=0x%x, length=0x%x\n", __func__, @@ -1840,6 +1867,7 @@ badindex: offset += elm_hdr->length; continue; } + elmpriv->addl.hdr = elm_hdr; /* Advance to the protocol data, skipping eip bytes if needed */ offset += (eip * SES_EIP_HDR_EXTRA_LEN); @@ -1863,6 +1891,13 @@ badindex: eip, iter.type_index, iter.global_element_index); break; + case SPSP_PROTO_ATA: + ses_get_elm_addlstatus_ata(enc, enc_cache, + &buf[offset], + proto_info_len, + eip, iter.type_index, + iter.global_element_index); + break; default: ENC_VLOG(enc, "Element %d: Unknown Additional Element " "Protocol 0x%x\n", iter.global_element_index, @@ -2191,18 +2226,16 @@ ses_get_elm_addlstatus_fc(enc_softc_t *enc, enc_cache_ } #define SES_PRINT_PORTS(p, type) do { \ - sbuf_printf(sbp, " %s(", type); \ - if (((p) & SES_SASOBJ_DEV_PHY_PROTOMASK) == 0) \ - sbuf_printf(sbp, " None"); \ - else { \ + if (((p) & SES_SASOBJ_DEV_PHY_PROTOMASK) != 0) { \ + sbuf_printf(sbp, " %s (", type); \ if ((p) & SES_SASOBJ_DEV_PHY_SMP) \ sbuf_printf(sbp, " SMP"); \ if ((p) & SES_SASOBJ_DEV_PHY_STP) \ sbuf_printf(sbp, " STP"); \ if ((p) & SES_SASOBJ_DEV_PHY_SSP) \ sbuf_printf(sbp, " SSP"); \ + sbuf_printf(sbp, " )"); \ } \ - sbuf_printf(sbp, " )"); \ } while(0) /** @@ -2212,11 +2245,10 @@ ses_get_elm_addlstatus_fc(enc_softc_t *enc, enc_cache_ * \param sesname SES device name associated with the object. * \param sbp Sbuf to print to. * \param obj The object to print the data for. - * \param periph_name Peripheral string associated with the object. */ static void ses_print_addl_data_sas_type0(char *sesname, struct sbuf *sbp, - enc_element_t *obj, char *periph_name) + enc_element_t *obj) { int i; ses_element_t *elmpriv; @@ -2225,16 +2257,12 @@ ses_print_addl_data_sas_type0(char *sesname, struct sb elmpriv = obj->elm_private; addl = &(elmpriv->addl); - if (addl->proto_hdr.sas == NULL) - return; - sbuf_printf(sbp, "%s: %s: SAS Device Slot Element:", - sesname, periph_name); - sbuf_printf(sbp, " %d Phys", addl->proto_hdr.sas->base_hdr.num_phys); + sbuf_printf(sbp, ", SAS Slot: %d%s phys", + addl->proto_hdr.sas->base_hdr.num_phys, + ses_elm_sas_type0_not_all_phys(addl->proto_hdr.sas) ? "+" : ""); if (ses_elm_addlstatus_eip(addl->hdr)) - sbuf_printf(sbp, " at Slot %d", + sbuf_printf(sbp, " at slot %d", addl->proto_hdr.sas->type0_eip.dev_slot_num); - if (ses_elm_sas_type0_not_all_phys(addl->proto_hdr.sas)) - sbuf_printf(sbp, ", Not All Phys"); sbuf_printf(sbp, "\n"); if (addl->proto_data.sasdev_phys == NULL) return; @@ -2245,9 +2273,8 @@ ses_print_addl_data_sas_type0(char *sesname, struct sb /* Spec says all other fields are specific values */ sbuf_printf(sbp, " SATA device\n"); else { - sbuf_printf(sbp, " SAS device type %d id %d\n", + sbuf_printf(sbp, " SAS device type %d phy %d", ses_elm_sas_dev_phy_dev_type(phy), phy->phy_id); - sbuf_printf(sbp, "%s: phy %d: protocols:", sesname, i); SES_PRINT_PORTS(phy->initiator_ports, "Initiator"); SES_PRINT_PORTS(phy->target_ports, "Target"); sbuf_printf(sbp, "\n"); @@ -2261,32 +2288,16 @@ ses_print_addl_data_sas_type0(char *sesname, struct sb #undef SES_PRINT_PORTS /** - * \brief Report whether a given enclosure object is an expander. - * - * \param enc SES softc associated with object. - * \param obj Enclosure object to report for. - * - * \return 1 if true, 0 otherwise. - */ -static int -ses_obj_is_expander(enc_softc_t *enc, enc_element_t *obj) -{ - return (obj->enctype == ELMTYP_SAS_EXP); -} - -/** * \brief Print the additional element status data for this object, for SAS * type 1 objects. See SES2 r20 Sections 6.1.13.3.3 and 6.1.13.3.4. * - * \param enc SES enclosure, needed for type identification. * \param sesname SES device name associated with the object. * \param sbp Sbuf to print to. * \param obj The object to print the data for. - * \param periph_name Peripheral string associated with the object. */ static void -ses_print_addl_data_sas_type1(enc_softc_t *enc, char *sesname, - struct sbuf *sbp, enc_element_t *obj, char *periph_name) +ses_print_addl_data_sas_type1(char *sesname, struct sbuf *sbp, + enc_element_t *obj) { int i, num_phys; ses_element_t *elmpriv; @@ -2296,12 +2307,10 @@ ses_print_addl_data_sas_type1(enc_softc_t *enc, char * elmpriv = obj->elm_private; addl = &(elmpriv->addl); - if (addl->proto_hdr.sas == NULL) - return; - sbuf_printf(sbp, "%s: %s: SAS ", sesname, periph_name); - if (ses_obj_is_expander(enc, obj)) { + sbuf_printf(sbp, ", SAS "); + if (obj->elm_type == ELMTYP_SAS_EXP) { num_phys = addl->proto_hdr.sas->base_hdr.num_phys; - sbuf_printf(sbp, "Expander: %d Phys", num_phys); + sbuf_printf(sbp, "Expander: %d phys", num_phys); if (addl->proto_data.sasexp_phys == NULL) return; for (i = 0;i < num_phys;i++) { @@ -2312,7 +2321,7 @@ ses_print_addl_data_sas_type1(enc_softc_t *enc, char * } } else { num_phys = addl->proto_hdr.sas->base_hdr.num_phys; - sbuf_printf(sbp, "Port: %d Phys", num_phys); + sbuf_printf(sbp, "Port: %d phys", num_phys); if (addl->proto_data.sasport_phys == NULL) return; for (i = 0;i < num_phys;i++) { @@ -2328,6 +2337,24 @@ ses_print_addl_data_sas_type1(enc_softc_t *enc, char * } /** + * \brief Print the additional element status data for this object, for + * ATA objects. + * + * \param sbp Sbuf to print to. + * \param obj The object to print the data for. + */ +static void +ses_print_addl_data_ata(struct sbuf *sbp, enc_element_t *obj) +{ + ses_element_t *elmpriv = obj->elm_private; + struct ses_addl_status *addl = &elmpriv->addl; + struct ses_elm_ata_hdr *ata = addl->proto_hdr.ata; + + sbuf_printf(sbp, ", SATA Slot: scbus%d target %d\n", + scsi_4btoul(ata->bus), scsi_4btoul(ata->target)); +} + +/** * \brief Print the additional element status data for this object. * * \param enc SES softc associated with the object. @@ -2358,27 +2385,45 @@ ses_print_addl_data(enc_softc_t *enc, enc_element_t *o sbuf_printf(&sesname, "%s%d", enc->periph->periph_name, enc->periph->unit_number); sbuf_finish(&sesname); + sbuf_printf(&out, "%s: %s in ", sbuf_data(&sesname), sbuf_data(&name)); if (elmpriv->descr != NULL) - sbuf_printf(&out, "%s: %s: Element descriptor: '%s'\n", - sbuf_data(&sesname), sbuf_data(&name), elmpriv->descr); + sbuf_printf(&out, "'%s'", elmpriv->descr); + else { + if (obj->elm_type <= ELMTYP_LAST) + sbuf_cat(&out, elm_type_names[obj->elm_type]); + else + sbuf_printf(&out, "", obj->elm_type); + sbuf_printf(&out, " %d", obj->type_elm_idx); + if (obj->subenclosure != 0) + sbuf_printf(&out, " of subenc %d", obj->subenclosure); + } switch(ses_elm_addlstatus_proto(addl->hdr)) { + case SPSP_PROTO_FC: + goto noaddl; /* stubbed for now */ case SPSP_PROTO_SAS: + if (addl->proto_hdr.sas == NULL) + goto noaddl; switch(ses_elm_sas_descr_type(addl->proto_hdr.sas)) { case SES_SASOBJ_TYPE_SLOT: ses_print_addl_data_sas_type0(sbuf_data(&sesname), - &out, obj, sbuf_data(&name)); + &out, obj); break; case SES_SASOBJ_TYPE_OTHER: - ses_print_addl_data_sas_type1(enc, sbuf_data(&sesname), - &out, obj, sbuf_data(&name)); + ses_print_addl_data_sas_type1(sbuf_data(&sesname), + &out, obj); break; default: - break; + goto noaddl; } break; - case SPSP_PROTO_FC: /* stubbed for now */ + case SPSP_PROTO_ATA: + if (addl->proto_hdr.ata == NULL) + goto noaddl; + ses_print_addl_data_ata(&out, obj); break; default: +noaddl: + sbuf_cat(&out, "\n"); break; } sbuf_finish(&out); @@ -2483,7 +2528,7 @@ ses_get_elm_addlstatus_sas_type1(enc_softc_t *enc, enc goto out; /* Process expanders differently from other type1 cases */ - if (ses_obj_is_expander(enc, obj)) { + if (obj->elm_type == ELMTYP_SAS_EXP) { offset += sizeof(struct ses_elm_sas_type1_expander_hdr); physz = addl->proto_hdr.sas->base_hdr.num_phys * sizeof(struct ses_elm_sas_expander_phy); @@ -2586,6 +2631,53 @@ ses_get_elm_addlstatus_sas(enc_softc_t *enc, enc_cache err = ENODEV; break; } + +out: + return (err); +} + +/** + * \brief Update the softc with the additional element status data for this + * object, for ATA objects. + * + * \param enc SES softc to be updated. + * \param buf The additional element status response buffer. + * \param bufsiz Size of the response buffer. + * \param eip The EIP bit value. + * \param tidx Type index for this object. + * \param nobj Number of objects attached to the SES softc. + * + * \return 0 on success, errno otherwise. + */ +static int +ses_get_elm_addlstatus_ata(enc_softc_t *enc, enc_cache_t *enc_cache, + uint8_t *buf, int bufsiz, int eip, int tidx, + int nobj) +{ + int err; + ses_cache_t *ses_cache; + + if (bufsiz < sizeof(struct ses_elm_ata_hdr)) { + err = EIO; + goto out; + } + + ses_cache = enc_cache->private; + switch(ses_cache->ses_types[tidx].hdr->etype_elm_type) { + case ELMTYP_DEVICE: + case ELMTYP_ARRAY_DEV: + break; + default: + ENC_VLOG(enc, "Element %d has Additional Status, " + "invalid for SES element type 0x%x\n", nobj, + ses_cache->ses_types[tidx].hdr->etype_elm_type); + err = ENODEV; + goto out; + } + + ((ses_element_t *)enc_cache->elm_map[nobj].elm_private) + ->addl.proto_hdr.ata = (struct ses_elm_ata_hdr *)buf; + err = 0; out: return (err); Modified: stable/11/sys/cam/scsi/scsi_ses.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_ses.h Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/cam/scsi/scsi_ses.h Thu Aug 8 21:46:36 2019 (r350793) @@ -2179,15 +2179,27 @@ struct ses_status_page_hdr { #define SESCTL_DISABLE 0x20 #define SESCTL_RSTSWAP 0x10 - -/* Control bits, Device Elements, byte 2 */ -#define SESCTL_DRVLCK 0x40 /* "DO NOT REMOVE" */ +/* Control bits, Array Device Slot Elements, byte 1 */ +#define SESCTL_RQSOK 0x80 /* RQST OK */ +#define SESCTL_RQSRSV 0x40 /* RQST RSVD DEVICE */ +#define SESCTL_RQSSPR 0x20 /* RQST HOT SPARE */ +#define SESCTL_RQSCCH 0x10 /* RQST CONS CHECK */ +#define SESCTL_RQSCRA 0x08 /* RQST IN CRIT ARRAY */ +#define SESCTL_RQSFAA 0x04 /* RQST IN FAILED ARRAY */ +#define SESCTL_RQSRR 0x02 /* RQST REBUI/REMAP */ +#define SESCTL_RQSRRA 0x01 /* RQST R/R ABORT */ +/* Control bits, [Array] Device Slot Elements, byte 2 */ +#define SESCTL_RQSACT 0x80 /* RQST ACTIVE */ +#define SESCTL_DRVLCK 0x40 /* DO NOT REMOVE */ +#define SESCTL_RQSMSN 0x10 /* RQST MISSING */ #define SESCTL_RQSINS 0x08 /* RQST INSERT */ #define SESCTL_RQSRMV 0x04 /* RQST REMOVE */ #define SESCTL_RQSID 0x02 /* RQST IDENT */ -/* Control bits, Device Elements, byte 3 */ +/* Control bits, [Array] Device Slot Elements, byte 3 */ #define SESCTL_RQSFLT 0x20 /* RQST FAULT */ #define SESCTL_DEVOFF 0x10 /* DEVICE OFF */ +#define SESCTL_ENBYPA 0x08 /* ENABLE BYP A */ +#define SESCTL_ENBYPB 0x04 /* ENABLE BYP B */ /* Control bits, Generic, byte 3 */ #define SESCTL_RQSTFAIL 0x40 @@ -2396,6 +2408,17 @@ union ses_elm_sas_hdr { }; int ses_elm_sas_type0_not_all_phys(union ses_elm_sas_hdr *); int ses_elm_sas_descr_type(union ses_elm_sas_hdr *); + +/* + * This structure for SPSP_PROTO_ATA is not defined by SES specs, + * but purely my own design to make AHCI EM interoperate with SES. + * Since no other software I know can talk to SEMB, and we do not + * expose this this outside, it should be safe to do what we want. + */ +struct ses_elm_ata_hdr { + uint8_t bus[4]; + uint8_t target[4]; +}; struct ses_elm_addlstatus_base_hdr { uint8_t byte0; Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/dev/ahci/ahci.c Thu Aug 8 21:46:36 2019 (r350793) @@ -184,6 +184,7 @@ ahci_attach(device_t dev) ctlr->ccc = 0; resource_int_value(device_get_name(dev), device_get_unit(dev), "ccc", &ctlr->ccc); + mtx_init(&ctlr->ch_mtx, "AHCI channels lock", NULL, MTX_DEF); /* Setup our own memory management for channels. */ ctlr->sc_iomem.rm_start = rman_get_start(ctlr->r_mem); @@ -376,6 +377,7 @@ ahci_detach(device_t dev) /* Free memory. */ rman_fini(&ctlr->sc_iomem); ahci_free_mem(dev); + mtx_destroy(&ctlr->ch_mtx); return (0); } @@ -663,6 +665,50 @@ ahci_get_dma_tag(device_t dev, device_t child) return (ctlr->dma_tag); } +void +ahci_attached(device_t dev, struct ahci_channel *ch) +{ + struct ahci_controller *ctlr = device_get_softc(dev); + + mtx_lock(&ctlr->ch_mtx); + ctlr->ch[ch->unit] = ch; + mtx_unlock(&ctlr->ch_mtx); +} + +void +ahci_detached(device_t dev, struct ahci_channel *ch) +{ + struct ahci_controller *ctlr = device_get_softc(dev); + + mtx_lock(&ctlr->ch_mtx); + mtx_lock(&ch->mtx); + ctlr->ch[ch->unit] = NULL; + mtx_unlock(&ch->mtx); + mtx_unlock(&ctlr->ch_mtx); +} + +struct ahci_channel * +ahci_getch(device_t dev, int n) +{ + struct ahci_controller *ctlr = device_get_softc(dev); + struct ahci_channel *ch; + + KASSERT(n >= 0 && n < AHCI_MAX_PORTS, ("Bad channel number %d", n)); + mtx_lock(&ctlr->ch_mtx); + ch = ctlr->ch[n]; + if (ch != NULL) + mtx_lock(&ch->mtx); + mtx_unlock(&ctlr->ch_mtx); + return (ch); +} + +void +ahci_putch(struct ahci_channel *ch) +{ + + mtx_unlock(&ch->mtx); +} + static int ahci_ch_probe(device_t dev) { @@ -821,6 +867,7 @@ ahci_ch_attach(device_t dev) ahci_ch_pm, ch); } mtx_unlock(&ch->mtx); + ahci_attached(device_get_parent(dev), ch); ctx = device_get_sysctl_ctx(dev); tree = device_get_sysctl_tree(dev); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "disable_phy", @@ -846,6 +893,7 @@ ahci_ch_detach(device_t dev) { struct ahci_channel *ch = device_get_softc(dev); + ahci_detached(device_get_parent(dev), ch); mtx_lock(&ch->mtx); xpt_async(AC_LOST_DEVICE, ch->path, NULL); /* Forget about reset. */ Modified: stable/11/sys/dev/ahci/ahci.h ============================================================================== --- stable/11/sys/dev/ahci/ahci.h Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/dev/ahci/ahci.h Thu Aug 8 21:46:36 2019 (r350793) @@ -521,6 +521,8 @@ struct ahci_controller { void *argument; } interrupt[AHCI_MAX_PORTS]; void (*ch_start)(struct ahci_channel *); + struct mtx ch_mtx; /* Lock for attached channels */ + struct ahci_channel *ch[AHCI_MAX_PORTS]; /* Attached channels */ }; enum ahci_err_type { @@ -648,6 +650,12 @@ bus_dma_tag_t ahci_get_dma_tag(device_t dev, device_t int ahci_ctlr_reset(device_t dev); int ahci_ctlr_setup(device_t dev); void ahci_free_mem(device_t dev); + +/* Functions to allow AHCI EM to access other channels. */ +void ahci_attached(device_t dev, struct ahci_channel *ch); +void ahci_detached(device_t dev, struct ahci_channel *ch); +struct ahci_channel * ahci_getch(device_t dev, int n); +void ahci_putch(struct ahci_channel *ch); extern devclass_t ahci_devclass; Modified: stable/11/sys/dev/ahci/ahciem.c ============================================================================== --- stable/11/sys/dev/ahci/ahciem.c Thu Aug 8 21:44:37 2019 (r350792) +++ stable/11/sys/dev/ahci/ahciem.c Thu Aug 8 21:46:36 2019 (r350793) @@ -292,14 +292,14 @@ ahci_em_setleds(device_t dev, int c) enc = device_get_softc(dev); val = 0; - if (enc->status[c][2] & 0x80) /* Activity */ + if (enc->status[c][2] & SESCTL_RQSACT) /* Activity */ val |= (1 << 0); - if (enc->status[c][2] & SESCTL_RQSID) /* Identification */ + if (enc->status[c][1] & SESCTL_RQSRR) /* Rebuild */ + val |= (1 << 6) | (1 << 3); + else if (enc->status[c][2] & SESCTL_RQSID) /* Identification */ val |= (1 << 3); else if (enc->status[c][3] & SESCTL_RQSFLT) /* Fault */ val |= (1 << 6); - else if (enc->status[c][1] & 0x02) /* Rebuild */ - val |= (1 << 6) | (1 << 3); timeout = 10000; while (ATA_INL(enc->r_memc, 0) & (AHCI_EM_TM | AHCI_EM_RST) && @@ -364,9 +364,12 @@ static void ahci_em_emulate_ses_on_led(device_t dev, union ccb *ccb) { struct ahci_enclosure *enc; + struct ahci_channel *ch; struct ses_status_page *page; struct ses_status_array_dev_slot *ads, *ads0; struct ses_elm_desc_hdr *elmd; + struct ses_elm_addlstatus_eip_hdr *elma; + struct ses_elm_ata_hdr *elmb; uint8_t *buf; int i; @@ -389,7 +392,7 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc strncpy(&buf[3], device_get_nameunit(dev), 7); strncpy(&buf[10], "AHCI ", SID_VENDOR_SIZE); strncpy(&buf[18], "SGPIO Enclosure ", SID_PRODUCT_SIZE); - strncpy(&buf[34], "1.00", SID_REVISION_SIZE); + strncpy(&buf[34], "2.00", SID_REVISION_SIZE); strncpy(&buf[39], "0001", 4); strncpy(&buf[43], "S-E-S ", 6); strncpy(&buf[49], "2.00", 4); @@ -401,14 +404,15 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc page = (struct ses_status_page *)buf; if (ccb->ataio.cmd.lba_low == 0x02 && ccb->ataio.cmd.features == 0x00 && - ccb->ataio.cmd.sector_count >= 2) { + ccb->ataio.cmd.sector_count >= 3) { bzero(buf, ccb->ataio.dxfer_len); page->hdr.page_code = 0; - scsi_ulto2b(4, page->hdr.length); - buf[4] = 0; - buf[5] = 1; - buf[6] = 2; - buf[7] = 7; + scsi_ulto2b(5, page->hdr.length); + buf[4] = 0x00; + buf[5] = 0x01; + buf[6] = 0x02; + buf[7] = 0x07; + buf[8] = 0x0a; ccb->ccb_h.status = CAM_REQ_CMP; goto out; } @@ -416,26 +420,30 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc /* SEMB RECEIVE DIAGNOSTIC RESULT (1) */ if (ccb->ataio.cmd.lba_low == 0x02 && ccb->ataio.cmd.features == 0x01 && - ccb->ataio.cmd.sector_count >= 13) { + ccb->ataio.cmd.sector_count >= 16) { struct ses_enc_desc *ed; struct ses_elm_type_desc *td; bzero(buf, ccb->ataio.dxfer_len); page->hdr.page_code = 0x01; - scsi_ulto2b(4 + 4 + 36 + 4, page->hdr.length); + scsi_ulto2b(4 + sizeof(*ed) + sizeof(*td) + 11, + page->hdr.length); ed = (struct ses_enc_desc *)&buf[8]; ed->byte0 = 0x11; ed->subenc_id = 0; ed->num_types = 1; ed->length = 36; + ed->logical_id[0] = 0x30; /* NAA Locally Assigned. */ + strncpy(&ed->logical_id[1], device_get_nameunit(dev), 7); strncpy(ed->vendor_id, "AHCI ", SID_VENDOR_SIZE); strncpy(ed->product_id, "SGPIO Enclosure ", SID_PRODUCT_SIZE); - strncpy(ed->product_rev, " ", SID_REVISION_SIZE); + strncpy(ed->product_rev, "2.00", SID_REVISION_SIZE); td = (struct ses_elm_type_desc *)ses_enc_desc_next(ed); td->etype_elm_type = 0x17; td->etype_maxelt = enc->channels; td->etype_subenc = 0; - td->etype_txt_len = 0; + td->etype_txt_len = 11; + snprintf((char *)(td + 1), 12, "Drive Slots"); ccb->ccb_h.status = CAM_REQ_CMP; goto out; } @@ -451,10 +459,22 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc for (i = 0; i < enc->channels; i++) { ads = &page->elements[i + 1].array_dev_slot; memcpy(ads, enc->status[i], 4); - ads->common.bytes[0] |= - (enc->ichannels & (1 << i)) ? - SES_OBJSTAT_UNKNOWN : - SES_OBJSTAT_NOTINSTALLED; + ch = ahci_getch(device_get_parent(dev), i); + if (ch == NULL) { + ads->common.bytes[0] |= SES_OBJSTAT_UNKNOWN; + continue; + } + if (ch->pm_present) + ads->common.bytes[0] |= SES_OBJSTAT_UNKNOWN; + else if (ch->devices) + ads->common.bytes[0] |= SES_OBJSTAT_OK; + else if (ch->disablephy) + ads->common.bytes[0] |= SES_OBJSTAT_NOTAVAIL; + else + ads->common.bytes[0] |= SES_OBJSTAT_NOTINSTALLED; + if (ch->disablephy) + ads->common.bytes[3] |= SESCTL_DEVOFF; + ahci_putch(ch); } ccb->ccb_h.status = CAM_REQ_CMP; goto out; @@ -469,21 +489,21 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc ads = &page->elements[i + 1].array_dev_slot; if (ads->common.bytes[0] & SESCTL_CSEL) { enc->status[i][0] = 0; - enc->status[i][1] = - ads->bytes[0] & 0x02; - enc->status[i][2] = - ads->bytes[1] & (0x80 | SESCTL_RQSID); - enc->status[i][3] = - ads->bytes[2] & SESCTL_RQSFLT; + enc->status[i][1] = ads->bytes[0] & + SESCTL_RQSRR; + enc->status[i][2] = ads->bytes[1] & + (SESCTL_RQSACT | SESCTL_RQSID); + enc->status[i][3] = ads->bytes[2] & + SESCTL_RQSFLT; ahci_em_setleds(dev, i); } else if (ads0->common.bytes[0] & SESCTL_CSEL) { enc->status[i][0] = 0; - enc->status[i][1] = - ads0->bytes[0] & 0x02; - enc->status[i][2] = - ads0->bytes[1] & (0x80 | SESCTL_RQSID); - enc->status[i][3] = - ads0->bytes[2] & SESCTL_RQSFLT; + enc->status[i][1] = ads0->bytes[0] & + SESCTL_RQSRR; + enc->status[i][2] = ads0->bytes[1] & + (SESCTL_RQSACT | SESCTL_RQSID); + enc->status[i][3] = ads0->bytes[2] & + SESCTL_RQSFLT; ahci_em_setleds(dev, i); } } @@ -494,15 +514,48 @@ ahci_em_emulate_ses_on_led(device_t dev, union ccb *cc /* SEMB RECEIVE DIAGNOSTIC RESULT (7) */ if (ccb->ataio.cmd.lba_low == 0x02 && ccb->ataio.cmd.features == 0x07 && - ccb->ataio.cmd.sector_count >= (3 + 3 * enc->channels)) { + ccb->ataio.cmd.sector_count >= (6 + 3 * enc->channels)) { bzero(buf, ccb->ataio.dxfer_len); page->hdr.page_code = 0x07; - scsi_ulto2b(4 + 4 + 12 * enc->channels, + scsi_ulto2b(4 + 15 + 11 * enc->channels, page->hdr.length); + elmd = (struct ses_elm_desc_hdr *)&buf[8]; + scsi_ulto2b(11, elmd->length); + snprintf((char *)(elmd + 1), 12, "Drive Slots"); + for (i = 0; i < enc->channels; i++) { + elmd = (struct ses_elm_desc_hdr *)&buf[8 + 15 + 11 * i]; + scsi_ulto2b(7, elmd->length); + snprintf((char *)(elmd + 1), 8, "Slot %02d", i); + } + ccb->ccb_h.status = CAM_REQ_CMP; + goto out; + } + + /* SEMB RECEIVE DIAGNOSTIC RESULT (a) */ + if (ccb->ataio.cmd.lba_low == 0x02 && + ccb->ataio.cmd.features == 0x0a && + ccb->ataio.cmd.sector_count >= (2 + 3 * enc->channels)) { + bzero(buf, ccb->ataio.dxfer_len); + page->hdr.page_code = 0x0a; + scsi_ulto2b(4 + (sizeof(*elma) + sizeof(*elmb)) * enc->channels, page->hdr.length); for (i = 0; i < enc->channels; i++) { - elmd = (struct ses_elm_desc_hdr *)&buf[8 + 4 + 12 * i]; - scsi_ulto2b(8, elmd->length); - snprintf((char *)(elmd + 1), 9, "SLOT %03d", i); + elma = (struct ses_elm_addlstatus_eip_hdr *)&buf[ + 8 + (sizeof(*elma) + sizeof(*elmb)) * i]; + elma->base.byte0 = 0x10 | SPSP_PROTO_ATA; + elma->base.length = 2 + sizeof(*elmb); + elma->byte2 = 0x01; + elma->element_index = 1 + i; + ch = ahci_getch(device_get_parent(dev), i); + if (ch == NULL) { + elma->base.byte0 |= 0x80; + continue; + } + if (ch->devices == 0 || ch->pm_present) + elma->base.byte0 |= 0x80; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 8 21:47:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3743DB4370; Thu, 8 Aug 2019 21:47: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MRd0gwYz3CWZ; Thu, 8 Aug 2019 21:47: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 ED0D73AE2; Thu, 8 Aug 2019 21:47:40 +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 x78LledB029522; Thu, 8 Aug 2019 21:47:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78Lle42029521; Thu, 8 Aug 2019 21:47:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082147.x78Lle42029521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:47: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: r350794 - stable/11/sys/cam/ata X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ata X-SVN-Commit-Revision: 350794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:47:41 -0000 Author: mav Date: Thu Aug 8 21:47:40 2019 New Revision: 350794 URL: https://svnweb.freebsd.org/changeset/base/350794 Log: MFC r349339 (by imp): Go ahead and completely fix the ata_params before calling the veto function. This breaks nothing that uses it in the tree since ata_params is ignored in storvsc_ada_probe_veto which is the only in-tree consumer. Modified: stable/11/sys/cam/ata/ata_xpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/11/sys/cam/ata/ata_xpt.c Thu Aug 8 21:46:36 2019 (r350793) +++ stable/11/sys/cam/ata/ata_xpt.c Thu Aug 8 21:47:40 2019 (r350794) @@ -884,22 +884,14 @@ noerror: int16_t *ptr; int veto = 0; + /* + * Convert to host byte order, and fix the strings. + */ ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { *ptr = le16toh(*ptr); } - - /* - * Allow others to veto this ATA disk attachment. This - * is mainly used by VMs, whose disk controllers may - * share the disks with the simulated ATA controllers. - */ - EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); - if (veto) { - goto device_fail; - } - if (strncmp(ident_buf->model, "FX", 2) && strncmp(ident_buf->model, "NEC", 3) && strncmp(ident_buf->model, "Pioneer", 7) && @@ -914,6 +906,17 @@ noerror: ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + + /* + * Allow others to veto this ATA disk attachment. This + * is mainly used by VMs, whose disk controllers may + * share the disks with the simulated ATA controllers. + */ + EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, &veto); + if (veto) { + goto device_fail; + } + /* Device may need spin-up before IDENTIFY become valid. */ if ((ident_buf->specconf == 0x37c8 || ident_buf->specconf == 0x738c) && From owner-svn-src-all@freebsd.org Thu Aug 8 21:54:32 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 919F8B46C1; Thu, 8 Aug 2019 21:54: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MbX2mfzz3CyX; Thu, 8 Aug 2019 21:54: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 3DF663CB4; Thu, 8 Aug 2019 21:54:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x78LsWK8035268; Thu, 8 Aug 2019 21:54:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LsVf6035267; Thu, 8 Aug 2019 21:54:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082154.x78LsVf6035267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:54: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: r350795 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:54:32 -0000 Author: mav Date: Thu Aug 8 21:54:31 2019 New Revision: 350795 URL: https://svnweb.freebsd.org/changeset/base/350795 Log: MFC r349964 (by imp): Add device type NVME and device type MMCSD to get_device_type For completeness, add nvme and mmc/sd devices to the list of device types we know. Modified: stable/11/sbin/camcontrol/camcontrol.c stable/11/sbin/camcontrol/camcontrol.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 21:47:40 2019 (r350794) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 21:54:31 2019 (r350795) @@ -5193,6 +5193,10 @@ get_device_type(struct cam_device *dev, int retry_coun *devtype = CC_DT_ATA; goto bailout; break; /*NOTREACHED*/ + case PROTO_NVME: + *devtype = CC_DT_NVME; + goto bailout; + break; /*NOTREACHED*/ default: *devtype = CC_DT_UNKNOWN; goto bailout; Modified: stable/11/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.h Thu Aug 8 21:47:40 2019 (r350794) +++ stable/11/sbin/camcontrol/camcontrol.h Thu Aug 8 21:54:31 2019 (r350795) @@ -44,6 +44,8 @@ typedef enum { CC_DT_SCSI, CC_DT_ATA_BEHIND_SCSI, CC_DT_ATA, + CC_DT_NVME, + CC_DT_MMCSD, CC_DT_UNKNOWN } camcontrol_devtype; From owner-svn-src-all@freebsd.org Thu Aug 8 21:55:50 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B47BAB4765; Thu, 8 Aug 2019 21:55:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Md24PZnz3D5x; Thu, 8 Aug 2019 21:55: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 7A1873CB5; Thu, 8 Aug 2019 21:55: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 x78LtoDB035421; Thu, 8 Aug 2019 21:55:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78LtnGR035416; Thu, 8 Aug 2019 21:55:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082155.x78LtnGR035416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 21:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350796 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 21:55:50 -0000 Author: mav Date: Thu Aug 8 21:55:49 2019 New Revision: 350796 URL: https://svnweb.freebsd.org/changeset/base/350796 Log: MFC r350008 (by imp): Use the more proper term of SATL instead of ATA_BEHIND_SCSI. Most people know SAS attached SATA devices by the name SAT or SATL (with the latter being a little more common). Change the device type ATA_BEHIND_SCSI to SATL since it's more specific and meaningful. Modified: stable/11/sbin/camcontrol/camcontrol.c stable/11/sbin/camcontrol/camcontrol.h stable/11/sbin/camcontrol/epc.c stable/11/sbin/camcontrol/fwdownload.c stable/11/sbin/camcontrol/zone.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 21:54:31 2019 (r350795) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 21:55:49 2019 (r350796) @@ -5214,7 +5214,7 @@ get_device_type(struct cam_device *dev, int retry_coun retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, timeout, verbosemode); if (retval == 1) - *devtype = CC_DT_ATA_BEHIND_SCSI; + *devtype = CC_DT_SATL; else *devtype = CC_DT_SCSI; Modified: stable/11/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.h Thu Aug 8 21:54:31 2019 (r350795) +++ stable/11/sbin/camcontrol/camcontrol.h Thu Aug 8 21:55:49 2019 (r350796) @@ -42,7 +42,7 @@ typedef enum { typedef enum { CC_DT_NONE, CC_DT_SCSI, - CC_DT_ATA_BEHIND_SCSI, + CC_DT_SATL, CC_DT_ATA, CC_DT_NVME, CC_DT_MMCSD, Modified: stable/11/sbin/camcontrol/epc.c ============================================================================== --- stable/11/sbin/camcontrol/epc.c Thu Aug 8 21:54:31 2019 (r350795) +++ stable/11/sbin/camcontrol/epc.c Thu Aug 8 21:55:49 2019 (r350796) @@ -767,7 +767,7 @@ epc(struct cam_device *device, int argc, char **argv, switch (devtype) { case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: + case CC_DT_SATL: break; default: warnx("The epc subcommand only works with ATA protocol " Modified: stable/11/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/11/sbin/camcontrol/fwdownload.c Thu Aug 8 21:54:31 2019 (r350795) +++ stable/11/sbin/camcontrol/fwdownload.c Thu Aug 8 21:55:49 2019 (r350796) @@ -694,7 +694,7 @@ fw_check_device_ready(struct cam_device *dev, camcontr /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 5000); break; - case CC_DT_ATA_BEHIND_SCSI: + case CC_DT_SATL: case CC_DT_ATA: { retval = build_ata_cmd(ccb, /*retries*/ 1, @@ -853,7 +853,7 @@ fw_download_img(struct cam_device *cam_dev, struct fw_ timeout ? timeout : WB_TIMEOUT); /* timeout*/ break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint32_t off; off = (uint32_t)(pkt_ptr - buf); @@ -969,7 +969,7 @@ fwdownload(struct cam_device *device, int argc, char * errx(1, "Unable to determine device type"); if ((devtype == CC_DT_ATA) - || (devtype == CC_DT_ATA_BEHIND_SCSI)) { + || (devtype == CC_DT_SATL)) { ccb = cam_getccb(device); if (ccb == NULL) { warnx("couldn't allocate CCB"); Modified: stable/11/sbin/camcontrol/zone.c ============================================================================== --- stable/11/sbin/camcontrol/zone.c Thu Aug 8 21:54:31 2019 (r350795) +++ stable/11/sbin/camcontrol/zone.c Thu Aug 8 21:55:49 2019 (r350796) @@ -466,7 +466,7 @@ restart_report: /*timeout*/ timeout ? timeout : 60000); break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint8_t command = 0; uint8_t protocol = 0; uint16_t features = 0, sector_count = 0; @@ -558,7 +558,7 @@ restart_report: /*timeout*/ timeout ? timeout : 60000); break; case CC_DT_ATA: - case CC_DT_ATA_BEHIND_SCSI: { + case CC_DT_SATL: { uint8_t command = 0; uint8_t protocol = 0; uint16_t features = 0, sector_count = 0; From owner-svn-src-all@freebsd.org Thu Aug 8 22:03:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C60EEB4A53; Thu, 8 Aug 2019 22:03:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MnL4rQRz3DX9; Thu, 8 Aug 2019 22:03:02 +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 87C3D3E6C; Thu, 8 Aug 2019 22:03:02 +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 x78M32RN041132; Thu, 8 Aug 2019 22:03:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78M32EZ041130; Thu, 8 Aug 2019 22:03:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082203.x78M32EZ041130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:03: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: r350797 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:03:02 -0000 Author: mav Date: Thu Aug 8 22:03:01 2019 New Revision: 350797 URL: https://svnweb.freebsd.org/changeset/base/350797 Log: MFC r350018 (by imp): Implement a devtype command. List the device's protocol. The returned value is one of the following: ata direct attach ATA or SATA device satl a SATA device attached via SAS scsi A parallel SCSI or SAS nvme A direct attached NVMe device mmcsd A MMC or SD attached device Modified: stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 21:55:49 2019 (r350796) +++ stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 22:03:01 2019 (r350797) @@ -353,6 +353,9 @@ .Op generic args .Ao Fl r Oo Ns Fl f Ar format | Fl m | Fl U Oc | Fl s Ao Fl f Ar format Fl T Ar time | Fl U Ac Ac .Nm +.Ic devtype +.Op device id +.Nm .Ic help .Sh DESCRIPTION The @@ -2515,6 +2518,26 @@ option. .It Fl U Set the timestamp to the host system's time in UTC. .El +.El +.It Ic devtype +Print out the device type for specified device. +.Bl -tag -width 10n +.It ata +An ATA device attached directly to an ATA controller +.It satl +An SATA device attached behind a SAS controller via SCSI-ATA Translation Layer (SATL) +.It scsi +A SCSI device +.It nvme +An directly attached NVMe device +.It mmcsd +An MMC or SD device attached via a mmcsd bus +.It none +No device type reported +.It unknown +Device type is unknown +.It illegal +A programming error occurred .El .It Ic help Print out verbose usage information. Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 21:55:49 2019 (r350796) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:03:01 2019 (r350797) @@ -106,6 +106,7 @@ typedef enum { CAM_CMD_EPC = 0x00000027, CAM_CMD_TIMESTAMP = 0x00000028, CAM_CMD_POWER_MODE = 0x0000002a, + CAM_CMD_DEVTYPE = 0x0000002b, } cam_cmdmask; typedef enum { @@ -219,6 +220,7 @@ static struct camcontrol_opts option_table[] = { {"defectlist", CAM_CMD_READ_DEFECTS, CAM_ARG_NONE, readdefect_opts}, #endif /* MINIMALISTIC */ {"devlist", CAM_CMD_DEVTREE, CAM_ARG_NONE, "-b"}, + {"devtype", CAM_CMD_DEVTYPE, CAM_ARG_NONE, ""}, #ifndef MINIMALISTIC {"periphlist", CAM_CMD_DEVLIST, CAM_ARG_NONE, NULL}, {"modepage", CAM_CMD_MODE_PAGE, CAM_ARG_NONE, "bdelm:P:"}, @@ -267,6 +269,16 @@ struct cam_devlist { static cam_cmdmask cmdlist; static cam_argmask arglist; +static const char *devtype_names[] = { + "none", + "scsi", + "satl", + "ata", + "nvme", + "mmcsd", + "unknown", +}; + camcontrol_optret getoption(struct camcontrol_opts *table, char *arg, uint32_t *cmdnum, cam_argmask *argnum, const char **subopt); @@ -274,6 +286,7 @@ camcontrol_optret getoption(struct camcontrol_opts *ta static int getdevlist(struct cam_device *device); #endif /* MINIMALISTIC */ static int getdevtree(int argc, char **argv, char *combinedopt); +static int getdevtype(struct cam_device *device); #ifndef MINIMALISTIC static int testunitready(struct cam_device *device, int task_attr, int retry_count, int timeout, int quiet); @@ -668,6 +681,24 @@ getdevtree(int argc, char **argv, char *combinedopt) return (error); } +static int +getdevtype(struct cam_device *cam_dev) +{ + camcontrol_devtype dt; + int error; + + /* + * Get the device type and report it, request no I/O be done to do this. + */ + error = get_device_type(cam_dev, -1, 0, 0, &dt); + if (error != 0 || dt < CC_DT_NONE || dt > CC_DT_UNKNOWN) { + fprintf(stdout, "illegal\n"); + return (1); + } + fprintf(stdout, "%s\n", devtype_names[dt]); + return (0); +} + #ifndef MINIMALISTIC static int testunitready(struct cam_device *device, int task_attr, int retry_count, @@ -5178,7 +5209,7 @@ get_device_type(struct cam_device *dev, int retry_coun int verbosemode, camcontrol_devtype *devtype) { struct ccb_getdev cgd; - int retval = 0; + int retval; retval = get_cgd(dev, &cgd); if (retval != 0) @@ -5203,21 +5234,34 @@ get_device_type(struct cam_device *dev, int retry_coun break; /*NOTREACHED*/ } - /* - * Check for the ATA Information VPD page (0x89). If this is an - * ATA device behind a SCSI to ATA translation layer, this VPD page - * should be present. - * - * If that VPD page isn't present, or we get an error back from the - * INQUIRY command, we'll just treat it as a normal SCSI device. - */ - retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, - timeout, verbosemode); - if (retval == 1) - *devtype = CC_DT_SATL; - else - *devtype = CC_DT_SCSI; - + if (retry_count == -1) { + /* + * For a retry count of -1, used only the cached data to avoid + * I/O to the drive. Sending the identify command to the drive + * can cause issues for SATL attachaed drives since identify is + * not an NCQ command. + */ + if (cgd.ident_data.config != 0) + *devtype = CC_DT_SATL; + else + *devtype = CC_DT_SCSI; + } else { + /* + * Check for the ATA Information VPD page (0x89). If this is an + * ATA device behind a SCSI to ATA translation layer (SATL), + * this VPD page should be present. + * + * If that VPD page isn't present, or we get an error back from + * the INQUIRY command, we'll just treat it as a normal SCSI + * device. + */ + retval = dev_has_vpd_page(dev, SVPD_ATA_INFORMATION, retry_count, + timeout, verbosemode); + if (retval == 1) + *devtype = CC_DT_SATL; + else + *devtype = CC_DT_SCSI; + } retval = 0; bailout: @@ -9162,6 +9206,7 @@ usage(int printlong) " [-S power_src] [-T timer]\n" " camcontrol timestamp [dev_id][generic_args] <-r [-f format|-m|-U]>|\n" " <-s <-f format -T time | -U >>\n" +" camcontrol devtype [dev_id]\n" " \n" #endif /* MINIMALISTIC */ " camcontrol help\n"); @@ -9209,6 +9254,7 @@ usage(int printlong) "zone manage Zoned Block (Shingled) devices\n" "epc send ATA Extended Power Conditions commands\n" "timestamp report or set the device's timestamp\n" +"devtype report the type of device\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -9680,6 +9726,9 @@ main(int argc, char **argv) #endif /* MINIMALISTIC */ case CAM_CMD_DEVTREE: error = getdevtree(argc, argv, combinedopt); + break; + case CAM_CMD_DEVTYPE: + error = getdevtype(cam_dev); break; #ifndef MINIMALISTIC case CAM_CMD_TUR: From owner-svn-src-all@freebsd.org Thu Aug 8 22:03:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F36C9B4ACF; Thu, 8 Aug 2019 22:03:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Mp067wCz3DfL; Thu, 8 Aug 2019 22:03:36 +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 B5A7D3E6D; Thu, 8 Aug 2019 22:03:36 +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 x78M3asG041213; Thu, 8 Aug 2019 22:03:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78M3ar9041212; Thu, 8 Aug 2019 22:03:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082203.x78M3ar9041212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:03: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: r350798 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:03:37 -0000 Author: mav Date: Thu Aug 8 22:03:36 2019 New Revision: 350798 URL: https://svnweb.freebsd.org/changeset/base/350798 Log: MFC r350020 (by imp): Use a different approach to range check. gcc hates dt < CC_DT_NONE since it can never be true when dt is an unsigned type. Since that's a compiler choice and may be affected by weird stuff, instead use (unsigned)dt > CC_DT_UNKNOWN to test for bounds error since that will work regardless of the signedness of dt. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:03:01 2019 (r350797) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:03:36 2019 (r350798) @@ -691,7 +691,7 @@ getdevtype(struct cam_device *cam_dev) * Get the device type and report it, request no I/O be done to do this. */ error = get_device_type(cam_dev, -1, 0, 0, &dt); - if (error != 0 || dt < CC_DT_NONE || dt > CC_DT_UNKNOWN) { + if (error != 0 || (unsigned)dt > CC_DT_UNKNOWN) { fprintf(stdout, "illegal\n"); return (1); } From owner-svn-src-all@freebsd.org Thu Aug 8 22:05:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B315B4C09; Thu, 8 Aug 2019 22:05:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MrM5v5Vz3DpD; Thu, 8 Aug 2019 22:05:39 +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 A85773E85; Thu, 8 Aug 2019 22:05:39 +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 x78M5d8x041433; Thu, 8 Aug 2019 22:05:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78M5dhE041432; Thu, 8 Aug 2019 22:05:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082205.x78M5dhE041432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:05:39 +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: r350799 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 350799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:05:40 -0000 Author: mav Date: Thu Aug 8 22:05:39 2019 New Revision: 350799 URL: https://svnweb.freebsd.org/changeset/base/350799 Log: MFC r312212 (by cem): Fix a minor typo (Seiral) Modified: stable/11/sys/sys/ata.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/ata.h ============================================================================== --- stable/11/sys/sys/ata.h Thu Aug 8 22:03:36 2019 (r350798) +++ stable/11/sys/sys/ata.h Thu Aug 8 22:05:39 2019 (r350799) @@ -693,7 +693,7 @@ struct atapi_sense { #define ATA_IDL_ATA_STRINGS 0x05 /* ATA Strings */ #define ATA_IDL_SECURITY 0x06 /* Security */ #define ATA_IDL_PARALLEL_ATA 0x07 /* Parallel ATA */ -#define ATA_IDL_SERIAL_ATA 0x08 /* Seiral ATA */ +#define ATA_IDL_SERIAL_ATA 0x08 /* Serial ATA */ #define ATA_IDL_ZDI 0x09 /* Zoned Device Information */ struct ata_gp_log_dir { From owner-svn-src-all@freebsd.org Thu Aug 8 22:06:40 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AFB17B4EB6; Thu, 8 Aug 2019 22:06:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MsX4C7lz3F62; Thu, 8 Aug 2019 22:06:40 +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 7177F3E88; Thu, 8 Aug 2019 22:06:40 +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 x78M6ero041680; Thu, 8 Aug 2019 22:06:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78M6ek7041679; Thu, 8 Aug 2019 22:06:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082206.x78M6ek7041679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:06: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: r350800 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 350800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:06:40 -0000 Author: mav Date: Thu Aug 8 22:06:40 2019 New Revision: 350800 URL: https://svnweb.freebsd.org/changeset/base/350800 Log: MFC r348376 (by rpokala): Add bits related to SANITIZE, SED, and form-factor to (struct ata_params) Based on ATA-ACS-4, recognize several bit-fields related to the ATA SANITIZE feature-set, Self-Encrypting Drives, and form-factor identification. As part of this change, the name of word 48 of (struct ata_params) is being changed. The previous name, "usedmovsd" does not appear to be related to the previous definition of the word ("double-word IO supported"). The word was defined that way in ATA-1 (1994), but it was marked "Reserved" (meaning "unused, but might be used in the future") in ATA-2 (1996). It stayed that way until ATA-8 (2008), which re-defined it as implemented in this change. The field is not used in-tree. Modified: stable/11/sys/sys/ata.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/ata.h ============================================================================== --- stable/11/sys/sys/ata.h Thu Aug 8 22:05:39 2019 (r350799) +++ stable/11/sys/sys/ata.h Thu Aug 8 22:06:40 2019 (r350800) @@ -64,7 +64,8 @@ struct ata_params { /*023*/ u_int8_t revision[8]; /* firmware revision */ /*027*/ u_int8_t model[40]; /* model name */ /*047*/ u_int16_t sectors_intr; /* sectors per interrupt */ -/*048*/ u_int16_t usedmovsd; /* double word read/write? */ +/*048*/ u_int16_t tcg; /* Trusted Computing Group */ +#define ATA_SUPPORT_TCG 0x0001 /*049*/ u_int16_t capabilities1; #define ATA_SUPPORT_DMA 0x0100 #define ATA_SUPPORT_LBA 0x0200 @@ -90,6 +91,10 @@ struct ata_params { /*057*/ u_int16_t current_size_1; /*058*/ u_int16_t current_size_2; /*059*/ u_int16_t multi; +#define ATA_SUPPORT_BLOCK_ERASE_EXT 0x8000 +#define ATA_SUPPORT_OVERWRITE_EXT 0x4000 +#define ATA_SUPPORT_CRYPTO_SCRAMBLE_EXT 0x2000 +#define ATA_SUPPORT_SANITIZE 0x1000 #define ATA_MULTI_VALID 0x0100 /*060*/ u_int16_t lba_size_1; @@ -105,6 +110,7 @@ struct ata_params { /*069*/ u_int16_t support3; #define ATA_SUPPORT_RZAT 0x0020 #define ATA_SUPPORT_DRAT 0x4000 +#define ATA_ENCRYPTS_ALL_USER_DATA 0x0010 /* Self-encrypting drive */ #define ATA_SUPPORT_ZONE_MASK 0x0003 #define ATA_SUPPORT_ZONE_NR 0x0000 #define ATA_SUPPORT_ZONE_HOST_AWARE 0x0001 @@ -257,7 +263,19 @@ struct ata_params { /*162*/ u_int16_t cfa_kms_support; /*163*/ u_int16_t cfa_trueide_modes; /*164*/ u_int16_t cfa_memory_modes; - u_int16_t reserved165[4]; + u_int16_t reserved165[3]; +/*168*/ u_int16_t form_factor; +#define ATA_FORM_FACTOR_MASK 0x000f +#define ATA_FORM_FACTOR_NOT_REPORTED 0x0000 +#define ATA_FORM_FACTOR_5_25 0x0001 +#define ATA_FORM_FACTOR_3_5 0x0002 +#define ATA_FORM_FACTOR_2_5 0x0003 +#define ATA_FORM_FACTOR_1_8 0x0004 +#define ATA_FORM_FACTOR_SUB_1_8 0x0005 +#define ATA_FORM_FACTOR_MSATA 0x0006 +#define ATA_FORM_FACTOR_M_2 0x0007 +#define ATA_FORM_FACTOR_MICRO_SSD 0x0008 +#define ATA_FORM_FACTOR_C_FAST 0x0009 /*169*/ u_int16_t support_dsm; #define ATA_SUPPORT_DSM_TRIM 0x0001 u_int16_t reserved170[6]; From owner-svn-src-all@freebsd.org Thu Aug 8 22:08:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A795B5054; Thu, 8 Aug 2019 22:08:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Mw80tlzz3FFf; Thu, 8 Aug 2019 22:08:56 +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 14F2B3E89; Thu, 8 Aug 2019 22:08:56 +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 x78M8uYo041846; Thu, 8 Aug 2019 22:08:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78M8tZm041843; Thu, 8 Aug 2019 22:08:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082208.x78M8tZm041843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r350801 - in stable/11: sbin/camcontrol sys/cam/ata sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11: sbin/camcontrol sys/cam/ata sys/sys X-SVN-Commit-Revision: 350801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:08:56 -0000 Author: mav Date: Thu Aug 8 22:08:54 2019 New Revision: 350801 URL: https://svnweb.freebsd.org/changeset/base/350801 Log: MFC r350149: Add Accessible Max Address Configuration support to camcontrol. AMA replaced HPA in ACS-3 specification. It allows to limit size of the disk alike to HPA, but declares inaccessible data as indeterminate. One of its practical use cases is to under-provision SATA SSDs for better reliability and performance. While there, fix HPA Security detection/reporting. Relnotes: yes Modified: stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c stable/11/sys/cam/ata/ata_all.c stable/11/sys/sys/ata.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 22:06:40 2019 (r350800) +++ stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 22:08:54 2019 (r350801) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 22, 2019 +.Dd July 19, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -292,6 +292,13 @@ .Op Fl U Ar pwd .Op Fl y .Nm +.Ic ama +.Op device id +.Op generic args +.Op Fl f +.Op Fl q +.Op Fl s Ar max_sectors +.Nm .Ic persist .Op device id .Op generic args @@ -1599,6 +1606,40 @@ without prompting for confirmation .Pp The password for all HPA commands is limited to 32 characters, longer passwords will fail. +.It Ic ama +Update or report Accessible Max Address Configuration. +By default +.Nm +will print out the Accessible Max Address Configuration support and associated +settings of the device. +The +.Ic ama +command takes several optional arguments: +.Bl -tag -width 0n +.It Fl f +.Pp +Freeze the Accessible Max Address Configuration of the specified device. +.Pp +After command completion any other commands that update the configuration +shall be command aborted. +Frozen mode is disabled by power-off. +.It Fl q +.Pp +Be quiet, do not print any status messages. +.It Fl s Ar max_sectors +.Pp +Configures the maximum user accessible sectors of the device. +This will change the number of sectors the device reports. +.Pp +.Em WARNING! WARNING! WARNING! +.Pp +Changing the max sectors of a device using this option will make the data on +the device beyond the specified value indeterminate. +.Pp +Only one successful +.Fl s Ar max_sectors +call can be made without a power-on reset of the device. +.El .It Ic fwdownload Program firmware of the named .Tn SCSI Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:06:40 2019 (r350800) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:08:54 2019 (r350801) @@ -107,6 +107,7 @@ typedef enum { CAM_CMD_TIMESTAMP = 0x00000028, CAM_CMD_POWER_MODE = 0x0000002a, CAM_CMD_DEVTYPE = 0x0000002b, + CAM_CMD_AMA = 0x0000002c, } cam_cmdmask; typedef enum { @@ -239,6 +240,7 @@ static struct camcontrol_opts option_table[] = { {"fwdownload", CAM_CMD_DOWNLOAD_FW, CAM_ARG_NONE, "f:qsy"}, {"security", CAM_CMD_SECURITY, CAM_ARG_NONE, "d:e:fh:k:l:qs:T:U:y"}, {"hpa", CAM_CMD_HPA, CAM_ARG_NONE, "Pflp:qs:U:y"}, + {"ama", CAM_CMD_AMA, CAM_ARG_NONE, "fqs:"}, {"persist", CAM_CMD_PERSIST, CAM_ARG_NONE, "ai:I:k:K:o:ps:ST:U"}, {"attrib", CAM_CMD_ATTRIB, CAM_ARG_NONE, "a:ce:F:p:r:s:T:w:V:"}, {"opcodes", CAM_CMD_OPCODES, CAM_ARG_NONE, "No:s:T"}, @@ -358,6 +360,8 @@ static int atasecurity(struct cam_device *device, int int argc, char **argv, char *combinedopt); static int atahpa(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt); +static int ataama(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt); static int scsiprintoneopcode(struct cam_device *device, int req_opcode, int sa_set, int req_sa, uint8_t *buf, uint32_t valid_len); @@ -1275,8 +1279,9 @@ atahpa_print(struct ata_params *parm, u_int64_t hpasiz lba, hpasize); printf("HPA - Security "); - if (parm->support.command1 & ATA_SUPPORT_MAXSECURITY) - printf("yes\n"); + if (parm->support.command2 & ATA_SUPPORT_MAXSECURITY) + printf("yes %s\n", (parm->enabled.command2 & + ATA_SUPPORT_MAXSECURITY) ? "yes" : "no "); else printf("no\n"); } else { @@ -1284,6 +1289,32 @@ atahpa_print(struct ata_params *parm, u_int64_t hpasiz } } +static void +ataama_print(struct ata_params *parm, u_int64_t nativesize, int header) +{ + u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | + ((u_int32_t)parm->lba_size_2 << 16); + + u_int64_t lbasize48 = ((u_int64_t)parm->lba_size48_1) | + ((u_int64_t)parm->lba_size48_2 << 16) | + ((u_int64_t)parm->lba_size48_3 << 32) | + ((u_int64_t)parm->lba_size48_4 << 48); + + if (header) { + printf("\nFeature " + "Support Enabled Value\n"); + } + + printf("Accessible Max Address Config "); + if (parm->support2 & ATA_SUPPORT_AMAX_ADDR) { + u_int64_t lba = lbasize48 ? lbasize48 : lbasize; + printf("yes %s %ju/%ju\n", + (nativesize > lba) ? "yes" : "no ", lba, nativesize); + } else { + printf("no\n"); + } +} + static int atasata(struct ata_params *parm) { @@ -2110,7 +2141,95 @@ atahpa_freeze_lock(struct cam_device *device, int retr return atahpa_proc_resp(device, ccb, is48bit, NULL); } +static int +ata_get_native_max(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, + u_int64_t *nativesize) +{ + int error; + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_GET, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, nativesize); +} + +static int +ataama_set(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb, u_int64_t maxsize) +{ + int error; + + /* lba's are zero indexed so the max lba is requested max - 1 */ + if (maxsize) + maxsize--; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_SET, + /*lba*/maxsize, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); +} + +static int +ataama_freeze(struct cam_device *device, int retry_count, + u_int32_t timeout, union ccb *ccb) +{ + int error; + + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_AMAX_ADDR, + /*features*/ATA_AMAX_ADDR_FREEZE, + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + timeout ? timeout : 30 * 1000, + /*force48bit*/1); + + if (error) + return (error); + + return atahpa_proc_resp(device, ccb, /*is48bit*/1, NULL); +} + int ata_do_identify(struct cam_device *device, int retry_count, int timeout, union ccb *ccb, struct ata_params** ident_bufp) @@ -2241,7 +2360,7 @@ ataidentify(struct cam_device *device, int retry_count { union ccb *ccb; struct ata_params *ident_buf; - u_int64_t hpasize; + u_int64_t hpasize, nativesize; if ((ccb = cam_getccb(device)) == NULL) { warnx("couldn't allocate CCB"); @@ -2262,12 +2381,22 @@ ataidentify(struct cam_device *device, int retry_count } else { hpasize = 0; } + if (ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR) { + if (ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize) != 0) { + cam_freeccb(ccb); + return (1); + } + } else { + nativesize = 0; + } printf("%s%d: ", device->device_name, device->dev_unit_num); ata_print_ident(ident_buf); camxferrate(device); atacapprint(ident_buf); atahpa_print(ident_buf, hpasize, 0); + ataama_print(ident_buf, nativesize, 0); free(ident_buf); cam_freeccb(ccb); @@ -2757,7 +2886,7 @@ atahpa(struct cam_device *device, int retry_count, int return (1); } - if (security && !(ident_buf->support.command1 & ATA_SUPPORT_MAXSECURITY)) { + if (security && !(ident_buf->support.command2 & ATA_SUPPORT_MAXSECURITY)) { warnx("HPA Security is not supported by this device"); cam_freeccb(ccb); free(ident_buf); @@ -2786,7 +2915,7 @@ atahpa(struct cam_device *device, int retry_count, int if (error == 0) { error = atahpa_set_max(device, retry_count, timeout, ccb, is48bit, maxsize, persist); - if (error == 0) { + if (error == 0 && quiet == 0) { /* redo identify to get new lba values */ error = ata_do_identify(device, retry_count, timeout, ccb, @@ -2799,28 +2928,28 @@ atahpa(struct cam_device *device, int retry_count, int case ATA_HPA_ACTION_SET_PWD: error = atahpa_password(device, retry_count, timeout, ccb, is48bit, &pwd); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA password has been set\n"); break; case ATA_HPA_ACTION_LOCK: error = atahpa_lock(device, retry_count, timeout, ccb, is48bit); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been locked\n"); break; case ATA_HPA_ACTION_UNLOCK: error = atahpa_unlock(device, retry_count, timeout, ccb, is48bit, &pwd); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been unlocked\n"); break; case ATA_HPA_ACTION_FREEZE_LOCK: error = atahpa_freeze_lock(device, retry_count, timeout, ccb, is48bit); - if (error == 0) + if (error == 0 && quiet == 0) printf("HPA has been frozen\n"); break; @@ -2834,7 +2963,128 @@ atahpa(struct cam_device *device, int retry_count, int return (error); } +enum { + ATA_AMA_ACTION_PRINT, + ATA_AMA_ACTION_SET_MAX, + ATA_AMA_ACTION_FREEZE_LOCK +}; + static int +ataama(struct cam_device *device, int retry_count, int timeout, + int argc, char **argv, char *combinedopt) +{ + union ccb *ccb; + struct ata_params *ident_buf; + struct ccb_getdev cgd; + int error, quiet, c, action, actions; + u_int64_t nativesize, maxsize; + + actions = 0; + quiet = 0; + maxsize = 0; + + /* default action is to print AMA information */ + action = ATA_AMA_ACTION_PRINT; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch(c){ + case 's': + action = ATA_AMA_ACTION_SET_MAX; + maxsize = strtoumax(optarg, NULL, 0); + actions++; + break; + + case 'f': + action = ATA_AMA_ACTION_FREEZE_LOCK; + actions++; + break; + + case 'q': + quiet++; + break; + } + } + + if (actions > 1) { + warnx("too many AMA actions specified"); + return (1); + } + + if (get_cgd(device, &cgd) != 0) { + warnx("couldn't get CGD"); + return (1); + } + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("couldn't allocate CCB"); + return (1); + } + + error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf); + if (error != 0) { + cam_freeccb(ccb); + return (1); + } + + if (quiet == 0) { + printf("%s%d: ", device->device_name, device->dev_unit_num); + ata_print_ident(ident_buf); + camxferrate(device); + } + + if (action == ATA_AMA_ACTION_PRINT) { + error = ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); + if (error == 0) + ataama_print(ident_buf, nativesize, 1); + + cam_freeccb(ccb); + free(ident_buf); + return (error); + } + + if (!(ident_buf->support2 & ATA_SUPPORT_AMAX_ADDR)) { + warnx("Accessible Max Address is not supported by this device"); + cam_freeccb(ccb); + free(ident_buf); + return (1); + } + + switch(action) { + case ATA_AMA_ACTION_SET_MAX: + error = ata_get_native_max(device, retry_count, timeout, ccb, + &nativesize); + if (error == 0) { + error = ataama_set(device, retry_count, timeout, + ccb, maxsize); + if (error == 0 && quiet == 0) { + /* redo identify to get new lba values */ + error = ata_do_identify(device, retry_count, + timeout, ccb, &ident_buf); + ataama_print(ident_buf, nativesize, 1); + } + } + break; + + case ATA_AMA_ACTION_FREEZE_LOCK: + error = ataama_freeze(device, retry_count, timeout, + ccb); + if (error == 0 && quiet == 0) + printf("Accessible Max Address has been frozen\n"); + break; + + default: + errx(1, "Option currently not supported"); + } + + cam_freeccb(ccb); + free(ident_buf); + + return (error); +} + +static int atasecurity(struct cam_device *device, int retry_count, int timeout, int argc, char **argv, char *combinedopt) { @@ -9191,6 +9441,7 @@ usage(int printlong) " [-U ] [-y]\n" " camcontrol hpa [dev_id][generic args] [-f] [-l] [-P] [-p pwd]\n" " [-q] [-s max_sectors] [-U pwd] [-y]\n" +" camcontrol ama [dev_id][generic args] [-f] [-q] [-s max_sectors]\n" " camcontrol persist [dev_id][generic args] <-i action|-o action>\n" " [-a][-I tid][-k key][-K sa_key][-p][-R rtp]\n" " [-s scope][-S][-T type][-U]\n" @@ -9391,6 +9642,11 @@ usage(int printlong) " device\n" "-U pwd unlock the HPA configuration of the device\n" "-y don't ask any questions\n" +"ama arguments:\n" +"-f freeze the AMA configuration of the device\n" +"-q be quiet, do not print any status messages\n" +"-s sectors configures the maximum user accessible sectors of the\n" +" device\n" "persist arguments:\n" "-i action specify read_keys, read_reservation, report_cap, or\n" " read_full_status\n" @@ -9721,6 +9977,10 @@ main(int argc, char **argv) break; case CAM_CMD_HPA: error = atahpa(cam_dev, retry_count, timeout, + argc, argv, combinedopt); + break; + case CAM_CMD_AMA: + error = ataama(cam_dev, retry_count, timeout, argc, argv, combinedopt); break; #endif /* MINIMALISTIC */ Modified: stable/11/sys/cam/ata/ata_all.c ============================================================================== --- stable/11/sys/cam/ata/ata_all.c Thu Aug 8 22:06:40 2019 (r350800) +++ stable/11/sys/cam/ata/ata_all.c Thu Aug 8 22:08:54 2019 (r350801) @@ -182,7 +182,13 @@ ata_op_string(struct ata_cmd *cmd) return ("SEP_ATTN"); case 0x70: return ("SEEK"); case 0x77: return ("SET_DATE_TIME_EXT"); - case 0x78: return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); + case 0x78: + switch (cmd->features) { + case 0x00: return ("GET_NATIVE_MAX_ADDRESS_EXT"); + case 0x01: return ("SET_ACCESSIBLE_MAX_ADDRESS_EXT"); + case 0x02: return ("FREEZE_ACCESSIBLE_MAX_ADDRESS_EXT"); + } + return ("ACCESSIBLE_MAX_ADDRESS_CONFIGURATION"); case 0x7C: return ("REMOVE_ELEMENT_AND_TRUNCATE"); case 0x87: return ("CFA_TRANSLATE_SECTOR"); case 0x90: return ("EXECUTE_DEVICE_DIAGNOSTIC"); Modified: stable/11/sys/sys/ata.h ============================================================================== --- stable/11/sys/sys/ata.h Thu Aug 8 22:06:40 2019 (r350800) +++ stable/11/sys/sys/ata.h Thu Aug 8 22:08:54 2019 (r350801) @@ -240,12 +240,15 @@ struct ata_params { #define ATA_SUPPORT_FREEFALL 0x0020 #define ATA_SUPPORT_SENSE_REPORT 0x0040 #define ATA_SUPPORT_EPC 0x0080 +#define ATA_SUPPORT_AMAX_ADDR 0x0100 +#define ATA_SUPPORT_DSN 0x0200 /*120*/ u_int16_t enabled2; #define ATA_ENABLED_WRITEREADVERIFY 0x0002 #define ATA_ENABLED_WRITEUNCORREXT 0x0004 #define ATA_ENABLED_FREEFALL 0x0020 #define ATA_ENABLED_SENSE_REPORT 0x0040 #define ATA_ENABLED_EPC 0x0080 +#define ATA_ENABLED_DSN 0x0200 u_int16_t reserved121[6]; /*127*/ u_int16_t removable_status; /*128*/ u_int16_t security_status; @@ -434,6 +437,10 @@ struct ata_params { #define ATA_RFPDMA_ZAC_MGMT_IN 0x02 /* NCQ ZAC mgmt in w/data */ #define ATA_SEP_ATTN 0x67 /* SEP request */ #define ATA_SEEK 0x70 /* seek */ +#define ATA_AMAX_ADDR 0x78 /* Accessible Max Address */ +#define ATA_AMAX_ADDR_GET 0x00 /* GET NATIVE MAX ADDRESS EXT */ +#define ATA_AMAX_ADDR_SET 0x01 /* SET ACCESSIBLE MAX ADDRESS EXT */ +#define ATA_AMAX_ADDR_FREEZE 0x02 /* FREEZE ACCESSIBLE MAX ADDRESS EXT */ #define ATA_ZAC_MANAGEMENT_OUT 0x9f /* ZAC management out */ #define ATA_ZM_CLOSE_ZONE 0x01 /* close zone */ #define ATA_ZM_FINISH_ZONE 0x02 /* finish zone */ From owner-svn-src-all@freebsd.org Thu Aug 8 22:09:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44E9EB5107; Thu, 8 Aug 2019 22:09:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464Mws16tzz3FRY; Thu, 8 Aug 2019 22:09:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A0D33E94; Thu, 8 Aug 2019 22:09:33 +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 x78M9Wds041934; Thu, 8 Aug 2019 22:09:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78M9Wm2041933; Thu, 8 Aug 2019 22:09:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082209.x78M9Wm2041933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:09:32 +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: r350802 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:09:33 -0000 Author: mav Date: Thu Aug 8 22:09:32 2019 New Revision: 350802 URL: https://svnweb.freebsd.org/changeset/base/350802 Log: MFC r350150: Properly report ACS revisions alike to kernel. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:08:54 2019 (r350801) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:09:32 2019 (r350802) @@ -1330,6 +1330,7 @@ atasata(struct ata_params *parm) static void atacapprint(struct ata_params *parm) { + const char *proto; u_int32_t lbasize = (u_int32_t)parm->lba_size_1 | ((u_int32_t)parm->lba_size_2 << 16); @@ -1340,7 +1341,19 @@ atacapprint(struct ata_params *parm) printf("\n"); printf("protocol "); - printf("ATA/ATAPI-%d", ata_version(parm->version_major)); + proto = (parm->config == ATA_PROTO_CFA) ? "CFA" : + (parm->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA"; + if (ata_version(parm->version_major) == 0) { + printf("%s", proto); + } else if (ata_version(parm->version_major) <= 7) { + printf("%s-%d", proto, + ata_version(parm->version_major)); + } else if (ata_version(parm->version_major) == 8) { + printf("%s8-ACS", proto); + } else { + printf("ACS-%d %s", + ata_version(parm->version_major) - 7, proto); + } if (parm->satacapabilities && parm->satacapabilities != 0xffff) { if (parm->satacapabilities & ATA_SATA_GEN3) printf(" SATA 3.x\n"); From owner-svn-src-all@freebsd.org Thu Aug 8 22:11:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEBA3B5250; Thu, 8 Aug 2019 22:11:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464MyZ4D4qz3Fdf; Thu, 8 Aug 2019 22:11:02 +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 71DA83FF6; Thu, 8 Aug 2019 22:11:02 +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 x78MB2Zc042127; Thu, 8 Aug 2019 22:11:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78MB2Nl042125; Thu, 8 Aug 2019 22:11:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082211.x78MB2Nl042125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:11: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: r350803 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:11:02 -0000 Author: mav Date: Thu Aug 8 22:11:01 2019 New Revision: 350803 URL: https://svnweb.freebsd.org/changeset/base/350803 Log: MFC r350214: Unify BTL parsing for `camcontrol debug` and `reset`. This makes `camcontrol debug` also allow peripheral device specification. While there, make BTL parser more strict and switch from strtok() to strsep(). Modified: stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 22:09:32 2019 (r350802) +++ stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 22:11:01 2019 (r350803) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2019 +.Dd July 22, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -185,7 +185,7 @@ .Op Fl X .Op Fl c .Op Fl p -.Aq all|off|bus Ns Op :target Ns Op :lun +.Aq all | off | device id | bus Ns Op :target Ns Op :lun .Nm .Ic tags .Op device id Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:09:32 2019 (r350802) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:11:01 2019 (r350803) @@ -3376,6 +3376,66 @@ atasecurity(struct cam_device *device, int retry_count #endif /* MINIMALISTIC */ /* + * Convert periph name into a bus, target and lun. + * + * Returns the number of parsed components, or 0. + */ +static int +parse_btl_name(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, + cam_argmask *arglst) +{ + int fd; + union ccb ccb; + + bzero(&ccb, sizeof(ccb)); + ccb.ccb_h.func_code = XPT_GDEVLIST; + if (cam_get_device(tstr, ccb.cgdl.periph_name, + sizeof(ccb.cgdl.periph_name), &ccb.cgdl.unit_number) == -1) { + warnx("%s", cam_errbuf); + return (0); + } + + /* + * Attempt to get the passthrough device. This ioctl will + * fail if the device name is null, if the device doesn't + * exist, or if the passthrough driver isn't in the kernel. + */ + if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { + warn("Unable to open %s", XPT_DEVICE); + return (0); + } + if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) { + warn("Unable to find bus:target:lun for device %s%d", + ccb.cgdl.periph_name, ccb.cgdl.unit_number); + close(fd); + return (0); + } + close(fd); + if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + const struct cam_status_entry *entry; + + entry = cam_fetch_status_entry(ccb.ccb_h.status); + warnx("Unable to find bus:target_lun for device %s%d, " + "CAM status: %s (%#x)", + ccb.cgdl.periph_name, ccb.cgdl.unit_number, + entry ? entry->status_text : "Unknown", + ccb.ccb_h.status); + return (0); + } + + /* + * The kernel fills in the bus/target/lun. We don't + * need the passthrough device name and unit number since + * we aren't going to open it. + */ + *bus = ccb.ccb_h.path_id; + *target = ccb.ccb_h.target_id; + *lun = ccb.ccb_h.target_lun; + *arglst |= CAM_ARG_BUS | CAM_ARG_TARGET | CAM_ARG_LUN; + return (3); +} + +/* * Parse out a bus, or a bus, target and lun in the following * format: * bus @@ -3388,25 +3448,43 @@ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst) { - char *tmpstr; + char *tmpstr, *end; int convs = 0; + *bus = CAM_BUS_WILDCARD; + *target = CAM_TARGET_WILDCARD; + *lun = CAM_LUN_WILDCARD; + while (isspace(*tstr) && (*tstr != '\0')) tstr++; - tmpstr = (char *)strtok(tstr, ":"); + if (strncasecmp(tstr, "all", strlen("all")) == 0) { + arglist |= CAM_ARG_BUS; + return (1); + } + + if (!isdigit(*tstr)) + return (parse_btl_name(tstr, bus, target, lun, arglst)); + + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *bus = strtol(tmpstr, NULL, 0); + *bus = strtol(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_BUS; convs++; - tmpstr = (char *)strtok(NULL, ":"); + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *target = strtol(tmpstr, NULL, 0); + *target = strtol(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_TARGET; convs++; - tmpstr = (char *)strtok(NULL, ":"); + tmpstr = strsep(&tstr, ":"); if ((tmpstr != NULL) && (*tmpstr != '\0')) { - *lun = strtol(tmpstr, NULL, 0); + *lun = strtoll(tmpstr, &end, 0); + if (*end != '\0') + return (0); *arglst |= CAM_ARG_LUN; convs++; } @@ -3420,7 +3498,7 @@ static int dorescan_or_reset(int argc, char **argv, int rescan) { static const char must[] = - "you must specify \"all\", a bus, or a bus:target:lun to %s"; + "you must specify \"all\", a bus, a bus:target:lun or periph to %s"; int rv, error = 0; path_id_t bus = CAM_BUS_WILDCARD; target_id_t target = CAM_TARGET_WILDCARD; @@ -3437,118 +3515,19 @@ dorescan_or_reset(int argc, char **argv, int rescan) tstr++; if (strncasecmp(tstr, "all", strlen("all")) == 0) arglist |= CAM_ARG_BUS; - else if (isdigit(*tstr)) { + else { rv = parse_btl(argv[optind], &bus, &target, &lun, &arglist); if (rv != 1 && rv != 3) { - warnx(must, rescan? "rescan" : "reset"); + warnx(must, rescan ? "rescan" : "reset"); return (1); } - } else { - char name[30]; - int unit; - int fd = -1; - union ccb ccb; - - /* - * Note that resetting or rescanning a device used to - * require a bus or bus:target:lun. This is because the - * device in question may not exist and you're trying to - * get the controller to rescan to find it. It may also be - * because the device is hung / unresponsive, and opening - * an unresponsive device is not desireable. - * - * It can be more convenient to reference a device by - * peripheral name and unit number, though, and it is - * possible to get the bus:target:lun for devices that - * currently exist in the EDT. So this can work for - * devices that we want to reset, or devices that exist - * that we want to rescan, but not devices that do not - * exist yet. - * - * So, we are careful here to look up the bus/target/lun - * for the device the user wants to operate on, specified - * by peripheral instance (e.g. da0, pass32) without - * actually opening that device. The process is similar to - * what cam_lookup_pass() does, except that we don't - * actually open the passthrough driver instance in the end. - */ - - if (cam_get_device(tstr, name, sizeof(name), &unit) == -1) { - warnx("%s", cam_errbuf); - error = 1; - goto bailout; - } - - if ((fd = open(XPT_DEVICE, O_RDWR)) == -1) { - warn("Unable to open %s", XPT_DEVICE); - error = 1; - goto bailout; - } - - bzero(&ccb, sizeof(ccb)); - - /* - * The function code isn't strictly necessary for the - * GETPASSTHRU ioctl. - */ - ccb.ccb_h.func_code = XPT_GDEVLIST; - - /* - * These two are necessary for the GETPASSTHRU ioctl to - * work. - */ - strlcpy(ccb.cgdl.periph_name, name, - sizeof(ccb.cgdl.periph_name)); - ccb.cgdl.unit_number = unit; - - /* - * Attempt to get the passthrough device. This ioctl will - * fail if the device name is null, if the device doesn't - * exist, or if the passthrough driver isn't in the kernel. - */ - if (ioctl(fd, CAMGETPASSTHRU, &ccb) == -1) { - warn("Unable to find bus:target:lun for device %s%d", - name, unit); - error = 1; - close(fd); - goto bailout; - } - if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - const struct cam_status_entry *entry; - - entry = cam_fetch_status_entry(ccb.ccb_h.status); - warnx("Unable to find bus:target_lun for device %s%d, " - "CAM status: %s (%#x)", name, unit, - entry ? entry->status_text : "Unknown", - ccb.ccb_h.status); - error = 1; - close(fd); - goto bailout; - } - - /* - * The kernel fills in the bus/target/lun. We don't - * need the passthrough device name and unit number since - * we aren't going to open it. - */ - bus = ccb.ccb_h.path_id; - target = ccb.ccb_h.target_id; - lun = ccb.ccb_h.target_lun; - - arglist |= CAM_ARG_BUS | CAM_ARG_TARGET | CAM_ARG_LUN; - - close(fd); } - if ((arglist & CAM_ARG_BUS) - && (arglist & CAM_ARG_TARGET) - && (arglist & CAM_ARG_LUN)) + if (arglist & CAM_ARG_LUN) error = scanlun_or_reset_dev(bus, target, lun, rescan); else error = rescan_or_reset_bus(bus, rescan); -bailout: - return (error); } @@ -4935,9 +4914,9 @@ camdebug(int argc, char **argv, char *combinedopt) path_id_t bus = CAM_BUS_WILDCARD; target_id_t target = CAM_TARGET_WILDCARD; lun_id_t lun = CAM_LUN_WILDCARD; - char *tstr, *tmpstr = NULL; + char *tstr; union ccb ccb; - int error = 0; + int error = 0, rv; bzero(&ccb, sizeof(union ccb)); @@ -4976,23 +4955,16 @@ camdebug(int argc, char **argv, char *combinedopt) } } - if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - warnx("error opening transport layer device %s", XPT_DEVICE); - warn("%s", XPT_DEVICE); - return (1); - } argc -= optind; argv += optind; if (argc <= 0) { warnx("you must specify \"off\", \"all\" or a bus,"); - warnx("bus:target, or bus:target:lun"); - close(fd); + warnx("bus:target, bus:target:lun or periph"); return (1); } tstr = *argv; - while (isspace(*tstr) && (*tstr != '\0')) tstr++; @@ -5001,66 +4973,54 @@ camdebug(int argc, char **argv, char *combinedopt) arglist &= ~(CAM_ARG_DEBUG_INFO|CAM_ARG_DEBUG_PERIPH| CAM_ARG_DEBUG_TRACE|CAM_ARG_DEBUG_SUBTRACE| CAM_ARG_DEBUG_XPT|CAM_ARG_DEBUG_PROBE); - } else if (strncmp(tstr, "all", 3) != 0) { - tmpstr = (char *)strtok(tstr, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - bus = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_BUS; - tmpstr = (char *)strtok(NULL, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - target = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_TARGET; - tmpstr = (char *)strtok(NULL, ":"); - if ((tmpstr != NULL) && (*tmpstr != '\0')){ - lun = strtol(tmpstr, NULL, 0); - arglist |= CAM_ARG_LUN; - } - } - } else { - error = 1; + } else { + rv = parse_btl(tstr, &bus, &target, &lun, &arglist); + if (rv < 1) { warnx("you must specify \"all\", \"off\", or a bus,"); - warnx("bus:target, or bus:target:lun to debug"); + warnx("bus:target, bus:target:lun or periph to debug"); + return (1); } } - if (error == 0) { + if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { + warnx("error opening transport layer device %s", XPT_DEVICE); + warn("%s", XPT_DEVICE); + return (1); + } - ccb.ccb_h.func_code = XPT_DEBUG; - ccb.ccb_h.path_id = bus; - ccb.ccb_h.target_id = target; - ccb.ccb_h.target_lun = lun; + ccb.ccb_h.func_code = XPT_DEBUG; + ccb.ccb_h.path_id = bus; + ccb.ccb_h.target_id = target; + ccb.ccb_h.target_lun = lun; - if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - warn("CAMIOCOMMAND ioctl failed"); + if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { + warn("CAMIOCOMMAND ioctl failed"); + error = 1; + } else { + if ((ccb.ccb_h.status & CAM_STATUS_MASK) == + CAM_FUNC_NOTAVAIL) { + warnx("CAM debugging not available"); + warnx("you need to put options CAMDEBUG in" + " your kernel config file!"); error = 1; - } - - if (error == 0) { - if ((ccb.ccb_h.status & CAM_STATUS_MASK) == - CAM_FUNC_NOTAVAIL) { - warnx("CAM debugging not available"); - warnx("you need to put options CAMDEBUG in" - " your kernel config file!"); - error = 1; - } else if ((ccb.ccb_h.status & CAM_STATUS_MASK) != - CAM_REQ_CMP) { - warnx("XPT_DEBUG CCB failed with status %#x", - ccb.ccb_h.status); - error = 1; + } else if ((ccb.ccb_h.status & CAM_STATUS_MASK) != + CAM_REQ_CMP) { + warnx("XPT_DEBUG CCB failed with status %#x", + ccb.ccb_h.status); + error = 1; + } else { + if (ccb.cdbg.flags == CAM_DEBUG_NONE) { + fprintf(stderr, + "Debugging turned off\n"); } else { - if (ccb.cdbg.flags == CAM_DEBUG_NONE) { - fprintf(stderr, - "Debugging turned off\n"); - } else { - fprintf(stderr, - "Debugging enabled for " - "%d:%d:%jx\n", - bus, target, (uintmax_t)lun); - } + fprintf(stderr, + "Debugging enabled for " + "%d:%d:%jx\n", + bus, target, (uintmax_t)lun); } } - close(fd); } + close(fd); return (error); } @@ -9429,7 +9389,7 @@ usage(int printlong) " camcontrol smpphylist [dev_id][generic args][-l][-q]\n" " camcontrol smpmaninfo [dev_id][generic args][-l]\n" " camcontrol debug [-I][-P][-T][-S][-X][-c]\n" -" \n" +" \n" " camcontrol tags [dev_id][generic args] [-N tags] [-q] [-v]\n" " camcontrol negotiate [dev_id][generic args] [-a][-c]\n" " [-D ][-M mode][-O offset]\n" From owner-svn-src-all@freebsd.org Thu Aug 8 22:16:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47026B548A; Thu, 8 Aug 2019 22:16:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464N4m1sf7z3G18; Thu, 8 Aug 2019 22:16:24 +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 06EFE4085; Thu, 8 Aug 2019 22:16:24 +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 x78MGO79048031; Thu, 8 Aug 2019 22:16:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78MGKAk048013; Thu, 8 Aug 2019 22:16:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082216.x78MGKAk048013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:16: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: r350804 - in stable/11/sys: cam cam/ata cam/nvme cam/scsi dev/hyperv/storvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11/sys: cam cam/ata cam/nvme cam/scsi dev/hyperv/storvsc X-SVN-Commit-Revision: 350804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:16:24 -0000 Author: mav Date: Thu Aug 8 22:16:19 2019 New Revision: 350804 URL: https://svnweb.freebsd.org/changeset/base/350804 Log: MFC r326645 (by imp): Define xpt_path_inq. This provides a nice wrarpper around the XPT_PATH_INQ ccb creation and calling. Modified: stable/11/sys/cam/ata/ata_da.c stable/11/sys/cam/ata/ata_xpt.c stable/11/sys/cam/cam_periph.c stable/11/sys/cam/cam_xpt.c stable/11/sys/cam/cam_xpt.h stable/11/sys/cam/nvme/nvme_da.c stable/11/sys/cam/nvme/nvme_xpt.c stable/11/sys/cam/scsi/scsi_cd.c stable/11/sys/cam/scsi/scsi_ch.c stable/11/sys/cam/scsi/scsi_da.c stable/11/sys/cam/scsi/scsi_pass.c stable/11/sys/cam/scsi/scsi_pt.c stable/11/sys/cam/scsi/scsi_sa.c stable/11/sys/cam/scsi/scsi_sg.c stable/11/sys/cam/scsi/scsi_target.c stable/11/sys/cam/scsi/scsi_xpt.c stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/ata/ata_da.c Thu Aug 8 22:16:19 2019 (r350804) @@ -1751,10 +1751,7 @@ adaregister(struct cam_periph *periph, void *arg) else softc->quirks = ADA_Q_NONE; - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); TASK_INIT(&softc->sysctl_task, 0, adasysctlinit, periph); Modified: stable/11/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/11/sys/cam/ata/ata_xpt.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/ata/ata_xpt.c Thu Aug 8 22:16:19 2019 (r350804) @@ -994,10 +994,7 @@ noerror: if (path->device->mintags != 0 && path->bus->sim->max_tagged_dev_openings != 0) { /* Check if the SIM does not want queued commands. */ - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_inquiry & PI_TAG_ABLE)) { /* Report SIM which tags are allowed. */ @@ -1400,10 +1397,7 @@ ata_scan_bus(struct cam_periph *periph, union ccb *req xpt_done(request_ccb); return; } - xpt_setup_ccb(&work_ccb->ccb_h, request_ccb->ccb_h.path, - request_ccb->ccb_h.pinfo.priority); - work_ccb->ccb_h.func_code = XPT_PATH_INQ; - xpt_action(work_ccb); + xpt_path_inq(&work_ccb->cpi, request_ccb->ccb_h.path); if (work_ccb->ccb_h.status != CAM_REQ_CMP) { request_ccb->ccb_h.status = work_ccb->ccb_h.status; xpt_free_ccb(work_ccb); @@ -1558,10 +1552,7 @@ ata_scan_lun(struct cam_periph *periph, struct cam_pat CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_scan_lun\n")); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); - + xpt_path_inq(&cpi, path); if (cpi.ccb_h.status != CAM_REQ_CMP) { if (request_ccb != NULL) { request_ccb->ccb_h.status = cpi.ccb_h.status; @@ -1670,9 +1661,7 @@ ata_device_transport(struct cam_path *path) struct ata_params *ident_buf = NULL; /* Get transport information from the SIM */ - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); path->device->transport = cpi.transport; if ((path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) != 0) @@ -1967,9 +1956,7 @@ ata_set_transfer_settings(struct ccb_trans_settings *c scsi = &cts->proto_specific.scsi; else scsi = NULL; - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); /* Sanity checking */ if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0 @@ -2101,9 +2088,7 @@ ata_announce_periph(struct cam_periph *periph) if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; /* Ask the SIM for its base transfer speed */ - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); /* Report connection speed */ speed = cpi.base_transfer_speed; if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { Modified: stable/11/sys/cam/cam_periph.c ============================================================================== --- stable/11/sys/cam/cam_periph.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/cam_periph.c Thu Aug 8 22:16:19 2019 (r350804) @@ -738,9 +738,7 @@ camperiphfree(struct cam_periph *periph) arg = &ccb; break; case AC_PATH_REGISTERED: - ccb.ccb_h.func_code = XPT_PATH_INQ; - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - xpt_action(&ccb); + xpt_path_inq(&ccb.cpi, periph->path); arg = &ccb; break; default: Modified: stable/11/sys/cam/cam_xpt.c ============================================================================== --- stable/11/sys/cam/cam_xpt.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/cam_xpt.c Thu Aug 8 22:16:19 2019 (r350804) @@ -2491,9 +2491,7 @@ xptsetasyncbusfunc(struct cam_eb *bus, void *arg) CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); xpt_path_lock(&path); - xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, &path); csa->callback(csa->callback_arg, AC_PATH_REGISTERED, &path, &cpi); @@ -3937,9 +3935,7 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, return (CAM_RESRC_UNAVAIL); } - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); if (cpi.ccb_h.status == CAM_REQ_CMP) { struct xpt_xport **xpt; Modified: stable/11/sys/cam/cam_xpt.h ============================================================================== --- stable/11/sys/cam/cam_xpt.h Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/cam_xpt.h Thu Aug 8 22:16:19 2019 (r350804) @@ -32,6 +32,12 @@ #ifndef _CAM_CAM_XPT_H #define _CAM_CAM_XPT_H 1 +#ifdef _KERNEL +#include +#include +#endif + + /* Forward Declarations */ union ccb; struct cam_periph; @@ -134,6 +140,20 @@ void xpt_copy_path(struct cam_path *new_path, struct cam_path *path); void xpt_release_path(struct cam_path *path); + +/* + * Perform a path inquiry at the request priority. The bzero may be + * unnecessary. + */ +static inline void +xpt_path_inq(struct ccb_pathinq *cpi, struct cam_path *path) +{ + + bzero(cpi, sizeof(*cpi)); + xpt_setup_ccb(&cpi->ccb_h, path, CAM_PRIORITY_NORMAL); + cpi->ccb_h.func_code = XPT_PATH_INQ; + xpt_action((union ccb *)cpi); +} #endif /* _KERNEL */ Modified: stable/11/sys/cam/nvme/nvme_da.c ============================================================================== --- stable/11/sys/cam/nvme/nvme_da.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/nvme/nvme_da.c Thu Aug 8 22:16:19 2019 (r350804) @@ -716,10 +716,7 @@ ndaregister(struct cam_periph *periph, void *arg) softc->quirks = NDA_Q_NONE; - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); TASK_INIT(&softc->sysctl_task, 0, ndasysctlinit, periph); Modified: stable/11/sys/cam/nvme/nvme_xpt.c ============================================================================== --- stable/11/sys/cam/nvme/nvme_xpt.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/nvme/nvme_xpt.c Thu Aug 8 22:16:19 2019 (r350804) @@ -364,9 +364,7 @@ nvme_scan_lun(struct cam_periph *periph, struct cam_pa CAM_DEBUG(path, CAM_DEBUG_TRACE, ("nvme_scan_lun\n")); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); if (cpi.ccb_h.status != CAM_REQ_CMP) { if (request_ccb != NULL) { @@ -457,9 +455,7 @@ nvme_device_transport(struct cam_path *path) /* XXX get data from nvme namespace and other info ??? */ /* Get transport information from the SIM */ - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); path->device->transport = cpi.transport; path->device->transport_version = cpi.transport_version; @@ -628,9 +624,7 @@ nvme_announce_periph(struct cam_periph *periph) if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; /* Ask the SIM for its base transfer speed */ - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); /* XXX NVME STUFF HERE */ printf("\n"); } Modified: stable/11/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_cd.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_cd.c Thu Aug 8 22:16:19 2019 (r350804) @@ -587,10 +587,7 @@ cdregister(struct cam_periph *periph, void *arg) softc->quirks = CD_Q_NONE; /* Check if the SIM does not want 6 byte commands */ - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE)) softc->quirks |= CD_Q_10_BYTE_ONLY; Modified: stable/11/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_ch.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_ch.c Thu Aug 8 22:16:19 2019 (r350804) @@ -402,10 +402,7 @@ chregister(struct cam_periph *periph, void *arg) if (cgd->inq_data.version <= SCSI_REV_2) softc->quirks |= CH_Q_NO_DVCID; - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); /* * Changers don't have a blocksize, and obviously don't support Modified: stable/11/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_da.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_da.c Thu Aug 8 22:16:19 2019 (r350804) @@ -2517,10 +2517,7 @@ daregister(struct cam_periph *periph, void *arg) softc->quirks = DA_Q_NONE; /* Check if the SIM does not want 6 byte commands */ - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); if (cpi.ccb_h.status == CAM_REQ_CMP && (cpi.hba_misc & PIM_NO_6_BYTE)) softc->quirks |= DA_Q_NO_6_BYTE; Modified: stable/11/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_pass.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_pass.c Thu Aug 8 22:16:19 2019 (r350804) @@ -589,10 +589,7 @@ passregister(struct cam_periph *periph, void *arg) softc->io_zone_size = MAXPHYS; knlist_init_mtx(&softc->read_select.si_note, cam_periph_mtx(periph)); - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); if (cpi.maxio == 0) softc->maxio = DFLTPHYS; /* traditional default */ Modified: stable/11/sys/cam/scsi/scsi_pt.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_pt.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_pt.c Thu Aug 8 22:16:19 2019 (r350804) @@ -275,10 +275,7 @@ ptctor(struct cam_periph *periph, void *arg) periph->softc = softc; - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); cam_periph_unlock(periph); Modified: stable/11/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sa.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_sa.c Thu Aug 8 22:16:19 2019 (r350804) @@ -2425,10 +2425,7 @@ saregister(struct cam_periph *periph, void *arg) softc->flags |= SA_FLAG_PROTECT_SUPP; } - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); /* * The SA driver supports a blocksize, but we don't know the Modified: stable/11/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sg.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_sg.c Thu Aug 8 22:16:19 2019 (r350804) @@ -322,10 +322,7 @@ sgregister(struct cam_periph *periph, void *arg) TAILQ_INIT(&softc->rdwr_done); periph->softc = softc; - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); if (cpi.maxio == 0) softc->maxio = DFLTPHYS; /* traditional default */ Modified: stable/11/sys/cam/scsi/scsi_target.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_target.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_target.c Thu Aug 8 22:16:19 2019 (r350804) @@ -391,9 +391,7 @@ targenable(struct targ_softc *softc, struct cam_path * return (CAM_LUN_ALRDY_ENA); /* Make sure SIM supports target mode */ - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); status = cpi.ccb_h.status & CAM_STATUS_MASK; if (status != CAM_REQ_CMP) { printf("pathinq failed, status %#x\n", status); Modified: stable/11/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_xpt.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/cam/scsi/scsi_xpt.c Thu Aug 8 22:16:19 2019 (r350804) @@ -697,9 +697,7 @@ probeschedule(struct cam_periph *periph) softc = (probe_softc *)periph->softc; ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, periph->path); /* * If a device has gone away and another device, or the same one, Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Aug 8 22:11:01 2019 (r350803) +++ stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Aug 8 22:16:19 2019 (r350804) @@ -2350,10 +2350,7 @@ storvsc_ada_probe_veto(void *arg __unused, struct cam_ if (path->device->protocol == PROTO_ATA) { struct ccb_pathinq cpi; - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); + xpt_path_inq(&cpi, path); if (cpi.ccb_h.status == CAM_REQ_CMP && cpi.hba_vendor == PCI_VENDOR_INTEL && cpi.hba_device == PCI_PRODUCT_PIIX4) { From owner-svn-src-all@freebsd.org Thu Aug 8 22:17:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AC6EB5528; Thu, 8 Aug 2019 22:17:42 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464N6F6PD8z3G8t; Thu, 8 Aug 2019 22:17: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 BCE194091; Thu, 8 Aug 2019 22:17: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 x78MHfwl048144; Thu, 8 Aug 2019 22:17:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78MHfij048142; Thu, 8 Aug 2019 22:17:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082217.x78MHfij048142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:17:41 +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: r350805 - stable/11/sys/cam/ata X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ata X-SVN-Commit-Revision: 350805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:17:42 -0000 Author: mav Date: Thu Aug 8 22:17:41 2019 New Revision: 350805 URL: https://svnweb.freebsd.org/changeset/base/350805 Log: MFC r350233: Make CAM ATA stack handle disk resizes. While for ATA disks resize is even more rare situation than for SCSI, it may happen in case of HPA or AMA being used. Make ATA XPT report minor IDENTIFY DATA change to upper layers with AC_GETDEV_CHANGED, and ada(4) periph driver handle that event, recalculating all the disk properties and signalling resize to GEOM. Since ATA has no mechanism of UNIT ATTENTIONs, like SCSI, it has no way to detect that something has changed. That is why this functionality depends on explicit reprobe via XPT_REPROBE_LUN call. Relnotes: yes Modified: stable/11/sys/cam/ata/ata_da.c stable/11/sys/cam/ata/ata_xpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Thu Aug 8 22:16:19 2019 (r350804) +++ stable/11/sys/cam/ata/ata_da.c Thu Aug 8 22:17:41 2019 (r350805) @@ -246,8 +246,9 @@ struct ada_softc { int periodic_read_error; int periodic_read_count; #endif - struct disk_params params; - struct disk *disk; + struct ccb_pathinq cpi; + struct disk_params params; + struct disk *disk; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -798,6 +799,8 @@ static void adasysctlinit(void *context, int pending) static int adagetattr(struct bio *bp); static void adasetflags(struct ada_softc *softc, struct ccb_getdev *cgd); +static void adasetgeom(struct ada_softc *softc, + struct ccb_getdev *cgd); static periph_ctor_t adaregister; static void ada_dsmtrim(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio); @@ -813,8 +816,6 @@ static void adadone(struct cam_periph *periph, union ccb *done_ccb); static int adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags); -static void adagetparams(struct cam_periph *periph, - struct ccb_getdev *cgd); static timeout_t adasendorderedtag; static void adashutdown(void *arg, int howto); static void adasuspend(void *arg); @@ -1317,9 +1318,11 @@ adaasync(void *callback_arg, u_int32_t code, xpt_action((union ccb *)&cgd); /* - * Set/clear support flags based on the new Identify data. + * Update our information based on the new Identify data. */ adasetflags(softc, &cgd); + adasetgeom(softc, &cgd); + disk_resize(softc->disk, M_NOWAIT); cam_periph_async(periph, code, path, arg); break; @@ -1639,7 +1642,8 @@ adasetflags(struct ada_softc *softc, struct ccb_getdev softc->flags &= ~ADA_FLAG_CAN_NCQ; if ((cgd->ident_data.support_dsm & ATA_SUPPORT_DSM_TRIM) && - (cgd->inq_flags & SID_DMA)) { + (cgd->inq_flags & SID_DMA) && + (softc->quirks & ADA_Q_NO_TRIM) == 0) { softc->flags |= ADA_FLAG_CAN_TRIM; softc->trim_max_ranges = TRIM_MAX_RANGES; if (cgd->ident_data.max_dsm_blocks != 0) { @@ -1707,12 +1711,10 @@ static cam_status adaregister(struct cam_periph *periph, void *arg) { struct ada_softc *softc; - struct ccb_pathinq cpi; struct ccb_getdev *cgd; char announce_buf[80]; struct disk_params *dp; caddr_t match; - u_int maxio; int quirks; cgd = (struct ccb_getdev *)arg; @@ -1738,6 +1740,7 @@ adaregister(struct cam_periph *periph, void *arg) } periph->softc = softc; + xpt_path_inq(&softc->cpi, periph->path); /* * See if this device has any quirks. @@ -1751,8 +1754,6 @@ adaregister(struct cam_periph *periph, void *arg) else softc->quirks = ADA_Q_NONE; - xpt_path_inq(&cpi, periph->path); - TASK_INIT(&softc->sysctl_task, 0, adasysctlinit, periph); /* @@ -1778,6 +1779,8 @@ adaregister(struct cam_periph *periph, void *arg) * Set support flags based on the Identify data and quirks. */ adasetflags(softc, cgd); + if (softc->cpi.hba_misc & PIM_ATA_EXT) + softc->flags |= ADA_FLAG_PIM_ATA_EXT; /* Disable queue sorting for non-rotational media by default. */ if (cgd->ident_data.media_rotation_rate == ATA_RATE_NON_ROTATING) { @@ -1786,14 +1789,13 @@ adaregister(struct cam_periph *periph, void *arg) softc->rotating = 1; } cam_iosched_set_sort_queue(softc->cam_iosched, softc->rotating ? -1 : 0); - adagetparams(periph, cgd); softc->disk = disk_alloc(); - softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; + adasetgeom(softc, cgd); softc->disk->d_devstat = devstat_new_entry(periph->periph_name, periph->unit_number, softc->params.secsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT | - XPORT_DEVSTAT_TYPE(cpi.transport), + XPORT_DEVSTAT_TYPE(softc->cpi.transport), DEVSTAT_PRIORITY_DISK); softc->disk->d_open = adaopen; softc->disk->d_close = adaclose; @@ -1803,70 +1805,8 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_gone = adadiskgonecb; softc->disk->d_name = "ada"; softc->disk->d_drv1 = periph; - maxio = cpi.maxio; /* Honor max I/O size of SIM */ - if (maxio == 0) - maxio = DFLTPHYS; /* traditional default */ - else if (maxio > MAXPHYS) - maxio = MAXPHYS; /* for safety */ - if (softc->flags & ADA_FLAG_CAN_48BIT) - maxio = min(maxio, 65536 * softc->params.secsize); - else /* 28bit ATA command limit */ - maxio = min(maxio, 256 * softc->params.secsize); - if (softc->quirks & ADA_Q_128KB) - maxio = min(maxio, 128 * 1024); - softc->disk->d_maxsize = maxio; softc->disk->d_unit = periph->unit_number; - softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; - if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) - softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; - /* Device lies about TRIM capability. */ - if ((softc->quirks & ADA_Q_NO_TRIM) && - (softc->flags & ADA_FLAG_CAN_TRIM)) - softc->flags &= ~ADA_FLAG_CAN_TRIM; - if (softc->flags & ADA_FLAG_CAN_TRIM) { - softc->disk->d_flags |= DISKFLAG_CANDELETE; - softc->disk->d_delmaxsize = softc->params.secsize * - ATA_DSM_RANGE_MAX * - softc->trim_max_ranges; - } else if ((softc->flags & ADA_FLAG_CAN_CFA) && - !(softc->flags & ADA_FLAG_CAN_48BIT)) { - softc->disk->d_flags |= DISKFLAG_CANDELETE; - softc->disk->d_delmaxsize = 256 * softc->params.secsize; - } else - softc->disk->d_delmaxsize = maxio; - if ((cpi.hba_misc & PIM_UNMAPPED) != 0) { - softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; - softc->unmappedio = 1; - } - if (cpi.hba_misc & PIM_ATA_EXT) - softc->flags |= ADA_FLAG_PIM_ATA_EXT; - strlcpy(softc->disk->d_descr, cgd->ident_data.model, - MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); - strlcpy(softc->disk->d_ident, cgd->ident_data.serial, - MIN(sizeof(softc->disk->d_ident), sizeof(cgd->ident_data.serial))); - softc->disk->d_hba_vendor = cpi.hba_vendor; - softc->disk->d_hba_device = cpi.hba_device; - softc->disk->d_hba_subvendor = cpi.hba_subvendor; - softc->disk->d_hba_subdevice = cpi.hba_subdevice; - softc->disk->d_sectorsize = softc->params.secsize; - softc->disk->d_mediasize = (off_t)softc->params.sectors * - softc->params.secsize; - if (ata_physical_sector_size(&cgd->ident_data) != - softc->params.secsize) { - softc->disk->d_stripesize = - ata_physical_sector_size(&cgd->ident_data); - softc->disk->d_stripeoffset = (softc->disk->d_stripesize - - ata_logical_sector_offset(&cgd->ident_data)) % - softc->disk->d_stripesize; - } else if (softc->quirks & ADA_Q_4K) { - softc->disk->d_stripesize = 4096; - softc->disk->d_stripeoffset = 0; - } - softc->disk->d_fwsectors = softc->params.secs_per_track; - softc->disk->d_fwheads = softc->params.heads; - ata_disk_firmware_geom_adjust(softc->disk); - /* * Acquire a reference to the periph before we register with GEOM. * We'll release this reference once GEOM calls us back (via @@ -3366,16 +3306,17 @@ adaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_ } static void -adagetparams(struct cam_periph *periph, struct ccb_getdev *cgd) +adasetgeom(struct ada_softc *softc, struct ccb_getdev *cgd) { - struct ada_softc *softc = (struct ada_softc *)periph->softc; struct disk_params *dp = &softc->params; u_int64_t lbasize48; u_int32_t lbasize; + u_int maxio, d_flags; dp->secsize = ata_logical_sector_size(&cgd->ident_data); if ((cgd->ident_data.atavalid & ATA_FLAG_54_58) && - cgd->ident_data.current_heads && cgd->ident_data.current_sectors) { + cgd->ident_data.current_heads != 0 && + cgd->ident_data.current_sectors != 0) { dp->heads = cgd->ident_data.current_heads; dp->secs_per_track = cgd->ident_data.current_sectors; dp->cylinders = cgd->ident_data.cylinders; @@ -3403,6 +3344,60 @@ adagetparams(struct cam_periph *periph, struct ccb_get if ((cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) && lbasize48 > ATA_MAX_28BIT_LBA) dp->sectors = lbasize48; + + maxio = softc->cpi.maxio; /* Honor max I/O size of SIM */ + if (maxio == 0) + maxio = DFLTPHYS; /* traditional default */ + else if (maxio > MAXPHYS) + maxio = MAXPHYS; /* for safety */ + if (softc->flags & ADA_FLAG_CAN_48BIT) + maxio = min(maxio, 65536 * softc->params.secsize); + else /* 28bit ATA command limit */ + maxio = min(maxio, 256 * softc->params.secsize); + if (softc->quirks & ADA_Q_128KB) + maxio = min(maxio, 128 * 1024); + softc->disk->d_maxsize = maxio; + d_flags = DISKFLAG_DIRECT_COMPLETION | DISKFLAG_CANZONE; + if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) + d_flags |= DISKFLAG_CANFLUSHCACHE; + if (softc->flags & ADA_FLAG_CAN_TRIM) { + d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = softc->params.secsize * + ATA_DSM_RANGE_MAX * softc->trim_max_ranges; + } else if ((softc->flags & ADA_FLAG_CAN_CFA) && + !(softc->flags & ADA_FLAG_CAN_48BIT)) { + d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = 256 * softc->params.secsize; + } else + softc->disk->d_delmaxsize = maxio; + if ((softc->cpi.hba_misc & PIM_UNMAPPED) != 0) { + d_flags |= DISKFLAG_UNMAPPED_BIO; + softc->unmappedio = 1; + } + softc->disk->d_flags = d_flags; + strlcpy(softc->disk->d_descr, cgd->ident_data.model, + MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); + strlcpy(softc->disk->d_ident, cgd->ident_data.serial, + MIN(sizeof(softc->disk->d_ident), sizeof(cgd->ident_data.serial))); + + softc->disk->d_sectorsize = softc->params.secsize; + softc->disk->d_mediasize = (off_t)softc->params.sectors * + softc->params.secsize; + if (ata_physical_sector_size(&cgd->ident_data) != + softc->params.secsize) { + softc->disk->d_stripesize = + ata_physical_sector_size(&cgd->ident_data); + softc->disk->d_stripeoffset = (softc->disk->d_stripesize - + ata_logical_sector_offset(&cgd->ident_data)) % + softc->disk->d_stripesize; + } else if (softc->quirks & ADA_Q_4K) { + softc->disk->d_stripesize = 4096; + softc->disk->d_stripeoffset = 0; + } + softc->disk->d_fwsectors = softc->params.secs_per_track; + softc->disk->d_fwheads = softc->params.heads; + ata_disk_firmware_geom_adjust(softc->disk); + softc->disk->d_rotation_rate = cgd->ident_data.media_rotation_rate; } static void Modified: stable/11/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/11/sys/cam/ata/ata_xpt.c Thu Aug 8 22:16:19 2019 (r350804) +++ stable/11/sys/cam/ata/ata_xpt.c Thu Aug 8 22:17:41 2019 (r350805) @@ -332,6 +332,7 @@ probestart(struct cam_periph *periph, union ccb *start probe_softc *softc; struct cam_path *path; struct ata_params *ident_buf; + u_int oif; CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probestart\n")); @@ -371,7 +372,7 @@ probestart(struct cam_periph *periph, union ccb *start /*data_ptr*/(u_int8_t *)&softc->ident_data, /*dxfer_len*/sizeof(softc->ident_data), 30 * 1000); - if (periph->path->device->protocol == PROTO_ATA) + if (path->device->protocol == PROTO_ATA) ata_28bit_cmd(ataio, ATA_ATA_IDENTIFY, 0, 0, 0); else ata_28bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); @@ -407,7 +408,7 @@ probestart(struct cam_periph *periph, union ccb *start if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) mode = cts.xport_specific.sata.mode; } - if (periph->path->device->protocol == PROTO_ATA) { + if (path->device->protocol == PROTO_ATA) { if (ata_dma == 0 && (mode == 0 || mode > ATA_PIO_MAX)) mode = ATA_PIO_MAX; } else { @@ -447,11 +448,13 @@ negotiate: if (mode != wantmode) goto negotiate; /* Remember what transport thinks about DMA. */ + oif = path->device->inq_flags; if (mode < ATA_DMA) path->device->inq_flags &= ~SID_DMA; else path->device->inq_flags |= SID_DMA; - xpt_async(AC_GETDEV_CHANGED, path, NULL); + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -504,11 +507,13 @@ negotiate: break; case PROBE_SETAN: /* Remember what transport thinks about AEN. */ + oif = path->device->inq_flags; if (softc->caps & CTS_SATA_CAPS_H_AN) path->device->inq_flags |= SID_AEN; else path->device->inq_flags &= ~SID_AEN; - xpt_async(AC_GETDEV_CHANGED, path, NULL); + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, probedone, @@ -627,7 +632,7 @@ negotiate: { u_int inquiry_len; struct scsi_inquiry_data *inq_buf = - &periph->path->device->inq_data; + &path->device->inq_data; if (softc->action == PROBE_INQUIRY) inquiry_len = SHORT_INQUIRY_LENGTH; @@ -732,8 +737,8 @@ probedone(struct cam_periph *periph, union ccb *done_c struct cam_path *path; cam_status status; u_int32_t priority; - u_int caps; - int changed = 1, found = 1; + u_int caps, oif; + int changed, found = 1; static const uint8_t fake_device_id_hdr[8] = {0, SVPD_DEVICE_ID, 0, 12, SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_NAA, 0, 8}; @@ -928,23 +933,32 @@ noerror: goto out; } ident_buf = &path->device->ident_data; + + /* Check that it is the same device as we know. */ if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { - /* Check that it is the same device. */ if (bcmp(softc->ident_data.model, ident_buf->model, sizeof(ident_buf->model)) || - bcmp(softc->ident_data.revision, ident_buf->revision, - sizeof(ident_buf->revision)) || bcmp(softc->ident_data.serial, ident_buf->serial, sizeof(ident_buf->serial))) { - /* Device changed. */ + /* The device was replaced. */ + changed = 2; xpt_async(AC_LOST_DEVICE, path, NULL); + } else if (bcmp(&softc->ident_data, ident_buf, + sizeof(*ident_buf))) { + /* The device is the same, but has changed. */ + changed = 1; } else { - bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + /* Nothing has changed. */ changed = 0; } + } else { + /* This is a new device. */ + changed = 2; } - if (changed) { + + if (changed != 0) bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); + if (changed == 2) { /* Clean up from previous instance of this device */ if (path->device->serial_num != NULL) { free(path->device->serial_num, M_CAMXPT); @@ -981,10 +995,10 @@ noerror: ata_bswap(path->device->device_id + 8, 8); } } - path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; - xpt_async(AC_GETDEV_CHANGED, path, NULL); } + if (changed == 1) + xpt_async(AC_GETDEV_CHANGED, path, NULL); if (ident_buf->satacapabilities & ATA_SUPPORT_NCQ) { path->device->mintags = 2; path->device->maxtags = @@ -1008,7 +1022,7 @@ noerror: } } ata_device_transport(path); - if (changed) + if (changed == 2) proberequestdefaultnegotiation(periph); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); @@ -1064,6 +1078,7 @@ noerror: * capability information is not provided or transport is * SATA, we take support for granted. */ + oif = path->device->inq_flags; if (!(path->device->inq_flags & SID_DMA) || (path->device->transport == XPORT_ATA && (cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) && @@ -1071,6 +1086,8 @@ noerror: path->device->inq_flags &= ~SID_DMA48; else path->device->inq_flags |= SID_DMA48; + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1241,6 +1258,7 @@ notsata: else caps = 0; /* Remember what transport thinks about AEN. */ + oif = path->device->inq_flags; if ((caps & CTS_SATA_CAPS_H_AN) && path->device->protocol != PROTO_ATA) path->device->inq_flags |= SID_AEN; else @@ -1254,7 +1272,6 @@ notsata: cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; xpt_action((union ccb *)&cts); softc->caps = caps; - xpt_async(AC_GETDEV_CHANGED, path, NULL); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; xpt_acquire_device(path->device); @@ -1262,6 +1279,8 @@ notsata: xpt_action(done_ccb); xpt_async(AC_FOUND_DEVICE, path, done_ccb); } else { + if (path->device->inq_flags != oif) + xpt_async(AC_GETDEV_CHANGED, path, NULL); done_ccb->ccb_h.func_code = XPT_GDEV_TYPE; xpt_action(done_ccb); xpt_async(AC_SCSI_AEN, path, done_ccb); @@ -1274,12 +1293,14 @@ notsata: /* Check that it is the same device. */ if (bcmp(&softc->ident_data, ident_buf, 53)) { /* Device changed. */ + changed = 2; xpt_async(AC_LOST_DEVICE, path, NULL); } else { bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); changed = 0; } - } + } else + changed = 2; if (changed) { bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); /* Clean up from previous instance of this device */ From owner-svn-src-all@freebsd.org Thu Aug 8 22:19:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94E1CB55B5; Thu, 8 Aug 2019 22:19:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464N8c386vz3GHB; Thu, 8 Aug 2019 22:19:44 +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 3069A4092; Thu, 8 Aug 2019 22:19:44 +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 x78MJiUh048288; Thu, 8 Aug 2019 22:19:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78MJhnV048287; Thu, 8 Aug 2019 22:19:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082219.x78MJhnV048287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:19: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: r350806 - stable/11/sbin/camcontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sbin/camcontrol X-SVN-Commit-Revision: 350806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:19:44 -0000 Author: mav Date: Thu Aug 8 22:19:43 2019 New Revision: 350806 URL: https://svnweb.freebsd.org/changeset/base/350806 Log: MFC r350257: Make `camcontrol hpa` and `camcontrol ama` trigger reprobe. This makes OS automatically see the disk's new disk size. Modified: stable/11/sbin/camcontrol/camcontrol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:17:41 2019 (r350805) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:19:43 2019 (r350806) @@ -301,6 +301,7 @@ static int scsiserial(struct cam_device *device, int t #endif /* MINIMALISTIC */ static int parse_btl(char *tstr, path_id_t *bus, target_id_t *target, lun_id_t *lun, cam_argmask *arglst); +static int reprobe(struct cam_device *device); static int dorescan_or_reset(int argc, char **argv, int rescan); static int rescan_or_reset_bus(path_id_t bus, int rescan); static int scanlun_or_reset_dev(path_id_t bus, target_id_t target, @@ -370,7 +371,6 @@ static int scsiprintopcodes(struct cam_device *device, static int scsiopcodes(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout, int verbose); -static int scsireprobe(struct cam_device *device); #endif /* MINIMALISTIC */ #ifndef min @@ -2934,6 +2934,8 @@ atahpa(struct cam_device *device, int retry_count, int timeout, ccb, &ident_buf); atahpa_print(ident_buf, hpasize, 1); + /* Hint CAM to reprobe the device. */ + reprobe(device); } } break; @@ -3076,6 +3078,8 @@ ataama(struct cam_device *device, int retry_count, int error = ata_do_identify(device, retry_count, timeout, ccb, &ident_buf); ataama_print(ident_buf, nativesize, 1); + /* Hint CAM to reprobe the device. */ + reprobe(device); } } break; @@ -9313,7 +9317,7 @@ bailout: #endif /* MINIMALISTIC */ static int -scsireprobe(struct cam_device *device) +reprobe(struct cam_device *device) { union ccb *ccb; int retval = 0; @@ -9325,7 +9329,7 @@ scsireprobe(struct cam_device *device) return (1); } - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); + CCB_CLEAR_ALL_EXCEPT_HDR(ccb); ccb->ccb_h.func_code = XPT_REPROBE_LUN; @@ -10090,7 +10094,7 @@ main(int argc, char **argv) arglist & CAM_ARG_VERBOSE); break; case CAM_CMD_REPROBE: - error = scsireprobe(cam_dev); + error = reprobe(cam_dev); break; case CAM_CMD_ZONE: error = zone(cam_dev, argc, argv, combinedopt, From owner-svn-src-all@freebsd.org Thu Aug 8 22:20:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 552E2B563F; Thu, 8 Aug 2019 22:20:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464N9D2H2bz3GSP; Thu, 8 Aug 2019 22:20:16 +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 2F9A94096; Thu, 8 Aug 2019 22:20:16 +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 x78MKGk8048413; Thu, 8 Aug 2019 22:20:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x78MKFut048407; Thu, 8 Aug 2019 22:20:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908082220.x78MKFut048407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 8 Aug 2019 22:20: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: r350807 - in stable/11: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11: sbin/camcontrol sys/cam/ata sys/cam/scsi sys/sys X-SVN-Commit-Revision: 350807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:20:16 -0000 Author: mav Date: Thu Aug 8 22:20:15 2019 New Revision: 350807 URL: https://svnweb.freebsd.org/changeset/base/350807 Log: MFC r350331: Make `camcontrol sanitize` support also ATA devices. ATA sanitize is functionally identical to SCSI, just uses different initiation commands and status reporting mechanism. While there, make kernel better handle sanitize commands and statuses. Modified: stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c stable/11/sys/cam/ata/ata_all.c stable/11/sys/cam/scsi/scsi_all.c stable/11/sys/sys/ata.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 22:19:43 2019 (r350806) +++ stable/11/sbin/camcontrol/camcontrol.8 Thu Aug 8 22:20:15 2019 (r350807) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 22, 2019 +.Dd July 25, 2019 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -1276,13 +1276,11 @@ will not be asked about the timeout if a timeout is sp command line. .El .It Ic sanitize -Issue the -.Tn SCSI -SANITIZE command to the named device. +Issue the SANITIZE command to the named device. .Pp .Em WARNING! WARNING! WARNING! .Pp -ALL data in the cache and on the disk will be destroyed or made inaccessible. +ALL data on the disk will be destroyed or made inaccessible. Recovery of the data is not possible. Use extreme caution when issuing this command. .Pp Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:19:43 2019 (r350806) +++ stable/11/sbin/camcontrol/camcontrol.c Thu Aug 8 22:20:15 2019 (r350807) @@ -346,7 +346,7 @@ static int ratecontrol(struct cam_device *device, int static int scsiformat(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout); -static int scsisanitize(struct cam_device *device, int argc, char **argv, +static int sanitize(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout); static int scsireportluns(struct cam_device *device, int argc, char **argv, @@ -1595,6 +1595,19 @@ atacapprint(struct ata_params *parm) } else { printf("no\n"); } + printf("Sanitize "); + if (parm->multi & ATA_SUPPORT_SANITIZE) { + printf("yes\t\t%s%s%s\n", + parm->multi & ATA_SUPPORT_BLOCK_ERASE_EXT ? "block, " : "", + parm->multi & ATA_SUPPORT_OVERWRITE_EXT ? "overwrite, " : "", + parm->multi & ATA_SUPPORT_CRYPTO_SCRAMBLE_EXT ? "crypto" : ""); + printf("Sanitize - commands allowed %s\n", + parm->multi & ATA_SUPPORT_SANITIZE_ALLOWED ? "yes" : "no"); + printf("Sanitize - antifreeze lock %s\n", + parm->multi & ATA_SUPPORT_ANTIFREEZE_LOCK_EXT ? "yes" : "no"); + } else { + printf("no\n"); + } } static int @@ -1841,6 +1854,11 @@ ata_do_cmd(struct cam_device *device, union ccb *ccb, res->lba_high_exp = res_pass16->lba_high_exp; res->sector_count = res_pass16->sector_count; res->sector_count_exp = res_pass16->sector_count_exp; + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + if (res->status & ATA_STATUS_ERROR) + ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; + else + ccb->ccb_h.status |= CAM_REQ_CMP; } return (error); @@ -2329,12 +2347,6 @@ ata_do_identify(struct cam_device *device, int retry_c error = 0; } - if (arglist & CAM_ARG_VERBOSE) { - fprintf(stdout, "%s%d: Raw identify data:\n", - device->device_name, device->dev_unit_num); - dump_data(ptr, sizeof(struct ata_params)); - } - /* check for invalid (all zero) response */ if (error != 0) { warnx("Invalid identify response detected"); @@ -2385,6 +2397,12 @@ ataidentify(struct cam_device *device, int retry_count return (1); } + if (arglist & CAM_ARG_VERBOSE) { + printf("%s%d: Raw identify data:\n", + device->device_name, device->dev_unit_num); + dump_data((void*)ident_buf, sizeof(struct ata_params)); + } + if (ident_buf->support.command1 & ATA_SUPPORT_PROTECTED) { if (ata_read_native_max(device, retry_count, timeout, ccb, ident_buf, &hpasize) != 0) { @@ -6567,15 +6585,184 @@ scsiformat_bailout: } static int -scsisanitize(struct cam_device *device, int argc, char **argv, +sanitize_wait_ata(struct cam_device *device, union ccb *ccb, int quiet) +{ + struct ata_res *res; + int retval; + cam_status status; + u_int val, perc; + + do { + retval = ata_do_cmd(device, + ccb, + /*retries*/1, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SANITIZE, + /*features*/0x00, /* SANITIZE STATUS EXT */ + /*lba*/0, + /*sector_count*/0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/10000, + /*is48bit*/1); + if (retval < 0) { + warn("error sending CAMIOCOMMAND ioctl"); + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + return (1); + } + + status = ccb->ccb_h.status & CAM_STATUS_MASK; + if (status == CAM_REQ_CMP) { + res = &ccb->ataio.res; + if (res->sector_count_exp & 0x40) { + if (quiet == 0) { + val = (res->lba_mid << 8) + res->lba_low; + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } + sleep(1); + } else if ((res->sector_count_exp & 0x80) == 0) { + warnx("Sanitize complete with an error. "); + return (1); + } else + break; + + } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { + warnx("Unexpected CAM status %#x", status); + if (arglist & CAM_ARG_VERBOSE) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + } while (1); + return (0); +} + +static int +sanitize_wait_scsi(struct cam_device *device, union ccb *ccb, int task_attr, int quiet) +{ + int warnings = 0, retval; + cam_status status; + u_int val, perc; + + do { + CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); + + /* + * There's really no need to do error recovery or + * retries here, since we're just going to sit in a + * loop and wait for the device to finish sanitizing. + */ + scsi_test_unit_ready(&ccb->csio, + /* retries */ 0, + /* cbfcnp */ NULL, + /* tag_action */ task_attr, + /* sense_len */ SSD_FULL_SIZE, + /* timeout */ 5000); + + /* Disable freezing the device queue */ + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + + retval = cam_send_ccb(device, ccb); + + /* + * If we get an error from the ioctl, bail out. SCSI + * errors are expected. + */ + if (retval < 0) { + warn("error sending CAMIOCOMMAND ioctl"); + if (arglist & CAM_ARG_VERBOSE) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + } + return (1); + } + + status = ccb->ccb_h.status & CAM_STATUS_MASK; + if ((status == CAM_SCSI_STATUS_ERROR) && + ((ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0)) { + struct scsi_sense_data *sense; + int error_code, sense_key, asc, ascq; + + sense = &ccb->csio.sense_data; + scsi_extract_sense_len(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, &error_code, &sense_key, + &asc, &ascq, /*show_errors*/ 1); + + /* + * According to the SCSI-3 spec, a drive that is in the + * middle of a sanitize should return NOT READY with an + * ASC of "logical unit not ready, sanitize in + * progress". The sense key specific bytes will then + * be a progress indicator. + */ + if ((sense_key == SSD_KEY_NOT_READY) + && (asc == 0x04) && (ascq == 0x1b)) { + uint8_t sks[3]; + + if ((scsi_get_sks(sense, ccb->csio.sense_len - + ccb->csio.sense_resid, sks) == 0) + && (quiet == 0)) { + val = scsi_2btoul(&sks[1]); + perc = 10000 * val; + fprintf(stdout, + "Sanitizing: %u.%02u%% (%d/%d)\r", + (perc / (0x10000 * 100)), + ((perc / 0x10000) % 100), + val, 0x10000); + fflush(stdout); + } else if ((quiet == 0) && (++warnings <= 1)) { + warnx("Unexpected SCSI Sense Key " + "Specific value returned " + "during sanitize:"); + scsi_sense_print(device, &ccb->csio, + stderr); + warnx("Unable to print status " + "information, but sanitze will " + "proceed."); + warnx("will exit when sanitize is " + "complete"); + } + sleep(1); + } else { + warnx("Unexpected SCSI error during sanitize"); + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + + } else if (status != CAM_REQ_CMP && status != CAM_REQUEUE_REQ) { + warnx("Unexpected CAM status %#x", status); + if (arglist & CAM_ARG_VERBOSE) + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + return (1); + } + } while ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP); + return (0); +} + +static int +sanitize(struct cam_device *device, int argc, char **argv, char *combinedopt, int task_attr, int retry_count, int timeout) { union ccb *ccb; u_int8_t action = 0; int c; int ycount = 0, quiet = 0; - int error = 0, retval = 0; - int use_timeout = 10800 * 1000; + int error = 0; + int use_timeout; int immediate = 1; int invert = 0; int passes = 0; @@ -6584,14 +6771,25 @@ scsisanitize(struct cam_device *device, int argc, char const char *pattern = NULL; u_int8_t *data_ptr = NULL; u_int32_t dxfer_len = 0; - u_int8_t byte2 = 0; - int num_warnings = 0; + uint8_t byte2; + uint16_t feature, count; + uint64_t lba; int reportonly = 0; + camcontrol_devtype dt; + /* + * Get the device type, request no I/O be done to do this. + */ + error = get_device_type(device, -1, 0, 0, &dt); + if (error != 0 || (unsigned)dt > CC_DT_UNKNOWN) { + warnx("sanitize: can't get device type"); + return (1); + } + ccb = cam_getccb(device); if (ccb == NULL) { - warnx("scsisanitize: error allocating ccb"); + warnx("sanitize: error allocating ccb"); return (1); } @@ -6612,7 +6810,7 @@ scsisanitize(struct cam_device *device, int argc, char warnx("invalid service operation \"%s\"", optarg); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } break; case 'c': @@ -6620,7 +6818,7 @@ scsisanitize(struct cam_device *device, int argc, char if (passes < 1 || passes > 31) { warnx("invalid passes value %d", passes); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } break; case 'I': @@ -6639,7 +6837,9 @@ scsisanitize(struct cam_device *device, int argc, char reportonly = 1; break; case 'w': - immediate = 0; + /* ATA supports only immediate commands. */ + if (dt == CC_DT_SCSI) + immediate = 0; break; case 'y': ycount++; @@ -6653,7 +6853,7 @@ scsisanitize(struct cam_device *device, int argc, char if (action == 0) { warnx("an action is required"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } else if (action == SSZ_SERVICE_ACTION_OVERWRITE) { struct scsi_sanitize_parameter_list *pl; struct stat sb; @@ -6662,43 +6862,43 @@ scsisanitize(struct cam_device *device, int argc, char if (pattern == NULL) { warnx("overwrite action requires -P argument"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } fd = open(pattern, O_RDONLY); if (fd < 0) { warn("cannot open pattern file %s", pattern); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } if (fstat(fd, &sb) < 0) { warn("cannot stat pattern file %s", pattern); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } sz = sb.st_size; if (sz > SSZPL_MAX_PATTERN_LENGTH) { warnx("pattern file size exceeds maximum value %d", SSZPL_MAX_PATTERN_LENGTH); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } dxfer_len = sizeof(*pl) + sz; data_ptr = calloc(1, dxfer_len); if (data_ptr == NULL) { warnx("cannot allocate parameter list buffer"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } amt = read(fd, data_ptr + sizeof(*pl), sz); if (amt < 0) { warn("cannot read pattern file"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } else if (amt != sz) { warnx("short pattern file read"); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } pl = (struct scsi_sanitize_parameter_list *)data_ptr; @@ -6724,7 +6924,7 @@ scsisanitize(struct cam_device *device, int argc, char warnx("%s argument only valid with overwrite " "operation", arg); error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } } @@ -6732,26 +6932,41 @@ scsisanitize(struct cam_device *device, int argc, char fprintf(stdout, "You are about to REMOVE ALL DATA from the " "following device:\n"); - error = scsidoinquiry(device, argc, argv, combinedopt, - task_attr, retry_count, timeout); + if (dt == CC_DT_SCSI) { + error = scsidoinquiry(device, argc, argv, combinedopt, + task_attr, retry_count, timeout); + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + struct ata_params *ident_buf; + error = ata_do_identify(device, retry_count, timeout, + ccb, &ident_buf); + if (error == 0) { + printf("%s%d: ", device->device_name, + device->dev_unit_num); + ata_print_ident(ident_buf); + free(ident_buf); + } + } else + error = 1; if (error != 0) { - warnx("scsisanitize: error sending inquiry"); - goto scsisanitize_bailout; + warnx("sanitize: error sending inquiry"); + goto sanitize_bailout; } } if (ycount == 0) { if (!get_confirmation()) { error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } } if (timeout != 0) use_timeout = timeout; + else + use_timeout = (immediate ? 10 : 10800) * 1000; - if (quiet == 0) { + if (immediate == 0 && quiet == 0) { fprintf(stdout, "Current sanitize timeout is %d seconds\n", use_timeout / 1000); } @@ -6761,8 +6976,7 @@ scsisanitize(struct cam_device *device, int argc, char * timeout on the command line, ask them if they want the current * timeout. */ - if ((ycount == 0) - && (timeout == 0)) { + if (immediate == 0 && ycount == 0 && timeout == 0) { char str[1024]; int new_timeout = 0; @@ -6782,33 +6996,76 @@ scsisanitize(struct cam_device *device, int argc, char } } - byte2 = action; - if (ause != 0) - byte2 |= SSZ_UNRESTRICTED_EXIT; - if (immediate != 0) - byte2 |= SSZ_IMMED; + if (dt == CC_DT_SCSI) { + byte2 = action; + if (ause != 0) + byte2 |= SSZ_UNRESTRICTED_EXIT; + if (immediate != 0) + byte2 |= SSZ_IMMED; + scsi_sanitize(&ccb->csio, + /* retries */ retry_count, + /* cbfcnp */ NULL, + /* tag_action */ task_attr, + /* byte2 */ byte2, + /* control */ 0, + /* data_ptr */ data_ptr, + /* dxfer_len */ dxfer_len, + /* sense_len */ SSD_FULL_SIZE, + /* timeout */ use_timeout); - scsi_sanitize(&ccb->csio, - /* retries */ retry_count, - /* cbfcnp */ NULL, - /* tag_action */ task_attr, - /* byte2 */ byte2, - /* control */ 0, - /* data_ptr */ data_ptr, - /* dxfer_len */ dxfer_len, - /* sense_len */ SSD_FULL_SIZE, - /* timeout */ use_timeout); + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (arglist & CAM_ARG_ERR_RECOVER) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + if (cam_send_ccb(device, ccb) < 0) { + warn("error sending sanitize command"); + error = 1; + goto sanitize_bailout; + } + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + if (action == SSZ_SERVICE_ACTION_OVERWRITE) { + feature = 0x14; /* OVERWRITE EXT */ + lba = 0x4F5700000000 | scsi_4btoul(data_ptr + 4); + count = (passes == 0) ? 1 : (passes >= 16) ? 0 : passes; + if (invert) + count |= 0x80; /* INVERT PATTERN */ + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_BLOCK_ERASE) { + feature = 0x12; /* BLOCK ERASE EXT */ + lba = 0x0000426B4572; + count = 0; + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_CRYPTO_ERASE) { + feature = 0x11; /* CRYPTO SCRAMBLE EXT */ + lba = 0x000043727970; + count = 0; + if (ause) + count |= 0x10; /* FAILURE MODE */ + } else if (action == SSZ_SERVICE_ACTION_EXIT_MODE_FAILURE) { + feature = 0x00; /* SANITIZE STATUS EXT */ + lba = 0; + count = 1; /* CLEAR SANITIZE OPERATION FAILED */ + } else { + error = 1; + goto sanitize_bailout; + } - /* Disable freezing the device queue */ - ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; - - if (arglist & CAM_ARG_ERR_RECOVER) - ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; - - if (cam_send_ccb(device, ccb) < 0) { - warn("error sending sanitize command"); - error = 1; - goto scsisanitize_bailout; + error = ata_do_cmd(device, + ccb, + retry_count, + /*flags*/CAM_DIR_NONE, + /*protocol*/AP_PROTO_NON_DATA | AP_EXTEND, + /*ata_flags*/AP_FLAG_CHK_COND, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*command*/ATA_SANITIZE, + /*features*/feature, + /*lba*/lba, + /*sector_count*/count, + /*data_ptr*/NULL, + /*dxfer_len*/0, + /*timeout*/ use_timeout, + /*is48bit*/1); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -6836,7 +7093,7 @@ scsisanitize(struct cam_device *device, int argc, char CAM_EPF_ALL, stderr); } error = 1; - goto scsisanitize_bailout; + goto sanitize_bailout; } /* @@ -6849,124 +7106,20 @@ scsisanitize(struct cam_device *device, int argc, char if (quiet == 0) { fprintf(stdout, "Sanitize Complete\n"); } - goto scsisanitize_bailout; + goto sanitize_bailout; } doreport: - do { - cam_status status; + if (dt == CC_DT_SCSI) { + error = sanitize_wait_scsi(device, ccb, task_attr, quiet); + } else if (dt == CC_DT_ATA || dt == CC_DT_SATL) { + error = sanitize_wait_ata(device, ccb, quiet); + } else + error = 1; + if (error == 0 && quiet == 0) + fprintf(stdout, "Sanitize Complete \n"); - CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - - /* - * There's really no need to do error recovery or - * retries here, since we're just going to sit in a - * loop and wait for the device to finish sanitizing. - */ - scsi_test_unit_ready(&ccb->csio, - /* retries */ 0, - /* cbfcnp */ NULL, - /* tag_action */ task_attr, - /* sense_len */ SSD_FULL_SIZE, - /* timeout */ 5000); - - /* Disable freezing the device queue */ - ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; - - retval = cam_send_ccb(device, ccb); - - /* - * If we get an error from the ioctl, bail out. SCSI - * errors are expected. - */ - if (retval < 0) { - warn("error sending CAMIOCOMMAND ioctl"); - if (arglist & CAM_ARG_VERBOSE) { - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } - error = 1; - goto scsisanitize_bailout; - } - - status = ccb->ccb_h.status & CAM_STATUS_MASK; - - if ((status != CAM_REQ_CMP) - && (status == CAM_SCSI_STATUS_ERROR) - && ((ccb->ccb_h.status & CAM_AUTOSNS_VALID) != 0)) { - struct scsi_sense_data *sense; - int error_code, sense_key, asc, ascq; - - sense = &ccb->csio.sense_data; - scsi_extract_sense_len(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, &error_code, &sense_key, - &asc, &ascq, /*show_errors*/ 1); - - /* - * According to the SCSI-3 spec, a drive that is in the - * middle of a sanitize should return NOT READY with an - * ASC of "logical unit not ready, sanitize in - * progress". The sense key specific bytes will then - * be a progress indicator. - */ - if ((sense_key == SSD_KEY_NOT_READY) - && (asc == 0x04) && (ascq == 0x1b)) { - uint8_t sks[3]; - - if ((scsi_get_sks(sense, ccb->csio.sense_len - - ccb->csio.sense_resid, sks) == 0) - && (quiet == 0)) { - int val; - u_int64_t percentage; - - val = scsi_2btoul(&sks[1]); - percentage = 10000 * val; - - fprintf(stdout, - "\rSanitizing: %ju.%02u %% " - "(%d/%d) done", - (uintmax_t)(percentage / - (0x10000 * 100)), - (unsigned)((percentage / - 0x10000) % 100), - val, 0x10000); - fflush(stdout); - } else if ((quiet == 0) - && (++num_warnings <= 1)) { - warnx("Unexpected SCSI Sense Key " - "Specific value returned " - "during sanitize:"); - scsi_sense_print(device, &ccb->csio, - stderr); - warnx("Unable to print status " - "information, but sanitze will " - "proceed."); - warnx("will exit when sanitize is " - "complete"); - } - sleep(1); - } else { - warnx("Unexpected SCSI error during sanitize"); - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - error = 1; - goto scsisanitize_bailout; - } - - } else if (status != CAM_REQ_CMP) { - warnx("Unexpected CAM status %#x", status); - if (arglist & CAM_ARG_VERBOSE) - cam_error_print(device, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - error = 1; - goto scsisanitize_bailout; - } - } while((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP); - - if (quiet == 0) - fprintf(stdout, "\nSanitize Complete\n"); - -scsisanitize_bailout: +sanitize_bailout: if (fd >= 0) close(fd); if (data_ptr != NULL) @@ -10072,9 +10225,8 @@ main(int argc, char **argv) timeout); break; case CAM_CMD_SANITIZE: - error = scsisanitize(cam_dev, argc, argv, - combinedopt, task_attr, - retry_count, timeout); + error = sanitize(cam_dev, argc, argv, combinedopt, task_attr, + retry_count, timeout); break; case CAM_CMD_PERSIST: error = scsipersist(cam_dev, argc, argv, combinedopt, Modified: stable/11/sys/cam/ata/ata_all.c ============================================================================== --- stable/11/sys/cam/ata/ata_all.c Thu Aug 8 22:19:43 2019 (r350806) +++ stable/11/sys/cam/ata/ata_all.c Thu Aug 8 22:20:15 2019 (r350807) @@ -213,7 +213,16 @@ ata_op_string(struct ata_cmd *cmd) return ("SMART"); case 0xb1: return ("DEVICE CONFIGURATION"); case 0xb2: return ("SET_SECTOR_CONFIGURATION_EXT"); - case 0xb4: return ("SANITIZE_DEVICE"); + case 0xb4: + switch(cmd->features) { + case 0x00: return ("SANITIZE_STATUS_EXT"); + case 0x11: return ("CRYPTO_SCRAMBLE_EXT"); + case 0x12: return ("BLOCK_ERASE_EXT"); + case 0x14: return ("OVERWRITE_EXT"); + case 0x20: return ("SANITIZE_FREEZE_LOCK_EXT"); + case 0x40: return ("SANITIZE_ANTIFREEZE_LOCK_EXT"); + } + return ("SANITIZE_DEVICE"); case 0xc0: return ("CFA_ERASE"); case 0xc4: return ("READ_MUL"); case 0xc5: return ("WRITE_MUL"); Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Thu Aug 8 22:19:43 2019 (r350806) +++ stable/11/sys/cam/scsi/scsi_all.c Thu Aug 8 22:20:15 2019 (r350807) @@ -377,7 +377,7 @@ static struct op_table_entry scsi_op_codes[] = { { 0x40, D | T | L | P | W | R | O | M | S | C, "CHANGE DEFINITION" }, /* 41 O WRITE SAME(10) */ { 0x41, D, "WRITE SAME(10)" }, - /* 42 O UNMAP */ + /* 42 O UNMAP */ { 0x42, D, "UNMAP" }, /* 42 O READ SUB-CHANNEL */ { 0x42, R, "READ SUB-CHANNEL" }, @@ -392,7 +392,8 @@ static struct op_table_entry scsi_op_codes[] = { { 0x46, R, "GET CONFIGURATION" }, /* 47 O PLAY AUDIO MSF */ { 0x47, R, "PLAY AUDIO MSF" }, - /* 48 */ + /* 48 O SANITIZE */ + { 0x48, D, "SANITIZE" }, /* 49 */ /* 4A M GET EVENT STATUS NOTIFICATION */ { 0x4A, R, "GET EVENT STATUS NOTIFICATION" }, @@ -1160,7 +1161,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */ "Logical unit not ready, START/STOP UNIT command in progress") }, /* D B */ - { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ + { SST(0x04, 0x1B, SS_WAIT | EBUSY, "Logical unit not ready, sanitize in progress") }, /* DT MAEB */ { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */ @@ -1451,7 +1452,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x11, 0x14, SS_RDEF, /* XXX TBD */ "Read error - LBA marked bad by application client") }, /* D */ - { SST(0x11, 0x15, SS_RDEF, /* XXX TBD */ + { SST(0x11, 0x15, SS_FATAL | EIO, "Write after sanitize required") }, /* D W O BK */ { SST(0x12, 0x00, SS_RDEF, @@ -2062,7 +2063,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x31, 0x02, SS_RDEF, /* XXX TBD */ "Zoned formatting failed due to spare linking") }, /* D B */ - { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */ + { SST(0x31, 0x03, SS_FATAL | EIO, "SANITIZE command failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, Modified: stable/11/sys/sys/ata.h ============================================================================== --- stable/11/sys/sys/ata.h Thu Aug 8 22:19:43 2019 (r350806) +++ stable/11/sys/sys/ata.h Thu Aug 8 22:20:15 2019 (r350807) @@ -95,6 +95,8 @@ struct ata_params { #define ATA_SUPPORT_OVERWRITE_EXT 0x4000 #define ATA_SUPPORT_CRYPTO_SCRAMBLE_EXT 0x2000 #define ATA_SUPPORT_SANITIZE 0x1000 +#define ATA_SUPPORT_SANITIZE_ALLOWED 0x0800 +#define ATA_SUPPORT_ANTIFREEZE_LOCK_EXT 0x0400 #define ATA_MULTI_VALID 0x0100 /*060*/ u_int16_t lba_size_1; @@ -452,6 +454,7 @@ struct ata_params { #define ATA_ATAPI_IDENTIFY 0xa1 /* get ATAPI params*/ #define ATA_SERVICE 0xa2 /* service command */ #define ATA_SMART_CMD 0xb0 /* SMART command */ +#define ATA_SANITIZE 0xb4 /* sanitize device */ #define ATA_CFA_ERASE 0xc0 /* CFA erase */ #define ATA_READ_MUL 0xc4 /* read multi */ #define ATA_WRITE_MUL 0xc5 /* write multi */ From owner-svn-src-all@freebsd.org Thu Aug 8 22:59:56 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADD23B6054; Thu, 8 Aug 2019 22:59:56 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 464P302T49z3Hvs; Thu, 8 Aug 2019 22:59:55 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x78MxlqC003472 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 8 Aug 2019 15:59:47 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x78MxlBx003471; Thu, 8 Aug 2019 15:59:47 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 8 Aug 2019 15:59:47 -0700 From: Gleb Smirnoff To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350764 - head/sys/arm64/arm64 Message-ID: <20190808225947.GD1531@FreeBSD.org> References: <201908081748.x78Hm79V085760@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908081748.x78Hm79V085760@repo.freebsd.org> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 464P302T49z3Hvs X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.951,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 08 Aug 2019 22:59:56 -0000 Hi, why do we need COMPAT_43 for arm64 at all? I can't imagine an application that would require this compatibility. A more general question is how far in the future are we going to carry COMPAT_43 for i386/amd64? On Thu, Aug 08, 2019 at 05:48:07PM +0000, Warner Losh wrote: W> Author: imp W> Date: Thu Aug 8 17:48:07 2019 W> New Revision: 350764 W> URL: https://svnweb.freebsd.org/changeset/base/350764 W> W> Log: W> Make arm64 32-bit mode compile with COMPAT_43 W> W> The COMPAT_43 option isn't quite like the other compat options, and arm64 makes W> attempts to support it in 64-bit mode. In 32-bit compat mode, however, two W> syscall implementations that COMPAT_FREEBSD32 assumes will be there are W> missing. Provide implementations for these: ofreebsd32_sigreturn (which we'll W> never encounter, so implement it as nosys as is done in kern_sig.c) and W> ofreebsd32_getpagesize, where we'll always return 4096 since that's the only W> PAGE_SIZE we support, similar to how the ia32 implementation does things. W> W> Reviewed by: manu@ W> Differential Revision: https://reviews.freebsd.org/D21192 W> W> Modified: W> head/sys/arm64/arm64/freebsd32_machdep.c W> W> Modified: head/sys/arm64/arm64/freebsd32_machdep.c W> ============================================================================== W> --- head/sys/arm64/arm64/freebsd32_machdep.c Thu Aug 8 17:30:51 2019 (r350763) W> +++ head/sys/arm64/arm64/freebsd32_machdep.c Thu Aug 8 17:48:07 2019 (r350764) W> @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); W> #include W> #include W> #include W> +#include W> #include W> #ifdef VFP W> #include W> @@ -410,3 +411,30 @@ freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigs W> mtx_lock(&psp->ps_mtx); W> W> } W> + W> +#ifdef COMPAT_43 W> +/* W> + * COMPAT_FREEBSD32 assumes we have this system call when COMPAT_43 is defined. W> + * FreeBSD/arm provies a similar getpagesize() syscall. W> + */ W> +#define ARM32_PAGE_SIZE 4096 W> +int W> +ofreebsd32_getpagesize(struct thread *td, W> + struct ofreebsd32_getpagesize_args *uap) W> +{ W> + W> + td->td_retval[0] = ARM32_PAGE_SIZE; W> + return (0); W> +} W> + W> +/* W> + * Mirror the osigreturn definition in kern_sig.c for !i386 platforms. This W> + * mirrors what's connected to the FreeBSD/arm syscall. W> + */ W> +int W> +ofreebsd32_sigreturn(struct thread *td, struct ofreebsd32_sigreturn_args *uap) W> +{ W> + W> + return (nosys(td, (struct nosys_args *)uap)); W> +} W> +#endif W> _______________________________________________ W> svn-src-all@freebsd.org mailing list W> https://lists.freebsd.org/mailman/listinfo/svn-src-all W> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Fri Aug 9 00:47:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D559B832F; Fri, 9 Aug 2019 00:47:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464RR43W5jz3MrT; Fri, 9 Aug 2019 00:47:28 +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 557005B88; Fri, 9 Aug 2019 00:47:28 +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 x790lSgJ036172; Fri, 9 Aug 2019 00:47:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x790lRN2036170; Fri, 9 Aug 2019 00:47:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908090047.x790lRN2036170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Aug 2019 00:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350808 - in stable/12/sys/cam: ctl scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: ctl scsi X-SVN-Commit-Revision: 350808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 00:47:28 -0000 Author: mav Date: Fri Aug 9 00:47:27 2019 New Revision: 350808 URL: https://svnweb.freebsd.org/changeset/base/350808 Log: MFC r350343: Add reporting of SCSI Feature Sets VPD page from SPC-5. CTL implements all defined feature sets except Drive Maintenance 2016, which is not very applicable to such a virtual device, and implemented only partially now. But may be it could be fixed later at least for completeness. Modified: stable/12/sys/cam/ctl/ctl.c stable/12/sys/cam/scsi/scsi_all.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl.c ============================================================================== --- stable/12/sys/cam/ctl/ctl.c Thu Aug 8 22:20:15 2019 (r350807) +++ stable/12/sys/cam/ctl/ctl.c Fri Aug 9 00:47:27 2019 (r350808) @@ -448,10 +448,11 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, max_ports, CTLFLAG /* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), * Extended INQUIRY Data (0x86), Mode Page Policy (0x87), - * SCSI Ports (0x88), Third-party Copy (0x8F), Block limits (0xB0), - * Block Device Characteristics (0xB1) and Logical Block Provisioning (0xB2) + * SCSI Ports (0x88), Third-party Copy (0x8F), SCSI Feature Sets (0x92), + * Block limits (0xB0), Block Device Characteristics (0xB1) and + * Logical Block Provisioning (0xB2) */ -#define SCSI_EVPD_NUM_SUPPORTED_PAGES 10 +#define SCSI_EVPD_NUM_SUPPORTED_PAGES 11 static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); @@ -489,6 +490,7 @@ static int ctl_inquiry_evpd_eid(struct ctl_scsiio *cts static int ctl_inquiry_evpd_mpp(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd_sfs(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len); static int ctl_inquiry_evpd_bdc(struct ctl_scsiio *ctsio, int alloc_len); @@ -9318,6 +9320,8 @@ ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, i pages->page_list[p++] = SVPD_SCSI_PORTS; /* Third-party Copy */ pages->page_list[p++] = SVPD_SCSI_TPC; + /* SCSI Feature Sets */ + pages->page_list[p++] = SVPD_SCSI_SFS; if (lun != NULL && lun->be_lun->lun_type == T_DIRECT) { /* Block limits */ pages->page_list[p++] = SVPD_BLOCK_LIMITS; @@ -9699,6 +9703,58 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_scsiio *ctsio, } static int +ctl_inquiry_evpd_sfs(struct ctl_scsiio *ctsio, int alloc_len) +{ + struct ctl_lun *lun = CTL_LUN(ctsio); + struct scsi_vpd_sfs *sfs_ptr; + int sfs_page_size, n; + + sfs_page_size = sizeof(*sfs_ptr) + 5 * 2; + ctsio->kern_data_ptr = malloc(sfs_page_size, M_CTL, M_WAITOK | M_ZERO); + sfs_ptr = (struct scsi_vpd_sfs *)ctsio->kern_data_ptr; + ctsio->kern_sg_entries = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(sfs_page_size, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; + + /* + * The control device is always connected. The disk device, on the + * other hand, may not be online all the time. Need to change this + * to figure out whether the disk device is actually online or not. + */ + if (lun != NULL) + sfs_ptr->device = (SID_QUAL_LU_CONNECTED << 5) | + lun->be_lun->lun_type; + else + sfs_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT; + + sfs_ptr->page_code = SVPD_SCSI_SFS; + n = 0; + /* Discovery 2016 */ + scsi_ulto2b(0x0001, &sfs_ptr->codes[2 * n++]); + if (lun != NULL && lun->be_lun->lun_type == T_DIRECT) { + /* SBC Base 2016 */ + scsi_ulto2b(0x0101, &sfs_ptr->codes[2 * n++]); + /* SBC Base 2010 */ + scsi_ulto2b(0x0102, &sfs_ptr->codes[2 * n++]); + if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { + /* Basic Provisioning 2016 */ + scsi_ulto2b(0x0103, &sfs_ptr->codes[2 * n++]); + } + /* Drive Maintenance 2016 */ + //scsi_ulto2b(0x0104, &sfs_ptr->codes[2 * n++]); + } + scsi_ulto2b(4 + 2 * n, sfs_ptr->page_length); + + ctl_set_success(ctsio); + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + ctl_datamove((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); +} + +static int ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len) { struct ctl_lun *lun = CTL_LUN(ctsio); @@ -9811,7 +9867,7 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio *ctsio, int all else i = 0; bdc_ptr->wab_wac_ff = (i & 0x0f); - bdc_ptr->flags = SVPD_FUAB | SVPD_VBULS; + bdc_ptr->flags = SVPD_RBWZ | SVPD_FUAB | SVPD_VBULS; ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -9903,6 +9959,9 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsio) break; case SVPD_SCSI_TPC: retval = ctl_inquiry_evpd_tpc(ctsio, alloc_len); + break; + case SVPD_SCSI_SFS: + retval = ctl_inquiry_evpd_sfs(ctsio, alloc_len); break; case SVPD_BLOCK_LIMITS: if (lun == NULL || lun->be_lun->lun_type != T_DIRECT) Modified: stable/12/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.h Thu Aug 8 22:20:15 2019 (r350807) +++ stable/12/sys/cam/scsi/scsi_all.h Fri Aug 9 00:47:27 2019 (r350808) @@ -2763,6 +2763,19 @@ struct scsi_vpd_tpc }; /* + * SCSI Feature Sets VPD Page + */ +struct scsi_vpd_sfs +{ + uint8_t device; + uint8_t page_code; +#define SVPD_SCSI_SFS 0x92 + uint8_t page_length[2]; + uint8_t reserved[4]; + uint8_t codes[]; +}; + +/* * Block Device Characteristics VPD Page based on * T10/1799-D Revision 31 */ @@ -2803,11 +2816,15 @@ struct scsi_vpd_block_device_characteristics uint8_t flags; #define SVPD_VBULS 0x01 #define SVPD_FUAB 0x02 +#define SVPD_BOCS 0x04 +#define SVPD_RBWZ 0x08 #define SVPD_ZBC_NR 0x00 /* Not Reported */ #define SVPD_HAW_ZBC 0x10 /* Host Aware */ #define SVPD_DM_ZBC 0x20 /* Drive Managed */ #define SVPD_ZBC_MASK 0x30 /* Zoned mask */ - uint8_t reserved[55]; + uint8_t reserved[3]; + uint8_t depopulation_time[4]; + uint8_t reserved2[48]; }; #define SBDC_IS_PRESENT(bdc, length, field) \ From owner-svn-src-all@freebsd.org Fri Aug 9 00:48:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E6A5B83DB; Fri, 9 Aug 2019 00:48:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464RSJ73rwz3Myk; Fri, 9 Aug 2019 00:48: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 D41855B89; Fri, 9 Aug 2019 00:48:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x790mWwB036275; Fri, 9 Aug 2019 00:48:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x790mVsS036270; Fri, 9 Aug 2019 00:48:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908090048.x790mVsS036270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Aug 2019 00:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350809 - in stable/12: sys/cam/ctl sys/cam/scsi usr.sbin/ctladm X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: sys/cam/ctl sys/cam/scsi usr.sbin/ctladm X-SVN-Commit-Revision: 350809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 00:48:33 -0000 Author: mav Date: Fri Aug 9 00:48:31 2019 New Revision: 350809 URL: https://svnweb.freebsd.org/changeset/base/350809 Log: MFC r350346: Add device temperature reporting into CTL. The values to report can be set via LUN options. It can be useful for testing, and also required for Drive Maintenance 2016 feature set. Modified: stable/12/sys/cam/ctl/ctl.c stable/12/sys/cam/ctl/ctl.h stable/12/sys/cam/ctl/ctl_private.h stable/12/sys/cam/scsi/scsi_all.h stable/12/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl.c ============================================================================== --- stable/12/sys/cam/ctl/ctl.c Fri Aug 9 00:47:27 2019 (r350808) +++ stable/12/sys/cam/ctl/ctl.c Fri Aug 9 00:48:31 2019 (r350809) @@ -4450,12 +4450,14 @@ ctl_init_log_page_index(struct ctl_lun *lun) lun->log_pages.index[0].page_len = j; lun->log_pages.index[1].page_data = &lun->log_pages.subpages_page[0]; lun->log_pages.index[1].page_len = k * 2; - lun->log_pages.index[2].page_data = &lun->log_pages.lbp_page[0]; - lun->log_pages.index[2].page_len = 12*CTL_NUM_LBP_PARAMS; - lun->log_pages.index[3].page_data = (uint8_t *)&lun->log_pages.stat_page; - lun->log_pages.index[3].page_len = sizeof(lun->log_pages.stat_page); - lun->log_pages.index[4].page_data = (uint8_t *)&lun->log_pages.ie_page; - lun->log_pages.index[4].page_len = sizeof(lun->log_pages.ie_page); + lun->log_pages.index[2].page_data = (uint8_t *)&lun->log_pages.temp_page; + lun->log_pages.index[2].page_len = sizeof(lun->log_pages.temp_page); + lun->log_pages.index[3].page_data = &lun->log_pages.lbp_page[0]; + lun->log_pages.index[3].page_len = 12*CTL_NUM_LBP_PARAMS; + lun->log_pages.index[4].page_data = (uint8_t *)&lun->log_pages.stat_page; + lun->log_pages.index[4].page_len = sizeof(lun->log_pages.stat_page); + lun->log_pages.index[5].page_data = (uint8_t *)&lun->log_pages.ie_page; + lun->log_pages.index[5].page_len = sizeof(lun->log_pages.ie_page); return (CTL_RETVAL_COMPLETE); } @@ -6679,6 +6681,40 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) } int +ctl_temp_log_sense_handler(struct ctl_scsiio *ctsio, + struct ctl_page_index *page_index, + int pc) +{ + struct ctl_lun *lun = CTL_LUN(ctsio); + struct scsi_log_temperature *data; + const char *value; + + data = (struct scsi_log_temperature *)page_index->page_data; + + scsi_ulto2b(SLP_TEMPERATURE, data->hdr.param_code); + data->hdr.param_control = SLP_LBIN; + data->hdr.param_len = sizeof(struct scsi_log_temperature) - + sizeof(struct scsi_log_param_header); + if ((value = dnvlist_get_string(lun->be_lun->options, "temperature", + NULL)) != NULL) + data->temperature = strtol(value, NULL, 0); + else + data->temperature = 0xff; + data++; + + scsi_ulto2b(SLP_REFTEMPERATURE, data->hdr.param_code); + data->hdr.param_control = SLP_LBIN; + data->hdr.param_len = sizeof(struct scsi_log_temperature) - + sizeof(struct scsi_log_param_header); + if ((value = dnvlist_get_string(lun->be_lun->options, "reftemperature", + NULL)) != NULL) + data->temperature = strtol(value, NULL, 0); + else + data->temperature = 0xff; + return (0); +} + +int ctl_lbp_log_sense_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, int pc) @@ -6802,6 +6838,7 @@ ctl_ie_log_sense_handler(struct ctl_scsiio *ctsio, { struct ctl_lun *lun = CTL_LUN(ctsio); struct scsi_log_informational_exceptions *data; + const char *value; data = (struct scsi_log_informational_exceptions *)page_index->page_data; @@ -6811,7 +6848,11 @@ ctl_ie_log_sense_handler(struct ctl_scsiio *ctsio, sizeof(struct scsi_log_param_header); data->ie_asc = lun->ie_asc; data->ie_ascq = lun->ie_ascq; - data->temperature = 0xff; + if ((value = dnvlist_get_string(lun->be_lun->options, "temperature", + NULL)) != NULL) + data->temperature = strtol(value, NULL, 0); + else + data->temperature = 0xff; return (0); } Modified: stable/12/sys/cam/ctl/ctl.h ============================================================================== --- stable/12/sys/cam/ctl/ctl.h Fri Aug 9 00:47:27 2019 (r350808) +++ stable/12/sys/cam/ctl/ctl.h Fri Aug 9 00:48:31 2019 (r350809) @@ -158,6 +158,9 @@ int ctl_default_page_handler(struct ctl_scsiio *ctsio, int ctl_ie_page_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, uint8_t *page_ptr); +int ctl_temp_log_sense_handler(struct ctl_scsiio *ctsio, + struct ctl_page_index *page_index, + int pc); int ctl_lbp_log_sense_handler(struct ctl_scsiio *ctsio, struct ctl_page_index *page_index, int pc); Modified: stable/12/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/12/sys/cam/ctl/ctl_private.h Fri Aug 9 00:47:27 2019 (r350808) +++ stable/12/sys/cam/ctl/ctl_private.h Fri Aug 9 00:48:31 2019 (r350809) @@ -331,6 +331,8 @@ static const struct ctl_page_index log_page_index_temp CTL_PAGE_FLAG_ALL, NULL, NULL}, {SLS_SUPPORTED_PAGES_PAGE, SLS_SUPPORTED_SUBPAGES_SUBPAGE, 0, NULL, CTL_PAGE_FLAG_ALL, NULL, NULL}, + {SLS_TEMPERATURE, 0, 0, NULL, + CTL_PAGE_FLAG_DIRECT, ctl_temp_log_sense_handler, NULL}, {SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL, CTL_PAGE_FLAG_DIRECT, ctl_lbp_log_sense_handler, NULL}, {SLS_STAT_AND_PERF, 0, 0, NULL, @@ -351,6 +353,7 @@ struct ctl_log_pages { struct scsi_log_idle_time it; struct scsi_log_time_interval ti; } stat_page; + struct scsi_log_temperature temp_page[2]; struct scsi_log_informational_exceptions ie_page; struct ctl_page_index index[CTL_NUM_LOG_PAGES]; }; Modified: stable/12/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.h Fri Aug 9 00:47:27 2019 (r350808) +++ stable/12/sys/cam/scsi/scsi_all.h Fri Aug 9 00:48:31 2019 (r350809) @@ -568,6 +568,7 @@ struct scsi_log_sense #define SLS_ERROR_NONMEDIUM_PAGE 0x06 #define SLS_ERROR_LASTN_PAGE 0x07 #define SLS_LOGICAL_BLOCK_PROVISIONING 0x0c +#define SLS_TEMPERATURE 0x0d #define SLS_SELF_TEST_PAGE 0x10 #define SLS_SOLID_STATE_MEDIA 0x11 #define SLS_STAT_AND_PERF 0x19 @@ -680,6 +681,14 @@ struct scsi_log_informational_exceptions { #define SLP_IE_GEN 0x0000 uint8_t ie_asc; uint8_t ie_ascq; + uint8_t temperature; +}; + +struct scsi_log_temperature { + struct scsi_log_param_header hdr; +#define SLP_TEMPERATURE 0x0000 +#define SLP_REFTEMPERATURE 0x0001 + uint8_t reserved; uint8_t temperature; }; Modified: stable/12/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/12/usr.sbin/ctladm/ctladm.8 Fri Aug 9 00:47:27 2019 (r350808) +++ stable/12/usr.sbin/ctladm/ctladm.8 Fri Aug 9 00:48:31 2019 (r350809) @@ -36,7 +36,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd May 10, 2018 +.Dd July 25, 2019 .Dt CTLADM 8 .Os .Sh NAME @@ -918,6 +918,9 @@ Specifies medium rotation rate of the device: 0 -- not .It Va formfactor Specifies nominal form factor of the device: 0 -- not reported, 1 -- 5.25", 2 -- 3.5", 3 -- 2.5", 4 -- 1.8", 5 -- less then 1.8". +.It Va temperature +.It Va reftemperature +Specify current and reference (maximum) temperatures of the device. .It Va provisioning_type When UNMAP support is enabled, this option specifies provisioning type: "resource", "thin" or "unknown". From owner-svn-src-all@freebsd.org Fri Aug 9 00:49:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E79B0B8455; Fri, 9 Aug 2019 00:49:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464RSt5mNtz3N5p; Fri, 9 Aug 2019 00:49:02 +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 A91645B8A; Fri, 9 Aug 2019 00:49:02 +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 x790n2T0036359; Fri, 9 Aug 2019 00:49:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x790n2ws036358; Fri, 9 Aug 2019 00:49:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908090049.x790n2ws036358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Aug 2019 00:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350810 - in stable/12/sys/cam: ctl scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: ctl scsi X-SVN-Commit-Revision: 350810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 00:49:03 -0000 Author: mav Date: Fri Aug 9 00:49:02 2019 New Revision: 350810 URL: https://svnweb.freebsd.org/changeset/base/350810 Log: MFC r350363: Add support for Long LBA mode parameter block descriptor. It is formally required for SBC Base 2016 feature set. Modified: stable/12/sys/cam/ctl/ctl.c stable/12/sys/cam/scsi/scsi_all.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl.c ============================================================================== --- stable/12/sys/cam/ctl/ctl.c Fri Aug 9 00:48:31 2019 (r350809) +++ stable/12/sys/cam/ctl/ctl.c Fri Aug 9 00:49:02 2019 (r350810) @@ -6365,13 +6365,12 @@ int ctl_mode_sense(struct ctl_scsiio *ctsio) { struct ctl_lun *lun = CTL_LUN(ctsio); - int pc, page_code, dbd, subpage; - int alloc_len, page_len, header_len, total_len; - struct scsi_mode_block_descr *block_desc; + int pc, page_code, llba, subpage; + int alloc_len, page_len, header_len, bd_len, total_len; + void *block_desc; struct ctl_page_index *page_index; - dbd = 0; - block_desc = NULL; + llba = 0; CTL_DEBUG_PRINT(("ctl_mode_sense\n")); @@ -6383,9 +6382,10 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header_len = sizeof(struct scsi_mode_hdr_6); if (cdb->byte2 & SMS_DBD) - dbd = 1; + bd_len = 0; else - header_len += sizeof(struct scsi_mode_block_descr); + bd_len = sizeof(struct scsi_mode_block_descr); + header_len += bd_len; pc = (cdb->page & SMS_PAGE_CTRL_MASK) >> 6; page_code = cdb->page & SMS_PAGE_CODE; @@ -6399,11 +6399,18 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) cdb = (struct scsi_mode_sense_10 *)ctsio->cdb; header_len = sizeof(struct scsi_mode_hdr_10); + if (cdb->byte2 & SMS_DBD) { + bd_len = 0; + } else if (lun->be_lun->lun_type == T_DIRECT) { + if (cdb->byte2 & SMS10_LLBAA) { + llba = 1; + bd_len = sizeof(struct scsi_mode_block_descr_dlong); + } else + bd_len = sizeof(struct scsi_mode_block_descr_dshort); + } else + bd_len = sizeof(struct scsi_mode_block_descr); + header_len += bd_len; - if (cdb->byte2 & SMS_DBD) - dbd = 1; - else - header_len += sizeof(struct scsi_mode_block_descr); pc = (cdb->page & SMS_PAGE_CTRL_MASK) >> 6; page_code = cdb->page & SMS_PAGE_CODE; subpage = cdb->subpage; @@ -6536,12 +6543,8 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) (lun->MODE_CTRL.eca_and_aen & SCP_SWP) != 0) header->dev_specific |= 0x80; /* WP */ } - if (dbd) - header->block_descr_len = 0; - else - header->block_descr_len = - sizeof(struct scsi_mode_block_descr); - block_desc = (struct scsi_mode_block_descr *)&header[1]; + header->block_descr_len = bd_len; + block_desc = &header[1]; break; } case MODE_SENSE_10: { @@ -6558,12 +6561,10 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) (lun->MODE_CTRL.eca_and_aen & SCP_SWP) != 0) header->dev_specific |= 0x80; /* WP */ } - if (dbd) - scsi_ulto2b(0, header->block_descr_len); - else - scsi_ulto2b(sizeof(struct scsi_mode_block_descr), - header->block_descr_len); - block_desc = (struct scsi_mode_block_descr *)&header[1]; + if (llba) + header->flags |= SMH_LONGLBA; + scsi_ulto2b(bd_len, header->block_descr_len); + block_desc = &header[1]; break; } default: @@ -6574,12 +6575,27 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) * If we've got a disk, use its blocksize in the block * descriptor. Otherwise, just set it to 0. */ - if (dbd == 0) { - if (lun->be_lun->lun_type == T_DIRECT) - scsi_ulto3b(lun->be_lun->blocksize, - block_desc->block_len); - else - scsi_ulto3b(0, block_desc->block_len); + if (bd_len > 0) { + if (lun->be_lun->lun_type == T_DIRECT) { + if (llba) { + struct scsi_mode_block_descr_dlong *bd = block_desc; + if (lun->be_lun->maxlba != 0) + scsi_u64to8b(lun->be_lun->maxlba + 1, + bd->num_blocks); + scsi_ulto4b(lun->be_lun->blocksize, + bd->block_len); + } else { + struct scsi_mode_block_descr_dshort *bd = block_desc; + if (lun->be_lun->maxlba != 0) + scsi_ulto4b(MIN(lun->be_lun->maxlba+1, + UINT32_MAX), bd->num_blocks); + scsi_ulto3b(lun->be_lun->blocksize, + bd->block_len); + } + } else { + struct scsi_mode_block_descr *bd = block_desc; + scsi_ulto3b(0, bd->block_len); + } } switch (page_code) { Modified: stable/12/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.h Fri Aug 9 00:48:31 2019 (r350809) +++ stable/12/sys/cam/scsi/scsi_all.h Fri Aug 9 00:49:02 2019 (r350810) @@ -264,7 +264,9 @@ struct scsi_mode_hdr_10 u_int8_t datalen[2]; u_int8_t medium_type; u_int8_t dev_specific; - u_int8_t reserved[2]; + u_int8_t flags; +#define SMH_LONGLBA 0x01 + u_int8_t reserved; u_int8_t block_descr_len[2]; }; @@ -274,6 +276,20 @@ struct scsi_mode_block_descr u_int8_t num_blocks[3]; u_int8_t reserved; u_int8_t block_len[3]; +}; + +struct scsi_mode_block_descr_dshort +{ + u_int8_t num_blocks[4]; + u_int8_t reserved; + u_int8_t block_len[3]; +}; + +struct scsi_mode_block_descr_dlong +{ + u_int8_t num_blocks[8]; + u_int8_t reserved[4]; + u_int8_t block_len[4]; }; struct scsi_per_res_in From owner-svn-src-all@freebsd.org Fri Aug 9 00:49:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F40B0B84C7; Fri, 9 Aug 2019 00:49: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464RTS6Bz8z3NCv; Fri, 9 Aug 2019 00:49: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 9CCDD5B8B; Fri, 9 Aug 2019 00:49:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x790nWM1036437; Fri, 9 Aug 2019 00:49:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x790nWnZ036434; Fri, 9 Aug 2019 00:49:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908090049.x790nWnZ036434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Aug 2019 00:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350811 - in stable/12/sys/cam: ctl scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/cam: ctl scsi X-SVN-Commit-Revision: 350811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 00:49:33 -0000 Author: mav Date: Fri Aug 9 00:49:31 2019 New Revision: 350811 URL: https://svnweb.freebsd.org/changeset/base/350811 Log: MFC r350378: Allow WRITE SAME handle more then 2^^32 blocks. If not limited by write_same_max_lba option, split operation into several 2^^31 blocks chunks in a loop. For large disks it may take a while, so setting write_same_max_lba may be useful to avoid timeouts. While there, fix build with CAM_CTL_DEBUG. Modified: stable/12/sys/cam/ctl/ctl.c stable/12/sys/cam/scsi/scsi_all.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl.c ============================================================================== --- stable/12/sys/cam/ctl/ctl.c Fri Aug 9 00:49:02 2019 (r350810) +++ stable/12/sys/cam/ctl/ctl.c Fri Aug 9 00:49:31 2019 (r350811) @@ -1438,7 +1438,7 @@ ctl_isc_event_handler(ctl_ha_channel channel, ctl_ha_e return; } - CTL_DEBUG_PRINT(("CTL: msg_type %d\n", msg->msg_type)); + CTL_DEBUG_PRINT(("CTL: msg_type %d\n", msg->hdr.msg_type)); switch (msg->hdr.msg_type) { case CTL_MSG_SERIALIZE: io = ctl_alloc_io(softc->othersc_pool); @@ -5685,12 +5685,36 @@ ctl_write_buffer(struct ctl_scsiio *ctsio) return (CTL_RETVAL_COMPLETE); } +static int +ctl_write_same_cont(union ctl_io *io) +{ + struct ctl_lun *lun = CTL_LUN(io); + struct ctl_scsiio *ctsio; + struct ctl_lba_len_flags *lbalen; + int retval; + + ctsio = &io->scsiio; + ctsio->io_hdr.status = CTL_STATUS_NONE; + lbalen = (struct ctl_lba_len_flags *) + &ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba += lbalen->len; + if ((lun->be_lun->maxlba + 1) - lbalen->lba <= UINT32_MAX) { + ctsio->io_hdr.flags &= ~CTL_FLAG_IO_CONT; + lbalen->len = (lun->be_lun->maxlba + 1) - lbalen->lba; + } + + CTL_DEBUG_PRINT(("ctl_write_same_cont: calling config_write()\n")); + retval = lun->backend->config_write((union ctl_io *)ctsio); + return (retval); +} + int ctl_write_same(struct ctl_scsiio *ctsio) { struct ctl_lun *lun = CTL_LUN(ctsio); struct ctl_lba_len_flags *lbalen; - uint64_t lba; + const char *val; + uint64_t lba, ival; uint32_t num_blocks; int len, retval; uint8_t byte2; @@ -5754,17 +5778,25 @@ ctl_write_same(struct ctl_scsiio *ctsio) /* Zero number of blocks means "to the last logical block" */ if (num_blocks == 0) { - if ((lun->be_lun->maxlba + 1) - lba > UINT32_MAX) { + ival = UINT64_MAX; + val = dnvlist_get_string(lun->be_lun->options, + "write_same_max_lba", NULL); + if (val != NULL) + ctl_expand_number(val, &ival); + if ((lun->be_lun->maxlba + 1) - lba > ival) { ctl_set_invalid_field(ctsio, - /*sks_valid*/ 0, - /*command*/ 1, - /*field*/ 0, - /*bit_valid*/ 0, - /*bit*/ 0); + /*sks_valid*/ 1, /*command*/ 1, + /*field*/ ctsio->cdb[0] == WRITE_SAME_10 ? 7 : 10, + /*bit_valid*/ 0, /*bit*/ 0); ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } - num_blocks = (lun->be_lun->maxlba + 1) - lba; + if ((lun->be_lun->maxlba + 1) - lba > UINT32_MAX) { + ctsio->io_hdr.flags |= CTL_FLAG_IO_CONT; + ctsio->io_cont = ctl_write_same_cont; + num_blocks = 1 << 31; + } else + num_blocks = (lun->be_lun->maxlba + 1) - lba; } len = lun->be_lun->blocksize; @@ -9876,6 +9908,8 @@ ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio if (val != NULL) ctl_expand_number(val, &ival); scsi_u64to8b(ival, bl_ptr->max_write_same_length); + if (lun->be_lun->maxlba + 1 > ival) + bl_ptr->flags |= SVPD_BL_WSNZ; } ctl_set_success(ctsio); @@ -11322,7 +11356,7 @@ ctl_failover_lun(union ctl_io *rio) uint32_t targ_lun; targ_lun = rio->io_hdr.nexus.targ_mapped_lun; - CTL_DEBUG_PRINT(("FAILOVER for lun %ju\n", targ_lun)); + CTL_DEBUG_PRINT(("FAILOVER for lun %u\n", targ_lun)); /* Find and lock the LUN. */ mtx_lock(&softc->ctl_lock); Modified: stable/12/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/12/sys/cam/scsi/scsi_all.h Fri Aug 9 00:49:02 2019 (r350810) +++ stable/12/sys/cam/scsi/scsi_all.h Fri Aug 9 00:49:31 2019 (r350811) @@ -2886,7 +2886,7 @@ struct scsi_vpd_logical_block_prov }; /* - * Block Limits VDP Page based on SBC-4 Revision 2 + * Block Limits VDP Page based on SBC-4 Revision 17 */ struct scsi_vpd_block_limits { @@ -2896,7 +2896,8 @@ struct scsi_vpd_block_limits u_int8_t page_length[2]; #define SVPD_BL_PL_BASIC 0x10 #define SVPD_BL_PL_TP 0x3C - u_int8_t reserved1; + u_int8_t flags; +#define SVPD_BL_WSNZ 0x01 u_int8_t max_cmp_write_len; u_int8_t opt_txfer_len_grain[2]; u_int8_t max_txfer_len[4]; From owner-svn-src-all@freebsd.org Fri Aug 9 00:50:02 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B46F1B854D; Fri, 9 Aug 2019 00:50:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464RV24Hdbz3NL6; Fri, 9 Aug 2019 00:50:02 +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 75F555B8F; Fri, 9 Aug 2019 00:50:02 +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 x790o2Ir036552; Fri, 9 Aug 2019 00:50:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x790o23A036551; Fri, 9 Aug 2019 00:50:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201908090050.x790o23A036551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Aug 2019 00:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350812 - stable/12/sys/cam/ctl X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ctl X-SVN-Commit-Revision: 350812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 00:50:02 -0000 Author: mav Date: Fri Aug 9 00:50:02 2019 New Revision: 350812 URL: https://svnweb.freebsd.org/changeset/base/350812 Log: MFC r350383: Reenable UNMAP support on ramdisks by default. For some reason, I guess just mechanical editing, it was disable in r333446. Modified: stable/12/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_backend_ramdisk.c Fri Aug 9 00:49:31 2019 (r350811) +++ stable/12/sys/cam/ctl/ctl_backend_ramdisk.c Fri Aug 9 00:50:02 2019 (r350812) @@ -1073,7 +1073,7 @@ ctl_backend_ramdisk_create(struct ctl_be_ramdisk_softc params->lun_size_bytes = be_lun->size_bytes; value = dnvlist_get_string(cbe_lun->options, "unmap", NULL); - if (value != NULL && strcmp(value, "off") != 0) + if (value == NULL || strcmp(value, "off") != 0) cbe_lun->flags |= CTL_LUN_FLAG_UNMAP; value = dnvlist_get_string(cbe_lun->options, "readonly", NULL); if (value != NULL) { From owner-svn-src-all@freebsd.org Fri Aug 9 01:38:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 974DAB91DD for ; Fri, 9 Aug 2019 01:38:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464SZ92Ykvz3Pxq for ; Fri, 9 Aug 2019 01:38:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x842.google.com with SMTP id t12so5742771qtp.9 for ; Thu, 08 Aug 2019 18:38: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=Za4kNDf3+zUt5DKsAq9XjAe0wPpfoDYZiLcjTPSv0Gk=; b=f5O7RmjGCOIVYOFEsQNuNBm6T4OabtU+zpfdlzHqKrr7BoiOBpKSx7y2Fpw6plsT8Q c2Ozmyqb6O1oMkhGj7+QEh0C+GP/80o9tlOBd62bf9W0zy6V0AOvtm9+kLbsiJmI9PFD fgG+aLBF2+W6QroB1mITXazVEEF/EJQhaq6ov0fmwkYUpiUu4kmk1ayAG/4cx00cudah +PthOhHSXWf7yPlwljjVi9PlR2yPnvywrnvhEvDVyMCGJqD/RCrE4ZB+9BlO4MWVYOFe MNWVUowzd2exyBn6+zoInCXrTmy5YwkMDgX3nKI3NFUHtXTdr6iZOUQZ4hW4VYMOmtAq dfFw== 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=Za4kNDf3+zUt5DKsAq9XjAe0wPpfoDYZiLcjTPSv0Gk=; b=bRi8zmmNDjihcuUu4C/7lZ+921PQ+FwHlJKB3Xo2DYUg4nzzM9ks2QLUsSm/M/oIIQ Roo8Ai6Cd+9INX544FSL/jqT7YgGvL42dfAzE7wzkSwXXU/d++/z6uCIT1fKGK7pXVfQ vzLGimuzSWeL9rPxP88r2xdKtNludVQakEKLA2Zgotb1D9gyfEt4jrbmMaNB24apcALs h2NO3meQNTClWgIy0sy0qkHn/hAhHmTihLNnStNKHPpncjAk/te934ICP5cp8LOKoYp1 kqrOQ4DSl9KksypSOh6XVCXBa5UzOpd1l3cQOh8DBKI6CIjVDEP6JEcdZmaDCNN8UK07 0Jsw== X-Gm-Message-State: APjAAAXwevBUZrbjdWJ0TyWEzz/+nR6GIoVFikN5rLINjSh2ay4a99cp Ma361TIFrZH2g5ODENY27x3Qo/i3oC4Hc48qoVxCXg== X-Google-Smtp-Source: APXvYqzUKqiZqNZM3KZ4u2PLX5eXF3HLvVJCbb9pmJ8uVA0iogtAPd5DLjXXa38v4Zxh3ca1RHVnTsef+rQzIHPi69M= X-Received: by 2002:a0c:c250:: with SMTP id w16mr4480540qvh.188.1565314720151; Thu, 08 Aug 2019 18:38:40 -0700 (PDT) MIME-Version: 1.0 References: <201908081748.x78Hm79V085760@repo.freebsd.org> <20190808225947.GD1531@FreeBSD.org> In-Reply-To: <20190808225947.GD1531@FreeBSD.org> From: Warner Losh Date: Thu, 8 Aug 2019 19:38:28 -0600 Message-ID: Subject: Re: svn commit: r350764 - head/sys/arm64/arm64 To: Gleb Smirnoff Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 464SZ92Ykvz3Pxq X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=f5O7RmjG; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::842) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.32 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[9]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.63)[-0.629,0]; RCVD_IN_DNSWL_NONE(0.00)[2.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-0.69)[ip: (2.04), ipnet: 2607:f8b0::/32(-3.03), asn: 15169(-2.43), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2019 01:38:42 -0000 On Thu, Aug 8, 2019, 4:59 PM Gleb Smirnoff wrote: > Hi, > > why do we need COMPAT_43 for arm64 at all? I can't imagine an > application that would require this compatibility. > > A more general question is how far in the future are we going > to carry COMPAT_43 for i386/amd64? > COMPAT_43 is a weird option. It's a combo of both sys calls and kernel behavior modifications. Before we thinned the ABIs we supported, it was necessary for them as well. The biggest behavior change is around signals. It is weird to sort out and nobody has done the deep analysis to see what is truly unused and what is there for compat with Linux and other SysV systems... Warner On Thu, Aug 08, 2019 at 05:48:07PM +0000, Warner Losh wrote: > W> Author: imp > W> Date: Thu Aug 8 17:48:07 2019 > W> New Revision: 350764 > W> URL: https://svnweb.freebsd.org/changeset/base/350764 > W> > W> Log: > W> Make arm64 32-bit mode compile with COMPAT_43 > W> > W> The COMPAT_43 option isn't quite like the other compat options, and > arm64 makes > W> attempts to support it in 64-bit mode. In 32-bit compat mode, > however, two > W> syscall implementations that COMPAT_FREEBSD32 assumes will be there > are > W> missing. Provide implementations for these: ofreebsd32_sigreturn > (which we'll > W> never encounter, so implement it as nosys as is done in kern_sig.c) > and > W> ofreebsd32_getpagesize, where we'll always return 4096 since that's > the only > W> PAGE_SIZE we support, similar to how the ia32 implementation does > things. > W> > W> Reviewed by: manu@ > W> Differential Revision: https://reviews.freebsd.org/D21192 > W> > W> Modified: > W> head/sys/arm64/arm64/freebsd32_machdep.c > W> > W> Modified: head/sys/arm64/arm64/freebsd32_machdep.c > W> > ============================================================================== > W> --- head/sys/arm64/arm64/freebsd32_machdep.c Thu Aug 8 17:30:51 2019 > (r350763) > W> +++ head/sys/arm64/arm64/freebsd32_machdep.c Thu Aug 8 17:48:07 2019 > (r350764) > W> @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); > W> #include > W> #include > W> #include > W> +#include > W> #include > W> #ifdef VFP > W> #include > W> @@ -410,3 +411,30 @@ freebsd32_sendsig(sig_t catcher, ksiginfo_t *ksi, > sigs > W> mtx_lock(&psp->ps_mtx); > W> > W> } > W> + > W> +#ifdef COMPAT_43 > W> +/* > W> + * COMPAT_FREEBSD32 assumes we have this system call when COMPAT_43 is > defined. > W> + * FreeBSD/arm provies a similar getpagesize() syscall. > W> + */ > W> +#define ARM32_PAGE_SIZE 4096 > W> +int > W> +ofreebsd32_getpagesize(struct thread *td, > W> + struct ofreebsd32_getpagesize_args *uap) > W> +{ > W> + > W> + td->td_retval[0] = ARM32_PAGE_SIZE; > W> + return (0); > W> +} > W> + > W> +/* > W> + * Mirror the osigreturn definition in kern_sig.c for !i386 platforms. > This > W> + * mirrors what's connected to the FreeBSD/arm syscall. > W> + */ > W> +int > W> +ofreebsd32_sigreturn(struct thread *td, struct > ofreebsd32_sigreturn_args *uap) > W> +{ > W> + > W> + return (nosys(td, (struct nosys_args *)uap)); > W> +} > W> +#endif > W> _______________________________________________ > W> svn-src-all@freebsd.org mailing list > W> https://lists.freebsd.org/mailman/listinfo/svn-src-all > W> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > -- > Gleb Smirnoff > From owner-svn-src-all@freebsd.org Fri Aug 9 02:11:48 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07328B9A07; Fri, 9 Aug 2019 02:11:48 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464TJM5jGcz3R2p; Fri, 9 Aug 2019 02:11:47 +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 A5A6B6B0F; Fri, 9 Aug 2019 02:11:47 +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 x792Bl4M087100; Fri, 9 Aug 2019 02:11:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x792Bl7f087099; Fri, 9 Aug 2019 02:11:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908090211.x792Bl7f087099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 9 Aug 2019 02:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350813 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 350813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 02:11:48 -0000 Author: cem Date: Fri Aug 9 02:11:47 2019 New Revision: 350813 URL: https://svnweb.freebsd.org/changeset/base/350813 Log: tools/tools/crypto: cryptokeytest: Fix build with newer OpenSSL Also, drag into this decade. Modified: head/tools/tools/crypto/cryptokeytest.c Modified: head/tools/tools/crypto/cryptokeytest.c ============================================================================== --- head/tools/tools/crypto/cryptokeytest.c Fri Aug 9 00:50:02 2019 (r350812) +++ head/tools/tools/crypto/cryptokeytest.c Fri Aug 9 02:11:47 2019 (r350813) @@ -7,19 +7,21 @@ * --Jason L. Wright */ #include +#include #include -#include #include #include -#include -#include -#include #include +#include +#include +#include #include #include -#include +#include +#include + int crid = CRYPTO_FLAG_HARDWARE; int verbose = 0; @@ -63,80 +65,64 @@ crfind(int crid) } /* - * Convert a little endian byte string in 'p' that - * is 'plen' bytes long to a BIGNUM. If 'dst' is NULL, - * a new BIGNUM is allocated. Returns NULL on failure. - * - * XXX there has got to be a more efficient way to do - * this, but I haven't figured out enough of the OpenSSL - * magic. + * Convert a little endian byte string in 'p' that is 'plen' bytes long to a + * BIGNUM. A new BIGNUM is allocated. Returns NULL on failure. */ -BIGNUM * -le_to_bignum(BIGNUM *dst, u_int8_t *p, int plen) +static BIGNUM * +le_to_bignum(BIGNUM *res, const void *p, int plen) { - u_int8_t *pd; - int i; - if (plen == 0) - return (NULL); + res = BN_lebin2bn(p, plen, res); + if (res == NULL) + ERR_print_errors_fp(stderr); - if ((pd = (u_int8_t *)malloc(plen)) == NULL) - return (NULL); - - for (i = 0; i < plen; i++) - pd[i] = p[plen - i - 1]; - - dst = BN_bin2bn(pd, plen, dst); - free(pd); - return (dst); + return (res); } /* - * Convert a BIGNUM to a little endian byte string. - * If 'rd' is NULL, allocate space for it, otherwise - * 'rd' is assumed to have room for BN_num_bytes(n) - * bytes. Returns NULL on failure. + * Convert a BIGNUM to a little endian byte string. Space for BN_num_bytes(n) + * is allocated. + * Returns NULL on failure. */ -u_int8_t * -bignum_to_le(BIGNUM *n, u_int8_t *rd) +static void * +bignum_to_le(const BIGNUM *n) { - int i, j, k; - int blen = BN_num_bytes(n); + int blen, error; + void *rd; + blen = BN_num_bytes(n); if (blen == 0) return (NULL); + + rd = malloc(blen); if (rd == NULL) - rd = (u_int8_t *)malloc(blen); - if (rd == NULL) return (NULL); - for (i = 0, j = 0; i < n->top; i++) { - for (k = 0; k < BN_BITS2 / 8; k++) { - if ((j + k) >= blen) - goto out; - rd[j + k] = n->d[i] >> (k * 8); - } - j += BN_BITS2 / 8; + error = BN_bn2lebinpad(n, rd, blen); + if (error < 0) { + ERR_print_errors_fp(stderr); + free(rd); + return (NULL); } -out: + return (rd); } -int -UB_mod_exp(BIGNUM *res, BIGNUM *a, BIGNUM *b, BIGNUM *c, BN_CTX *ctx) +static int +UB_mod_exp(BIGNUM *res, const BIGNUM *a, const BIGNUM *b, const BIGNUM *c) { struct crypt_kop kop; - u_int8_t *ale, *ble, *cle; + void *ale, *ble, *cle; static int crypto_fd = -1; if (crypto_fd == -1 && ioctl(devcrypto(), CRIOGET, &crypto_fd) == -1) err(1, "CRIOGET"); - if ((ale = bignum_to_le(a, NULL)) == NULL) + if ((ale = bignum_to_le(a)) == NULL) err(1, "bignum_to_le, a"); - if ((ble = bignum_to_le(b, NULL)) == NULL) + if ((ble = bignum_to_le(b)) == NULL) err(1, "bignum_to_le, b"); - if ((cle = bignum_to_le(c, NULL)) == NULL) + if ((cle = bignum_to_le(c)) == NULL) err(1, "bignum_to_le, c"); bzero(&kop, sizeof(kop)); @@ -158,19 +144,19 @@ UB_mod_exp(BIGNUM *res, BIGNUM *a, BIGNUM *b, BIGNUM * if (verbose) printf("device = %s\n", crfind(kop.crk_crid)); - bzero(ale, BN_num_bytes(a)); + explicit_bzero(ale, BN_num_bytes(a)); free(ale); - bzero(ble, BN_num_bytes(b)); + explicit_bzero(ble, BN_num_bytes(b)); free(ble); if (kop.crk_status != 0) { printf("error %d\n", kop.crk_status); - bzero(cle, BN_num_bytes(c)); + explicit_bzero(cle, BN_num_bytes(c)); free(cle); return (-1); } else { res = le_to_bignum(res, cle, BN_num_bytes(c)); - bzero(cle, BN_num_bytes(c)); + explicit_bzero(cle, BN_num_bytes(c)); free(cle); if (res == NULL) err(1, "le_to_bignum"); @@ -179,9 +165,9 @@ UB_mod_exp(BIGNUM *res, BIGNUM *a, BIGNUM *b, BIGNUM * return (0); } -void -show_result(a, b, c, sw, hw) -BIGNUM *a, *b, *c, *sw, *hw; +static void +show_result(const BIGNUM *a, const BIGNUM *b, const BIGNUM *c, + const BIGNUM *sw, const BIGNUM *hw) { printf("\n"); @@ -208,7 +194,7 @@ BIGNUM *a, *b, *c, *sw, *hw; printf("\n"); } -void +static void testit(void) { BIGNUM *a, *b, *c, *r1, *r2; @@ -230,10 +216,10 @@ testit(void) BIGNUM *rem = BN_new(); BN_mod(rem, a, c, ctx); - UB_mod_exp(r2, rem, b, c, ctx); + UB_mod_exp(r2, rem, b, c); BN_free(rem); } else { - UB_mod_exp(r2, a, b, c, ctx); + UB_mod_exp(r2, a, b, c); } BN_mod_exp(r1, a, b, c, ctx); From owner-svn-src-all@freebsd.org Fri Aug 9 02:20:27 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6595AB9B2E; Fri, 9 Aug 2019 02:20:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464TVM1pwdz3RGY; Fri, 9 Aug 2019 02:20:27 +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 350CA6B64; Fri, 9 Aug 2019 02:20:27 +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 x792KQx6089449; Fri, 9 Aug 2019 02:20:26 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x792KQw2089448; Fri, 9 Aug 2019 02:20:26 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201908090220.x792KQw2089448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 9 Aug 2019 02:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350814 - head/usr.sbin/autofs X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.sbin/autofs X-SVN-Commit-Revision: 350814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 02:20:27 -0000 Author: jhibbits Date: Fri Aug 9 02:20:26 2019 New Revision: 350814 URL: https://svnweb.freebsd.org/changeset/base/350814 Log: autofs: Fix autounmountd's printing of mount time. time_t should be printed as intmax_t. Even though duration should be short, the correct way to print is intmax_t, not long. Reported by: ian,imp Modified: head/usr.sbin/autofs/autounmountd.c Modified: head/usr.sbin/autofs/autounmountd.c ============================================================================== --- head/usr.sbin/autofs/autounmountd.c Fri Aug 9 02:11:47 2019 (r350813) +++ head/usr.sbin/autofs/autounmountd.c Fri Aug 9 02:20:26 2019 (r350814) @@ -196,9 +196,9 @@ expire_automounted(time_t expiration_time) if (mounted_for < expiration_time) { log_debugx("skipping %s (FSID:%d:%d), mounted " - "for %ld seconds", af->af_mountpoint, + "for %jd seconds", af->af_mountpoint, af->af_fsid.val[0], af->af_fsid.val[1], - (long)mounted_for); + (intmax_t)mounted_for); if (mounted_for > mounted_max) mounted_max = mounted_for; From owner-svn-src-all@freebsd.org Fri Aug 9 03:35:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCD14BB021; Fri, 9 Aug 2019 03:35:15 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [IPv6:2001:19f0:300:2185:123::1]) (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 464W8f2hssz40Jv; Fri, 9 Aug 2019 03:35:14 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [104.207.135.49]) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5) with ESMTP id x793Z6as074460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 9 Aug 2019 04:35:07 +0100 (BST) (envelope-from jamie@donotpassgo.dyslexicfish.net) Received: (from jamie@localhost) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5/Submit) id x793Z5WP074456; Fri, 9 Aug 2019 04:35:05 +0100 (BST) (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <201908090335.x793Z5WP074456@donotpassgo.dyslexicfish.net> Date: Fri, 09 Aug 2019 04:35:05 +0100 Organization: Dyslexic Fish To: jhb@freebsd.org, gjb@freebsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, freebsd-hackers@freebsd.org, freebsd-arch@freebsd.org Subject: Re: svn commit: r350550 - head/share/mk References: <201908030106.x7316Ibx078529@repo.freebsd.org> <20190806165614.GA41295@FreeBSD.org> In-Reply-To: <20190806165614.GA41295@FreeBSD.org> User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (donotpassgo.dyslexicfish.net [104.207.135.49]); Fri, 09 Aug 2019 04:35:07 +0100 (BST) X-Rspamd-Queue-Id: 464W8f2hssz40Jv X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=catflap.org; spf=pass (mx1.freebsd.org: domain of jamie@catflap.org designates 2001:19f0:300:2185:123::1 as permitted sender) smtp.mailfrom=jamie@catflap.org X-Spamd-Result: default: False [-3.90 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:dyslexicfish.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; HAS_ORG_HEADER(0.00)[]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_SHORT(-0.71)[-0.710,0]; DMARC_POLICY_ALLOW(-0.50)[catflap.org,none]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(-0.40)[ipnet: 2001:19f0::/38(-1.74), asn: 20473(-0.18), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:20473, ipnet:2001:19f0::/38, country:US]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2019 03:35:15 -0000 Glen Barber wrote: > after stable/12 branched, I have seen no public complaints about > enabling REPRODUCIBLE_BUILD by default (and quite honestly, do not see > the benefit of disabling it by default -- why wouldn't we want > reproducibility?). I track stable. I had no need to complain because I could edit src.conf and add WITHOUT_REPRODUCIBLE_BUILD=YES Please don't remove this ability thinking no-one minds reproducible builds.. I personally think they are pointless. Cheers, Jamie From owner-svn-src-all@freebsd.org Fri Aug 9 05:19:00 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FEEFBD2CA; Fri, 9 Aug 2019 05:19: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464YSN2nHyz444W; Fri, 9 Aug 2019 05:19: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 3D11A8BD9; Fri, 9 Aug 2019 05:19: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 x795J0Ww096496; Fri, 9 Aug 2019 05:19:00 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x795J0q0096491; Fri, 9 Aug 2019 05:19:00 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201908090519.x795J0q0096491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 9 Aug 2019 05:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350815 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 350815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 05:19:00 -0000 Author: jtl Date: Fri Aug 9 05:18:59 2019 New Revision: 350815 URL: https://svnweb.freebsd.org/changeset/base/350815 Log: In m_pulldown(), before trying to prepend bytes to the subsequent mbuf, ensure that the subsequent mbuf contains the remainder of the bytes the caller sought. If this is not the case, fall through to the code which gathers the bytes in a new mbuf. This fixes a bug where m_pulldown() could fail to gather all the desired bytes into consecutive memory. PR: 238787 Reported by: A reddit user Discussed with: emaste Obtained from: NetBSD MFC after: 3 days Modified: head/sys/kern/uipc_mbuf2.c Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Fri Aug 9 02:20:26 2019 (r350814) +++ head/sys/kern/uipc_mbuf2.c Fri Aug 9 05:18:59 2019 (r350815) @@ -216,7 +216,7 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp goto ok; } if ((off == 0 || offp) && M_LEADINGSPACE(n->m_next) >= hlen - && writable) { + && writable && n->m_next->m_len >= tlen) { n->m_next->m_data -= hlen; n->m_next->m_len += hlen; bcopy(mtod(n, caddr_t) + off, mtod(n->m_next, caddr_t), hlen); From owner-svn-src-all@freebsd.org Fri Aug 9 06:57:42 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A0A5BF8DD; Fri, 9 Aug 2019 06:57:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 464bfF5cctz48Td; Fri, 9 Aug 2019 06:57:41 +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 x796vX9i016514 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 9 Aug 2019 09:57:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x796vX9i016514 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x796vXql016513; Fri, 9 Aug 2019 09:57:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 9 Aug 2019 09:57:33 +0300 From: Konstantin Belousov To: Warner Losh Cc: Gleb Smirnoff , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r350764 - head/sys/arm64/arm64 Message-ID: <20190809065733.GI2731@kib.kiev.ua> References: <201908081748.x78Hm79V085760@repo.freebsd.org> <20190808225947.GD1531@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 464bfF5cctz48Td X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.96 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[6]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; IP_SCORE(0.00)[ip: (-2.61), ipnet: 2001:470::/32(-4.48), asn: 6939(-2.94), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 06:57:42 -0000 On Thu, Aug 08, 2019 at 07:38:28PM -0600, Warner Losh wrote: > On Thu, Aug 8, 2019, 4:59 PM Gleb Smirnoff wrote: > > > Hi, > > > > why do we need COMPAT_43 for arm64 at all? I can't imagine an > > application that would require this compatibility. > > > > A more general question is how far in the future are we going > > to carry COMPAT_43 for i386/amd64? > > > > COMPAT_43 is a weird option. It's a combo of both sys calls and kernel > behavior modifications. Before we thinned the ABIs we supported, it was > necessary for them as well. The biggest behavior change is around signals. > It is weird to sort out and nobody has done the deep analysis to see what > is truly unused and what is there for compat with Linux and other SysV > systems... I am not aware of any changes that COMPAT_43 provides for the signal handling semantic, except a minor adjustment for interpretation of zero-sized stack for sigaltstack(2). The COMPAT_43 option indeed enables lcall 7,0 syscall entry emulation, on both i386 and amd64. We are able to run FreeBSD 1.1.8 (i386) on amd64 kernel in chroot this way. Since sometimes I get bug reports about this stuff, there are some users of it. I believe it is important to be able to run any FreeBSD binary for PR purposes, to wave the flag of excellent binary compatibility we offer. COMPAT_43 is there to stay as far as there are people willing to maintain it. There are more than one. From owner-svn-src-all@freebsd.org Fri Aug 9 08:58:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C874C2B12; Fri, 9 Aug 2019 08:58: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464fKG0TtMz4GKf; Fri, 9 Aug 2019 08:58:10 +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 E8140B343; Fri, 9 Aug 2019 08:58: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 x798w9XW027770; Fri, 9 Aug 2019 08:58:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x798w9oV027769; Fri, 9 Aug 2019 08:58:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201908090858.x798w9oV027769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 9 Aug 2019 08:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350816 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 350816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 08:58:10 -0000 Author: ae Date: Fri Aug 9 08:58:09 2019 New Revision: 350816 URL: https://svnweb.freebsd.org/changeset/base/350816 Log: Add missing new line in several log messages. PR: 239694 MFC after: 1 week Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Fri Aug 9 05:18:59 2019 (r350815) +++ head/sys/netipsec/key.c Fri Aug 9 08:58:09 2019 (r350816) @@ -284,7 +284,7 @@ key_addrprotohash(const union sockaddr_union *src, #endif default: hval = 0; - ipseclog((LOG_DEBUG, "%s: unknown address family %d", + ipseclog((LOG_DEBUG, "%s: unknown address family %d\n", __func__, dst->sa.sa_family)); } return (hval); @@ -2039,8 +2039,8 @@ key_spdadd(struct socket *so, struct mbuf *m, const st key_freesp(&newsp); } else { key_freesp(&newsp); - ipseclog((LOG_DEBUG, "%s: a SP entry exists already.", - __func__)); + ipseclog((LOG_DEBUG, + "%s: a SP entry exists already.\n", __func__)); return (key_senderror(so, m, EEXIST)); } } @@ -5409,7 +5409,7 @@ key_update(struct socket *so, struct mbuf *m, const st } /* saidx should match with SA. */ if (key_cmpsaidx(&sav->sah->saidx, &saidx, CMP_MODE_REQID) == 0) { - ipseclog((LOG_DEBUG, "%s: saidx mismatched for SPI %u", + ipseclog((LOG_DEBUG, "%s: saidx mismatched for SPI %u\n", __func__, ntohl(sav->spi))); key_freesav(&sav); return key_senderror(so, m, ESRCH); @@ -6885,14 +6885,14 @@ key_acqdone(const struct secasindex *saidx, uint32_t s if (acq != NULL) { if (key_cmpsaidx(&acq->saidx, saidx, CMP_EXACTLY) == 0) { ipseclog((LOG_DEBUG, - "%s: Mismatched saidx for ACQ %u", __func__, seq)); + "%s: Mismatched saidx for ACQ %u\n", __func__, seq)); acq = NULL; } else { acq->created = 0; } } else { ipseclog((LOG_DEBUG, - "%s: ACQ %u is not found.", __func__, seq)); + "%s: ACQ %u is not found.\n", __func__, seq)); } ACQ_UNLOCK(); if (acq == NULL) From owner-svn-src-all@freebsd.org Fri Aug 9 09:57:05 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07299C4281; Fri, 9 Aug 2019 09:57:05 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464gdD6QMtz4KbN; Fri, 9 Aug 2019 09:57:04 +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 BDC5DBFB7; Fri, 9 Aug 2019 09:57:04 +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 x799v4Se063518; Fri, 9 Aug 2019 09:57:04 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x799v4be063517; Fri, 9 Aug 2019 09:57:04 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908090957.x799v4be063517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 9 Aug 2019 09:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350817 - stable/12/sys/dev/extres/phy X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/12/sys/dev/extres/phy X-SVN-Commit-Revision: 350817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 09:57:05 -0000 Author: mmel Date: Fri Aug 9 09:57:04 2019 New Revision: 350817 URL: https://svnweb.freebsd.org/changeset/base/350817 Log: MFC r343498: Properly define and declare phynode_topo_lock, it should be single global variable. Modified: stable/12/sys/dev/extres/phy/phy.c stable/12/sys/dev/extres/phy/phy_internal.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/extres/phy/phy.c ============================================================================== --- stable/12/sys/dev/extres/phy/phy.c Fri Aug 9 08:58:09 2019 (r350816) +++ stable/12/sys/dev/extres/phy/phy.c Fri Aug 9 09:57:04 2019 (r350817) @@ -68,7 +68,7 @@ static phynode_method_t phynode_methods[] = { DEFINE_CLASS_0(phynode, phynode_class, phynode_methods, 0); static phynode_list_t phynode_list = TAILQ_HEAD_INITIALIZER(phynode_list); - +struct sx phynode_topo_lock; SX_SYSINIT(phy_topology, &phynode_topo_lock, "Phy topology lock"); /* ---------------------------------------------------------------------------- Modified: stable/12/sys/dev/extres/phy/phy_internal.h ============================================================================== --- stable/12/sys/dev/extres/phy/phy_internal.h Fri Aug 9 08:58:09 2019 (r350816) +++ stable/12/sys/dev/extres/phy/phy_internal.h Fri Aug 9 09:57:04 2019 (r350817) @@ -78,6 +78,6 @@ struct phy { #define PHYNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) #define PHYNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) -struct sx phynode_topo_lock; +extern struct sx phynode_topo_lock; #endif /* DEV_EXTRES_PHY_INTERNAL_H */ From owner-svn-src-all@freebsd.org Fri Aug 9 10:00:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F061C4399; Fri, 9 Aug 2019 10:00:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464ghr002Kz4KpD; Fri, 9 Aug 2019 10:00:11 +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 D5A9DBFC0; Fri, 9 Aug 2019 10:00:11 +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 x79A0BQV063792; Fri, 9 Aug 2019 10:00:11 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79A0B9s063791; Fri, 9 Aug 2019 10:00:11 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908091000.x79A0B9s063791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 9 Aug 2019 10:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350818 - stable/12/sys/dts/arm X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/12/sys/dts/arm X-SVN-Commit-Revision: 350818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 10:00:12 -0000 Author: mmel Date: Fri Aug 9 10:00:11 2019 New Revision: 350818 URL: https://svnweb.freebsd.org/changeset/base/350818 Log: MFC r343828: Adapt FreeBSD specific DT stub for Jetson TK1 board to be consistent with update of devicetree to 4.19 in r340337. Our build system doesn't provide dependencies for included DTS files, so nobody noticed this issue for long time. Modified: stable/12/sys/dts/arm/tegra124-jetson-tk1-fbsd.dts Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dts/arm/tegra124-jetson-tk1-fbsd.dts ============================================================================== --- stable/12/sys/dts/arm/tegra124-jetson-tk1-fbsd.dts Fri Aug 9 09:57:04 2019 (r350817) +++ stable/12/sys/dts/arm/tegra124-jetson-tk1-fbsd.dts Fri Aug 9 10:00:11 2019 (r350818) @@ -38,7 +38,7 @@ stdout = &uartd; }; - memory { + memory@80000000 { /* reg = <0x0 0x80000000 0x0 0x80000000>; */ reg = <0x0 0x80000000 0x0 0x70000000>; }; From owner-svn-src-all@freebsd.org Fri Aug 9 10:28:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66A35C4CBE; Fri, 9 Aug 2019 10:28:21 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464hKK25QFz4MKJ; Fri, 9 Aug 2019 10:28:21 +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 29746C4FC; Fri, 9 Aug 2019 10:28:21 +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 x79ASLh4081617; Fri, 9 Aug 2019 10:28:21 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79ASLAV081616; Fri, 9 Aug 2019 10:28:21 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908091028.x79ASLAV081616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 9 Aug 2019 10:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350819 - stable/12/sys/arm/arm X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/12/sys/arm/arm X-SVN-Commit-Revision: 350819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 10:28:21 -0000 Author: mmel Date: Fri Aug 9 10:28:20 2019 New Revision: 350819 URL: https://svnweb.freebsd.org/changeset/base/350819 Log: MFC r343962,r343965: r343962: Properly handle alignment requests bigger that page size. - for now, alignments bigger that page size is allowed only for buffers allocated by bus_dmamem_alloc(), cover this fact by KASSERT. - never bounce buffers allocated by bus_dmamem_alloc(), these always comply with the required rules (alignment, boundary, address range). r343965: Fix bug introduced by r343962. DMAMAP_DMAMEM_ALLOC is property of dmamap, not dmatag. Modified: stable/12/sys/arm/arm/busdma_machdep-v6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- stable/12/sys/arm/arm/busdma_machdep-v6.c Fri Aug 9 10:00:11 2019 (r350818) +++ stable/12/sys/arm/arm/busdma_machdep-v6.c Fri Aug 9 10:28:20 2019 (r350819) @@ -339,16 +339,27 @@ cacheline_bounce(bus_dmamap_t map, bus_addr_t addr, bu * * Note that the addr argument might be either virtual or physical. It doesn't * matter because we only look at the low-order bits, which are the same in both - * address spaces. + * address spaces and maximum alignment of generic buffer is limited up to page + * size. + * Bouncing of buffers allocated by bus_dmamem_alloc()is not necessary, these + * always comply with the required rules (alignment, boundary, and address + * range). */ static __inline int might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t addr, bus_size_t size) { - return ((dmat->flags & BUS_DMA_EXCL_BOUNCE) || + KASSERT(map->flags & DMAMAP_DMAMEM_ALLOC || + dmat->alignment <= PAGE_SIZE, + ("%s: unsupported alignment (0x%08lx) for buffer not " + "allocated by bus_dmamem_alloc()", + __func__, dmat->alignment)); + + return (!(map->flags & DMAMAP_DMAMEM_ALLOC) && + ((dmat->flags & BUS_DMA_EXCL_BOUNCE) || alignment_bounce(dmat, addr) || - cacheline_bounce(map, addr, size)); + cacheline_bounce(map, addr, size))); } /* From owner-svn-src-all@freebsd.org Fri Aug 9 10:31:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95EC1C4EE0; Fri, 9 Aug 2019 10:31:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464hPQ3Pqdz4MY4; Fri, 9 Aug 2019 10:31:54 +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 57322C562; Fri, 9 Aug 2019 10:31:54 +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 x79AVsnV085593; Fri, 9 Aug 2019 10:31:54 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79AVsge085592; Fri, 9 Aug 2019 10:31:54 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908091031.x79AVsge085592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 9 Aug 2019 10:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350820 - stable/12/sys/arm/nvidia X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/12/sys/arm/nvidia X-SVN-Commit-Revision: 350820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 10:31:54 -0000 Author: mmel Date: Fri Aug 9 10:31:53 2019 New Revision: 350820 URL: https://svnweb.freebsd.org/changeset/base/350820 Log: MFC r343963: Don't allocate same clock twice.. Modified: stable/12/sys/arm/nvidia/tegra_sdhci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/nvidia/tegra_sdhci.c ============================================================================== --- stable/12/sys/arm/nvidia/tegra_sdhci.c Fri Aug 9 10:28:20 2019 (r350819) +++ stable/12/sys/arm/nvidia/tegra_sdhci.c Fri Aug 9 10:31:53 2019 (r350820) @@ -313,13 +313,6 @@ tegra_sdhci_attach(device_t dev) rv = clk_get_by_ofw_index(dev, 0, 0, &sc->clk); if (rv != 0) { - - device_printf(dev, "Cannot get clock\n"); - goto fail; - } - - rv = clk_get_by_ofw_index(dev, 0, 0, &sc->clk); - if (rv != 0) { device_printf(dev, "Cannot get clock\n"); goto fail; } From owner-svn-src-all@freebsd.org Fri Aug 9 10:33:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFCD1C4F98; Fri, 9 Aug 2019 10:33:24 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464hR85ddSz4MwD; Fri, 9 Aug 2019 10:33:24 +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 A33C5C6BB; Fri, 9 Aug 2019 10:33:24 +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 x79AXOo4087559; Fri, 9 Aug 2019 10:33:24 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79AXOdZ087556; Fri, 9 Aug 2019 10:33:24 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908091033.x79AXOdZ087556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 9 Aug 2019 10:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350821 - in stable/12/sys/dev/extres: phy regulator syscon X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in stable/12/sys/dev/extres: phy regulator syscon X-SVN-Commit-Revision: 350821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 10:33:24 -0000 Author: mmel Date: Fri Aug 9 10:33:23 2019 New Revision: 350821 URL: https://svnweb.freebsd.org/changeset/base/350821 Log: MFC r345295: extres: Unify error codes for _get_by_ofw_property() methods. Return: - ENOENT if requested property doesn't exist - ENODEV if producer device is not (yet) attached - ENXIO otherwise Modified: stable/12/sys/dev/extres/phy/phy.c stable/12/sys/dev/extres/regulator/regulator.c stable/12/sys/dev/extres/syscon/syscon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/extres/phy/phy.c ============================================================================== --- stable/12/sys/dev/extres/phy/phy.c Fri Aug 9 10:31:53 2019 (r350820) +++ stable/12/sys/dev/extres/phy/phy.c Fri Aug 9 10:33:23 2019 (r350821) @@ -517,7 +517,7 @@ phy_get_by_ofw_property(device_t consumer_dev, phandle ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(pcell_t), (void **)&cells); if (ncells < 1) - return (ENXIO); + return (ENOENT); /* Tranlate provider to device. */ phydev = OF_device_from_xref(cells[0]); Modified: stable/12/sys/dev/extres/regulator/regulator.c ============================================================================== --- stable/12/sys/dev/extres/regulator/regulator.c Fri Aug 9 10:31:53 2019 (r350820) +++ stable/12/sys/dev/extres/regulator/regulator.c Fri Aug 9 10:33:23 2019 (r350821) @@ -1091,7 +1091,7 @@ regulator_get_by_ofw_property(device_t cdev, phandle_t ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(*cells), (void **)&cells); if (ncells <= 0) - return (ENXIO); + return (ENOENT); /* Translate xref to device */ regdev = OF_device_from_xref(cells[0]); Modified: stable/12/sys/dev/extres/syscon/syscon.c ============================================================================== --- stable/12/sys/dev/extres/syscon/syscon.c Fri Aug 9 10:31:53 2019 (r350820) +++ stable/12/sys/dev/extres/syscon/syscon.c Fri Aug 9 10:33:23 2019 (r350821) @@ -238,7 +238,7 @@ syscon_get_by_ofw_property(device_t cdev, phandle_t cn ncells = OF_getencprop_alloc_multi(cnode, name, sizeof(pcell_t), (void **)&cells); if (ncells < 1) - return (ENXIO); + return (ENOENT); /* Translate to syscon node. */ SYSCON_TOPO_SLOCK(); From owner-svn-src-all@freebsd.org Fri Aug 9 11:20:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 604DDC5F3D; Fri, 9 Aug 2019 11:20:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464jT21xZkz4QKJ; Fri, 9 Aug 2019 11:20:06 +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 2475DCE12; Fri, 9 Aug 2019 11:20:06 +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 x79BK6Sa011818; Fri, 9 Aug 2019 11:20:06 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79BK66h011817; Fri, 9 Aug 2019 11:20:06 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908091120.x79BK66h011817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 9 Aug 2019 11:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350822 - stable/12/sys/arm/include X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/12/sys/arm/include X-SVN-Commit-Revision: 350822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 11:20:06 -0000 Author: mmel Date: Fri Aug 9 11:20:05 2019 New Revision: 350822 URL: https://svnweb.freebsd.org/changeset/base/350822 Log: MFC r345296: Use named field's initializer when constructing _platform structure. In current code, the delay argument in FDT_PLATFORM_DEF(2) improperly initialize refs field from kobj_class structure instead of delay_count field. This causes not working DELAY() function (due to never initialized delay_count) in earlier boot stages, until the first timer was attached. Modified: stable/12/sys/arm/include/platformvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/include/platformvar.h ============================================================================== --- stable/12/sys/arm/include/platformvar.h Fri Aug 9 10:33:23 2019 (r350821) +++ stable/12/sys/arm/include/platformvar.h Fri Aug 9 11:20:05 2019 (r350822) @@ -90,22 +90,22 @@ typedef struct fdt_platform_class fdt_platform_def_t; extern platform_method_t fdt_platform_methods[]; -#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, size, compatible, \ - delay) \ -CTASSERT(delay > 0); \ +#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, _size, _compatible, \ + _delay) \ +CTASSERT(_delay > 0); \ static fdt_platform_def_t VAR_NAME ## _fdt_platform = { \ .name = NAME_STR, \ .methods = fdt_platform_methods, \ - .fdt_compatible = compatible, \ + .fdt_compatible = _compatible, \ }; \ static kobj_class_t VAR_NAME ## _baseclasses[] = \ { (kobj_class_t)&VAR_NAME ## _fdt_platform, NULL }; \ static platform_def_t VAR_NAME ## _platform = { \ - NAME_STR, \ - NAME ## _methods, \ - size, \ - VAR_NAME ## _baseclasses, \ - delay, \ + .name = NAME_STR, \ + .methods = NAME ## _methods, \ + .size = _size, \ + .baseclasses = VAR_NAME ## _baseclasses, \ + .delay_count = _delay, \ }; \ DATA_SET(platform_set, VAR_NAME ## _platform) From owner-svn-src-all@freebsd.org Fri Aug 9 11:21:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DB06C6008; Fri, 9 Aug 2019 11:21:43 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464jVt75f5z4QfC; Fri, 9 Aug 2019 11:21:42 +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 D6D99CF77; Fri, 9 Aug 2019 11:21:42 +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 x79BLg2Y013321; Fri, 9 Aug 2019 11:21:42 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79BLgVq013320; Fri, 9 Aug 2019 11:21:42 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908091121.x79BLgVq013320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 9 Aug 2019 11:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350823 - stable/12/sys/dev/cpufreq X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/12/sys/dev/cpufreq X-SVN-Commit-Revision: 350823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 11:21:43 -0000 Author: mmel Date: Fri Aug 9 11:21:42 2019 New Revision: 350823 URL: https://svnweb.freebsd.org/changeset/base/350823 Log: MFC r345297: Improve cpufreq_dt. - older DT can use 'cpu0-supply' property for power supply binding. - don't expect that actual CPU frequency is contained in CPU operational point table, but read current CPU voltage directly from reguator. Typically, u-boot can set starting CPU frequency to any value. Modified: stable/12/sys/dev/cpufreq/cpufreq_dt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cpufreq/cpufreq_dt.c ============================================================================== --- stable/12/sys/dev/cpufreq/cpufreq_dt.c Fri Aug 9 11:20:05 2019 (r350822) +++ stable/12/sys/dev/cpufreq/cpufreq_dt.c Fri Aug 9 11:21:42 2019 (r350823) @@ -166,7 +166,7 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * struct cpufreq_dt_softc *sc; const struct cpufreq_dt_opp *opp, *copp; uint64_t freq; - int error = 0; + int uvolt, error; sc = device_get_softc(dev); @@ -174,23 +174,38 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * device_printf(dev, "Can't get current clk freq\n"); return (ENXIO); } + /* Try to get current valtage by using regulator first. */ + error = regulator_get_voltage(sc->reg, &uvolt); + if (error != 0) { + /* + * Try oppoints table as backup way. However, + * this is insufficient because the actual processor + * frequency may not be in the table. PLL frequency + * granularity can be different that granularity of + * oppoint table. + */ + copp = cpufreq_dt_find_opp(sc->dev, freq); + if (copp == NULL) { + device_printf(dev, + "Can't find the current freq in opp\n"); + return (ENOENT); + } + uvolt = copp->uvolt_target; - DEBUG(sc->dev, "Current freq %ju\n", freq); - DEBUG(sc->dev, "Target freq %ju\n", (uint64_t)set->freq * 1000000); - copp = cpufreq_dt_find_opp(sc->dev, freq); - if (copp == NULL) { - device_printf(dev, "Can't find the current freq in opp\n"); - return (ENOENT); } + opp = cpufreq_dt_find_opp(sc->dev, set->freq * 1000000); if (opp == NULL) { device_printf(dev, "Couldn't find an opp for this freq\n"); return (EINVAL); } + DEBUG(sc->dev, "Current freq %ju, uvolt: %d\n", freq, uvolt); + DEBUG(sc->dev, "Target freq %ju, , uvolt: %d\n", + opp->freq, opp->uvolt_target); - if (copp->uvolt_target < opp->uvolt_target) { + if (uvolt < opp->uvolt_target) { DEBUG(dev, "Changing regulator from %u to %u\n", - copp->uvolt_target, opp->uvolt_target); + uvolt, opp->uvolt_target); error = regulator_set_voltage(sc->reg, opp->uvolt_min, opp->uvolt_max); @@ -201,7 +216,7 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * } DEBUG(dev, "Setting clk to %ju\n", opp->freq); - error = clk_set_freq(sc->clk, opp->freq, 0); + error = clk_set_freq(sc->clk, opp->freq, CLK_SET_ROUND_DOWN); if (error != 0) { DEBUG(dev, "Failed, backout\n"); /* Restore previous voltage (best effort) */ @@ -211,7 +226,9 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * return (ENXIO); } - if (copp->uvolt_target > opp->uvolt_target) { + if (uvolt > opp->uvolt_target) { + DEBUG(dev, "Changing regulator from %u to %u\n", + uvolt, opp->uvolt_target); error = regulator_set_voltage(sc->reg, opp->uvolt_min, opp->uvolt_max); @@ -219,8 +236,7 @@ cpufreq_dt_set(device_t dev, const struct cf_setting * DEBUG(dev, "Failed to switch regulator to %d\n", opp->uvolt_target); /* Restore previous CPU frequency (best effort) */ - (void)clk_set_freq(sc->clk, - copp->freq, 0); + (void)clk_set_freq(sc->clk, copp->freq, 0); return (ENXIO); } } @@ -277,7 +293,8 @@ cpufreq_dt_identify(driver_t *driver, device_t parent) /* The cpu@0 node must have the following properties */ if (!OF_hasprop(node, "clocks") || - !OF_hasprop(node, "cpu-supply")) + (!OF_hasprop(node, "cpu-supply") && + !OF_hasprop(node, "cpu0-supply"))) return; if (!OF_hasprop(node, "operating-points") && @@ -299,7 +316,9 @@ cpufreq_dt_probe(device_t dev) node = ofw_bus_get_node(device_get_parent(dev)); if (!OF_hasprop(node, "clocks") || - !OF_hasprop(node, "cpu-supply")) + (!OF_hasprop(node, "cpu-supply") && + !OF_hasprop(node, "cpu0-supply"))) + return (ENXIO); if (!OF_hasprop(node, "operating-points") && @@ -439,9 +458,12 @@ cpufreq_dt_attach(device_t dev) if (regulator_get_by_ofw_property(dev, node, "cpu-supply", &sc->reg) != 0) { - device_printf(dev, "no regulator for %s\n", - ofw_bus_get_name(device_get_parent(dev))); - return (ENXIO); + if (regulator_get_by_ofw_property(dev, node, + "cpu0-supply", &sc->reg) != 0) { + device_printf(dev, "no regulator for %s\n", + ofw_bus_get_name(device_get_parent(dev))); + return (ENXIO); + } } if (clk_get_by_ofw_index(dev, node, 0, &sc->clk) != 0) { From owner-svn-src-all@freebsd.org Fri Aug 9 12:15:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2C52C81E9; Fri, 9 Aug 2019 12:15:24 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464khr49fdz4VS0; Fri, 9 Aug 2019 12:15:24 +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 70DF2D8BE; Fri, 9 Aug 2019 12:15:24 +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 x79CFOAH048380; Fri, 9 Aug 2019 12:15:24 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79CFOSO048378; Fri, 9 Aug 2019 12:15:24 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201908091215.x79CFOSO048378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 9 Aug 2019 12:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350824 - stable/12/sys/dev/psci X-SVN-Group: stable-12 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/12/sys/dev/psci X-SVN-Commit-Revision: 350824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 12:15:24 -0000 Author: mmel Date: Fri Aug 9 12:15:23 2019 New Revision: 350824 URL: https://svnweb.freebsd.org/changeset/base/350824 Log: MFC r345299: PSCI: Don't take missing implementation of psci get_version() as fatal. Minimalistic PSCI implementation in U-Boot doesn't implement get_version() method for some SoC. In this case, use PSCI version declared by 'psci' node in DT as fallback. Modified: stable/12/sys/dev/psci/psci.c stable/12/sys/dev/psci/psci.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/psci/psci.c ============================================================================== --- stable/12/sys/dev/psci/psci.c Fri Aug 9 11:21:42 2019 (r350823) +++ stable/12/sys/dev/psci/psci.c Fri Aug 9 12:15:23 2019 (r350824) @@ -79,9 +79,9 @@ struct psci_softc { }; #ifdef FDT -static int psci_v0_1_init(device_t dev); +static int psci_v0_1_init(device_t dev, int default_version); #endif -static int psci_v0_2_init(device_t dev); +static int psci_v0_2_init(device_t dev, int default_version); struct psci_softc *psci_softc = NULL; @@ -96,15 +96,35 @@ struct psci_softc *psci_softc = NULL; #endif #ifdef FDT +struct psci_init_def { + int default_version; + psci_initfn_t psci_init; +}; + +static struct psci_init_def psci_v1_0_init_def = { + .default_version = (1 << 16) | 0, + .psci_init = psci_v0_2_init +}; + +static struct psci_init_def psci_v0_2_init_def = { + .default_version = (0 << 16) | 2, + .psci_init = psci_v0_2_init +}; + +static struct psci_init_def psci_v0_1_init_def = { + .default_version = (0 << 16) | 1, + .psci_init = psci_v0_1_init +}; + static struct ofw_compat_data compat_data[] = { - {"arm,psci-1.0", (uintptr_t)psci_v0_2_init}, - {"arm,psci-0.2", (uintptr_t)psci_v0_2_init}, - {"arm,psci", (uintptr_t)psci_v0_1_init}, + {"arm,psci-1.0", (uintptr_t)&psci_v1_0_init_def}, + {"arm,psci-0.2", (uintptr_t)&psci_v0_2_init_def}, + {"arm,psci", (uintptr_t)&psci_v0_1_init_def}, {NULL, 0} }; #endif -static int psci_attach(device_t, psci_initfn_t); +static int psci_attach(device_t, psci_initfn_t, int); static void psci_shutdown(void *, int); static int psci_find_callfn(psci_callfn_t *); @@ -198,12 +218,13 @@ static int psci_fdt_attach(device_t dev) { const struct ofw_compat_data *ocd; - psci_initfn_t psci_init; + struct psci_init_def *psci_init_def; ocd = ofw_bus_search_compatible(dev, compat_data); - psci_init = (psci_initfn_t)ocd->ocd_data; + psci_init_def = (struct psci_init_def *)ocd->ocd_data; - return (psci_attach(dev, psci_init)); + return (psci_attach(dev, psci_init_def->psci_init, + psci_init_def->default_version)); } #endif @@ -304,12 +325,12 @@ static int psci_acpi_attach(device_t dev) { - return (psci_attach(dev, psci_v0_2_init)); + return (psci_attach(dev, psci_v0_2_init, PSCI_RETVAL_NOT_SUPPORTED)); } #endif static int -psci_attach(device_t dev, psci_initfn_t psci_init) +psci_attach(device_t dev, psci_initfn_t psci_init, int default_version) { struct psci_softc *sc = device_get_softc(dev); @@ -317,7 +338,7 @@ psci_attach(device_t dev, psci_initfn_t psci_init) return (ENXIO); KASSERT(psci_init != NULL, ("PSCI init function cannot be NULL")); - if (psci_init(dev)) + if (psci_init(dev, default_version)) return (ENXIO); psci_softc = sc; @@ -464,7 +485,7 @@ psci_reset(void) #ifdef FDT /* Only support PSCI 0.1 on FDT */ static int -psci_v0_1_init(device_t dev) +psci_v0_1_init(device_t dev, int default_version __unused) { struct psci_softc *sc = device_get_softc(dev); int psci_fn; @@ -510,7 +531,7 @@ psci_v0_1_init(device_t dev) #endif static int -psci_v0_2_init(device_t dev) +psci_v0_2_init(device_t dev, int default_version) { struct psci_softc *sc = device_get_softc(dev); int version; @@ -529,8 +550,20 @@ psci_v0_2_init(device_t dev) version = _psci_get_version(sc); - if (version == PSCI_RETVAL_NOT_SUPPORTED) - return (1); + /* + * U-Boot PSCI implementation doesn't have psci_get_version() + * method implemented for many boards. In this case, use the version + * readed from FDT as fallback. No fallback method for ACPI. + */ + if (version == PSCI_RETVAL_NOT_SUPPORTED) { + if (default_version == PSCI_RETVAL_NOT_SUPPORTED) + return (1); + + version = default_version; + printf("PSCI get_version() function is not implemented, " + " assuming v%d.%d\n", PSCI_VER_MAJOR(version), + PSCI_VER_MINOR(version)); + } sc->psci_version = version; if ((PSCI_VER_MAJOR(version) == 0 && PSCI_VER_MINOR(version) == 2) || Modified: stable/12/sys/dev/psci/psci.h ============================================================================== --- stable/12/sys/dev/psci/psci.h Fri Aug 9 11:21:42 2019 (r350823) +++ stable/12/sys/dev/psci/psci.h Fri Aug 9 12:15:23 2019 (r350824) @@ -31,7 +31,7 @@ #include -typedef int (*psci_initfn_t)(device_t dev); +typedef int (*psci_initfn_t)(device_t dev, int default_version); typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t); extern int psci_present; From owner-svn-src-all@freebsd.org Fri Aug 9 16:01:44 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7812CC2FF for ; Fri, 9 Aug 2019 16:01:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464qk00pZnz3FJn for ; Fri, 9 Aug 2019 16:01:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72f.google.com with SMTP id w190so72008472qkc.6 for ; Fri, 09 Aug 2019 09:01:43 -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=uDhoE0JwbuoDIDykmP00crDCn3vaXikXj8d+jf5c2S0=; b=j1IAfECQ8ax3NkgooA3UIVqoyP2ztNltM1Z//MRS19zj7sXsdhSZnKZXV9JNJVmP0T Rjco4kzsf2irUy1o3oUE1xoba/HMlFPPnDiuyH81/0Yi/4huglBOL3BN+RnsLxFrS8i3 kDjTfJ6R68E6Al4BpNAAlBMvm6vPvX22G45q70iHTpUCRAhvKNCuH2K/m1fkPGLbVZ1r C8FBqC+GZ9H418Lp+XzHh4TFGcHtq5NfDvzxcUICKDPOsdpmO/HDjqN890JzSBmVnZeb BBs4milY4RzpqH1O9FUr8Qjnxcr0UQCicK5mjT3M8rHFCk/YH6vvHzxVTRBEdETibQEM Bkgw== 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=uDhoE0JwbuoDIDykmP00crDCn3vaXikXj8d+jf5c2S0=; b=cmoxzXJZv+9C5RAnd9xPRtruwGvNYvzqTe6C0BLTTmSUeNirzXmL9yfy1fSTp/lKEt gHvaieQbWxrXl7C463Wo+7cZCO9WV2uInQ+tiVXbU8ADwU1W2qUTojQMqqVd08Ue+LUu LBO8bElG3x3AxBcFrqCHR5dV9tybtgCfNewbq3hjEFrz8d/NLpv07TWoPfy9N/OCa1qm z4aBGDT02HymvimavaxxeD1eelcovlJLce2PIEDuqEuOI6SaG/x365DtyVbURqrhKyIL fz5oIxHsogjbBctU5fzJ+4jY5hjQQ4db/sdX4Zpxn9tvXj5n1+TKoQR70ndv7oZz3DKp Pa7A== X-Gm-Message-State: APjAAAU3LUTj0R8KQRbLMpgW0Amxtufud6eWTfP9dYgRqYIxMb21G4V3 H7NqxRXMh9p3b5NUzfRgQqkAri6cmbuYqiRaH4F+Lw== X-Google-Smtp-Source: APXvYqxaqyrFzhwZvHktcuoQnnM/0YqpRLuKo2hzWVmDGFpaB3dQ8sT7rfJTcaj7h+EN9T4s9fuhVLW5Li6ZGHV8UCw= X-Received: by 2002:a37:c87:: with SMTP id 129mr17408854qkm.240.1565366502702; Fri, 09 Aug 2019 09:01:42 -0700 (PDT) MIME-Version: 1.0 References: <201908081748.x78Hm79V085760@repo.freebsd.org> <20190808225947.GD1531@FreeBSD.org> <20190809065733.GI2731@kib.kiev.ua> In-Reply-To: <20190809065733.GI2731@kib.kiev.ua> From: Warner Losh Date: Fri, 9 Aug 2019 10:01:31 -0600 Message-ID: Subject: Re: svn commit: r350764 - head/sys/arm64/arm64 To: Konstantin Belousov Cc: Gleb Smirnoff , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 464qk00pZnz3FJn X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=j1IAfECQ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72f) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-5.98 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.996,0]; RCVD_IN_DNSWL_NONE(0.00)[f.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.99)[ip: (-9.51), ipnet: 2607:f8b0::/32(-2.98), asn: 15169(-2.40), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2019 16:01:44 -0000 On Fri, Aug 9, 2019 at 12:57 AM Konstantin Belousov wrote: > On Thu, Aug 08, 2019 at 07:38:28PM -0600, Warner Losh wrote: > > On Thu, Aug 8, 2019, 4:59 PM Gleb Smirnoff wrote: > > > > > Hi, > > > > > > why do we need COMPAT_43 for arm64 at all? I can't imagine an > > > application that would require this compatibility. > > > > > > A more general question is how far in the future are we going > > > to carry COMPAT_43 for i386/amd64? > > > > > > > COMPAT_43 is a weird option. It's a combo of both sys calls and kernel > > behavior modifications. Before we thinned the ABIs we supported, it was > > necessary for them as well. The biggest behavior change is around > signals. > > It is weird to sort out and nobody has done the deep analysis to see what > > is truly unused and what is there for compat with Linux and other SysV > > systems... > I am not aware of any changes that COMPAT_43 provides for the signal > handling semantic, except a minor adjustment for interpretation of > zero-sized stack for sigaltstack(2). > The onstack stuff was what I was thinking about, but we also have code in sys_getpid() that returns the ppid in the second retval register, and similar things for getuid and getgid, It also allows ioctl numbers that have IOC_IN set, but size == 0 (these would otherwise return ENOTTY). It also turns on the COMPAT_OLDSOCK code which generally only kicks in when compat bits are set, but in one place it allows a shorter unix domain socket path length to be compatible unconditionally. The compatibility TTY stuff, at least is under COMPAT_43TTY, but that's purely ioctl translation code. The COMPAT_43 option indeed enables lcall 7,0 syscall entry emulation, > on both i386 and amd64. We are able to run FreeBSD 1.1.8 (i386) on amd64 > kernel in chroot this way. Since sometimes I get bug reports about this > stuff, there are some users of it. I believe it is important to be able > to run any FreeBSD binary for PR purposes, to wave the flag of excellent > binary compatibility we offer. > > COMPAT_43 is there to stay as far as there are people willing to maintain > it. There are more than one. > I think it's safe to retain on i386. amd64 is less clear to me, but I'd lean yes. All the other platforms I'd agree with gleb: why do we need it in the kernels by default (and maybe why do we need to support it at all)? Warner From owner-svn-src-all@freebsd.org Fri Aug 9 19:09:06 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D8EBCF294; Fri, 9 Aug 2019 19:09:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464vtB1nlhz3Plv; Fri, 9 Aug 2019 19:09:06 +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 1AB421A2F0; Fri, 9 Aug 2019 19:09: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 x79J95a1090298; Fri, 9 Aug 2019 19:09:05 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79J951p090297; Fri, 9 Aug 2019 19:09:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201908091909.x79J951p090297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Fri, 9 Aug 2019 19:09:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350825 - 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: 350825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 19:09:06 -0000 Author: tsoome Date: Fri Aug 9 19:09:05 2019 New Revision: 350825 URL: https://svnweb.freebsd.org/changeset/base/350825 Log: loader: add error check for vdev_indirect calls We can error out due to memory allocation errors, we can not recover from those and need to get out. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Fri Aug 9 12:15:23 2019 (r350824) +++ head/stand/libsa/zfs/zfsimpl.c Fri Aug 9 19:09:05 2019 (r350825) @@ -839,6 +839,7 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 { list_t stack; spa_t *spa = vd->spa; + zio_t *zio = arg; list_create(&stack, sizeof (remap_segment_t), offsetof(remap_segment_t, rs_node)); @@ -872,6 +873,13 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 dst_offset + inner_offset, inner_size, arg); + /* + * vdev_indirect_gather_splits can have memory + * allocation error, we can not recover from it. + */ + if (zio->io_error != 0) + break; + rs->rs_offset += inner_size; rs->rs_asize -= inner_size; rs->rs_split_offset += inner_size; @@ -879,6 +887,8 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 free(mapping); free(rs); + if (zio->io_error != 0) + break; } list_destroy(&stack); @@ -935,6 +945,8 @@ vdev_indirect_read(vdev_t *vdev, const blkptr_t *bp, v } vdev_indirect_remap(vdev, offset, bytes, &zio); + if (zio.io_error != 0) + return (zio.io_error); first = list_head(&iv->iv_splits); if (first->is_size == zio.io_size) { From owner-svn-src-all@freebsd.org Fri Aug 9 20:16:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 679D4A8F0D; Fri, 9 Aug 2019 20:16:39 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 464xN70ryBz40YY; Fri, 9 Aug 2019 20:16:39 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F31801AF5E; Fri, 9 Aug 2019 20:16:38 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x79KGcN4033556; Fri, 9 Aug 2019 20:16:38 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79KGcvW033553; Fri, 9 Aug 2019 20:16:38 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201908092016.x79KGcvW033553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Fri, 9 Aug 2019 20:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350826 - in head/lib/libthr/arch/powerpc: . include powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/lib/libthr/arch/powerpc: . include powerpc X-SVN-Commit-Revision: 350826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 20:16:39 -0000 Author: bdragon Date: Fri Aug 9 20:16:38 2019 New Revision: 350826 URL: https://svnweb.freebsd.org/changeset/base/350826 Log: Implement _umtx_op_err.S on powerpc / powerpc64. As per r177853, we need to avoid using errno inside user mutex code, since signal handlers can interfere with it and mess up libthr internal state. So, implement _umtx_op_err() instead, which makes a raw syscall and returns the error value directly instead of using errno. Approved by: jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D20946 Added: head/lib/libthr/arch/powerpc/Makefile.inc (contents, props changed) head/lib/libthr/arch/powerpc/powerpc/ head/lib/libthr/arch/powerpc/powerpc/_umtx_op_err.S (contents, props changed) Modified: head/lib/libthr/arch/powerpc/include/pthread_md.h Added: head/lib/libthr/arch/powerpc/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/powerpc/Makefile.inc Fri Aug 9 20:16:38 2019 (r350826) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +SRCS+= _umtx_op_err.S Modified: head/lib/libthr/arch/powerpc/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/powerpc/include/pthread_md.h Fri Aug 9 19:09:05 2019 (r350825) +++ head/lib/libthr/arch/powerpc/include/pthread_md.h Fri Aug 9 20:16:38 2019 (r350826) @@ -91,4 +91,6 @@ _get_curthread(void) return (NULL); } +#define HAS__UMTX_OP_ERR 1 + #endif /* _PTHREAD_MD_H_ */ Added: head/lib/libthr/arch/powerpc/powerpc/_umtx_op_err.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/powerpc/powerpc/_umtx_op_err.S Fri Aug 9 20:16:38 2019 (r350826) @@ -0,0 +1,41 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Brandon Bergren + * + * 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 + + .text + .align 2 +ENTRY(_umtx_op_err) + li %r0, SYS__umtx_op + sc + blr +END(_umtx_op_err) + + .section .note.GNU-stack,"",%progbits From owner-svn-src-all@freebsd.org Fri Aug 9 21:05:23 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1564CA9F22; Fri, 9 Aug 2019 21:05:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 464ySK3skkz42sc; Fri, 9 Aug 2019 21:05:21 +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 x79L55CZ021364 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 10 Aug 2019 00:05:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x79L55CZ021364 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x79L55Av021355; Sat, 10 Aug 2019 00:05:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Aug 2019 00:05:05 +0300 From: Konstantin Belousov To: Warner Losh Cc: Gleb Smirnoff , Warner Losh , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r350764 - head/sys/arm64/arm64 Message-ID: <20190809210505.GJ2731@kib.kiev.ua> References: <201908081748.x78Hm79V085760@repo.freebsd.org> <20190808225947.GD1531@FreeBSD.org> <20190809065733.GI2731@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 464ySK3skkz42sc X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-0.99)[-0.995,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[6]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; IP_SCORE(0.00)[ip: (-2.59), ipnet: 2001:470::/32(-4.48), asn: 6939(-2.97), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 21:05:23 -0000 On Fri, Aug 09, 2019 at 10:01:31AM -0600, Warner Losh wrote: > On Fri, Aug 9, 2019 at 12:57 AM Konstantin Belousov > wrote: > > > On Thu, Aug 08, 2019 at 07:38:28PM -0600, Warner Losh wrote: > > > On Thu, Aug 8, 2019, 4:59 PM Gleb Smirnoff wrote: > > > > > > > Hi, > > > > > > > > why do we need COMPAT_43 for arm64 at all? I can't imagine an > > > > application that would require this compatibility. > > > > > > > > A more general question is how far in the future are we going > > > > to carry COMPAT_43 for i386/amd64? > > > > > > > > > > COMPAT_43 is a weird option. It's a combo of both sys calls and kernel > > > behavior modifications. Before we thinned the ABIs we supported, it was > > > necessary for them as well. The biggest behavior change is around > > signals. > > > It is weird to sort out and nobody has done the deep analysis to see what > > > is truly unused and what is there for compat with Linux and other SysV > > > systems... > > I am not aware of any changes that COMPAT_43 provides for the signal > > handling semantic, except a minor adjustment for interpretation of > > zero-sized stack for sigaltstack(2). > > > > The onstack stuff was what I was thinking about, but we also have code in > sys_getpid() that returns the ppid in the second retval register, and > similar things for getuid and getgid, It also allows ioctl numbers that > have IOC_IN set, but size == 0 (these would otherwise return ENOTTY). It > also turns on the COMPAT_OLDSOCK code which generally only kicks in when > compat bits are set, but in one place it allows a shorter unix domain > socket path length to be compatible unconditionally. The compatibility TTY > stuff, at least is under COMPAT_43TTY, but that's purely ioctl translation > code. I only reacted to the note about changing the signals syscalls behavior. But the point is valid, we should not change the syscalls ABI for new binaries when COMPAT_43 is enabled. I propose the following https://reviews.freebsd.org/D21200 WRT ioctl code for no IOC_OUT and size == 0, I believe that this is in fact cannot be changed. It is enabled also under COMPAT_FREEBSD4 and 5, and we always enable these for GENERIC. So effectively this ioctl permissive mode is always there. > > The COMPAT_43 option indeed enables lcall 7,0 syscall entry emulation, > > on both i386 and amd64. We are able to run FreeBSD 1.1.8 (i386) on amd64 > > kernel in chroot this way. Since sometimes I get bug reports about this > > stuff, there are some users of it. I believe it is important to be able > > to run any FreeBSD binary for PR purposes, to wave the flag of excellent > > binary compatibility we offer. > > > > COMPAT_43 is there to stay as far as there are people willing to maintain > > it. There are more than one. > > > > I think it's safe to retain on i386. amd64 is less clear to me, but I'd > lean yes. I believe amd64 is required since you have less and less chances to usefully run i386 kernel on modern hardware. > All the other platforms I'd agree with gleb: why do we need it in > the kernels by default (and maybe why do we need to support it at all)? > > Warner From owner-svn-src-all@freebsd.org Fri Aug 9 21:29:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEF84AAB2C; Fri, 9 Aug 2019 21:29:52 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.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 464z0b6hgjz44Fm; Fri, 9 Aug 2019 21:29:51 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x79LTnYW099314; Fri, 9 Aug 2019 14:29:49 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x79LTncP099313; Fri, 9 Aug 2019 14:29:49 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201908092129.x79LTncP099313@gndrsh.dnsmgr.net> Subject: Re: svn commit: r350764 - head/sys/arm64/arm64 In-Reply-To: <20190809210505.GJ2731@kib.kiev.ua> To: Konstantin Belousov Date: Fri, 9 Aug 2019 14:29:49 -0700 (PDT) CC: Warner Losh , Gleb Smirnoff , Warner Losh , src-committers , svn-src-all , svn-src-head Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 464z0b6hgjz44Fm X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [2.86 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.15)[0.151,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; NEURAL_SPAM_MEDIUM(0.92)[0.922,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_SPAM_LONG(0.84)[0.839,0]; RCPT_COUNT_SEVEN(0.00)[7]; R_SPF_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(0.05)[ip: (0.15), ipnet: 69.59.192.0/19(0.08), asn: 13868(0.05), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2019 21:29:52 -0000 > On Fri, Aug 09, 2019 at 10:01:31AM -0600, Warner Losh wrote: > > On Fri, Aug 9, 2019 at 12:57 AM Konstantin Belousov > > wrote: > > > > > On Thu, Aug 08, 2019 at 07:38:28PM -0600, Warner Losh wrote: > > > > On Thu, Aug 8, 2019, 4:59 PM Gleb Smirnoff wrote: > > > > > > > > > Hi, > > > > > > > > > > why do we need COMPAT_43 for arm64 at all? I can't imagine an > > > > > application that would require this compatibility. > > > > > > > > > > A more general question is how far in the future are we going > > > > > to carry COMPAT_43 for i386/amd64? > > > > > > > > > > > > > COMPAT_43 is a weird option. It's a combo of both sys calls and kernel > > > > behavior modifications. Before we thinned the ABIs we supported, it was > > > > necessary for them as well. The biggest behavior change is around > > > signals. > > > > It is weird to sort out and nobody has done the deep analysis to see what > > > > is truly unused and what is there for compat with Linux and other SysV > > > > systems... > > > I am not aware of any changes that COMPAT_43 provides for the signal > > > handling semantic, except a minor adjustment for interpretation of > > > zero-sized stack for sigaltstack(2). > > > > > > > The onstack stuff was what I was thinking about, but we also have code in > > sys_getpid() that returns the ppid in the second retval register, and > > similar things for getuid and getgid, It also allows ioctl numbers that > > have IOC_IN set, but size == 0 (these would otherwise return ENOTTY). It > > also turns on the COMPAT_OLDSOCK code which generally only kicks in when > > compat bits are set, but in one place it allows a shorter unix domain > > socket path length to be compatible unconditionally. The compatibility TTY > > stuff, at least is under COMPAT_43TTY, but that's purely ioctl translation > > code. > I only reacted to the note about changing the signals syscalls behavior. > But the point is valid, we should not change the syscalls ABI for new > binaries when COMPAT_43 is enabled. I propose the following > https://reviews.freebsd.org/D21200 > > WRT ioctl code for no IOC_OUT and size == 0, I believe that this is in > fact cannot be changed. It is enabled also under COMPAT_FREEBSD4 and > 5, and we always enable these for GENERIC. So effectively this ioctl > permissive mode is always there. > > > > > The COMPAT_43 option indeed enables lcall 7,0 syscall entry emulation, > > > on both i386 and amd64. We are able to run FreeBSD 1.1.8 (i386) on amd64 > > > kernel in chroot this way. Since sometimes I get bug reports about this > > > stuff, there are some users of it. I believe it is important to be able > > > to run any FreeBSD binary for PR purposes, to wave the flag of excellent > > > binary compatibility we offer. > > > > > > COMPAT_43 is there to stay as far as there are people willing to maintain > > > it. There are more than one. > > > > > > > I think it's safe to retain on i386. amd64 is less clear to me, but I'd > > lean yes. > I believe amd64 is required since you have less and less chances to usefully > run i386 kernel on modern hardware. Would this also be required for running i386 binaries on amd64 using lib32 that expect the COMPAT_43 behavior? > > All the other platforms I'd agree with gleb: why do we need it in > > the kernels by default (and maybe why do we need to support it at all)? > > > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Aug 9 21:49:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7114AB204; Fri, 9 Aug 2019 21:49:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 464zQt1gWYz45R4; Fri, 9 Aug 2019 21:49:09 +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 x79Ln15X031905 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 10 Aug 2019 00:49:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x79Ln15X031905 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x79Ln1gi031904; Sat, 10 Aug 2019 00:49:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Aug 2019 00:49:01 +0300 From: Konstantin Belousov To: rgrimes@freebsd.org Cc: Warner Losh , Gleb Smirnoff , Warner Losh , src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r350764 - head/sys/arm64/arm64 Message-ID: <20190809214901.GK2731@kib.kiev.ua> References: <20190809210505.GJ2731@kib.kiev.ua> <201908092129.x79LTncP099313@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201908092129.x79LTncP099313@gndrsh.dnsmgr.net> User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: 464zQt1gWYz45R4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-0.997,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; RCPT_COUNT_SEVEN(0.00)[7]; IP_SCORE(0.00)[ip: (-2.57), ipnet: 2001:470::/32(-4.47), asn: 6939(-2.97), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 21:49:11 -0000 On Fri, Aug 09, 2019 at 02:29:49PM -0700, Rodney W. Grimes wrote: > > On Fri, Aug 09, 2019 at 10:01:31AM -0600, Warner Losh wrote: > > > On Fri, Aug 9, 2019 at 12:57 AM Konstantin Belousov > > > wrote: > > > > > > > On Thu, Aug 08, 2019 at 07:38:28PM -0600, Warner Losh wrote: > > > > > On Thu, Aug 8, 2019, 4:59 PM Gleb Smirnoff wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > > why do we need COMPAT_43 for arm64 at all? I can't imagine an > > > > > > application that would require this compatibility. > > > > > > > > > > > > A more general question is how far in the future are we going > > > > > > to carry COMPAT_43 for i386/amd64? > > > > > > > > > > > > > > > > COMPAT_43 is a weird option. It's a combo of both sys calls and kernel > > > > > behavior modifications. Before we thinned the ABIs we supported, it was > > > > > necessary for them as well. The biggest behavior change is around > > > > signals. > > > > > It is weird to sort out and nobody has done the deep analysis to see what > > > > > is truly unused and what is there for compat with Linux and other SysV > > > > > systems... > > > > I am not aware of any changes that COMPAT_43 provides for the signal > > > > handling semantic, except a minor adjustment for interpretation of > > > > zero-sized stack for sigaltstack(2). > > > > > > > > > > The onstack stuff was what I was thinking about, but we also have code in > > > sys_getpid() that returns the ppid in the second retval register, and > > > similar things for getuid and getgid, It also allows ioctl numbers that > > > have IOC_IN set, but size == 0 (these would otherwise return ENOTTY). It > > > also turns on the COMPAT_OLDSOCK code which generally only kicks in when > > > compat bits are set, but in one place it allows a shorter unix domain > > > socket path length to be compatible unconditionally. The compatibility TTY > > > stuff, at least is under COMPAT_43TTY, but that's purely ioctl translation > > > code. > > I only reacted to the note about changing the signals syscalls behavior. > > But the point is valid, we should not change the syscalls ABI for new > > binaries when COMPAT_43 is enabled. I propose the following > > https://reviews.freebsd.org/D21200 > > > > WRT ioctl code for no IOC_OUT and size == 0, I believe that this is in > > fact cannot be changed. It is enabled also under COMPAT_FREEBSD4 and > > 5, and we always enable these for GENERIC. So effectively this ioctl > > permissive mode is always there. > > > > > > > > The COMPAT_43 option indeed enables lcall 7,0 syscall entry emulation, > > > > on both i386 and amd64. We are able to run FreeBSD 1.1.8 (i386) on amd64 > > > > kernel in chroot this way. Since sometimes I get bug reports about this > > > > stuff, there are some users of it. I believe it is important to be able > > > > to run any FreeBSD binary for PR purposes, to wave the flag of excellent > > > > binary compatibility we offer. > > > > > > > > COMPAT_43 is there to stay as far as there are people willing to maintain > > > > it. There are more than one. > > > > > > > > > > I think it's safe to retain on i386. amd64 is less clear to me, but I'd > > > lean yes. > > I believe amd64 is required since you have less and less chances to usefully > > run i386 kernel on modern hardware. > > Would this also be required for running i386 binaries on amd64 using lib32 > that expect the COMPAT_43 behavior? I do not quite understand the question. My proposed change would mostly limit effect of COMPAT_43 to a.out binaries. /usr/lib32 are ELF. I would not expect any modern (as in, ELF) binaries to require changes to the syscalls behavior from COMPAT_43. > > > > All the other platforms I'd agree with gleb: why do we need it in > > > the kernels by default (and maybe why do we need to support it at all)? > > > > > > Warner > > -- > Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Aug 9 23:50:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E19B7AD451; Fri, 9 Aug 2019 23:50:57 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46527P5Hbbz4Bly; Fri, 9 Aug 2019 23:50:57 +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 981381D4DA; Fri, 9 Aug 2019 23:50:57 +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 x79NovlF057295; Fri, 9 Aug 2019 23:50:57 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x79NovgE057294; Fri, 9 Aug 2019 23:50:57 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201908092350.x79NovgE057294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 9 Aug 2019 23:50:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350827 - head/tests/sys/fs/fusefs X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/tests/sys/fs/fusefs X-SVN-Commit-Revision: 350827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 09 Aug 2019 23:50:57 -0000 Author: brooks Date: Fri Aug 9 23:50:57 2019 New Revision: 350827 URL: https://svnweb.freebsd.org/changeset/base/350827 Log: Don't add -Wno-class-memaccess with older gcc. This is a gcc 8.0+ warning which needed to be silenced on for the riscv build. amd64-xtoolchain-gcc still uses gcc 6.4.0 and does not understand this flag. Reviewed by: asomers Feedback from: imp Differential Revision: https://reviews.freebsd.org/D21195 Modified: head/tests/sys/fs/fusefs/Makefile Modified: head/tests/sys/fs/fusefs/Makefile ============================================================================== --- head/tests/sys/fs/fusefs/Makefile Fri Aug 9 20:16:38 2019 (r350826) +++ head/tests/sys/fs/fusefs/Makefile Fri Aug 9 23:50:57 2019 (r350827) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/fs/fusefs @@ -65,7 +67,10 @@ TEST_METADATA+= timeout=10 FUSEFS= ${SRCTOP}/sys/fs/fuse MOUNT= ${SRCTOP}/sbin/mount # Suppress warnings that GCC generates for the libc++ and gtest headers. -CXXWARNFLAGS.gcc+= -Wno-placement-new -Wno-attributes -Wno-class-memaccess +CXXWARNFLAGS.gcc+= -Wno-placement-new -Wno-attributes +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80000 +CXXWARNFLAGS+= -Wno-class-memaccess +.endif CXXFLAGS+= -I${SRCTOP}/tests CXXFLAGS+= -I${FUSEFS} CXXFLAGS+= -I${MOUNT} From owner-svn-src-all@freebsd.org Sat Aug 10 00:01:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C06DAD959; Sat, 10 Aug 2019 00:01: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4652MV3Ckhz4CMV; Sat, 10 Aug 2019 00:01: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 506361D6DC; Sat, 10 Aug 2019 00:01: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 x7A01QIC066511; Sat, 10 Aug 2019 00:01:26 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7A01QmQ066510; Sat, 10 Aug 2019 00:01:26 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201908100001.x7A01QmQ066510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 10 Aug 2019 00:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350828 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 350828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 00:01:26 -0000 Author: jtl Date: Sat Aug 10 00:01:25 2019 New Revision: 350828 URL: https://svnweb.freebsd.org/changeset/base/350828 Log: MFC r350815: In m_pulldown(), before trying to prepend bytes to the subsequent mbuf, ensure that the subsequent mbuf contains the remainder of the bytes the caller sought. If this is not the case, fall through to the code which gathers the bytes in a new mbuf. This fixes a bug where m_pulldown() could fail to gather all the desired bytes into consecutive memory. PR: 238787 Approved by: so (emaste) Modified: stable/12/sys/kern/uipc_mbuf2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/uipc_mbuf2.c ============================================================================== --- stable/12/sys/kern/uipc_mbuf2.c Fri Aug 9 23:50:57 2019 (r350827) +++ stable/12/sys/kern/uipc_mbuf2.c Sat Aug 10 00:01:25 2019 (r350828) @@ -216,7 +216,7 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp goto ok; } if ((off == 0 || offp) && M_LEADINGSPACE(n->m_next) >= hlen - && writable) { + && writable && n->m_next->m_len >= tlen) { n->m_next->m_data -= hlen; n->m_next->m_len += hlen; bcopy(mtod(n, caddr_t) + off, mtod(n->m_next, caddr_t), hlen); From owner-svn-src-all@freebsd.org Sat Aug 10 00:02:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FD71ADBCD; Sat, 10 Aug 2019 00:02:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4652P22ZXrz4CYh; Sat, 10 Aug 2019 00:02: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 38E2F1D843; Sat, 10 Aug 2019 00:02: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 x7A02kcr069069; Sat, 10 Aug 2019 00:02:46 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7A02k0x069068; Sat, 10 Aug 2019 00:02:46 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201908100002.x7A02k0x069068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Sat, 10 Aug 2019 00:02: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: r350829 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 350829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 00:02:46 -0000 Author: jtl Date: Sat Aug 10 00:02:45 2019 New Revision: 350829 URL: https://svnweb.freebsd.org/changeset/base/350829 Log: MFC r350815: In m_pulldown(), before trying to prepend bytes to the subsequent mbuf, ensure that the subsequent mbuf contains the remainder of the bytes the caller sought. If this is not the case, fall through to the code which gathers the bytes in a new mbuf. This fixes a bug where m_pulldown() could fail to gather all the desired bytes into consecutive memory. PR: 238787 Approved by: so (emaste) Modified: stable/11/sys/kern/uipc_mbuf2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_mbuf2.c ============================================================================== --- stable/11/sys/kern/uipc_mbuf2.c Sat Aug 10 00:01:25 2019 (r350828) +++ stable/11/sys/kern/uipc_mbuf2.c Sat Aug 10 00:02:45 2019 (r350829) @@ -214,7 +214,7 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp goto ok; } if ((off == 0 || offp) && M_LEADINGSPACE(n->m_next) >= hlen - && writable) { + && writable && n->m_next->m_len >= tlen) { n->m_next->m_data -= hlen; n->m_next->m_len += hlen; bcopy(mtod(n, caddr_t) + off, mtod(n->m_next, caddr_t), hlen); From owner-svn-src-all@freebsd.org Sat Aug 10 00:18:46 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B653EADEF9 for ; Sat, 10 Aug 2019 00:18:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4652lT6cLjz4D3h for ; Sat, 10 Aug 2019 00:18:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x735.google.com with SMTP id s22so73109406qkj.12 for ; Fri, 09 Aug 2019 17:18:45 -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=FeqrBd7UigagxbXy0TtbM7Cp/UGvhU6JeueDZS+vpw8=; b=P811mqUIOoA8XQ4do/fws+GtcdHfldaF0+AxSI8piDFQkgs6KhImuxnoWLEmDWed/1 t8j9IblARIzH0SzVUpMxV1OUeGcgctzNzKTk63YNaIbCheodvVH4y10vKiXtOYKaqmMo sVnahoDsx0g89d+6Y9YmuG7kDsK88+yYjLTD0FxB2K13Meqadm2tAdFEzejxGVaE1Jkq nfTy48pin0yXNNUcQbhd2SkKZYAStmSCnQeHLjgAK5uOJ9aP1YoVYXjj1rmag0FpIl/H C3PoQW+rdyA5sKRNRk0BTkfuM4cgzaYkeuJQI1pYwmXKGxrtUjPpAk1P3VshdMS6PDyK 8waA== 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=FeqrBd7UigagxbXy0TtbM7Cp/UGvhU6JeueDZS+vpw8=; b=fxXHpB/rl8bcaJj3YH3+tpses41uzqR6s5UuH0Nw4Qm6WCMNGt4/66noY9ZMHsnTEl 89MNm4IysGItmgUp8ssn5I8dHwbCq2rAiskx2jsGV/g6sSZimLtz7qErxtAyQT+zMh/g 4lA3rZB1wGhjOk3+bCpmDEXvmbYgnua8SpemW0HHJ1H/MhMHJ6gDTTlxA5/eeSIIpNTl S1bFI8BRg34t5Z73pE49xDwC7WGdX73yNqvYEoioE/XXxjscXgHcmk3RXev+vMZqdbJ+ HmiqzJSZXBPvdtEFsjXiyFIlZnizIvLXW8ldNlCiU2jnxR3oof6b/+fWtKyCK3+G5kgu ExNA== X-Gm-Message-State: APjAAAVH/0SLElvIYFFkrmkX7aC9FdcJTNUMg4w1ceYhUceaL+mqvpiw V1KjILleGnJzywTuTcAKONRw0MJqmnb5yr1Ucwzwbw== X-Google-Smtp-Source: APXvYqy4DGFCBPuuQDqIDa0t5s6VI6UF5q7j2IbmAXoL75gU/MRgbr8TRLVGPPlMFwKQ+UBTUofwINuo7NyTtIDqJT8= X-Received: by 2002:a37:c87:: with SMTP id 129mr19221533qkm.240.1565396323984; Fri, 09 Aug 2019 17:18:43 -0700 (PDT) MIME-Version: 1.0 References: <201908081748.x78Hm79V085760@repo.freebsd.org> <20190808225947.GD1531@FreeBSD.org> <20190809065733.GI2731@kib.kiev.ua> <20190809210505.GJ2731@kib.kiev.ua> In-Reply-To: <20190809210505.GJ2731@kib.kiev.ua> From: Warner Losh Date: Fri, 9 Aug 2019 18:18:32 -0600 Message-ID: Subject: Re: svn commit: r350764 - head/sys/arm64/arm64 To: Konstantin Belousov Cc: Gleb Smirnoff , Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4652lT6cLjz4D3h X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=P811mqUI; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::735) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.97 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; RCVD_IN_DNSWL_NONE(0.00)[5.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.98)[ip: (-9.45), ipnet: 2607:f8b0::/32(-2.98), asn: 15169(-2.40), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Aug 2019 00:18:46 -0000 On Fri, Aug 9, 2019 at 3:05 PM Konstantin Belousov wrote: > On Fri, Aug 09, 2019 at 10:01:31AM -0600, Warner Losh wrote: > > On Fri, Aug 9, 2019 at 12:57 AM Konstantin Belousov > > > wrote: > > > > > On Thu, Aug 08, 2019 at 07:38:28PM -0600, Warner Losh wrote: > > > > On Thu, Aug 8, 2019, 4:59 PM Gleb Smirnoff > wrote: > > > > > > > > > Hi, > > > > > > > > > > why do we need COMPAT_43 for arm64 at all? I can't imagine an > > > > > application that would require this compatibility. > > > > > > > > > > A more general question is how far in the future are we going > > > > > to carry COMPAT_43 for i386/amd64? > > > > > > > > > > > > > COMPAT_43 is a weird option. It's a combo of both sys calls and > kernel > > > > behavior modifications. Before we thinned the ABIs we supported, it > was > > > > necessary for them as well. The biggest behavior change is around > > > signals. > > > > It is weird to sort out and nobody has done the deep analysis to see > what > > > > is truly unused and what is there for compat with Linux and other > SysV > > > > systems... > > > I am not aware of any changes that COMPAT_43 provides for the signal > > > handling semantic, except a minor adjustment for interpretation of > > > zero-sized stack for sigaltstack(2). > > > > > > > The onstack stuff was what I was thinking about, but we also have code in > > sys_getpid() that returns the ppid in the second retval register, and > > similar things for getuid and getgid, It also allows ioctl numbers that > > have IOC_IN set, but size == 0 (these would otherwise return ENOTTY). It > > also turns on the COMPAT_OLDSOCK code which generally only kicks in when > > compat bits are set, but in one place it allows a shorter unix domain > > socket path length to be compatible unconditionally. The compatibility > TTY > > stuff, at least is under COMPAT_43TTY, but that's purely ioctl > translation > > code. > I only reacted to the note about changing the signals syscalls behavior. > But the point is valid, we should not change the syscalls ABI for new > binaries when COMPAT_43 is enabled. I propose the following > https://reviews.freebsd.org/D21200 Glad I did the dumpster-diving grep then. I like your proposal for the same reasons you stated. WRT ioctl code for no IOC_OUT and size == 0, I believe that this is in > fact cannot be changed. It is enabled also under COMPAT_FREEBSD4 and > 5, and we always enable these for GENERIC. So effectively this ioctl > permissive mode is always there. > Yes. I also agree. And I honestly think it's OK. > > > > The COMPAT_43 option indeed enables lcall 7,0 syscall entry emulation, > > > on both i386 and amd64. We are able to run FreeBSD 1.1.8 (i386) on > amd64 > > > kernel in chroot this way. Since sometimes I get bug reports about > this > > > stuff, there are some users of it. I believe it is important to be > able > > > to run any FreeBSD binary for PR purposes, to wave the flag of > excellent > > > binary compatibility we offer. > > > > > > COMPAT_43 is there to stay as far as there are people willing to > maintain > > > it. There are more than one. > > > > > > > I think it's safe to retain on i386. amd64 is less clear to me, but I'd > > lean yes. > I believe amd64 is required since you have less and less chances to > usefully > run i386 kernel on modern hardware. > True. With your changes, enabling the option is much safer, and only drags in a minor amount of extra code. All but the most space starved users won't care at all about the delta in size. Warner > > All the other platforms I'd agree with gleb: why do we need it in > > the kernels by default (and maybe why do we need to support it at all)? > > > > Warner > From owner-svn-src-all@freebsd.org Sat Aug 10 04:15:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B83B4B1C22; Sat, 10 Aug 2019 04:15:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46580n30H6z4NNV; Sat, 10 Aug 2019 04:15:37 +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 49C2B20517; Sat, 10 Aug 2019 04:15: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 x7A4Fb0o017592; Sat, 10 Aug 2019 04:15:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7A4FbQu017591; Sat, 10 Aug 2019 04:15:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201908100415.x7A4FbQu017591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 10 Aug 2019 04:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350830 - head/sys/sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/sparc64/conf X-SVN-Commit-Revision: 350830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 04:15:37 -0000 Author: imp Date: Sat Aug 10 04:15:36 2019 New Revision: 350830 URL: https://svnweb.freebsd.org/changeset/base/350830 Log: These are no longer a thing, remove them. We don't need to omit ep and ex from LINT since they have been removed from the tree. Modified: head/sys/sparc64/conf/NOTES Modified: head/sys/sparc64/conf/NOTES ============================================================================== --- head/sys/sparc64/conf/NOTES Sat Aug 10 00:02:45 2019 (r350829) +++ head/sys/sparc64/conf/NOTES Sat Aug 10 04:15:36 2019 (r350830) @@ -119,8 +119,6 @@ nodevice snd_via8233 nodevice snd_via82c686 nodevice snd_vibes nodevice snd_uaudio -nodevice ep -nodevice ex ##################################################################### From owner-svn-src-all@freebsd.org Sat Aug 10 08:26:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E530B6545; Sat, 10 Aug 2019 08:26:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465FYv2fJ1z4XHl; Sat, 10 Aug 2019 08:26: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 518DC231AD; Sat, 10 Aug 2019 08:26: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 x7A8QBFC065036; Sat, 10 Aug 2019 08:26:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7A8QBot065035; Sat, 10 Aug 2019 08:26:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908100826.x7A8QBot065035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 10 Aug 2019 08:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350831 - stable/12/sys/amd64/vmm/io X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/vmm/io X-SVN-Commit-Revision: 350831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 08:26:11 -0000 Author: kib Date: Sat Aug 10 08:26:10 2019 New Revision: 350831 URL: https://svnweb.freebsd.org/changeset/base/350831 Log: MFC r350560: bhyve: Ignore MSI/MSI-X interrupts sent to non-active vCPUs in physical destination mode. Modified: stable/12/sys/amd64/vmm/io/vlapic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/io/vlapic.c ============================================================================== --- stable/12/sys/amd64/vmm/io/vlapic.c Sat Aug 10 04:15:36 2019 (r350830) +++ stable/12/sys/amd64/vmm/io/vlapic.c Sat Aug 10 08:26:10 2019 (r350831) @@ -838,7 +838,8 @@ vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32 */ CPU_ZERO(dmask); vcpuid = vm_apicid2vcpuid(vm, dest); - if (vcpuid < vm_get_maxcpus(vm)) + amask = vm_active_cpus(vm); + if (vcpuid < vm_get_maxcpus(vm) && CPU_ISSET(vcpuid, &amask)) CPU_SET(vcpuid, dmask); } else { /* From owner-svn-src-all@freebsd.org Sat Aug 10 08:27:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A81AB6606; Sat, 10 Aug 2019 08:27:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465FbY0ny2z4XQZ; Sat, 10 Aug 2019 08:27:37 +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 F1B48231B0; Sat, 10 Aug 2019 08:27: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 x7A8Ratf065153; Sat, 10 Aug 2019 08:27:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7A8Radu065152; Sat, 10 Aug 2019 08:27:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908100827.x7A8Radu065152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 10 Aug 2019 08:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350832 - in stable/12/sys/amd64: amd64 include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/amd64: amd64 include X-SVN-Commit-Revision: 350832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 08:27:37 -0000 Author: kib Date: Sat Aug 10 08:27:36 2019 New Revision: 350832 URL: https://svnweb.freebsd.org/changeset/base/350832 Log: MFC r350561: amd64: Streamline exceptions and interrupts handlers. Modified: stable/12/sys/amd64/amd64/exception.S stable/12/sys/amd64/include/asmacros.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/exception.S ============================================================================== --- stable/12/sys/amd64/amd64/exception.S Sat Aug 10 08:26:10 2019 (r350831) +++ stable/12/sys/amd64/amd64/exception.S Sat Aug 10 08:27:36 2019 (r350832) @@ -105,14 +105,31 @@ MCOUNT_LABEL(btrap) /* Traps that we leave interrupts disabled for. */ .macro TRAP_NOEN l, trapno - PTI_ENTRY \l,X\l + PTI_ENTRY \l,\l\()_pti_k,\l\()_pti_u +\l\()_pti_k: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + jmp alltraps_noen_k +\l\()_pti_u: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + jmp alltraps_noen_u + .globl X\l .type X\l,@function -X\l: subq $TF_RIP,%rsp - movl $\trapno,TF_TRAPNO(%rsp) - movq $0,TF_ADDR(%rsp) - movq $0,TF_ERR(%rsp) - jmp alltraps_noen +X\l: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz alltraps_noen_k + swapgs + jmp alltraps_noen_u .endm TRAP_NOEN bpt, T_BPTFLT @@ -122,15 +139,31 @@ X\l: subq $TF_RIP,%rsp /* Regular traps; The cpu does not supply tf_err for these. */ .macro TRAP l, trapno - PTI_ENTRY \l,X\l + PTI_ENTRY \l,\l\()_pti_k,\l\()_pti_u +\l\()_pti_k: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + jmp alltraps_k +\l\()_pti_u: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + jmp alltraps_u + .globl X\l .type X\l,@function X\l: - subq $TF_RIP,%rsp - movl $\trapno,TF_TRAPNO(%rsp) - movq $0,TF_ADDR(%rsp) - movq $0,TF_ERR(%rsp) - jmp alltraps + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz alltraps_k + swapgs + jmp alltraps_u .endm TRAP div, T_DIVIDE @@ -145,42 +178,62 @@ X\l: /* This group of traps have tf_err already pushed by the cpu. */ .macro TRAP_ERR l, trapno - PTI_ENTRY \l,X\l,has_err=1 + PTI_ENTRY \l,\l\()_pti_k,\l\()_pti_u,has_err=1 +\l\()_pti_k: + subq $TF_ERR,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + jmp alltraps_k +\l\()_pti_u: + subq $TF_ERR,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + jmp alltraps_u .globl X\l .type X\l,@function X\l: - subq $TF_ERR,%rsp - movl $\trapno,TF_TRAPNO(%rsp) - movq $0,TF_ADDR(%rsp) - jmp alltraps + subq $TF_ERR,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz alltraps_k + swapgs + jmp alltraps_u .endm TRAP_ERR tss, T_TSSFLT TRAP_ERR align, T_ALIGNFLT /* - * alltraps entry point. Use swapgs if this is the first time in the - * kernel from userland. Reenable interrupts if they were enabled - * before the trap. This approximates SDT_SYS386TGT on the i386 port. + * alltraps_u/k entry points. + * SWAPGS must be already performed by prologue, + * if this is the first time in the kernel from userland. + * Reenable interrupts if they were enabled before the trap. + * This approximates SDT_SYS386TGT on the i386 port. */ SUPERALIGN_TEXT - .globl alltraps - .type alltraps,@function -alltraps: + .globl alltraps_u + .type alltraps_u,@function +alltraps_u: movq %rdi,TF_RDI(%rsp) - testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ - swapgs + movq %rdx,TF_RDX(%rsp) + movq %rax,TF_RAX(%rsp) + movq %rcx,TF_RCX(%rsp) movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: SAVE_SEGS + call handle_ibrs_entry + jmp alltraps_save_segs + SUPERALIGN_TEXT + .globl alltraps_k + .type alltraps_k,@function +alltraps_k: + movq %rdi,TF_RDI(%rsp) movq %rdx,TF_RDX(%rsp) movq %rax,TF_RAX(%rsp) movq %rcx,TF_RCX(%rsp) - testb $SEL_RPL_MASK,TF_CS(%rsp) - jz 2f - call handle_ibrs_entry -2: testl $PSL_I,TF_RFLAGS(%rsp) +alltraps_save_segs: + SAVE_SEGS + testl $PSL_I,TF_RFLAGS(%rsp) jz alltraps_pushregs_no_rax sti alltraps_pushregs_no_rax: @@ -234,21 +287,26 @@ calltrap: jmp doreti /* Handle any pending ASTs */ /* - * alltraps_noen entry point. Unlike alltraps above, we want to - * leave the interrupts disabled. This corresponds to - * SDT_SYS386IGT on the i386 port. + * alltraps_noen_u/k entry points. + * Again, SWAPGS must be already performed by prologue, if needed. + * Unlike alltraps above, we want to leave the interrupts disabled. + * This corresponds to SDT_SYS386IGT on the i386 port. */ SUPERALIGN_TEXT - .globl alltraps_noen - .type alltraps_noen,@function -alltraps_noen: + .globl alltraps_noen_u + .type alltraps_noen_u,@function +alltraps_noen_u: movq %rdi,TF_RDI(%rsp) - testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ - swapgs movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: SAVE_SEGS + jmp alltraps_noen_save_segs + SUPERALIGN_TEXT + .globl alltraps_noen_k + .type alltraps_noen_k,@function +alltraps_noen_k: + movq %rdi,TF_RDI(%rsp) +alltraps_noen_save_segs: + SAVE_SEGS movq %rdx,TF_RDX(%rsp) movq %rax,TF_RAX(%rsp) movq %rcx,TF_RCX(%rsp) @@ -297,8 +355,8 @@ IDTVEC(dblfault) ALIGN_TEXT IDTVEC(page_pti) - testb $SEL_RPL_MASK,PTI_CS-2*8(%rsp) - jz Xpage + testb $SEL_RPL_MASK,PTI_CS-PTI_ERR(%rsp) + jz page_k swapgs pushq %rax movq %cr3,%rax @@ -306,25 +364,31 @@ IDTVEC(page_pti) cmpq $~0,PCPU(UCR3) jne 1f popq %rax - jmp 2f + jmp page_u 1: pushq %rdx PTI_UUENTRY has_err=1 -2: subq $TF_ERR,%rsp - movq %rdi,TF_RDI(%rsp) - movq %rax,TF_RAX(%rsp) - movq %rdx,TF_RDX(%rsp) - movq %rcx,TF_RCX(%rsp) jmp page_u + ALIGN_TEXT IDTVEC(page) + testb $SEL_RPL_MASK,TF_CS-TF_ERR(%rsp) /* Did we come from kernel? */ + jnz page_u_swapgs /* already running with kernel GS.base */ +page_k: subq $TF_ERR,%rsp movq %rdi,TF_RDI(%rsp) /* free up GP registers */ movq %rax,TF_RAX(%rsp) movq %rdx,TF_RDX(%rsp) movq %rcx,TF_RCX(%rsp) - testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz page_cr2 /* already running with kernel GS.base */ + jmp page_cr2 + ALIGN_TEXT +page_u_swapgs: swapgs -page_u: movq PCPU(CURPCB),%rdi +page_u: + subq $TF_ERR,%rsp + movq %rdi,TF_RDI(%rsp) + movq %rax,TF_RAX(%rsp) + movq %rdx,TF_RDX(%rsp) + movq %rcx,TF_RCX(%rsp) + movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) movq PCPU(SAVED_UCR3),%rax movq %rax,PCB_SAVED_UCR3(%rdi) Modified: stable/12/sys/amd64/include/asmacros.h ============================================================================== --- stable/12/sys/amd64/include/asmacros.h Sat Aug 10 08:26:10 2019 (r350831) +++ stable/12/sys/amd64/include/asmacros.h Sat Aug 10 08:27:36 2019 (r350832) @@ -204,17 +204,16 @@ 1: .endm - .macro PTI_ENTRY name, cont, has_err=0 + .macro PTI_ENTRY name, contk, contu, has_err=0 ALIGN_TEXT .globl X\name\()_pti .type X\name\()_pti,@function X\name\()_pti: - /* %rax, %rdx and possibly err not yet pushed */ - testb $SEL_RPL_MASK,PTI_CS-(2+1-\has_err)*8(%rsp) - jz \cont + /* %rax, %rdx, and possibly err are not yet pushed */ + testb $SEL_RPL_MASK,PTI_CS-PTI_ERR-((1-\has_err)*8)(%rsp) + jz \contk PTI_UENTRY \has_err - swapgs - jmp \cont + jmp \contu .endm .macro PTI_INTRENTRY vec_name From owner-svn-src-all@freebsd.org Sat Aug 10 08:29:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68D85B66B6; Sat, 10 Aug 2019 08:29:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465Fdd25H9z4XXt; Sat, 10 Aug 2019 08:29:25 +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 3DE43231B1; Sat, 10 Aug 2019 08:29:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7A8TPAM065290; Sat, 10 Aug 2019 08:29:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7A8TO4P065285; Sat, 10 Aug 2019 08:29:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908100829.x7A8TO4P065285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 10 Aug 2019 08:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350833 - stable/12/share/man/man3 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/share/man/man3 X-SVN-Commit-Revision: 350833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 08:29:25 -0000 Author: kib Date: Sat Aug 10 08:29:23 2019 New Revision: 350833 URL: https://svnweb.freebsd.org/changeset/base/350833 Log: MFC r350683, r350684: Clarify the robustness guarantees. Modified: stable/12/share/man/man3/pthread_cond_wait.3 stable/12/share/man/man3/pthread_mutex_consistent.3 stable/12/share/man/man3/pthread_mutex_lock.3 stable/12/share/man/man3/pthread_mutex_timedlock.3 stable/12/share/man/man3/pthread_mutex_trylock.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man3/pthread_cond_wait.3 ============================================================================== --- stable/12/share/man/man3/pthread_cond_wait.3 Sat Aug 10 08:27:36 2019 (r350832) +++ stable/12/share/man/man3/pthread_cond_wait.3 Sat Aug 10 08:29:23 2019 (r350833) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2018 +.Dd August 7, 2019 .Dt PTHREAD_COND_WAIT 3 .Os .Sh NAME @@ -78,8 +78,8 @@ was not locked by the calling thread. .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE Modified: stable/12/share/man/man3/pthread_mutex_consistent.3 ============================================================================== --- stable/12/share/man/man3/pthread_mutex_consistent.3 Sat Aug 10 08:27:36 2019 (r350832) +++ stable/12/share/man/man3/pthread_mutex_consistent.3 Sat Aug 10 08:29:23 2019 (r350833) @@ -41,9 +41,9 @@ .Ft int .Fn pthread_mutex_consistent "pthread_mutex_t *mutex" .Sh DESCRIPTION -If the thread owning a robust mutex terminates while holding the -mutex, the mutex becomes inconsistent and the next thread that -acquires the mutex lock is notified of the state by the return value +If the process containing the thread owning a robust mutex terminates +while holding the mutex, the mutex becomes inconsistent and the next thread +that acquires the mutex lock is notified of the state by the return value .Er EOWNERDEAD . In this case, the mutex does not become normally usable again until the state is marked consistent. Modified: stable/12/share/man/man3/pthread_mutex_lock.3 ============================================================================== --- stable/12/share/man/man3/pthread_mutex_lock.3 Sat Aug 10 08:27:36 2019 (r350832) +++ stable/12/share/man/man3/pthread_mutex_lock.3 Sat Aug 10 08:29:23 2019 (r350833) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_LOCK 3 .Os .Sh NAME @@ -66,8 +66,8 @@ A deadlock would occur if the thread blocked waiting f .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE Modified: stable/12/share/man/man3/pthread_mutex_timedlock.3 ============================================================================== --- stable/12/share/man/man3/pthread_mutex_timedlock.3 Sat Aug 10 08:27:36 2019 (r350832) +++ stable/12/share/man/man3/pthread_mutex_timedlock.3 Sat Aug 10 08:29:23 2019 (r350833) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2018 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_TIMEDLOCK 3 .Os .Sh NAME @@ -92,8 +92,8 @@ The current thread already owns the .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE Modified: stable/12/share/man/man3/pthread_mutex_trylock.3 ============================================================================== --- stable/12/share/man/man3/pthread_mutex_trylock.3 Sat Aug 10 08:27:36 2019 (r350832) +++ stable/12/share/man/man3/pthread_mutex_trylock.3 Sat Aug 10 08:29:23 2019 (r350833) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_TRYLOCK 3 .Os .Sh NAME @@ -67,8 +67,8 @@ is already locked. .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE From owner-svn-src-all@freebsd.org Sat Aug 10 08:34:03 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76329B6A3E; Sat, 10 Aug 2019 08:34:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465Fkz2Z1Gz4Y0K; Sat, 10 Aug 2019 08:34: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 39B8123380; Sat, 10 Aug 2019 08:34: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 x7A8Y32l070842; Sat, 10 Aug 2019 08:34:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7A8Y27i070841; Sat, 10 Aug 2019 08:34:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908100834.x7A8Y27i070841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 10 Aug 2019 08:34: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: r350834 - stable/11/sys/amd64/vmm/io X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/io X-SVN-Commit-Revision: 350834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 08:34:03 -0000 Author: kib Date: Sat Aug 10 08:34:02 2019 New Revision: 350834 URL: https://svnweb.freebsd.org/changeset/base/350834 Log: MFC r350560: bhyve: Ignore MSI/MSI-X interrupts sent to non-active vCPUs in physical destination mode. Modified: stable/11/sys/amd64/vmm/io/vlapic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/io/vlapic.c ============================================================================== --- stable/11/sys/amd64/vmm/io/vlapic.c Sat Aug 10 08:29:23 2019 (r350833) +++ stable/11/sys/amd64/vmm/io/vlapic.c Sat Aug 10 08:34:02 2019 (r350834) @@ -836,7 +836,8 @@ vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32 */ CPU_ZERO(dmask); vcpuid = vm_apicid2vcpuid(vm, dest); - if (vcpuid < vm_get_maxcpus(vm)) + amask = vm_active_cpus(vm); + if (vcpuid < vm_get_maxcpus(vm) && CPU_ISSET(vcpuid, &amask)) CPU_SET(vcpuid, dmask); } else { /* From owner-svn-src-all@freebsd.org Sat Aug 10 08:34:57 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B31C7B6AC8; Sat, 10 Aug 2019 08:34:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465Fm14Q6Fz4Y6M; Sat, 10 Aug 2019 08:34:57 +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 79A2823381; Sat, 10 Aug 2019 08:34:57 +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 x7A8YvG7070935; Sat, 10 Aug 2019 08:34:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7A8YuNA070930; Sat, 10 Aug 2019 08:34:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908100834.x7A8YuNA070930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 10 Aug 2019 08:34: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: r350835 - stable/11/share/man/man3 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/share/man/man3 X-SVN-Commit-Revision: 350835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 08:34:57 -0000 Author: kib Date: Sat Aug 10 08:34:56 2019 New Revision: 350835 URL: https://svnweb.freebsd.org/changeset/base/350835 Log: MFC r350683, r350684: Clarify the robustness guarantees. Modified: stable/11/share/man/man3/pthread_cond_wait.3 stable/11/share/man/man3/pthread_mutex_consistent.3 stable/11/share/man/man3/pthread_mutex_lock.3 stable/11/share/man/man3/pthread_mutex_timedlock.3 stable/11/share/man/man3/pthread_mutex_trylock.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man3/pthread_cond_wait.3 ============================================================================== --- stable/11/share/man/man3/pthread_cond_wait.3 Sat Aug 10 08:34:02 2019 (r350834) +++ stable/11/share/man/man3/pthread_cond_wait.3 Sat Aug 10 08:34:56 2019 (r350835) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2018 +.Dd August 7, 2019 .Dt PTHREAD_COND_WAIT 3 .Os .Sh NAME @@ -78,8 +78,8 @@ was not locked by the calling thread. .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE Modified: stable/11/share/man/man3/pthread_mutex_consistent.3 ============================================================================== --- stable/11/share/man/man3/pthread_mutex_consistent.3 Sat Aug 10 08:34:02 2019 (r350834) +++ stable/11/share/man/man3/pthread_mutex_consistent.3 Sat Aug 10 08:34:56 2019 (r350835) @@ -41,9 +41,9 @@ .Ft int .Fn pthread_mutex_consistent "pthread_mutex_t *mutex" .Sh DESCRIPTION -If the thread owning a robust mutex terminates while holding the -mutex, the mutex becomes inconsistent and the next thread that -acquires the mutex lock is notified of the state by the return value +If the process containing the thread owning a robust mutex terminates +while holding the mutex, the mutex becomes inconsistent and the next thread +that acquires the mutex lock is notified of the state by the return value .Er EOWNERDEAD . In this case, the mutex does not become normally usable again until the state is marked consistent. Modified: stable/11/share/man/man3/pthread_mutex_lock.3 ============================================================================== --- stable/11/share/man/man3/pthread_mutex_lock.3 Sat Aug 10 08:34:02 2019 (r350834) +++ stable/11/share/man/man3/pthread_mutex_lock.3 Sat Aug 10 08:34:56 2019 (r350835) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_LOCK 3 .Os .Sh NAME @@ -66,8 +66,8 @@ A deadlock would occur if the thread blocked waiting f .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE Modified: stable/11/share/man/man3/pthread_mutex_timedlock.3 ============================================================================== --- stable/11/share/man/man3/pthread_mutex_timedlock.3 Sat Aug 10 08:34:02 2019 (r350834) +++ stable/11/share/man/man3/pthread_mutex_timedlock.3 Sat Aug 10 08:34:56 2019 (r350835) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 17, 2018 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_TIMEDLOCK 3 .Os .Sh NAME @@ -92,8 +92,8 @@ The current thread already owns the .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE Modified: stable/11/share/man/man3/pthread_mutex_trylock.3 ============================================================================== --- stable/11/share/man/man3/pthread_mutex_trylock.3 Sat Aug 10 08:34:02 2019 (r350834) +++ stable/11/share/man/man3/pthread_mutex_trylock.3 Sat Aug 10 08:34:56 2019 (r350835) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd August 7, 2019 .Dt PTHREAD_MUTEX_TRYLOCK 3 .Os .Sh NAME @@ -67,8 +67,8 @@ is already locked. .It Bq Er EOWNERDEAD The argument .Fa mutex -points to a robust mutex and the previous owning thread terminated -while holding the mutex lock. +points to a robust mutex and the process containing the previous owning +thread terminated while holding the mutex lock. The lock was granted to the caller and it is up to the new owner to make the state consistent. .It Bq Er ENOTRECOVERABLE From owner-svn-src-all@freebsd.org Sat Aug 10 13:50:17 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B343CBD112; Sat, 10 Aug 2019 13:50:17 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465Nls4JTNz3HKl; Sat, 10 Aug 2019 13:50:17 +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 7548C26A7C; Sat, 10 Aug 2019 13:50:17 +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 x7ADoH6Q053486; Sat, 10 Aug 2019 13:50:17 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7ADoGIv053477; Sat, 10 Aug 2019 13:50:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908101350.x7ADoGIv053477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Aug 2019 13:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350836 - in stable/12/sys: arm/ti arm/ti/cpsw dev/ofw gnu/dts/arm X-SVN-Group: stable-12 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/12/sys: arm/ti arm/ti/cpsw dev/ofw gnu/dts/arm X-SVN-Commit-Revision: 350836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 13:50:17 -0000 Author: manu Date: Sat Aug 10 13:50:15 2019 New Revision: 350836 URL: https://svnweb.freebsd.org/changeset/base/350836 Log: MFC r350229-r350230, r350408, r350410, r350673-r350674 r350229: arm: ti: Get the hwmods property from the parent node Since the Linux 5.0 dts the ti,hwmods property is on the parent ti.sysc node. r350230: arm: ti: Add a driver for ti,sysc bus ti,sysc is a simple-bus like driver. Add a driver for it so child nodes can attach. r350408: arm: ti: Get the hwmods property either from the node or the parent r350229 changed the code to lookup the ti,hwmods property in the parent as it's now like that in the DTS from >= Linux 5.0, allow the property to be also in the node itself so we can boot with an older DTB. Reported by: "Dr. Rolf Jansen" r350410: arm: ti: cpsw: Check the new slave node address Since DTS from >= Linux 5.0 the slave address are relative to the parent node address and aren't the full ones. Check both so the cpsw driver can find the phy id. r350673: arm: dts: am33xx: Fix the region for uart0 The region for uart0 is declared to be 0x2000 in size but the parent node only declare 0x1000. As the parent only declare a size of 0x1000 in the ranges for it's children this cause the device to not be mappable. https://patchwork.kernel.org/patch/11056769/ r350674: ofw: ofw_reg_to_paddr: Use a 256 static array for the cell Some hardware needs more than 32, bump this value. We cannot use the _alloc for of getencprop as this function is called too early in the boot before pmap is initialized and we only have 2k of stack when cninit is called. Discussed with: ian Added: stable/12/sys/arm/ti/ti_sysc.c - copied unchanged from r350230, head/sys/arm/ti/ti_sysc.c Modified: stable/12/sys/arm/ti/cpsw/if_cpsw.c stable/12/sys/arm/ti/files.ti stable/12/sys/arm/ti/ti_hwmods.c stable/12/sys/dev/ofw/ofw_subr.c stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/12/sys/arm/ti/cpsw/if_cpsw.c Sat Aug 10 08:34:56 2019 (r350835) +++ stable/12/sys/arm/ti/cpsw/if_cpsw.c Sat Aug 10 13:50:15 2019 (r350836) @@ -755,7 +755,9 @@ cpsw_get_fdt_data(struct cpsw_softc *sc, int port) continue; } OF_prop_free(name); - if (mdio_child_addr != slave_mdio_addr[port]) + + if (mdio_child_addr != slave_mdio_addr[port] && + mdio_child_addr != (slave_mdio_addr[port] & 0xFFF)) continue; if (fdt_get_phyaddr(child, NULL, &phy, NULL) != 0){ Modified: stable/12/sys/arm/ti/files.ti ============================================================================== --- stable/12/sys/arm/ti/files.ti Sat Aug 10 08:34:56 2019 (r350835) +++ stable/12/sys/arm/ti/files.ti Sat Aug 10 13:50:15 2019 (r350836) @@ -16,6 +16,7 @@ arm/ti/ti_gpio_if.m optional gpio arm/ti/ti_i2c.c optional ti_i2c arm/ti/ti_sdhci.c optional sdhci arm/ti/ti_spi.c optional ti_spi +arm/ti/ti_sysc.c standard dev/uart/uart_dev_ti8250.c optional uart dev/uart/uart_dev_ns8250.c optional uart Modified: stable/12/sys/arm/ti/ti_hwmods.c ============================================================================== --- stable/12/sys/arm/ti/ti_hwmods.c Sat Aug 10 08:34:56 2019 (r350835) +++ stable/12/sys/arm/ti/ti_hwmods.c Sat Aug 10 13:50:15 2019 (r350836) @@ -97,6 +97,16 @@ struct hwmod ti_hwmods[] = { {NULL, 0} }; +static inline int +ti_get_hwmods_prop(phandle_t node, void **name) +{ + int len; + + if ((len = OF_getprop_alloc(node, "ti,hwmods", name)) > 0) + return (len); + return (OF_getprop_alloc(OF_parent(node), "ti,hwmods", name)); +} + clk_ident_t ti_hwmods_get_clock(device_t dev) { @@ -110,7 +120,7 @@ ti_hwmods_get_clock(device_t dev) if ((node = ofw_bus_get_node(dev)) == 0) return (INVALID_CLK_IDENT); - if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) + if ((len = ti_get_hwmods_prop(node, (void **)&name)) <= 0) return (INVALID_CLK_IDENT); buf = name; @@ -148,7 +158,7 @@ int ti_hwmods_contains(device_t dev, const char *hwmod if ((node = ofw_bus_get_node(dev)) == 0) return (0); - if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) + if ((len = ti_get_hwmods_prop(node, (void **)&name)) <= 0) return (0); buf = name; @@ -182,7 +192,7 @@ ti_hwmods_get_unit(device_t dev, const char *hwmod) if ((node = ofw_bus_get_node(dev)) == 0) return (0); - if ((len = OF_getprop_alloc(node, "ti,hwmods", (void**)&name)) <= 0) + if ((len = ti_get_hwmods_prop(node, (void **)&name)) <= 0) return (0); buf = name; Copied: stable/12/sys/arm/ti/ti_sysc.c (from r350230, head/sys/arm/ti/ti_sysc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/arm/ti/ti_sysc.c Sat Aug 10 13:50:15 2019 (r350836, copy of r350230, head/sys/arm/ti/ti_sysc.c) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +static struct ofw_compat_data compat_data[] = { + { "ti,sysc", 1 }, + { NULL, 0 } +}; + +struct ti_sysc_softc { + struct simplebus_softc sc; + device_t dev; +}; + +static int ti_sysc_probe(device_t dev); +static int ti_sysc_attach(device_t dev); +static int ti_sysc_detach(device_t dev); + +static int +ti_sysc_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "TI SYSC Interconnect"); + return (BUS_PROBE_DEFAULT); +} + +static int +ti_sysc_attach(device_t dev) +{ + struct ti_sysc_softc *sc; + device_t cdev; + phandle_t node, child; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + + simplebus_init(dev, node); + if (simplebus_fill_ranges(node, &sc->sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + + for (child = OF_child(node); child > 0; child = OF_peer(child)) { + cdev = simplebus_add_device(dev, child, 0, NULL, -1, NULL); + if (cdev != NULL) + device_probe_and_attach(cdev); + } + + return (bus_generic_attach(dev)); +} + +static int +ti_sysc_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t ti_sysc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ti_sysc_probe), + DEVMETHOD(device_attach, ti_sysc_attach), + DEVMETHOD(device_detach, ti_sysc_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(ti_sysc, ti_sysc_driver, ti_sysc_methods, + sizeof(struct ti_sysc_softc), simplebus_driver); + +static devclass_t ti_sysc_devclass; + +EARLY_DRIVER_MODULE(ti_sysc, simplebus, ti_sysc_driver, +ti_sysc_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_FIRST); Modified: stable/12/sys/dev/ofw/ofw_subr.c ============================================================================== --- stable/12/sys/dev/ofw/ofw_subr.c Sat Aug 10 08:34:56 2019 (r350835) +++ stable/12/sys/dev/ofw/ofw_subr.c Sat Aug 10 13:50:15 2019 (r350836) @@ -79,7 +79,8 @@ int ofw_reg_to_paddr(phandle_t dev, int regno, bus_addr_t *paddr, bus_size_t *psize, pcell_t *ppci_hi) { - pcell_t cell[32], pci_hi; + static pcell_t cell[256]; + pcell_t pci_hi; uint64_t addr, raddr, baddr; uint64_t size, rsize; uint32_t c, nbridge, naddr, nsize; Modified: stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi ============================================================================== --- stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi Sat Aug 10 08:34:56 2019 (r350835) +++ stable/12/sys/gnu/dts/arm/am33xx-l4.dtsi Sat Aug 10 13:50:15 2019 (r350836) @@ -185,7 +185,7 @@ uart0: serial@0 { compatible = "ti,am3352-uart", "ti,omap3-uart"; clock-frequency = <48000000>; - reg = <0x0 0x2000>; + reg = <0x0 0x1000>; interrupts = <72>; status = "disabled"; dmas = <&edma 26 0>, <&edma 27 0>; From owner-svn-src-all@freebsd.org Sat Aug 10 15:53:43 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB48EBF80F; Sat, 10 Aug 2019 15:53:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465RVH4Rn4z3Mqb; Sat, 10 Aug 2019 15:53:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A25C251; Sat, 10 Aug 2019 15:53:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7AFrhaf030049; Sat, 10 Aug 2019 15:53:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AFrhvw030048; Sat, 10 Aug 2019 15:53:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201908101553.x7AFrhvw030048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sat, 10 Aug 2019 15:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350837 - head/tests/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/opencrypto X-SVN-Commit-Revision: 350837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 15:53:43 -0000 Author: ngie Date: Sat Aug 10 15:53:42 2019 New Revision: 350837 URL: https://svnweb.freebsd.org/changeset/base/350837 Log: tests/sys/opencrypto: enable armv8crypto on aarch64 This change makes required modifications in runtests to also only require the aesni module on Intel (i386/amd64) platforms, as it is an Intel specific module. MFC after: 1 month MFC to: ^/stable/12 (support not present on ^/stable/11) Submitted by: Greg V Differential Revision: https://reviews.freebsd.org/D21018 Modified: head/tests/sys/opencrypto/cryptotest.py head/tests/sys/opencrypto/runtests.sh Modified: head/tests/sys/opencrypto/cryptotest.py ============================================================================== --- head/tests/sys/opencrypto/cryptotest.py Sat Aug 10 13:50:15 2019 (r350836) +++ head/tests/sys/opencrypto/cryptotest.py Sat Aug 10 15:53:42 2019 (r350837) @@ -50,9 +50,9 @@ def katg(base, glob): raise unittest.SkipTest("Missing %s test vectors" % (base)) return iglob(os.path.join(katdir, base, glob)) -aesmodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ] +aesmodules = [ 'cryptosoft0', 'aesni0', 'armv8crypto0', 'ccr0', 'ccp0' ] desmodules = [ 'cryptosoft0', ] -shamodules = [ 'cryptosoft0', 'aesni0', 'ccr0', 'ccp0' ] +shamodules = [ 'cryptosoft0', 'aesni0', 'armv8crypto0', 'ccr0', 'ccp0' ] def GenTestCase(cname): try: @@ -500,6 +500,7 @@ def GenTestCase(cname): cryptosoft = GenTestCase('cryptosoft0') aesni = GenTestCase('aesni0') +armv8crypto = GenTestCase('armv8crypto0') ccr = GenTestCase('ccr0') ccp = GenTestCase('ccp0') Modified: head/tests/sys/opencrypto/runtests.sh ============================================================================== --- head/tests/sys/opencrypto/runtests.sh Sat Aug 10 13:50:15 2019 (r350836) +++ head/tests/sys/opencrypto/runtests.sh Sat Aug 10 15:53:42 2019 (r350837) @@ -60,7 +60,19 @@ cleanup_tests() } trap cleanup_tests EXIT INT TERM -for required_module in nexus/aesni cryptodev; do +cpu_type="$(uname -p)" +cpu_module= + +case ${cpu_type} in +aarch64) + cpu_module=nexus/armv8crypto + ;; +amd64|i386) + cpu_module=nexus/aesni + ;; +esac + +for required_module in $cpu_module cryptodev; do if ! kldstat -q -m $required_module; then module_to_load=${required_module#nexus/} if ! kldload ${module_to_load}; then From owner-svn-src-all@freebsd.org Sat Aug 10 17:14:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3057AC1034; Sat, 10 Aug 2019 17:14:36 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465THc0SWTz3wrL; Sat, 10 Aug 2019 17:14:36 +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 0B02E10BD; Sat, 10 Aug 2019 17:14:36 +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 x7AHEZBT076734; Sat, 10 Aug 2019 17:14:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AHEZLP076733; Sat, 10 Aug 2019 17:14:35 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201908101714.x7AHEZLP076733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 10 Aug 2019 17:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350838 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 350838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 17:14:36 -0000 Author: ian Date: Sat Aug 10 17:14:35 2019 New Revision: 350838 URL: https://svnweb.freebsd.org/changeset/base/350838 Log: Switch the am335x_pmic driver to using iicdev_readfrom/writeto. PR: 239697 Submitted by: Chuhong Yuan Modified: head/sys/arm/ti/am335x/am335x_pmic.c Modified: head/sys/arm/ti/am335x/am335x_pmic.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 10 15:53:42 2019 (r350837) +++ head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 10 17:14:35 2019 (r350838) @@ -79,30 +79,16 @@ static void am335x_pmic_shutdown(void *, int); static int am335x_pmic_read(device_t dev, uint8_t addr, uint8_t *data, uint8_t size) { - struct am335x_pmic_softc *sc = device_get_softc(dev); - struct iic_msg msg[] = { - { sc->sc_addr, IIC_M_WR, 1, &addr }, - { sc->sc_addr, IIC_M_RD, size, data }, - }; - return (iicbus_transfer(dev, msg, 2)); + return (iicdev_readfrom(dev, addr, data, size, IIC_INTRWAIT)); } static int am335x_pmic_write(device_t dev, uint8_t address, uint8_t *data, uint8_t size) { - uint8_t buffer[MAX_IIC_DATA_SIZE + 1]; - struct am335x_pmic_softc *sc = device_get_softc(dev); - struct iic_msg msg[] = { - { sc->sc_addr, IIC_M_WR, size + 1, buffer }, - }; - if (size > MAX_IIC_DATA_SIZE) return (ENOMEM); - buffer[0] = address; - memcpy(buffer + 1, data, size); - - return (iicbus_transfer(dev, msg, 1)); + return (iicdev_writeto(dev, address, data, size, IIC_INTRWAIT)); } static void From owner-svn-src-all@freebsd.org Sat Aug 10 17:17:37 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C72E6C111E; Sat, 10 Aug 2019 17:17:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465TM54yKnz3x2H; Sat, 10 Aug 2019 17:17:37 +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 8BA6C10C5; Sat, 10 Aug 2019 17:17:37 +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 x7AHHbD2076923; Sat, 10 Aug 2019 17:17:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AHHblA076921; Sat, 10 Aug 2019 17:17:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201908101717.x7AHHblA076921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 10 Aug 2019 17:17: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: r350839 - in stable/11/sys/amd64: amd64 include X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/amd64: amd64 include X-SVN-Commit-Revision: 350839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 17:17:37 -0000 Author: kib Date: Sat Aug 10 17:17:36 2019 New Revision: 350839 URL: https://svnweb.freebsd.org/changeset/base/350839 Log: MFC r350561: amd64: Streamline exceptions and interrupts handlers. Modified: stable/11/sys/amd64/amd64/exception.S stable/11/sys/amd64/include/asmacros.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/exception.S ============================================================================== --- stable/11/sys/amd64/amd64/exception.S Sat Aug 10 17:14:35 2019 (r350838) +++ stable/11/sys/amd64/amd64/exception.S Sat Aug 10 17:17:36 2019 (r350839) @@ -106,14 +106,31 @@ MCOUNT_LABEL(btrap) /* Traps that we leave interrupts disabled for. */ .macro TRAP_NOEN l, trapno - PTI_ENTRY \l,X\l + PTI_ENTRY \l,\l\()_pti_k,\l\()_pti_u +\l\()_pti_k: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + jmp alltraps_noen_k +\l\()_pti_u: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + jmp alltraps_noen_u + .globl X\l .type X\l,@function -X\l: subq $TF_RIP,%rsp - movl $\trapno,TF_TRAPNO(%rsp) - movq $0,TF_ADDR(%rsp) - movq $0,TF_ERR(%rsp) - jmp alltraps_noen +X\l: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz alltraps_noen_k + swapgs + jmp alltraps_noen_u .endm TRAP_NOEN bpt, T_BPTFLT @@ -123,15 +140,31 @@ X\l: subq $TF_RIP,%rsp /* Regular traps; The cpu does not supply tf_err for these. */ .macro TRAP l, trapno - PTI_ENTRY \l,X\l + PTI_ENTRY \l,\l\()_pti_k,\l\()_pti_u +\l\()_pti_k: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + jmp alltraps_k +\l\()_pti_u: + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + jmp alltraps_u + .globl X\l .type X\l,@function X\l: - subq $TF_RIP,%rsp - movl $\trapno,TF_TRAPNO(%rsp) - movq $0,TF_ADDR(%rsp) - movq $0,TF_ERR(%rsp) - jmp alltraps + subq $TF_RIP,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + movq $0,TF_ERR(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz alltraps_k + swapgs + jmp alltraps_u .endm TRAP div, T_DIVIDE @@ -146,42 +179,62 @@ X\l: /* This group of traps have tf_err already pushed by the cpu. */ .macro TRAP_ERR l, trapno - PTI_ENTRY \l,X\l,has_err=1 + PTI_ENTRY \l,\l\()_pti_k,\l\()_pti_u,has_err=1 +\l\()_pti_k: + subq $TF_ERR,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + jmp alltraps_k +\l\()_pti_u: + subq $TF_ERR,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + jmp alltraps_u .globl X\l .type X\l,@function X\l: - subq $TF_ERR,%rsp - movl $\trapno,TF_TRAPNO(%rsp) - movq $0,TF_ADDR(%rsp) - jmp alltraps + subq $TF_ERR,%rsp + movl $\trapno,TF_TRAPNO(%rsp) + movq $0,TF_ADDR(%rsp) + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz alltraps_k + swapgs + jmp alltraps_u .endm TRAP_ERR tss, T_TSSFLT TRAP_ERR align, T_ALIGNFLT /* - * alltraps entry point. Use swapgs if this is the first time in the - * kernel from userland. Reenable interrupts if they were enabled - * before the trap. This approximates SDT_SYS386TGT on the i386 port. + * alltraps_u/k entry points. + * SWAPGS must be already performed by prologue, + * if this is the first time in the kernel from userland. + * Reenable interrupts if they were enabled before the trap. + * This approximates SDT_SYS386TGT on the i386 port. */ SUPERALIGN_TEXT - .globl alltraps - .type alltraps,@function -alltraps: + .globl alltraps_u + .type alltraps_u,@function +alltraps_u: movq %rdi,TF_RDI(%rsp) - testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ - swapgs + movq %rdx,TF_RDX(%rsp) + movq %rax,TF_RAX(%rsp) + movq %rcx,TF_RCX(%rsp) movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: SAVE_SEGS + call handle_ibrs_entry + jmp alltraps_save_segs + SUPERALIGN_TEXT + .globl alltraps_k + .type alltraps_k,@function +alltraps_k: + movq %rdi,TF_RDI(%rsp) movq %rdx,TF_RDX(%rsp) movq %rax,TF_RAX(%rsp) movq %rcx,TF_RCX(%rsp) - testb $SEL_RPL_MASK,TF_CS(%rsp) - jz 2f - call handle_ibrs_entry -2: testl $PSL_I,TF_RFLAGS(%rsp) +alltraps_save_segs: + SAVE_SEGS + testl $PSL_I,TF_RFLAGS(%rsp) jz alltraps_pushregs_no_rax sti alltraps_pushregs_no_rax: @@ -233,21 +286,26 @@ calltrap: jmp doreti /* Handle any pending ASTs */ /* - * alltraps_noen entry point. Unlike alltraps above, we want to - * leave the interrupts disabled. This corresponds to - * SDT_SYS386IGT on the i386 port. + * alltraps_noen_u/k entry points. + * Again, SWAPGS must be already performed by prologue, if needed. + * Unlike alltraps above, we want to leave the interrupts disabled. + * This corresponds to SDT_SYS386IGT on the i386 port. */ SUPERALIGN_TEXT - .globl alltraps_noen - .type alltraps_noen,@function -alltraps_noen: + .globl alltraps_noen_u + .type alltraps_noen_u,@function +alltraps_noen_u: movq %rdi,TF_RDI(%rsp) - testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ - swapgs movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) -1: SAVE_SEGS + jmp alltraps_noen_save_segs + SUPERALIGN_TEXT + .globl alltraps_noen_k + .type alltraps_noen_k,@function +alltraps_noen_k: + movq %rdi,TF_RDI(%rsp) +alltraps_noen_save_segs: + SAVE_SEGS movq %rdx,TF_RDX(%rsp) movq %rax,TF_RAX(%rsp) movq %rcx,TF_RCX(%rsp) @@ -294,8 +352,8 @@ IDTVEC(dblfault) ALIGN_TEXT IDTVEC(page_pti) - testb $SEL_RPL_MASK,PTI_CS-2*8(%rsp) - jz Xpage + testb $SEL_RPL_MASK,PTI_CS-PTI_ERR(%rsp) + jz page_k swapgs pushq %rax movq %cr3,%rax @@ -303,25 +361,31 @@ IDTVEC(page_pti) cmpq $~0,PCPU(UCR3) jne 1f popq %rax - jmp 2f + jmp page_u 1: pushq %rdx PTI_UUENTRY has_err=1 -2: subq $TF_ERR,%rsp - movq %rdi,TF_RDI(%rsp) - movq %rax,TF_RAX(%rsp) - movq %rdx,TF_RDX(%rsp) - movq %rcx,TF_RCX(%rsp) jmp page_u + ALIGN_TEXT IDTVEC(page) + testb $SEL_RPL_MASK,TF_CS-TF_ERR(%rsp) /* Did we come from kernel? */ + jnz page_u_swapgs /* already running with kernel GS.base */ +page_k: subq $TF_ERR,%rsp movq %rdi,TF_RDI(%rsp) /* free up GP registers */ movq %rax,TF_RAX(%rsp) movq %rdx,TF_RDX(%rsp) movq %rcx,TF_RCX(%rsp) - testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz page_cr2 /* already running with kernel GS.base */ + jmp page_cr2 + ALIGN_TEXT +page_u_swapgs: swapgs -page_u: movq PCPU(CURPCB),%rdi +page_u: + subq $TF_ERR,%rsp + movq %rdi,TF_RDI(%rsp) + movq %rax,TF_RAX(%rsp) + movq %rdx,TF_RDX(%rsp) + movq %rcx,TF_RCX(%rsp) + movq PCPU(CURPCB),%rdi andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) movq PCPU(SAVED_UCR3),%rax movq %rax,PCB_SAVED_UCR3(%rdi) Modified: stable/11/sys/amd64/include/asmacros.h ============================================================================== --- stable/11/sys/amd64/include/asmacros.h Sat Aug 10 17:14:35 2019 (r350838) +++ stable/11/sys/amd64/include/asmacros.h Sat Aug 10 17:17:36 2019 (r350839) @@ -202,17 +202,16 @@ 1: .endm - .macro PTI_ENTRY name, cont, has_err=0 + .macro PTI_ENTRY name, contk, contu, has_err=0 ALIGN_TEXT .globl X\name\()_pti .type X\name\()_pti,@function X\name\()_pti: - /* %rax, %rdx and possibly err not yet pushed */ - testb $SEL_RPL_MASK,PTI_CS-(2+1-\has_err)*8(%rsp) - jz \cont + /* %rax, %rdx, and possibly err are not yet pushed */ + testb $SEL_RPL_MASK,PTI_CS-PTI_ERR-((1-\has_err)*8)(%rsp) + jz \contk PTI_UENTRY \has_err - swapgs - jmp \cont + jmp \contu .endm .macro PTI_INTRENTRY vec_name From owner-svn-src-all@freebsd.org Sat Aug 10 17:28:14 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E13A5C1483; Sat, 10 Aug 2019 17:28:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465TbL5WzNz3xWD; Sat, 10 Aug 2019 17:28:14 +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 B471912A2; Sat, 10 Aug 2019 17:28:14 +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 x7AHSEoq082897; Sat, 10 Aug 2019 17:28:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AHSEOc082896; Sat, 10 Aug 2019 17:28:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201908101728.x7AHSEOc082896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 10 Aug 2019 17:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350840 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 350840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 17:28:14 -0000 Author: ian Date: Sat Aug 10 17:28:14 2019 New Revision: 350840 URL: https://svnweb.freebsd.org/changeset/base/350840 Log: Garbage collect the no-longer-necessary MAX_IIC_DATA_SIZE (there is not a buffer allocated at that fixed size anymore). Modified: head/sys/arm/ti/am335x/am335x_pmic.c Modified: head/sys/arm/ti/am335x/am335x_pmic.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 10 17:17:36 2019 (r350839) +++ head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 10 17:28:14 2019 (r350840) @@ -56,9 +56,6 @@ __FBSDID("$FreeBSD$"); #include "iicbus_if.h" -#define MAX_IIC_DATA_SIZE 2 - - struct am335x_pmic_softc { device_t sc_dev; uint32_t sc_addr; @@ -85,9 +82,6 @@ am335x_pmic_read(device_t dev, uint8_t addr, uint8_t * static int am335x_pmic_write(device_t dev, uint8_t address, uint8_t *data, uint8_t size) { - if (size > MAX_IIC_DATA_SIZE) - return (ENOMEM); - return (iicdev_writeto(dev, address, data, size, IIC_INTRWAIT)); } From owner-svn-src-all@freebsd.org Sat Aug 10 17:48:12 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 594F5C1A2F; Sat, 10 Aug 2019 17:48: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465V2N1gmFz3yMv; Sat, 10 Aug 2019 17:48: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 1B3671644; Sat, 10 Aug 2019 17:48: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 x7AHmBZB094674; Sat, 10 Aug 2019 17:48:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AHmBLl094673; Sat, 10 Aug 2019 17:48:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201908101748.x7AHmBLl094673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 10 Aug 2019 17:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350841 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 350841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 17:48:12 -0000 Author: ian Date: Sat Aug 10 17:48:11 2019 New Revision: 350841 URL: https://svnweb.freebsd.org/changeset/base/350841 Log: When responding to an interrupt in the am335x_pmic driver, use a taskqueue thread to do the work that involves i2c IO, which sleeps while the IO is in progress. Modified: head/sys/arm/ti/am335x/am335x_pmic.c Modified: head/sys/arm/ti/am335x/am335x_pmic.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 10 17:28:14 2019 (r350840) +++ head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 10 17:48:11 2019 (r350841) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -62,6 +63,7 @@ struct am335x_pmic_softc { struct intr_config_hook enum_hook; struct resource *sc_irq_res; void *sc_intrhand; + struct task intr_task; }; static const char *tps65217_voreg_c[4] = {"4.10V", "4.15V", "4.20V", "4.25V"}; @@ -86,7 +88,7 @@ am335x_pmic_write(device_t dev, uint8_t address, uint8 } static void -am335x_pmic_intr(void *arg) +am335x_pmic_intrtask(void *arg, int pending) { struct am335x_pmic_softc *sc = (struct am335x_pmic_softc *)arg; struct tps65217_status_reg status_reg; @@ -94,20 +96,16 @@ am335x_pmic_intr(void *arg) int rv; char notify_buf[16]; - THREAD_SLEEPING_OK(); rv = am335x_pmic_read(sc->sc_dev, TPS65217_INT_REG, (uint8_t *)&int_reg, 1); if (rv != 0) { device_printf(sc->sc_dev, "Cannot read interrupt register\n"); - THREAD_NO_SLEEPING(); return; } rv = am335x_pmic_read(sc->sc_dev, TPS65217_STATUS_REG, (uint8_t *)&status_reg, 1); if (rv != 0) { device_printf(sc->sc_dev, "Cannot read status register\n"); - THREAD_NO_SLEEPING(); return; } - THREAD_NO_SLEEPING(); if (int_reg.pbi && status_reg.pb) shutdown_nice(RB_POWEROFF); @@ -118,6 +116,18 @@ am335x_pmic_intr(void *arg) } } +static void +am335x_pmic_intr(void *arg) +{ + struct am335x_pmic_softc *sc = arg; + + /* + * Handling the interrupt requires doing i2c IO, which sleeps while the + * IO is in progress, so do the processing on a taskqueue thread. + */ + taskqueue_enqueue(taskqueue_thread, &sc->intr_task); +} + static int am335x_pmic_probe(device_t dev) { @@ -279,6 +289,8 @@ am335x_pmic_attach(device_t dev) int rid; sc = device_get_softc(dev); + + TASK_INIT(&sc->intr_task, 0, am335x_pmic_intrtask, sc); rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, From owner-svn-src-all@freebsd.org Sat Aug 10 17:58:35 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07727C1D0A; Sat, 10 Aug 2019 17:58:35 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465VGL6K6Zz3yvD; Sat, 10 Aug 2019 17:58:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B705C1816; Sat, 10 Aug 2019 17:58:34 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7AHwYCk000709; Sat, 10 Aug 2019 17:58:34 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AHwVPF000692; Sat, 10 Aug 2019 17:58:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908101758.x7AHwVPF000692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Aug 2019 17:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350842 - in head/sys/arm/allwinner: . a20 clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm/allwinner: . a20 clkng X-SVN-Commit-Revision: 350842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 17:58:35 -0000 Author: manu Date: Sat Aug 10 17:58:30 2019 New Revision: 350842 URL: https://svnweb.freebsd.org/changeset/base/350842 Log: allwinner: Rework the BUS_PASS on drivers - Put all clock and control unit driver in BUS_PASS_RESOURCE except for the DE2 CCU as it needs the main CCU to be available. - Use BUS_PASS_CPU for a20_cpu_cfg as it makes more sense. - For aw_syscon use SCHEDULER pass as we need it early for drivers that attach in BUS_PASS_SUPPORTDEV - For the rest we can use BUS_PASS_SUPPORTDEV Modified: head/sys/arm/allwinner/a10_sramc.c head/sys/arm/allwinner/a20/a20_cpu_cfg.c head/sys/arm/allwinner/aw_ccu.c head/sys/arm/allwinner/aw_gmacclk.c head/sys/arm/allwinner/aw_reset.c head/sys/arm/allwinner/aw_rsb.c head/sys/arm/allwinner/aw_rtc.c head/sys/arm/allwinner/aw_sid.c head/sys/arm/allwinner/aw_syscon.c head/sys/arm/allwinner/clkng/ccu_a10.c head/sys/arm/allwinner/clkng/ccu_a13.c head/sys/arm/allwinner/clkng/ccu_a31.c head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/arm/allwinner/clkng/ccu_a83t.c head/sys/arm/allwinner/clkng/ccu_de2.c head/sys/arm/allwinner/clkng/ccu_h3.c head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Modified: head/sys/arm/allwinner/a10_sramc.c ============================================================================== --- head/sys/arm/allwinner/a10_sramc.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/a10_sramc.c Sat Aug 10 17:58:30 2019 (r350842) @@ -116,7 +116,7 @@ static driver_t a10_sramc_driver = { static devclass_t a10_sramc_devclass; EARLY_DRIVER_MODULE(a10_sramc, simplebus, a10_sramc_driver, a10_sramc_devclass, - 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_EARLY); + 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_FIRST); int a10_map_to_emac(void) Modified: head/sys/arm/allwinner/a20/a20_cpu_cfg.c ============================================================================== --- head/sys/arm/allwinner/a20/a20_cpu_cfg.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/a20/a20_cpu_cfg.c Sat Aug 10 17:58:30 2019 (r350842) @@ -119,7 +119,7 @@ static driver_t a20_cpu_cfg_driver = { static devclass_t a20_cpu_cfg_devclass; EARLY_DRIVER_MODULE(a20_cpu_cfg, simplebus, a20_cpu_cfg_driver, a20_cpu_cfg_devclass, 0, 0, - BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); uint64_t a20_read_counter64(void) Modified: head/sys/arm/allwinner/aw_ccu.c ============================================================================== --- head/sys/arm/allwinner/aw_ccu.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/aw_ccu.c Sat Aug 10 17:58:30 2019 (r350842) @@ -250,6 +250,6 @@ DEFINE_CLASS_1(aw_ccu, aw_ccu_driver, aw_ccu_methods, static devclass_t aw_ccu_devclass; EARLY_DRIVER_MODULE(aw_ccu, simplebus, aw_ccu_driver, aw_ccu_devclass, - 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(aw_ccu, 1); Modified: head/sys/arm/allwinner/aw_gmacclk.c ============================================================================== --- head/sys/arm/allwinner/aw_gmacclk.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/aw_gmacclk.c Sat Aug 10 17:58:30 2019 (r350842) @@ -277,4 +277,4 @@ static driver_t aw_gmacclk_driver = { static devclass_t aw_gmacclk_devclass; EARLY_DRIVER_MODULE(aw_gmacclk, simplebus, aw_gmacclk_driver, - aw_gmacclk_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + aw_gmacclk_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/aw_reset.c ============================================================================== --- head/sys/arm/allwinner/aw_reset.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/aw_reset.c Sat Aug 10 17:58:30 2019 (r350842) @@ -162,5 +162,5 @@ static driver_t aw_reset_driver = { static devclass_t aw_reset_devclass; EARLY_DRIVER_MODULE(aw_reset, simplebus, aw_reset_driver, aw_reset_devclass, - 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(aw_reset, 1); Modified: head/sys/arm/allwinner/aw_rsb.c ============================================================================== --- head/sys/arm/allwinner/aw_rsb.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/aw_rsb.c Sat Aug 10 17:58:30 2019 (r350842) @@ -494,9 +494,9 @@ static driver_t rsb_driver = { static devclass_t rsb_devclass; EARLY_DRIVER_MODULE(iicbus, rsb, iicbus_driver, iicbus_devclass, 0, 0, - BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); EARLY_DRIVER_MODULE(rsb, simplebus, rsb_driver, rsb_devclass, 0, 0, - BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(rsb, 1); MODULE_DEPEND(rsb, iicbus, 1, 1, 1); SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/arm/allwinner/aw_rtc.c ============================================================================== --- head/sys/arm/allwinner/aw_rtc.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/aw_rtc.c Sat Aug 10 17:58:30 2019 (r350842) @@ -185,7 +185,7 @@ static driver_t aw_rtc_driver = { static devclass_t aw_rtc_devclass; EARLY_DRIVER_MODULE(aw_rtc, simplebus, aw_rtc_driver, aw_rtc_devclass, 0, 0, - BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + BUS_PASS_RESOURCE + BUS_PASS_ORDER_FIRST); MODULE_VERSION(aw_rtc, 1); SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/aw_sid.c Sat Aug 10 17:58:30 2019 (r350842) @@ -412,6 +412,6 @@ static driver_t aw_sid_driver = { static devclass_t aw_sid_devclass; EARLY_DRIVER_MODULE(aw_sid, simplebus, aw_sid_driver, aw_sid_devclass, 0, 0, - BUS_PASS_RESOURCE + BUS_PASS_ORDER_FIRST); + BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_FIRST); MODULE_VERSION(aw_sid, 1); SIMPLEBUS_PNP_INFO(compat_data); Modified: head/sys/arm/allwinner/aw_syscon.c ============================================================================== --- head/sys/arm/allwinner/aw_syscon.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/aw_syscon.c Sat Aug 10 17:58:30 2019 (r350842) @@ -82,5 +82,5 @@ DEFINE_CLASS_1(aw_syscon, aw_syscon_driver, aw_syscon_ static devclass_t aw_syscon_devclass; /* aw_syscon needs to attach prior to if_awg */ EARLY_DRIVER_MODULE(aw_syscon, simplebus, aw_syscon_driver, aw_syscon_devclass, - 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_SCHEDULER + BUS_PASS_ORDER_LAST); MODULE_VERSION(aw_syscon, 1); Modified: head/sys/arm/allwinner/clkng/ccu_a10.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a10.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/clkng/ccu_a10.c Sat Aug 10 17:58:30 2019 (r350842) @@ -621,4 +621,4 @@ DEFINE_CLASS_1(ccu_a10ng, ccu_a10ng_driver, ccu_a10ng_ sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a10ng, simplebus, ccu_a10ng_driver, - ccu_a10ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_a10ng_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_a13.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a13.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/clkng/ccu_a13.c Sat Aug 10 17:58:30 2019 (r350842) @@ -568,4 +568,4 @@ DEFINE_CLASS_1(ccu_a13ng, ccu_a13ng_driver, ccu_a13ng_ sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a13ng, simplebus, ccu_a13ng_driver, - ccu_a13ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); + ccu_a13ng_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_a31.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a31.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/clkng/ccu_a31.c Sat Aug 10 17:58:30 2019 (r350842) @@ -973,4 +973,4 @@ DEFINE_CLASS_1(ccu_a31ng, ccu_a31ng_driver, ccu_a31ng_ sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a31ng, simplebus, ccu_a31ng_driver, - ccu_a31ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); + ccu_a31ng_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Sat Aug 10 17:58:30 2019 (r350842) @@ -827,4 +827,4 @@ DEFINE_CLASS_1(ccu_a64ng, ccu_a64ng_driver, ccu_a64ng_ sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a64ng, simplebus, ccu_a64ng_driver, - ccu_a64ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); + ccu_a64ng_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_a83t.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a83t.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/clkng/ccu_a83t.c Sat Aug 10 17:58:30 2019 (r350842) @@ -786,4 +786,4 @@ DEFINE_CLASS_1(ccu_a83tng, ccu_a83tng_driver, ccu_a83t sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a83tng, simplebus, ccu_a83tng_driver, - ccu_a83tng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); + ccu_a83tng_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_de2.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_de2.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/clkng/ccu_de2.c Sat Aug 10 17:58:30 2019 (r350842) @@ -163,4 +163,4 @@ DEFINE_CLASS_1(ccu_de2, ccu_de2_driver, ccu_de2_method sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_de2, simplebus, ccu_de2_driver, - ccu_de2ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); + ccu_de2ng_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_LAST); Modified: head/sys/arm/allwinner/clkng/ccu_h3.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_h3.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/clkng/ccu_h3.c Sat Aug 10 17:58:30 2019 (r350842) @@ -787,4 +787,4 @@ DEFINE_CLASS_1(ccu_h3ng, ccu_h3ng_driver, ccu_h3ng_met sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_h3ng, simplebus, ccu_h3ng_driver, - ccu_h3ng_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); + ccu_h3ng_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat Aug 10 17:48:11 2019 (r350841) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat Aug 10 17:58:30 2019 (r350842) @@ -215,7 +215,7 @@ DEFINE_CLASS_1(ccu_sun8i_r, ccu_sun8i_r_driver, ccu_su sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_sun8i_r, simplebus, ccu_sun8i_r_driver, - ccu_sun8i_r_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); + ccu_sun8i_r_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); static int ccu_a83t_r_probe(device_t dev) @@ -262,4 +262,4 @@ DEFINE_CLASS_1(ccu_a83t_r, ccu_a83t_r_driver, ccu_a83t sizeof(struct aw_ccung_softc), aw_ccung_driver); EARLY_DRIVER_MODULE(ccu_a83t_r, simplebus, ccu_a83t_r_driver, - ccu_a83t_r_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LAST); + ccu_a83t_r_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); From owner-svn-src-all@freebsd.org Sat Aug 10 18:22:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7E7DC273E; Sat, 10 Aug 2019 18:22:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465Vnp5Pxnz41FQ; Sat, 10 Aug 2019 18:22: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 9CA931C4D; Sat, 10 Aug 2019 18:22: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 x7AIMMI3018081; Sat, 10 Aug 2019 18:22:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AIMMZg018080; Sat, 10 Aug 2019 18:22:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201908101822.x7AIMMZg018080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Aug 2019 18:22:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350843 - head X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 350843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 18:22:22 -0000 Author: cem Date: Sat Aug 10 18:22:22 2019 New Revision: 350843 URL: https://svnweb.freebsd.org/changeset/base/350843 Log: .gitignore: Add LINT kernel configurations generated into SRCDIR Modified: head/.gitignore Modified: head/.gitignore ============================================================================== --- head/.gitignore Sat Aug 10 17:58:30 2019 (r350842) +++ head/.gitignore Sat Aug 10 18:22:22 2019 (r350843) @@ -17,3 +17,19 @@ GTAGS ID cscope.out ?cscope.out +# Ignore LINT generated configs. +/sys/amd64/conf/LINT +/sys/amd64/conf/LINT-NOINET +/sys/amd64/conf/LINT-NOINET6 +/sys/amd64/conf/LINT-NOIP +/sys/arm/conf/LINT +/sys/arm/conf/LINT-V5 +/sys/arm/conf/LINT-V7 +/sys/arm64/conf/LINT +/sys/i386/conf/LINT +/sys/i386/conf/LINT-NOINET +/sys/i386/conf/LINT-NOINET6 +/sys/i386/conf/LINT-NOIP +/sys/powerpc/conf/LINT +/sys/powerpc/conf/LINT64 +/sys/sparc64/conf/LINT From owner-svn-src-all@freebsd.org Sat Aug 10 18:50:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C4981C2F41; Sat, 10 Aug 2019 18:50:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465WQR5cFdz429N; Sat, 10 Aug 2019 18:50:39 +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 89C052159; Sat, 10 Aug 2019 18:50:39 +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 x7AIod3R030464; Sat, 10 Aug 2019 18:50:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AIobSP030442; Sat, 10 Aug 2019 18:50:37 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908101850.x7AIobSP030442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Aug 2019 18:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350844 - in head/sys: arm/allwinner arm/allwinner/clkng conf dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/allwinner/clkng conf dev/extres/clk X-SVN-Commit-Revision: 350844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 18:50:39 -0000 Author: manu Date: Sat Aug 10 18:50:37 2019 New Revision: 350844 URL: https://svnweb.freebsd.org/changeset/base/350844 Log: allwinner: Add a new clock aw_clk_m We used the aw_clk_nm clock for clock with only one divider factor and used a fake multiplier factor. This cannot work properly as we end up writing the "fake" factor to the register (and so always set the LSB to 1). Create a new clock for those. The reason for not using the clk_div clock is because those clocks are a bit special. Since they are (almost) all related to video we also need to set the parent clock (the main PLL) to a frequency that they can support. As the main PLL have some minimal frequency that they can support we need to be able to set the main PLL to a multiple of the desired frequency. Let say you want to have a 71Mhz pixel clock (typical for a 1280x800 display) and the main PLL cannot go under 192Mhz, you need to set it to 3 times the desired frequency and set the divider to 3 on the hdmi clock. So this also introduce the CLK_SET_ROUND_MULTIPLE flag that allow for this kind of scenario. Added: head/sys/arm/allwinner/clkng/aw_clk_m.c (contents, props changed) head/sys/arm/allwinner/clkng/aw_clk_m.h (contents, props changed) Modified: head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/allwinner/clkng/aw_ccung.h head/sys/arm/allwinner/clkng/aw_clk.h head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/arm/allwinner/files.allwinner head/sys/conf/files.arm64 head/sys/dev/extres/clk/clk.h Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Sat Aug 10 18:22:22 2019 (r350843) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Sat Aug 10 18:50:37 2019 (r350844) @@ -301,6 +301,9 @@ aw_ccung_attach(device_t dev) case AW_CLK_NM: aw_clk_nm_register(sc->clkdom, sc->clks[i].clk.nm); break; + case AW_CLK_M: + aw_clk_m_register(sc->clkdom, sc->clks[i].clk.m); + break; case AW_CLK_PREDIV_MUX: aw_clk_prediv_mux_register(sc->clkdom, sc->clks[i].clk.prediv_mux); Modified: head/sys/arm/allwinner/clkng/aw_ccung.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.h Sat Aug 10 18:22:22 2019 (r350843) +++ head/sys/arm/allwinner/clkng/aw_ccung.h Sat Aug 10 18:50:37 2019 (r350844) @@ -31,6 +31,7 @@ #define __CCU_NG_H__ #include +#include #include #include #include @@ -48,6 +49,7 @@ enum aw_ccung_clk_type { AW_CLK_NM, AW_CLK_PREDIV_MUX, AW_CLK_FRAC, + AW_CLK_M, }; struct aw_ccung_clk { @@ -60,6 +62,7 @@ struct aw_ccung_clk { struct aw_clk_nm_def *nm; struct aw_clk_prediv_mux_def *prediv_mux; struct aw_clk_frac_def *frac; + struct aw_clk_m_def *m; } clk; }; Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Sat Aug 10 18:22:22 2019 (r350843) +++ head/sys/arm/allwinner/clkng/aw_clk.h Sat Aug 10 18:50:37 2019 (r350844) @@ -66,6 +66,7 @@ struct aw_clk_init { #define AW_CLK_SCALE_CHANGE 0x0010 #define AW_CLK_HAS_UPDATE 0x0040 #define AW_CLK_HAS_PREDIV 0x0080 +#define AW_CLK_SET_PARENT 0x0100 #define AW_CLK_FACTOR_POWER_OF_TWO 0x0001 #define AW_CLK_FACTOR_ZERO_BASED 0x0002 @@ -338,6 +339,30 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .frac.freq1 = _freq1, \ .frac.mode_sel = _mode_sel, \ .frac.freq_sel = _freq_sel, \ + } + +#define M_CLK(_clkname, _id, _name, _pnames, \ + _offset, \ + _mshift, _mwidth, _mvalue, _mflags, \ + _mux_shift, _mux_width, \ + _gate_shift, \ + _flags) \ + static struct aw_clk_m_def _clkname = { \ + .clkdef = { \ + .id = _id, \ + .name = _name, \ + .parent_names = _pnames, \ + .parent_cnt = nitems(_pnames), \ + }, \ + .offset = _offset, \ + .mux_shift = _mux_shift, \ + .m.shift = _mshift, \ + .m.width = _mwidth, \ + .m.value = _mvalue, \ + .m.flags = _mflags, \ + .mux_width = _mux_width, \ + .gate_shift = _gate_shift, \ + .flags = _flags, \ } #define NM_CLK(_clkname, _id, _name, _pnames, \ Added: head/sys/arm/allwinner/clkng/aw_clk_m.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/aw_clk_m.c Sat Aug 10 18:50:37 2019 (r350844) @@ -0,0 +1,580 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include + +#include "clkdev_if.h" + +/* + * clknode for clocks matching the formula : + * + * clk = clkin / m + * And that needs to potentially : + * 1) Set the parent freq + * 2) Support Setting the parent to a multiple + * + */ + +struct aw_clk_m_sc { + uint32_t offset; + + struct aw_clk_factor m; + + uint32_t mux_shift; + uint32_t mux_mask; + uint32_t gate_shift; + + uint32_t flags; +}; + +#define WRITE4(_clk, off, val) \ + CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) +#define READ4(_clk, off, val) \ + CLKDEV_READ_4(clknode_get_device(_clk), off, val) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) + +static int +aw_clk_m_init(struct clknode *clk, device_t dev) +{ + struct aw_clk_m_sc *sc; + uint32_t val, idx; + + sc = clknode_get_softc(clk); + + idx = 0; + if ((sc->flags & AW_CLK_HAS_MUX) != 0) { + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + idx = (val & sc->mux_mask) >> sc->mux_shift; + } + + clknode_init_parent_idx(clk, idx); + return (0); +} + +static int +aw_clk_m_set_gate(struct clknode *clk, bool enable) +{ + struct aw_clk_m_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & AW_CLK_HAS_GATE) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + if (enable) + val |= (1 << sc->gate_shift); + else + val &= ~(1 << sc->gate_shift); + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static int +aw_clk_m_set_mux(struct clknode *clk, int index) +{ + struct aw_clk_m_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & AW_CLK_HAS_MUX) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + val &= ~sc->mux_mask; + val |= index << sc->mux_shift; + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static uint64_t +aw_clk_m_find_best(struct aw_clk_m_sc *sc, uint64_t fparent, uint64_t *fout, + uint32_t *factor_m) +{ + uint64_t cur, best; + uint32_t m, max_m, min_m; + + *factor_m = 0; + + max_m = aw_clk_factor_get_max(&sc->m); + min_m = aw_clk_factor_get_min(&sc->m); + + for (m = min_m; m <= max_m; ) { + cur = fparent / m; + if (abs(*fout - cur) < abs(*fout - best)) { + best = cur; + *factor_m = m; + } + if ((sc->m.flags & AW_CLK_FACTOR_POWER_OF_TWO) != 0) + m <<= 1; + else + m++; + } + + return (best); +} + +static int +aw_clk_m_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, + int flags, int *stop) +{ + struct aw_clk_m_sc *sc; + struct clknode *p_clk; + uint64_t cur, best; + uint32_t val, m, best_m; + + sc = clknode_get_softc(clk); + + best = cur = 0; + + if ((sc->flags & AW_CLK_SET_PARENT) != 0) { + p_clk = clknode_get_parent(clk); + if (p_clk == NULL) { + printf("%s: Cannot get parent for clock %s\n", + __func__, + clknode_get_name(clk)); + return (ENXIO); + } + clknode_set_freq(p_clk, *fout, CLK_SET_ROUND_MULTIPLE, 0); + clknode_get_freq(p_clk, &fparent); + best = aw_clk_m_find_best(sc, fparent, fout, + &best_m); + } else { + best = aw_clk_m_find_best(sc, fparent, fout, + &best_m); + } + + if ((flags & CLK_SET_DRYRUN) != 0) { + *fout = best; + *stop = 1; + return (0); + } + + if ((best < *fout) && + ((flags & CLK_SET_ROUND_DOWN) == 0)) { + *stop = 1; + return (ERANGE); + } + if ((best > *fout) && + ((flags & CLK_SET_ROUND_UP) == 0)) { + *stop = 1; + return (ERANGE); + } + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + + m = aw_clk_factor_get_value(&sc->m, best_m); + val &= ~sc->m.mask; + val |= m << sc->m.shift; + + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + *fout = best; + *stop = 1; + + return (0); +} + +static int +aw_clk_m_recalc(struct clknode *clk, uint64_t *freq) +{ + struct aw_clk_m_sc *sc; + uint32_t val, m; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + m = aw_clk_get_factor(val, &sc->m); + + *freq = *freq / m; + + return (0); +} + +static clknode_method_t aw_m_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, aw_clk_m_init), + CLKNODEMETHOD(clknode_set_gate, aw_clk_m_set_gate), + CLKNODEMETHOD(clknode_set_mux, aw_clk_m_set_mux), + CLKNODEMETHOD(clknode_recalc_freq, aw_clk_m_recalc), + CLKNODEMETHOD(clknode_set_freq, aw_clk_m_set_freq), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(aw_m_clknode, aw_m_clknode_class, aw_m_clknode_methods, + sizeof(struct aw_clk_m_sc), clknode_class); + +int +aw_clk_m_register(struct clkdom *clkdom, struct aw_clk_m_def *clkdef) +{ + struct clknode *clk; + struct aw_clk_m_sc *sc; + + clk = clknode_create(clkdom, &aw_m_clknode_class, &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + + sc->offset = clkdef->offset; + + sc->m.shift = clkdef->m.shift; + sc->m.width = clkdef->m.width; + sc->m.mask = ((1 << sc->m.width) - 1) << sc->m.shift; + sc->m.value = clkdef->m.value; + sc->m.flags = clkdef->m.flags; + + sc->mux_shift = clkdef->mux_shift; + sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; + + sc->gate_shift = clkdef->gate_shift; + + sc->flags = clkdef->flags; + + clknode_register(clkdom, clk); + + return (0); +} +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include + +#include "clkdev_if.h" + +/* + * clknode for clocks matching the formula : + * + * clk = clkin / m + * And that needs to potentially : + * 1) Set the parent freq + * 2) Support Setting the parent to a multiple + * + */ + +struct aw_clk_m_sc { + uint32_t offset; + + struct aw_clk_factor m; + + uint32_t mux_shift; + uint32_t mux_mask; + uint32_t gate_shift; + + uint32_t flags; +}; + +#define WRITE4(_clk, off, val) \ + CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) +#define READ4(_clk, off, val) \ + CLKDEV_READ_4(clknode_get_device(_clk), off, val) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) + +static int +aw_clk_m_init(struct clknode *clk, device_t dev) +{ + struct aw_clk_m_sc *sc; + uint32_t val, idx; + + sc = clknode_get_softc(clk); + + idx = 0; + if ((sc->flags & AW_CLK_HAS_MUX) != 0) { + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + idx = (val & sc->mux_mask) >> sc->mux_shift; + } + + clknode_init_parent_idx(clk, idx); + return (0); +} + +static int +aw_clk_m_set_gate(struct clknode *clk, bool enable) +{ + struct aw_clk_m_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & AW_CLK_HAS_GATE) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + if (enable) + val |= (1 << sc->gate_shift); + else + val &= ~(1 << sc->gate_shift); + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static int +aw_clk_m_set_mux(struct clknode *clk, int index) +{ + struct aw_clk_m_sc *sc; + uint32_t val; + + sc = clknode_get_softc(clk); + + if ((sc->flags & AW_CLK_HAS_MUX) == 0) + return (0); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + val &= ~sc->mux_mask; + val |= index << sc->mux_shift; + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + return (0); +} + +static uint64_t +aw_clk_m_find_best(struct aw_clk_m_sc *sc, uint64_t fparent, uint64_t *fout, + uint32_t *factor_m) +{ + uint64_t cur, best; + uint32_t m, max_m, min_m; + + *factor_m = 0; + + max_m = aw_clk_factor_get_max(&sc->m); + min_m = aw_clk_factor_get_min(&sc->m); + + for (m = min_m; m <= max_m; ) { + cur = fparent / m; + if (abs(*fout - cur) < abs(*fout - best)) { + best = cur; + *factor_m = m; + } + if ((sc->m.flags & AW_CLK_FACTOR_POWER_OF_TWO) != 0) + m <<= 1; + else + m++; + } + + return (best); +} + +static int +aw_clk_m_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, + int flags, int *stop) +{ + struct aw_clk_m_sc *sc; + struct clknode *p_clk; + uint64_t cur, best; + uint32_t val, m, best_m; + + sc = clknode_get_softc(clk); + + best = cur = 0; + + if ((sc->flags & AW_CLK_SET_PARENT) != 0) { + p_clk = clknode_get_parent(clk); + if (p_clk == NULL) { + printf("%s: Cannot get parent for clock %s\n", + __func__, + clknode_get_name(clk)); + return (ENXIO); + } + clknode_set_freq(p_clk, *fout, CLK_SET_ROUND_MULTIPLE, 0); + clknode_get_freq(p_clk, &fparent); + best = aw_clk_m_find_best(sc, fparent, fout, + &best_m); + } else { + best = aw_clk_m_find_best(sc, fparent, fout, + &best_m); + } + + if ((flags & CLK_SET_DRYRUN) != 0) { + *fout = best; + *stop = 1; + return (0); + } + + if ((best < *fout) && + ((flags & CLK_SET_ROUND_DOWN) == 0)) { + *stop = 1; + return (ERANGE); + } + if ((best > *fout) && + ((flags & CLK_SET_ROUND_UP) == 0)) { + *stop = 1; + return (ERANGE); + } + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + + m = aw_clk_factor_get_value(&sc->m, best_m); + val &= ~sc->m.mask; + val |= m << sc->m.shift; + + WRITE4(clk, sc->offset, val); + DEVICE_UNLOCK(clk); + + *fout = best; + *stop = 1; + + return (0); +} + +static int +aw_clk_m_recalc(struct clknode *clk, uint64_t *freq) +{ + struct aw_clk_m_sc *sc; + uint32_t val, m; + + sc = clknode_get_softc(clk); + + DEVICE_LOCK(clk); + READ4(clk, sc->offset, &val); + DEVICE_UNLOCK(clk); + + m = aw_clk_get_factor(val, &sc->m); + + *freq = *freq / m; + + return (0); +} + +static clknode_method_t aw_m_clknode_methods[] = { + /* Device interface */ + CLKNODEMETHOD(clknode_init, aw_clk_m_init), + CLKNODEMETHOD(clknode_set_gate, aw_clk_m_set_gate), + CLKNODEMETHOD(clknode_set_mux, aw_clk_m_set_mux), + CLKNODEMETHOD(clknode_recalc_freq, aw_clk_m_recalc), + CLKNODEMETHOD(clknode_set_freq, aw_clk_m_set_freq), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(aw_m_clknode, aw_m_clknode_class, aw_m_clknode_methods, + sizeof(struct aw_clk_m_sc), clknode_class); + +int +aw_clk_m_register(struct clkdom *clkdom, struct aw_clk_m_def *clkdef) +{ + struct clknode *clk; + struct aw_clk_m_sc *sc; + + clk = clknode_create(clkdom, &aw_m_clknode_class, &clkdef->clkdef); + if (clk == NULL) + return (1); + + sc = clknode_get_softc(clk); + + sc->offset = clkdef->offset; + + sc->m.shift = clkdef->m.shift; + sc->m.width = clkdef->m.width; + sc->m.mask = ((1 << sc->m.width) - 1) << sc->m.shift; + sc->m.value = clkdef->m.value; + sc->m.flags = clkdef->m.flags; + + sc->mux_shift = clkdef->mux_shift; + sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; + + sc->gate_shift = clkdef->gate_shift; + + sc->flags = clkdef->flags; + + clknode_register(clkdom, clk); + + return (0); +} Added: head/sys/arm/allwinner/clkng/aw_clk_m.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/aw_clk_m.h Sat Aug 10 18:50:37 2019 (r350844) @@ -0,0 +1,96 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __AW_CLK_M_H__ +#define __AW_CLK_M_H__ + +#include + +struct aw_clk_m_def { + struct clknode_init_def clkdef; + uint32_t offset; + + struct aw_clk_factor m; + + uint32_t mux_shift; + uint32_t mux_width; + uint32_t gate_shift; + + uint32_t flags; +}; + +int aw_clk_m_register(struct clkdom *clkdom, struct aw_clk_m_def *clkdef); + +#endif /* __AW_CLK_M_H__ */ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __AW_CLK_M_H__ +#define __AW_CLK_M_H__ + +#include + +struct aw_clk_m_def { + struct clknode_init_def clkdef; + uint32_t offset; + + struct aw_clk_factor m; + + uint32_t mux_shift; + uint32_t mux_width; + uint32_t gate_shift; + + uint32_t flags; +}; + +int aw_clk_m_register(struct clkdom *clkdom, struct aw_clk_m_def *clkdef); + +#endif /* __AW_CLK_M_H__ */ Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Sat Aug 10 18:22:22 2019 (r350843) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Sat Aug 10 18:50:37 2019 (r350844) @@ -607,10 +607,9 @@ MUX_CLK(i2s2mux_clk, 0xb8, 16, 2); /* offset, mux shift, mux width */ static const char *spdif_parents[] = {"pll_audio"}; -NM_CLK(spdif_clk, +M_CLK(spdif_clk, CLK_SPDIF, "spdif", spdif_parents, /* id, name, parents */ 0xC0, /* offset */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake); */ 0, 4, 0, 0, /* m factor */ 0, 0, /* mux */ 31, /* gate */ @@ -620,20 +619,18 @@ NM_CLK(spdif_clk, /* DRAM needs update bit */ static const char *dram_parents[] = {"pll_ddr0", "pll_ddr1"}; -NM_CLK(dram_clk, +M_CLK(dram_clk, CLK_DRAM, "dram", dram_parents, /* id, name, parents */ 0xF4, /* offset */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 2, 0, 0, /* m factor */ 20, 2, /* mux */ 0, /* gate */ AW_CLK_HAS_MUX); /* flags */ static const char *de_parents[] = {"pll_periph0_2x", "pll_de"}; -NM_CLK(de_clk, +M_CLK(de_clk, CLK_DE, "de", de_parents, /* id, name, parents */ 0x104, /* offset */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ 24, 2, /* mux */ 31, /* gate */ @@ -641,81 +638,74 @@ NM_CLK(de_clk, /* TCON0/1 Needs mux table */ static const char *tcon1_parents[] = {"pll_video0", "pll_video0", "pll_video1"}; -NM_CLK(tcon1_clk, - CLK_TCON1, "tcon1", tcon1_parents, - 0x11C, - 0, 0, 1, AW_CLK_FACTOR_FIXED, - 0, 4, 0, 0, - 24, 2, - 31, - AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); +M_CLK(tcon1_clk, + CLK_TCON1, "tcon1", tcon1_parents, /* id, name, parents */ + 0x11C, /* offset */ + 0, 5, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | + AW_CLK_SET_PARENT); /* flags */ static const char *deinterlace_parents[] = {"pll_periph0", "pll_periph1"}; -NM_CLK(deinterlace_clk, +M_CLK(deinterlace_clk, CLK_DEINTERLACE, "deinterlace", deinterlace_parents, /* id, name, parents */ 0x124, /* offset */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ 24, 2, /* mux */ 31, /* gate */ AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ static const char *csi_sclk_parents[] = {"pll_periph0", "pll_periph1"}; -NM_CLK(csi_sclk_clk, +M_CLK(csi_sclk_clk, CLK_CSI_SCLK, "csi-sclk", csi_sclk_parents, /* id, name, parents */ 0x134, /* offset */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 16, 4, 0, 0, /* m factor */ 24, 2, /* mux */ 31, /* gate */ AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ static const char *csi_mclk_parents[] = {"osc24M", "pll_video0", "pll_periph1"}; -NM_CLK(csi_mclk_clk, +M_CLK(csi_mclk_clk, CLK_CSI_MCLK, "csi-mclk", csi_mclk_parents, /* id, name, parents */ 0x134, /* offset */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ 8, 2, /* mux */ 15, /* gate */ AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ static const char *ve_parents[] = {"pll_ve"}; -NM_CLK(ve_clk, +M_CLK(ve_clk, CLK_VE, "ve", ve_parents, /* id, name, parents */ 0x13C, /* offset */ - 16, 3, 0, 0, /* n factor */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 16, 3, 0, 0, /* m factor */ 0, 0, /* mux */ 31, /* gate */ AW_CLK_HAS_GATE); /* flags */ static const char *hdmi_parents[] = {"pll_video0"}; -NM_CLK(hdmi_clk, +M_CLK(hdmi_clk, CLK_HDMI, "hdmi", hdmi_parents, /* id, name, parents */ 0x150, /* offset */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 4, 0, 0, /* m factor */ 24, 2, /* mux */ 31, /* gate */ - AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE | AW_CLK_SET_PARENT); /* flags */ static const char *mbus_parents[] = {"osc24M", "pll_periph0_2x", "pll_ddr0"}; -NM_CLK(mbus_clk, +M_CLK(mbus_clk, CLK_MBUS, "mbus", mbus_parents, /* id, name, parents */ 0x15C, /* offset */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ 0, 3, 0, 0, /* m factor */ 24, 2, /* mux */ 31, /* gate */ AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); /* flags */ static const char *gpu_parents[] = {"pll_gpu"}; -NM_CLK(gpu_clk, +M_CLK(gpu_clk, CLK_GPU, "gpu", gpu_parents, /* id, name, parents */ 0x1A0, /* offset */ - 0, 2, 0, 0, /* n factor */ - 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 0, 2, 0, 0, /* m factor */ 0, 0, /* mux */ 31, /* gate */ AW_CLK_HAS_GATE); /* flags */ @@ -744,17 +734,17 @@ static struct aw_ccung_clk a64_ccu_clks[] = { { .type = AW_CLK_NM, .clk.nm = &ce_clk}, { .type = AW_CLK_NM, .clk.nm = &spi0_clk}, { .type = AW_CLK_NM, .clk.nm = &spi1_clk}, - { .type = AW_CLK_NM, .clk.nm = &spdif_clk}, - { .type = AW_CLK_NM, .clk.nm = &dram_clk}, - { .type = AW_CLK_NM, .clk.nm = &de_clk}, - { .type = AW_CLK_NM, .clk.nm = &tcon1_clk}, - { .type = AW_CLK_NM, .clk.nm = &deinterlace_clk}, - { .type = AW_CLK_NM, .clk.nm = &csi_sclk_clk}, - { .type = AW_CLK_NM, .clk.nm = &csi_mclk_clk}, - { .type = AW_CLK_NM, .clk.nm = &ve_clk}, - { .type = AW_CLK_NM, .clk.nm = &hdmi_clk}, - { .type = AW_CLK_NM, .clk.nm = &mbus_clk}, - { .type = AW_CLK_NM, .clk.nm = &gpu_clk}, + { .type = AW_CLK_M, .clk.m = &spdif_clk}, + { .type = AW_CLK_M, .clk.m = &dram_clk}, + { .type = AW_CLK_M, .clk.m = &de_clk}, + { .type = AW_CLK_M, .clk.m = &tcon1_clk}, + { .type = AW_CLK_M, .clk.m = &deinterlace_clk}, + { .type = AW_CLK_M, .clk.m = &csi_sclk_clk}, + { .type = AW_CLK_M, .clk.m = &csi_mclk_clk}, + { .type = AW_CLK_M, .clk.m = &ve_clk}, + { .type = AW_CLK_M, .clk.m = &hdmi_clk}, + { .type = AW_CLK_M, .clk.m = &mbus_clk}, + { .type = AW_CLK_M, .clk.m = &gpu_clk}, { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &ahb1_clk}, { .type = AW_CLK_PREDIV_MUX, .clk.prediv_mux = &ahb2_clk}, { .type = AW_CLK_MUX, .clk.mux = &cpux_clk}, Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Sat Aug 10 18:22:22 2019 (r350843) +++ head/sys/arm/allwinner/files.allwinner Sat Aug 10 18:50:37 2019 (r350844) @@ -36,6 +36,7 @@ arm/allwinner/aw_gmacclk.c standard arm/allwinner/clkng/aw_ccung.c standard arm/allwinner/clkng/aw_clk_frac.c standard +arm/allwinner/clkng/aw_clk_m.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard arm/allwinner/clkng/aw_clk_nm.c standard arm/allwinner/clkng/aw_clk_prediv_mux.c standard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Aug 10 18:22:22 2019 (r350843) +++ head/sys/conf/files.arm64 Sat Aug 10 18:50:37 2019 (r350844) @@ -50,6 +50,7 @@ arm/allwinner/if_awg.c optional awg ext_resources sys # Allwinner clock driver arm/allwinner/clkng/aw_ccung.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_frac.c optional aw_ccu fdt +arm/allwinner/clkng/aw_clk_m.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nkmp.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt Modified: head/sys/dev/extres/clk/clk.h ============================================================================== --- head/sys/dev/extres/clk/clk.h Sat Aug 10 18:22:22 2019 (r350843) +++ head/sys/dev/extres/clk/clk.h Sat Aug 10 18:50:37 2019 (r350844) @@ -48,6 +48,7 @@ #define CLK_SET_ROUND_EXACT 0 #define CLK_SET_ROUND_UP 0x00000001 #define CLK_SET_ROUND_DOWN 0x00000002 +#define CLK_SET_ROUND_MULTIPLE 0x00000004 #define CLK_SET_ROUND_ANY (CLK_SET_ROUND_UP | CLK_SET_ROUND_DOWN) #define CLK_SET_USER_MASK 0x0000FFFF From owner-svn-src-all@freebsd.org Sat Aug 10 18:58:26 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9326C303B; Sat, 10 Aug 2019 18:58:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465WbQ50dhz42X8; Sat, 10 Aug 2019 18:58:26 +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 8D55F2312; Sat, 10 Aug 2019 18:58:26 +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 x7AIwQih036172; Sat, 10 Aug 2019 18:58:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AIwQs9036171; Sat, 10 Aug 2019 18:58:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908101858.x7AIwQs9036171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Aug 2019 18:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350845 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 350845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 18:58:26 -0000 Author: manu Date: Sat Aug 10 18:58:25 2019 New Revision: 350845 URL: https://svnweb.freebsd.org/changeset/base/350845 Log: Remove some duplicate code that end up in r350844 Modified: head/sys/arm/allwinner/clkng/aw_clk_m.c head/sys/arm/allwinner/clkng/aw_clk_m.h Modified: head/sys/arm/allwinner/clkng/aw_clk_m.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_m.c Sat Aug 10 18:50:37 2019 (r350844) +++ head/sys/arm/allwinner/clkng/aw_clk_m.c Sat Aug 10 18:58:25 2019 (r350845) @@ -288,293 +288,3 @@ aw_clk_m_register(struct clkdom *clkdom, struct aw_clk return (0); } -/*- - * Copyright (c) 2019 Emmanuel Vadot - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include - -#include - -#include -#include - -#include "clkdev_if.h" - -/* - * clknode for clocks matching the formula : - * - * clk = clkin / m - * And that needs to potentially : - * 1) Set the parent freq - * 2) Support Setting the parent to a multiple - * - */ - -struct aw_clk_m_sc { - uint32_t offset; - - struct aw_clk_factor m; - - uint32_t mux_shift; - uint32_t mux_mask; - uint32_t gate_shift; - - uint32_t flags; -}; - -#define WRITE4(_clk, off, val) \ - CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) -#define READ4(_clk, off, val) \ - CLKDEV_READ_4(clknode_get_device(_clk), off, val) -#define DEVICE_LOCK(_clk) \ - CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) -#define DEVICE_UNLOCK(_clk) \ - CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) - -static int -aw_clk_m_init(struct clknode *clk, device_t dev) -{ - struct aw_clk_m_sc *sc; - uint32_t val, idx; - - sc = clknode_get_softc(clk); - - idx = 0; - if ((sc->flags & AW_CLK_HAS_MUX) != 0) { - DEVICE_LOCK(clk); - READ4(clk, sc->offset, &val); - DEVICE_UNLOCK(clk); - - idx = (val & sc->mux_mask) >> sc->mux_shift; - } - - clknode_init_parent_idx(clk, idx); - return (0); -} - -static int -aw_clk_m_set_gate(struct clknode *clk, bool enable) -{ - struct aw_clk_m_sc *sc; - uint32_t val; - - sc = clknode_get_softc(clk); - - if ((sc->flags & AW_CLK_HAS_GATE) == 0) - return (0); - - DEVICE_LOCK(clk); - READ4(clk, sc->offset, &val); - if (enable) - val |= (1 << sc->gate_shift); - else - val &= ~(1 << sc->gate_shift); - WRITE4(clk, sc->offset, val); - DEVICE_UNLOCK(clk); - - return (0); -} - -static int -aw_clk_m_set_mux(struct clknode *clk, int index) -{ - struct aw_clk_m_sc *sc; - uint32_t val; - - sc = clknode_get_softc(clk); - - if ((sc->flags & AW_CLK_HAS_MUX) == 0) - return (0); - - DEVICE_LOCK(clk); - READ4(clk, sc->offset, &val); - val &= ~sc->mux_mask; - val |= index << sc->mux_shift; - WRITE4(clk, sc->offset, val); - DEVICE_UNLOCK(clk); - - return (0); -} - -static uint64_t -aw_clk_m_find_best(struct aw_clk_m_sc *sc, uint64_t fparent, uint64_t *fout, - uint32_t *factor_m) -{ - uint64_t cur, best; - uint32_t m, max_m, min_m; - - *factor_m = 0; - - max_m = aw_clk_factor_get_max(&sc->m); - min_m = aw_clk_factor_get_min(&sc->m); - - for (m = min_m; m <= max_m; ) { - cur = fparent / m; - if (abs(*fout - cur) < abs(*fout - best)) { - best = cur; - *factor_m = m; - } - if ((sc->m.flags & AW_CLK_FACTOR_POWER_OF_TWO) != 0) - m <<= 1; - else - m++; - } - - return (best); -} - -static int -aw_clk_m_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, - int flags, int *stop) -{ - struct aw_clk_m_sc *sc; - struct clknode *p_clk; - uint64_t cur, best; - uint32_t val, m, best_m; - - sc = clknode_get_softc(clk); - - best = cur = 0; - - if ((sc->flags & AW_CLK_SET_PARENT) != 0) { - p_clk = clknode_get_parent(clk); - if (p_clk == NULL) { - printf("%s: Cannot get parent for clock %s\n", - __func__, - clknode_get_name(clk)); - return (ENXIO); - } - clknode_set_freq(p_clk, *fout, CLK_SET_ROUND_MULTIPLE, 0); - clknode_get_freq(p_clk, &fparent); - best = aw_clk_m_find_best(sc, fparent, fout, - &best_m); - } else { - best = aw_clk_m_find_best(sc, fparent, fout, - &best_m); - } - - if ((flags & CLK_SET_DRYRUN) != 0) { - *fout = best; - *stop = 1; - return (0); - } - - if ((best < *fout) && - ((flags & CLK_SET_ROUND_DOWN) == 0)) { - *stop = 1; - return (ERANGE); - } - if ((best > *fout) && - ((flags & CLK_SET_ROUND_UP) == 0)) { - *stop = 1; - return (ERANGE); - } - - DEVICE_LOCK(clk); - READ4(clk, sc->offset, &val); - - m = aw_clk_factor_get_value(&sc->m, best_m); - val &= ~sc->m.mask; - val |= m << sc->m.shift; - - WRITE4(clk, sc->offset, val); - DEVICE_UNLOCK(clk); - - *fout = best; - *stop = 1; - - return (0); -} - -static int -aw_clk_m_recalc(struct clknode *clk, uint64_t *freq) -{ - struct aw_clk_m_sc *sc; - uint32_t val, m; - - sc = clknode_get_softc(clk); - - DEVICE_LOCK(clk); - READ4(clk, sc->offset, &val); - DEVICE_UNLOCK(clk); - - m = aw_clk_get_factor(val, &sc->m); - - *freq = *freq / m; - - return (0); -} - -static clknode_method_t aw_m_clknode_methods[] = { - /* Device interface */ - CLKNODEMETHOD(clknode_init, aw_clk_m_init), - CLKNODEMETHOD(clknode_set_gate, aw_clk_m_set_gate), - CLKNODEMETHOD(clknode_set_mux, aw_clk_m_set_mux), - CLKNODEMETHOD(clknode_recalc_freq, aw_clk_m_recalc), - CLKNODEMETHOD(clknode_set_freq, aw_clk_m_set_freq), - CLKNODEMETHOD_END -}; - -DEFINE_CLASS_1(aw_m_clknode, aw_m_clknode_class, aw_m_clknode_methods, - sizeof(struct aw_clk_m_sc), clknode_class); - -int -aw_clk_m_register(struct clkdom *clkdom, struct aw_clk_m_def *clkdef) -{ - struct clknode *clk; - struct aw_clk_m_sc *sc; - - clk = clknode_create(clkdom, &aw_m_clknode_class, &clkdef->clkdef); - if (clk == NULL) - return (1); - - sc = clknode_get_softc(clk); - - sc->offset = clkdef->offset; - - sc->m.shift = clkdef->m.shift; - sc->m.width = clkdef->m.width; - sc->m.mask = ((1 << sc->m.width) - 1) << sc->m.shift; - sc->m.value = clkdef->m.value; - sc->m.flags = clkdef->m.flags; - - sc->mux_shift = clkdef->mux_shift; - sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; - - sc->gate_shift = clkdef->gate_shift; - - sc->flags = clkdef->flags; - - clknode_register(clkdom, clk); - - return (0); -} Modified: head/sys/arm/allwinner/clkng/aw_clk_m.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_m.h Sat Aug 10 18:50:37 2019 (r350844) +++ head/sys/arm/allwinner/clkng/aw_clk_m.h Sat Aug 10 18:58:25 2019 (r350845) @@ -46,51 +46,3 @@ struct aw_clk_m_def { int aw_clk_m_register(struct clkdom *clkdom, struct aw_clk_m_def *clkdef); #endif /* __AW_CLK_M_H__ */ -/*- - * Copyright (c) 2019 Emmanuel Vadot - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef __AW_CLK_M_H__ -#define __AW_CLK_M_H__ - -#include - -struct aw_clk_m_def { - struct clknode_init_def clkdef; - uint32_t offset; - - struct aw_clk_factor m; - - uint32_t mux_shift; - uint32_t mux_width; - uint32_t gate_shift; - - uint32_t flags; -}; - -int aw_clk_m_register(struct clkdom *clkdom, struct aw_clk_m_def *clkdef); - -#endif /* __AW_CLK_M_H__ */ From owner-svn-src-all@freebsd.org Sat Aug 10 19:02:51 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E004CC32BE; Sat, 10 Aug 2019 19:02:51 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465WhW6MBzz42vJ; Sat, 10 Aug 2019 19:02:51 +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 BB6BD24D8; Sat, 10 Aug 2019 19:02:51 +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 x7AJ2phm041888; Sat, 10 Aug 2019 19:02:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AJ2ojd041881; Sat, 10 Aug 2019 19:02:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201908101902.x7AJ2ojd041881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Aug 2019 19:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350846 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 350846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 19:02:51 -0000 Author: manu Date: Sat Aug 10 19:02:50 2019 New Revision: 350846 URL: https://svnweb.freebsd.org/changeset/base/350846 Log: allwinner: Add support to min/max in aw_clk_frac The Fractionals clock in Allwinner device have some min/max frequencies that they can do. Add support for it. Modified: head/sys/arm/allwinner/clkng/aw_clk.h head/sys/arm/allwinner/clkng/aw_clk_frac.c head/sys/arm/allwinner/clkng/aw_clk_frac.h head/sys/arm/allwinner/clkng/ccu_a10.c head/sys/arm/allwinner/clkng/ccu_a31.c head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/arm/allwinner/clkng/ccu_h3.c Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Sat Aug 10 18:58:25 2019 (r350845) +++ head/sys/arm/allwinner/clkng/aw_clk.h Sat Aug 10 19:02:50 2019 (r350846) @@ -314,13 +314,15 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, _nshift, _nwidth, _nvalue, _nflags, \ _mshift, _mwidth, _mvalue, _mflags, \ _gate_shift, _lock_shift,_lock_retries, \ - _flags, _freq0, _freq1, _mode_sel, _freq_sel) \ + _flags, _freq0, _freq1, _mode_sel, _freq_sel, \ + _min_freq, _max_freq) \ static struct aw_clk_frac_def _clkname = { \ .clkdef = { \ .id = _id, \ .name = _name, \ .parent_names = _pnames, \ .parent_cnt = nitems(_pnames), \ + .flags = CLK_NODE_GLITCH_FREE, \ }, \ .offset = _offset, \ .n.shift = _nshift, \ @@ -339,6 +341,8 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .frac.freq1 = _freq1, \ .frac.mode_sel = _mode_sel, \ .frac.freq_sel = _freq_sel, \ + .min_freq = _min_freq, \ + .max_freq = _max_freq, \ } #define M_CLK(_clkname, _id, _name, _pnames, \ Modified: head/sys/arm/allwinner/clkng/aw_clk_frac.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_frac.c Sat Aug 10 18:58:25 2019 (r350845) +++ head/sys/arm/allwinner/clkng/aw_clk_frac.c Sat Aug 10 19:02:50 2019 (r350846) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include "clkdev_if.h" +/* #define dprintf(format, arg...) printf("%s:(%s)" format, __func__, clknode_get_name(clk), arg) */ +#define dprintf(format, arg...) + /* * clknode for clocks matching the formula : * @@ -54,6 +57,9 @@ struct aw_clk_frac_sc { struct aw_clk_factor n; struct aw_clk_frac frac; + uint64_t min_freq; + uint64_t max_freq; + uint32_t mux_shift; uint32_t mux_mask; uint32_t gate_shift; @@ -89,6 +95,7 @@ aw_clk_frac_init(struct clknode *clk, device_t dev) idx = (val & sc->mux_mask) >> sc->mux_shift; } + dprintf("init parent idx %d\n", idx); clknode_init_parent_idx(clk, idx); return (0); } @@ -104,6 +111,7 @@ aw_clk_frac_set_gate(struct clknode *clk, bool enable) if ((sc->flags & AW_CLK_HAS_GATE) == 0) return (0); + dprintf("%sabling gate\n", enable ? "En" : "Dis"); DEVICE_LOCK(clk); READ4(clk, sc->offset, &val); if (enable) @@ -127,6 +135,7 @@ aw_clk_frac_set_mux(struct clknode *clk, int index) if ((sc->flags & AW_CLK_HAS_MUX) == 0) return (0); + dprintf("Set mux to %d\n", index); DEVICE_LOCK(clk); READ4(clk, sc->offset, &val); val &= ~sc->mux_mask; @@ -138,7 +147,7 @@ aw_clk_frac_set_mux(struct clknode *clk, int index) } static uint64_t -aw_clk_frac_find_best(struct aw_clk_frac_sc *sc, uint64_t fparent, uint64_t *fout, +aw_clk_frac_find_best(struct aw_clk_frac_sc *sc, uint64_t fparent, uint64_t fout, uint32_t *factor_n, uint32_t *factor_m) { uint64_t cur, best; @@ -150,18 +159,27 @@ aw_clk_frac_find_best(struct aw_clk_frac_sc *sc, uint6 max_m = aw_clk_factor_get_max(&sc->m); max_n = aw_clk_factor_get_max(&sc->n); min_m = aw_clk_factor_get_min(&sc->m); - min_n = aw_clk_factor_get_min(&sc->n); + min_n = sc->min_freq / fparent; for (n = min_n; n <= max_n; n++) { for (m = min_m; m <= max_m; m++) { cur = fparent * n / m; - if ((*fout - cur) < (*fout - best)) { + if (cur < sc->min_freq) { + continue; + } + if (cur > sc->max_freq) { + continue; + } + if (cur == fout) { + *factor_n = n; + *factor_m = m; + return (cur); + } + if (abs((fout - cur)) < abs((fout - best))) { best = cur; *factor_n = n; *factor_m = m; } - if (best == *fout) - return (best); } } @@ -175,32 +193,73 @@ aw_clk_frac_set_freq(struct clknode *clk, uint64_t fpa struct aw_clk_frac_sc *sc; uint64_t cur, best, best_frac; uint32_t val, m, n, best_m, best_n; - int retry; + int retry, multiple, max_mult, best_mult; sc = clknode_get_softc(clk); best = best_frac = cur = 0; + best_mult = 0; + max_mult = 1; - if (*fout == sc->frac.freq0) - best = best_frac = sc->frac.freq0; - else if (*fout == sc->frac.freq1) - best = best_frac = sc->frac.freq1; - else - best = aw_clk_frac_find_best(sc, fparent, fout, - &best_n, &best_m); + dprintf("Trying to find freq %ju with parent %ju\n", *fout, fparent); + if ((flags & CLK_SET_ROUND_MULTIPLE) != 0) + max_mult = 10; + for (multiple = 1; multiple <= max_mult; multiple++) { + /* First test the fractional frequencies */ + dprintf("Testing with multiple %d\n", multiple); + if (*fout * multiple == sc->frac.freq0) { + best = best_frac = sc->frac.freq0; + best_mult = multiple; + dprintf("Found with using frac.freq0 and multiple %d\n", multiple); + break; + } + else if (*fout * multiple == sc->frac.freq1) { + best = best_frac = sc->frac.freq1; + best_mult = multiple; + dprintf("Found with using frac.freq1 and multiple %d\n", multiple); + break; + } + else { + cur = aw_clk_frac_find_best(sc, fparent, *fout * multiple, + &n, &m); + dprintf("Got %ju with n=%d, m=%d\n", cur, n, m); + if (cur == (*fout * multiple)) { + best = cur; + best_mult = multiple; + best_n = n; + best_m = m; + dprintf("This is the one: n=%d m=%d mult=%d\n", best_n, best_m, best_mult); + break; + } + if (abs(((*fout * multiple) - cur)) < abs(((*fout * multiple) - best))) { + best = cur; + best_mult = multiple; + best_n = n; + best_m = m; + dprintf("This is the best for now: n=%d m=%d mult=%d\n", best_n, best_m, best_mult); + } + } + } + if (best < sc->min_freq || + best > sc->max_freq) { + printf("%s: Cannot set %ju for %s (min=%ju max=%ju)\n", + __func__, best, clknode_get_name(clk), + sc->min_freq, sc->max_freq); + return (ERANGE); + } if ((flags & CLK_SET_DRYRUN) != 0) { *fout = best; *stop = 1; return (0); } - if ((best < *fout) && + if ((best < (*fout * best_mult)) && ((flags & CLK_SET_ROUND_DOWN) == 0)) { *stop = 1; return (ERANGE); } - if ((best > *fout) && + if ((best > *fout * best_mult) && ((flags & CLK_SET_ROUND_UP) == 0)) { *stop = 1; return (ERANGE); @@ -271,7 +330,6 @@ aw_clk_frac_recalc(struct clknode *clk, uint64_t *freq } else { m = aw_clk_get_factor(val, &sc->m); n = aw_clk_get_factor(val, &sc->n); - *freq = *freq * n / m; } @@ -321,6 +379,9 @@ aw_clk_frac_register(struct clkdom *clkdom, struct aw_ sc->frac.freq1 = clkdef->frac.freq1; sc->frac.mode_sel = 1 << clkdef->frac.mode_sel; sc->frac.freq_sel = 1 << clkdef->frac.freq_sel; + + sc->min_freq = clkdef->min_freq; + sc->max_freq = clkdef->max_freq; sc->mux_shift = clkdef->mux_shift; sc->mux_mask = ((1 << clkdef->mux_width) - 1) << sc->mux_shift; Modified: head/sys/arm/allwinner/clkng/aw_clk_frac.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_frac.h Sat Aug 10 18:58:25 2019 (r350845) +++ head/sys/arm/allwinner/clkng/aw_clk_frac.h Sat Aug 10 19:02:50 2019 (r350846) @@ -38,6 +38,9 @@ struct aw_clk_frac_def { struct aw_clk_factor n; struct aw_clk_frac frac; + uint64_t min_freq; + uint64_t max_freq; + uint32_t mux_shift; uint32_t mux_width; uint32_t gate_shift; Modified: head/sys/arm/allwinner/clkng/ccu_a10.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a10.c Sat Aug 10 18:58:25 2019 (r350845) +++ head/sys/arm/allwinner/clkng/ccu_a10.c Sat Aug 10 19:02:50 2019 (r350846) @@ -221,7 +221,8 @@ FRAC_CLK(pll_video0_clk, 31, 0, 0, /* gate, lock, lock retries */ AW_CLK_HAS_GATE, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 15, 14); /* mode sel, freq sel */ + 15, 14, /* mode sel, freq sel */ + 27000000, 381000000); /* min freq, max freq */ static const char *pll_video0_2x_parents[] = {"pll_video0"}; FIXED_CLK(pll_video0_2x_clk, CLK_PLL_VIDEO0_2X, /* id */ @@ -240,7 +241,8 @@ FRAC_CLK(pll_video1_clk, 31, 0, 0, /* gate, lock, lock retries */ AW_CLK_HAS_GATE, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 15, 14); /* mode sel, freq sel */ + 15, 14, /* mode sel, freq sel */ + 27000000, 381000000); /* min freq, max freq */ static const char *pll_video1_2x_parents[] = {"pll_video1"}; FIXED_CLK(pll_video1_2x_clk, CLK_PLL_VIDEO1_2X, /* id */ Modified: head/sys/arm/allwinner/clkng/ccu_a31.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a31.c Sat Aug 10 18:58:25 2019 (r350845) +++ head/sys/arm/allwinner/clkng/ccu_a31.c Sat Aug 10 19:02:50 2019 (r350846) @@ -302,8 +302,8 @@ FRAC_CLK(pll_video0_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ - + 24, 25, /* mode sel, freq sel */ + 30000000, 600000000); /* min freq, max freq */ static const char *pll_video0_2x_parents[] = {"pll_video0"}; FIXED_CLK(pll_video0_2x_clk, CLK_PLL_VIDEO0_2X, /* id */ @@ -323,7 +323,8 @@ FRAC_CLK(pll_ve_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 30000000, 600000000); /* min freq, max freq */ NKMP_CLK_WITH_UPDATE(pll_ddr_clk, CLK_PLL_DDR, /* id */ @@ -369,7 +370,8 @@ FRAC_CLK(pll_video1_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 30000000, 600000000); /* min freq, max freq */ static const char *pll_video1_2x_parents[] = {"pll_video1"}; FIXED_CLK(pll_video1_2x_clk, @@ -390,7 +392,8 @@ FRAC_CLK(pll_gpu_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 30000000, 600000000); /* min freq, max freq */ static const char *pll_mipi_parents[] = {"pll_video0", "pll_video1"}; NKMP_CLK(pll_mipi_clk, @@ -414,7 +417,8 @@ FRAC_CLK(pll9_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 30000000, 600000000); /* min freq, max freq */ FRAC_CLK(pll10_clk, CLK_PLL10, /* id */ @@ -425,7 +429,8 @@ FRAC_CLK(pll10_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 30000000, 600000000); /* min freq, max freq */ static struct clk_div_table axi_div_table[] = { { .value = 0, .divider = 1, }, Modified: head/sys/arm/allwinner/clkng/ccu_a64.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_a64.c Sat Aug 10 18:58:25 2019 (r350845) +++ head/sys/arm/allwinner/clkng/ccu_a64.c Sat Aug 10 19:02:50 2019 (r350846) @@ -288,7 +288,8 @@ FRAC_CLK(pll_video0_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *pll_video0_2x_parents[] = {"pll_video0"}; FIXED_CLK(pll_video0_2x_clk, CLK_PLL_VIDEO0_2X, /* id */ @@ -309,7 +310,8 @@ FRAC_CLK(pll_ve_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *pll_ddr0_parents[] = {"osc24M"}; NKMP_CLK_WITH_UPDATE(pll_ddr0_clk, @@ -379,7 +381,8 @@ FRAC_CLK(pll_video1_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *pll_gpu_parents[] = {"osc24M"}; FRAC_CLK(pll_gpu_clk, @@ -391,7 +394,8 @@ FRAC_CLK(pll_gpu_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ /* PLL MIPI is missing */ @@ -405,7 +409,8 @@ FRAC_CLK(pll_hsic_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *pll_de_parents[] = {"osc24M"}; FRAC_CLK(pll_de_clk, @@ -417,7 +422,8 @@ FRAC_CLK(pll_de_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *pll_ddr1_parents[] = {"osc24M"}; NKMP_CLK_WITH_UPDATE(pll_ddr1_clk, Modified: head/sys/arm/allwinner/clkng/ccu_h3.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_h3.c Sat Aug 10 18:58:25 2019 (r350845) +++ head/sys/arm/allwinner/clkng/ccu_h3.c Sat Aug 10 19:02:50 2019 (r350846) @@ -306,7 +306,8 @@ FRAC_CLK(pll_video_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *pll_ve_parents[] = {"osc24M"}; FRAC_CLK(pll_ve_clk, @@ -318,7 +319,8 @@ FRAC_CLK(pll_ve_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *pll_ddr_parents[] = {"osc24M"}; NKMP_CLK_WITH_UPDATE(pll_ddr_clk, @@ -366,7 +368,8 @@ FRAC_CLK(pll_gpu_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *pll_periph1_parents[] = {"osc24M"}; NKMP_CLK(pll_periph1_clk, @@ -391,7 +394,8 @@ FRAC_CLK(pll_de_clk, 31, 28, 1000, /* gate, lock, lock retries */ AW_CLK_HAS_LOCK, /* flags */ 270000000, 297000000, /* freq0, freq1 */ - 24, 25); /* mode sel, freq sel */ + 24, 25, /* mode sel, freq sel */ + 192000000, 600000000); /* min freq, max freq */ static const char *cpux_parents[] = {"osc32k", "osc24M", "pll_cpux", "pll_cpux"}; MUX_CLK(cpux_clk, From owner-svn-src-all@freebsd.org Sat Aug 10 20:03:15 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15E42C4562; Sat, 10 Aug 2019 20:03:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465Y2B6pc2z45Rc; Sat, 10 Aug 2019 20:03:14 +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 CB1E12F8B; Sat, 10 Aug 2019 20:03:14 +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 x7AK3ERD077807; Sat, 10 Aug 2019 20:03:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AK3EQt077806; Sat, 10 Aug 2019 20:03:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201908102003.x7AK3EQt077806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 10 Aug 2019 20:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350847 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 350847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 20:03:15 -0000 Author: ian Date: Sat Aug 10 20:03:14 2019 New Revision: 350847 URL: https://svnweb.freebsd.org/changeset/base/350847 Log: Allow the sdhci timeout sysctl var to be set as a tunable. Also, add a missing newline in a warning printf. Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Aug 10 19:02:50 2019 (r350846) +++ head/sys/dev/sdhci/sdhci.c Sat Aug 10 20:03:14 2019 (r350847) @@ -481,7 +481,7 @@ sdhci_set_power(struct sdhci_slot *slot, u_char power) DELAY(100); } if (!(RD1(slot, SDHCI_POWER_CONTROL) & SDHCI_POWER_ON)) - slot_printf(slot, "Bus power failed to enable"); + slot_printf(slot, "Bus power failed to enable\n"); if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) { WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10); @@ -1128,7 +1128,7 @@ no_tuning: slot->timeout = 10; SYSCTL_ADD_INT(device_get_sysctl_ctx(slot->bus), SYSCTL_CHILDREN(device_get_sysctl_tree(slot->bus)), OID_AUTO, - "timeout", CTLFLAG_RW, &slot->timeout, 0, + "timeout", CTLFLAG_RWTUN, &slot->timeout, 0, "Maximum timeout for SDHCI transfers (in secs)"); TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); TIMEOUT_TASK_INIT(taskqueue_swi_giant, &slot->card_delayed_task, 0, From owner-svn-src-all@freebsd.org Sat Aug 10 20:05:16 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7227BC45FB; Sat, 10 Aug 2019 20:05:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465Y4X2NXkz45ZB; Sat, 10 Aug 2019 20:05:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48D192F8C; Sat, 10 Aug 2019 20:05:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7AK5Ggm077940; Sat, 10 Aug 2019 20:05:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AK5Gbi077939; Sat, 10 Aug 2019 20:05:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201908102005.x7AK5Gbi077939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 10 Aug 2019 20:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350848 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 350848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 20:05:16 -0000 Author: ian Date: Sat Aug 10 20:05:15 2019 New Revision: 350848 URL: https://svnweb.freebsd.org/changeset/base/350848 Log: The am335x_ehrpwm driver now requires the pwmbus_if interface, add it. Modified: head/sys/arm/ti/am335x/files.am335x Modified: head/sys/arm/ti/am335x/files.am335x ============================================================================== --- head/sys/arm/ti/am335x/files.am335x Sat Aug 10 20:03:14 2019 (r350847) +++ head/sys/arm/ti/am335x/files.am335x Sat Aug 10 20:05:15 2019 (r350848) @@ -10,6 +10,7 @@ arm/ti/am335x/am335x_lcd_syscons.c optional sc arm/ti/am335x/am335x_pmic.c optional am335x_pmic arm/ti/am335x/am335x_prcm.c standard arm/ti/am335x/am335x_pwmss.c standard +dev/pwm/pwmbus_if.m standard arm/ti/am335x/am335x_ehrpwm.c standard arm/ti/am335x/am335x_ecap.c standard arm/ti/am335x/am335x_rtc.c optional am335x_rtc From owner-svn-src-all@freebsd.org Sat Aug 10 20:08:38 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81D05C46DF; Sat, 10 Aug 2019 20:08:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465Y8Q2qfdz45kg; Sat, 10 Aug 2019 20:08:38 +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 28BB92F91; Sat, 10 Aug 2019 20:08:38 +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 x7AK8cYd078119; Sat, 10 Aug 2019 20:08:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AK8bHq078117; Sat, 10 Aug 2019 20:08:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201908102008.x7AK8bHq078117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 10 Aug 2019 20:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350849 - head/sys/arm/ti/am335x X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti/am335x X-SVN-Commit-Revision: 350849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 20:08:38 -0000 Author: ian Date: Sat Aug 10 20:08:37 2019 New Revision: 350849 URL: https://svnweb.freebsd.org/changeset/base/350849 Log: Remove use of intr_config_hook from the am335x_pmic and tda19988 drivers. Long ago this was needed, but now low-level i2c controller drivers cleverly defer attachment of the bus until interrupts are enabled (if they require interrupts to function), so that every i2c slave device doesn't have to. Modified: head/sys/arm/ti/am335x/am335x_pmic.c head/sys/arm/ti/am335x/tda19988.c Modified: head/sys/arm/ti/am335x/am335x_pmic.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 10 20:05:15 2019 (r350848) +++ head/sys/arm/ti/am335x/am335x_pmic.c Sat Aug 10 20:08:37 2019 (r350849) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); struct am335x_pmic_softc { device_t sc_dev; uint32_t sc_addr; - struct intr_config_hook enum_hook; struct resource *sc_irq_res; void *sc_intrhand; struct task intr_task; @@ -210,10 +209,9 @@ am335x_pmic_setvo(device_t dev, uint8_t vo) } static void -am335x_pmic_start(void *xdev) +am335x_pmic_start(struct am335x_pmic_softc *sc) { - struct am335x_pmic_softc *sc; - device_t dev = (device_t)xdev; + device_t dev; struct tps65217_status_reg status_reg; struct tps65217_chipid_reg chipid_reg; uint8_t reg, vo; @@ -221,8 +219,7 @@ am335x_pmic_start(void *xdev) char pwr[4][11] = {"Battery", "USB", "AC", "USB and AC"}; int rv; - sc = device_get_softc(dev); - + dev = sc->sc_dev; am335x_pmic_read(dev, TPS65217_CHIPID_REG, (uint8_t *)&chipid_reg, 1); switch (chipid_reg.chip) { case TPS65217A: @@ -265,8 +262,6 @@ am335x_pmic_start(void *xdev) EVENTHANDLER_REGISTER(shutdown_final, am335x_pmic_shutdown, dev, SHUTDOWN_PRI_LAST); - config_intrhook_disestablish(&sc->enum_hook); - /* Unmask all interrupts and clear pending status */ reg = 0; am335x_pmic_write(dev, TPS65217_INT_REG, ®, 1); @@ -300,11 +295,7 @@ am335x_pmic_attach(device_t dev) /* return (ENXIO); */ } - sc->enum_hook.ich_func = am335x_pmic_start; - sc->enum_hook.ich_arg = dev; - - if (config_intrhook_establish(&sc->enum_hook) != 0) - return (ENOMEM); + am335x_pmic_start(sc); return (0); } Modified: head/sys/arm/ti/am335x/tda19988.c ============================================================================== --- head/sys/arm/ti/am335x/tda19988.c Sat Aug 10 20:05:15 2019 (r350848) +++ head/sys/arm/ti/am335x/tda19988.c Sat Aug 10 20:08:37 2019 (r350849) @@ -243,7 +243,6 @@ struct tda19988_softc { uint32_t sc_addr; uint32_t sc_cec_addr; uint16_t sc_version; - struct intr_config_hook enum_hook; int sc_current_page; uint8_t *sc_edid; uint32_t sc_edid_len; @@ -645,15 +644,14 @@ done: } static void -tda19988_start(void *xdev) +tda19988_start(struct tda19988_softc *sc) { - struct tda19988_softc *sc; - device_t dev = (device_t)xdev; + device_t dev; uint8_t data; uint16_t version; - sc = device_get_softc(dev); - + dev = sc->sc_dev; + tda19988_cec_write(sc, TDA_CEC_ENAMODS, ENAMODS_RXSENS | ENAMODS_HDMI); DELAY(1000); tda19988_cec_read(sc, 0xfe, &data); @@ -699,7 +697,7 @@ tda19988_start(void *xdev) break; default: device_printf(dev, "Unknown device: %04x\n", sc->sc_version); - goto done; + return; } tda19988_reg_write(sc, TDA_DDC_CTRL, DDC_ENABLE); @@ -710,16 +708,13 @@ tda19988_start(void *xdev) if (tda19988_read_edid(sc) < 0) { device_printf(dev, "failed to read EDID\n"); - goto done; + return; } /* Default values for RGB 4:4:4 mapping */ tda19988_reg_write(sc, TDA_VIP_CNTRL_0, 0x23); tda19988_reg_write(sc, TDA_VIP_CNTRL_1, 0x01); tda19988_reg_write(sc, TDA_VIP_CNTRL_2, 0x45); - -done: - config_intrhook_disestablish(&sc->enum_hook); } static int @@ -738,14 +733,10 @@ tda19988_attach(device_t dev) device_set_desc(dev, "NXP TDA19988 HDMI transmitter"); - sc->enum_hook.ich_func = tda19988_start; - sc->enum_hook.ich_arg = dev; - - if (config_intrhook_establish(&sc->enum_hook) != 0) - return (ENOMEM); - node = ofw_bus_get_node(dev); OF_device_register_xref(OF_xref_from_node(node), dev); + + tda19988_start(sc); return (0); } From owner-svn-src-all@freebsd.org Sat Aug 10 23:03:25 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38D9EA85E1; Sat, 10 Aug 2019 23:03:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465d2509v6z4K76; Sat, 10 Aug 2019 23:03:25 +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 DB8B9529E; Sat, 10 Aug 2019 23:03:24 +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 x7AN3OY6091312; Sat, 10 Aug 2019 23:03:24 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AN3OmM091308; Sat, 10 Aug 2019 23:03:24 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201908102303.x7AN3OmM091308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 10 Aug 2019 23:03:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350850 - in stable/12/sys/ufs: ffs ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/12/sys/ufs: ffs ufs X-SVN-Commit-Revision: 350850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 23:03:25 -0000 Author: mckusick Date: Sat Aug 10 23:03:23 2019 New Revision: 350850 URL: https://svnweb.freebsd.org/changeset/base/350850 Log: MFC of 350490 Set FORCE in chk[id]q when returning inodes and blocks. Modified: stable/12/sys/ufs/ffs/ffs_inode.c stable/12/sys/ufs/ffs/ffs_softdep.c stable/12/sys/ufs/ufs/ufs_quota.c stable/12/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_inode.c Sat Aug 10 20:08:37 2019 (r350849) +++ stable/12/sys/ufs/ffs/ffs_inode.c Sat Aug 10 23:03:23 2019 (r350850) @@ -256,7 +256,7 @@ ffs_truncate(vp, length, flags, cred) if ((error = ffs_syncvnode(vp, MNT_WAIT, 0)) != 0) return (error); #ifdef QUOTA - (void) chkdq(ip, -extblocks, NOCRED, 0); + (void) chkdq(ip, -extblocks, NOCRED, FORCE); #endif vinvalbuf(vp, V_ALT, 0, 0); vn_pages_remove(vp, @@ -609,7 +609,7 @@ done: DIP_SET(ip, i_blocks, 0); ip->i_flag |= IN_CHANGE; #ifdef QUOTA - (void) chkdq(ip, -blocksreleased, NOCRED, 0); + (void) chkdq(ip, -blocksreleased, NOCRED, FORCE); #endif return (allerror); Modified: stable/12/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_softdep.c Sat Aug 10 20:08:37 2019 (r350849) +++ stable/12/sys/ufs/ffs/ffs_softdep.c Sat Aug 10 23:03:23 2019 (r350850) @@ -6670,7 +6670,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ quotaref(vp, freeblks->fb_quota); - (void) chkdq(ip, -datablocks, NOCRED, 0); + (void) chkdq(ip, -datablocks, NOCRED, FORCE); #endif freeblks->fb_chkcnt = -datablocks; UFS_LOCK(ump); @@ -6932,7 +6932,7 @@ softdep_setup_freeblocks(ip, length, flags) #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ quotaref(ITOV(ip), freeblks->fb_quota); - (void) chkdq(ip, -datablocks, NOCRED, 0); + (void) chkdq(ip, -datablocks, NOCRED, FORCE); #endif freeblks->fb_chkcnt = -datablocks; UFS_LOCK(ump); Modified: stable/12/sys/ufs/ufs/ufs_quota.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_quota.c Sat Aug 10 20:08:37 2019 (r350849) +++ stable/12/sys/ufs/ufs/ufs_quota.c Sat Aug 10 23:03:23 2019 (r350850) @@ -159,6 +159,7 @@ chkdq(struct inode *ip, ufs2_daddr_t change, struct uc struct vnode *vp = ITOV(ip); int i, error, warn, do_check; + MPASS(cred != NOCRED || (flags & FORCE) != 0); /* * Disk quotas must be turned off for system files. Currently * snapshot and quota files. @@ -311,6 +312,7 @@ chkiq(struct inode *ip, int change, struct ucred *cred struct dquot *dq; int i, error, warn, do_check; + MPASS(cred != NOCRED || (flags & FORCE) != 0); #ifdef DIAGNOSTIC if ((flags & CHOWN) == 0) chkdquot(ip); Modified: stable/12/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_vnops.c Sat Aug 10 20:08:37 2019 (r350849) +++ stable/12/sys/ufs/ufs/ufs_vnops.c Sat Aug 10 23:03:23 2019 (r350850) @@ -811,8 +811,8 @@ ufs_chown(vp, uid, gid, cred, td) ip->i_dquot[GRPQUOTA] = NODQUOT; } change = DIP(ip, i_blocks); - (void) chkdq(ip, -change, cred, CHOWN); - (void) chkiq(ip, -1, cred, CHOWN); + (void) chkdq(ip, -change, cred, CHOWN|FORCE); + (void) chkiq(ip, -1, cred, CHOWN|FORCE); for (i = 0; i < MAXQUOTAS; i++) { dqrele(vp, ip->i_dquot[i]); ip->i_dquot[i] = NODQUOT; From owner-svn-src-all@freebsd.org Sat Aug 10 23:06:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1581DA86CF; Sat, 10 Aug 2019 23:06:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465d646XQ2z4KFk; Sat, 10 Aug 2019 23:06:52 +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 D6F4252A0; Sat, 10 Aug 2019 23:06:52 +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 x7AN6qYl091521; Sat, 10 Aug 2019 23:06:52 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AN6qD4091519; Sat, 10 Aug 2019 23:06:52 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201908102306.x7AN6qD4091519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 10 Aug 2019 23:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350851 - in stable/12/sbin: fsck_ffs newfs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/12/sbin: fsck_ffs newfs X-SVN-Commit-Revision: 350851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 23:06:53 -0000 Author: mckusick Date: Sat Aug 10 23:06:52 2019 New Revision: 350851 URL: https://svnweb.freebsd.org/changeset/base/350851 Log: MFC of 350682 Correct first superblock backup location in fsck_ffs.8. Modified: stable/12/sbin/fsck_ffs/fsck_ffs.8 stable/12/sbin/newfs/newfs.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/12/sbin/fsck_ffs/fsck_ffs.8 Sat Aug 10 23:03:23 2019 (r350850) +++ stable/12/sbin/fsck_ffs/fsck_ffs.8 Sat Aug 10 23:06:52 2019 (r350851) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd May 3, 2019 +.Dd August 10, 2019 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -153,7 +153,7 @@ exits without attempting any further cleaning. Use the block specified immediately after the flag as the super block for the file system. An alternate super block is usually located at block 32 for UFS1, -and block 160 for UFS2. +and block 192 for UFS2. .Pp See the .Fl N Modified: stable/12/sbin/newfs/newfs.8 ============================================================================== --- stable/12/sbin/newfs/newfs.8 Sat Aug 10 23:03:23 2019 (r350850) +++ stable/12/sbin/newfs/newfs.8 Sat Aug 10 23:06:52 2019 (r350851) @@ -111,6 +111,9 @@ for more details on how to set this option. .It Fl b Ar block-size The block size of the file system, in bytes. It must be a power of 2. +.\" If changing the default block size and it causes the default +.\" fragment size to change, be sure to update the location of +.\" the first backup superblock on the fsck_ffs.8 manual page. The default size is 32768 bytes, and the smallest allowable size is 4096 bytes. The optimal block:fragment ratio is 8:1. @@ -143,6 +146,9 @@ ranging in value between .Ar blocksize Ns /8 and .Ar blocksize . +.\" If changing the default fragment size or it changes because of a +.\" change to the default block size, be sure to update the location +.\" of the first backup superblock on the fsck_ffs.8 manual page. The default is 4096 bytes. .It Fl g Ar avgfilesize The expected average file size for the file system. From owner-svn-src-all@freebsd.org Sat Aug 10 23:08:36 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5F79A8793; Sat, 10 Aug 2019 23:08:36 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 465d843mW5z4KN5; Sat, 10 Aug 2019 23:08:36 +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 62BF352A2; Sat, 10 Aug 2019 23:08:36 +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 x7AN8aPZ091684; Sat, 10 Aug 2019 23:08:36 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7AN8aXK091682; Sat, 10 Aug 2019 23:08:36 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201908102308.x7AN8aXK091682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 10 Aug 2019 23:08: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: r350852 - in stable/11/sbin: fsck_ffs newfs X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/11/sbin: fsck_ffs newfs X-SVN-Commit-Revision: 350852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages 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, 10 Aug 2019 23:08:36 -0000 Author: mckusick Date: Sat Aug 10 23:08:35 2019 New Revision: 350852 URL: https://svnweb.freebsd.org/changeset/base/350852 Log: MFC of 350682 Correct first superblock backup location in fsck_ffs.8. Modified: stable/11/sbin/fsck_ffs/fsck_ffs.8 stable/11/sbin/newfs/newfs.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/11/sbin/fsck_ffs/fsck_ffs.8 Sat Aug 10 23:06:52 2019 (r350851) +++ stable/11/sbin/fsck_ffs/fsck_ffs.8 Sat Aug 10 23:08:35 2019 (r350852) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd May 3, 2019 +.Dd August 10, 2019 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -153,7 +153,7 @@ exits without attempting any further cleaning. Use the block specified immediately after the flag as the super block for the file system. An alternate super block is usually located at block 32 for UFS1, -and block 160 for UFS2. +and block 192 for UFS2. .Pp See the .Fl N Modified: stable/11/sbin/newfs/newfs.8 ============================================================================== --- stable/11/sbin/newfs/newfs.8 Sat Aug 10 23:06:52 2019 (r350851) +++ stable/11/sbin/newfs/newfs.8 Sat Aug 10 23:08:35 2019 (r350852) @@ -113,6 +113,9 @@ for more details on how to set this option. .It Fl b Ar block-size The block size of the file system, in bytes. It must be a power of 2. +.\" If changing the default block size and it causes the default +.\" fragment size to change, be sure to update the location of +.\" the first backup superblock on the fsck_ffs.8 manual page. The default size is 32768 bytes, and the smallest allowable size is 4096 bytes. The optimal block:fragment ratio is 8:1. @@ -145,6 +148,9 @@ ranging in value between .Ar blocksize Ns /8 and .Ar blocksize . +.\" If changing the default fragment size or it changes because of a +.\" change to the default block size, be sure to update the location +.\" of the first backup superblock on the fsck_ffs.8 manual page. The default is 4096 bytes. .It Fl g Ar avgfilesize The expected average file size for the file system.