From owner-svn-src-head@freebsd.org Sun Apr 22 02:40:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC9B4FB7B65; Sun, 22 Apr 2018 02:40:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F69B7AFCE; Sun, 22 Apr 2018 02:40:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A6017BDB; Sun, 22 Apr 2018 02:40:21 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3M2eL3t037379; Sun, 22 Apr 2018 02:40:21 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3M2eLEr037378; Sun, 22 Apr 2018 02:40:21 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201804220240.w3M2eLEr037378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 22 Apr 2018 02:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332867 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 332867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 02:40:22 -0000 Author: dteske Date: Sun Apr 22 02:40:21 2018 New Revision: 332867 URL: https://svnweb.freebsd.org/changeset/base/332867 Log: dwatch(1): Remove the line used to demonstrate `-dev' option In recently added sendrecv profile, there was a line purposefully added to introduce a compilation error in which `-dev' is used to debug the entry. Removing the entry. Sponsored by: Smule, Inc. Modified: head/cddl/usr.sbin/dwatch/libexec/sendrecv Modified: head/cddl/usr.sbin/dwatch/libexec/sendrecv ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/sendrecv Sun Apr 22 02:36:06 2018 (r332866) +++ head/cddl/usr.sbin/dwatch/libexec/sendrecv Sun Apr 22 02:40:21 2018 (r332867) @@ -154,7 +154,6 @@ syscall::recvfrom:entry /* probe ID $(( $ID + 1 )) */ (struct sockaddr *)alloca(sizeof(struct sockaddr)) : (struct sockaddr *)copyin(arg4, sizeof(struct sockaddr)); this->sainfo = xlate ((struct sockaddr *)this->sa); - printf("missing closing paren\n"; } syscall::recvfrom:return /* probe ID $(( $ID + 2 )) */ From owner-svn-src-head@freebsd.org Sun Apr 22 02:20:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C570FB7031; Sun, 22 Apr 2018 02:20:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 229AB77E45; Sun, 22 Apr 2018 02:20:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D723787D; Sun, 22 Apr 2018 02:20:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3M2KHpp027498; Sun, 22 Apr 2018 02:20:17 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3M2KHEi027497; Sun, 22 Apr 2018 02:20:17 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201804220220.w3M2KHEi027497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 22 Apr 2018 02:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332865 - head/cddl/usr.sbin/dwatch X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch X-SVN-Commit-Revision: 332865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 02:20:18 -0000 Author: dteske Date: Sun Apr 22 02:20:17 2018 New Revision: 332865 URL: https://svnweb.freebsd.org/changeset/base/332865 Log: dwatch(1): Add `-dev' option to aid debugging of profiles The options `-d' (debug), `-e' (exit after compile), and `-v' (verbose) when combined in any order (though best remembered as `-dev') will run the conflated script through dtrace(1), test for error conditions, and show the line that dtrace(1) failed at (with context). If no errors are found, the output is the same as `-e[v]'. When writing a new profile for dwatch(1), you can quickly test to make sure it compiles by running `dwatch -devX profile_name' where profiles live in /usr/libexec/dwatch or /usr/local/libexec/dwatch (the latter being where profiles installed via ports should go). Sponsored by: Smule, Inc. Modified: head/cddl/usr.sbin/dwatch/dwatch Modified: head/cddl/usr.sbin/dwatch/dwatch ============================================================================== --- head/cddl/usr.sbin/dwatch/dwatch Sun Apr 22 00:26:35 2018 (r332864) +++ head/cddl/usr.sbin/dwatch/dwatch Sun Apr 22 02:20:17 2018 (r332865) @@ -47,7 +47,7 @@ DTRACE_PRAGMA=" ############################################################ GLOBALS -VERSION='$Version: 1.0 $' # -V +VERSION='$Version: 1.1 $' # -V pgm="${0##*/}" # Program basename @@ -67,6 +67,7 @@ CUSTOM_DETAILS= # -E code CUSTOM_TEST= # -t test DEBUG= # -d DESTRUCTIVE_ACTIONS= # -w +DEVELOPER= # -dev EXECNAME= # -k name EXECREGEX= # -z regex EXIT_AFTER_COMPILE= # -e @@ -835,6 +836,11 @@ if [ "$PROBE_ARG" ]; then fi # +# Developer switch +# +[ "$DEBUG" -a "$EXIT_AFTER_COMPILE" -a "$VERBOSE" ] && DEVELOPER=1 DEBUG= + +# # Set default event details if `-E code' was not given # [ "$CUSTOM_DETAILS" ] || EVENT_DETAILS=$( pproc_dump 0 ) @@ -966,6 +972,61 @@ PSARGS_ACTION=$( cat <&9 ) exec 3>&1 console_stdout=3 + # + # Developer debugging aide + # + if [ "$DEVELOPER" ]; then + # + # Run, capture the error line, and focus it + # + # Example error text to capture line number from: + # dtrace: failed to compile script /dev/stdin: line 669: ... + # + errline= + stdin_buf=$( cat ) + stderr_buf=$( echo "$stdin_buf" | + dtrace_cmd -t -es /dev/stdin "$@" 2>&1 > /dev/null ) + status=$? + if [ "$stderr_buf" ]; then + errline=$( echo "$stderr_buf" | awk ' + BEGIN { + ti = "\033[31m" + te = "\033[39m" + } + { line = $0 } + sub(/.*: line /, "") && sub(/:.*/, "") { + print # to errline + sub("line " $0, ti "&" te, line) + } + { print line > "/dev/stderr" } + ' 2>&3 ) + fi + if [ "$errline" ]; then + echo "$stdin_buf" | awk -v line="${errline%%[^0-9]*}" ' + BEGIN { + start = line < 10 ? 1 : line - 10 + end = line + 10 + slen = length(sprintf("%u", start)) + elen = length(sprintf("%u", end)) + N = elen > slen ? elen : slen + for (i = start; i <= end; i++) { + ti[i] = "\033[2m" + te[i] = "\033[22m" + } + ti[line] = "\033[31m" + te[line] = "\033[39m" + fmt = "%s%*u %s%s\n" + } + NR < start { next } + NR == start, NR == end { + printf(fmt, ti[NR], N, NR, $0, te[NR]) + } + NR > end { exit } + ' # END-QUOTE + fi + exit $status + fi + if [ $COUNT -eq 0 -a ! "$EXECREGEX$FILTER$GROUP$OUTPUT_CMD$PID$USER" ] then case "$OUTPUT" in @@ -1285,6 +1346,7 @@ $( pproc_dump -v 3 )} } EOF +# NOTREACHED ################################################################################ # END From owner-svn-src-head@freebsd.org Sun Apr 22 02:36:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95C13FB7A31; Sun, 22 Apr 2018 02:36:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49EDB7AE4C; Sun, 22 Apr 2018 02:36:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44C587BCD; Sun, 22 Apr 2018 02:36:07 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3M2a7Yh037181; Sun, 22 Apr 2018 02:36:07 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3M2a7uP037179; Sun, 22 Apr 2018 02:36:07 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201804220236.w3M2a7uP037179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 22 Apr 2018 02:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332866 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 332866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 02:36:07 -0000 Author: dteske Date: Sun Apr 22 02:36:06 2018 New Revision: 332866 URL: https://svnweb.freebsd.org/changeset/base/332866 Log: dwatch(1): Add profile for send(2)/recv(2) syscalls Sponsored by: Smule, Inc. Added: head/cddl/usr.sbin/dwatch/libexec/sendrecv (contents, props changed) Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile Modified: head/cddl/usr.sbin/dwatch/libexec/Makefile ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/Makefile Sun Apr 22 02:20:17 2018 (r332865) +++ head/cddl/usr.sbin/dwatch/libexec/Makefile Sun Apr 22 02:36:06 2018 (r332866) @@ -11,6 +11,7 @@ FILES= chmod \ proc \ rw \ sched \ + sendrecv \ tcp \ udp \ vop_create \ @@ -54,6 +55,12 @@ LINKS+= ${LIBEXECDIR}/dwatch/sched ${LIBEXECDIR}/dwatc LINKS+= ${LIBEXECDIR}/dwatch/sched ${LIBEXECDIR}/dwatch/sched-surrender LINKS+= ${LIBEXECDIR}/dwatch/sched ${LIBEXECDIR}/dwatch/sched-tick LINKS+= ${LIBEXECDIR}/dwatch/sched ${LIBEXECDIR}/dwatch/sched-wakeup +LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/recv +LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/recvfrom +LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/recvmsg +LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/send +LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendmsg +LINKS+= ${LIBEXECDIR}/dwatch/sendrecv ${LIBEXECDIR}/dwatch/sendto LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-established LINKS+= ${LIBEXECDIR}/dwatch/tcp ${LIBEXECDIR}/dwatch/tcp-accept-refused Added: head/cddl/usr.sbin/dwatch/libexec/sendrecv ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dwatch/libexec/sendrecv Sun Apr 22 02:36:06 2018 (r332866) @@ -0,0 +1,216 @@ +# -*- tab-width: 4 -*- ;; Emacs +# vi: set filetype=sh tabstop=8 shiftwidth=8 noexpandtab :: Vi/ViM +############################################################ IDENT(1) +# +# $Title: dwatch(8) module for send(2)/recv(2) $ +# $Copyright: 2014-2018 Devin Teske. All rights reserved. $ +# $FreeBSD$ +# +############################################################ DESCRIPTION +# +# Print details from send(2)/recv(2) +# +############################################################ PROBE + +case "$PROFILE" in +sendrecv) + : ${PROBE:=$( echo \ + syscall::recvfrom:return, \ + syscall::recvmsg:return, \ + syscall::sendmsg:entry, \ + syscall::sendto:entry )} ;; +send) + : ${PROBE:=$( echo \ + syscall::sendmsg:entry, \ + syscall::sendto:entry )} ;; +recv) + : ${PROBE:=$( echo \ + syscall::recvfrom:return, \ + syscall::recvmsg:return )} ;; +*) + : ${PROBE:=syscall::$PROFILE} +esac + +############################################################ EVENT ACTION + +#[ "$CUSTOM_TEST" ] || EVENT_TEST="this->from != NULL" + +############################################################ ACTIONS + +exec 9< + */ +#pragma D binding "1.13" address_family_string +inline string address_family_string[sa_family_t af] = + af == AF_UNSPEC ? "AF_UNSPEC" : + af == AF_LOCAL ? "AF_UNIX" : + af == AF_UNIX ? "AF_UNIX" : + af == AF_INET ? "AF_INET" : + af == AF_IMPLINK ? "AF_IMPLINK" : + af == AF_PUP ? "AF_PUP" : + af == AF_CHAOS ? "AF_CHAOS" : + af == AF_NETBIOS ? "AF_NETBIOS" : + af == AF_ISO ? "AF_ISO" : + af == AF_OSI ? "AF_ISO" : + af == AF_ECMA ? "AF_ECMA" : + af == AF_DATAKIT ? "AF_DATAKIT" : + af == AF_CCITT ? "AF_CCITT" : + af == AF_SNA ? "AF_SNA" : + af == AF_DECnet ? "AF_DECnet" : + af == AF_DLI ? "AF_DLI" : + af == AF_LAT ? "AF_LAT" : + af == AF_HYLINK ? "AF_HYLINK" : + af == AF_APPLETALK ? "AF_APPLETALK" : + af == AF_ROUTE ? "AF_ROUTE" : + af == AF_LINK ? "AF_LINK" : + af == pseudo_AF_XTP ? "pseudo_AF_XTP" : + af == AF_COIP ? "AF_COIP" : + af == AF_CNT ? "AF_CNT" : + af == pseudo_AF_RTIP ? "pseudo_AF_RTIP" : + af == AF_IPX ? "AF_IPX" : + af == AF_SIP ? "AF_SIP" : + af == pseudo_AF_PIP ? "pseudo_AF_PIP" : + af == AF_ISDN ? "AF_ISDN" : + af == AF_E164 ? "AF_ISDN" : + af == pseudo_AF_KEY ? "pseudo_AF_KEY" : + af == AF_INET6 ? "AF_INET6" : + af == AF_NATM ? "AF_NATM" : + af == AF_ATM ? "AF_ATM" : + af == pseudo_AF_HDRCMPLT ? "pseudo_AF_HDRCMPLT" : + af == AF_NETGRAPH ? "AF_NETGRAPH" : + af == AF_SLOW ? "AF_SLOW" : + af == AF_SCLUSTER ? "AF_SCLUSTER" : + af == AF_ARP ? "AF_ARP" : + af == AF_BLUETOOTH ? "AF_BLUETOOTH" : + af == AF_IEEE80211 ? "AF_IEEE80211" : + af == AF_INET_SDP ? "AF_INET_SDP" : + af == AF_INET6_SDP ? "AF_INET6_SDP" : + af == AF_MAX ? "AF_MAX" : + strjoin("AF_UNKNOWN(", strjoin(lltostr(af), ")")); + +#pragma D binding "1.13" sa_data_size +inline int sa_data_size = 14; + +#pragma D binding "1.13" sa_data_addr +inline string sa_data_addr[sa_family_t af, char data[sa_data_size]] = + af == AF_INET ? strjoin( + strjoin(strjoin(lltostr(data[2] & 0xFF), "."), + strjoin(lltostr(data[3] & 0xFF), ".") + ), + strjoin(strjoin(lltostr(data[4] & 0xFF), "."), + lltostr(data[5] & 0xFF)) + ) : + ""; + +#pragma D binding "1.13" sa_data_port +inline uint16_t sa_data_port[sa_family_t af, char data[sa_data_size]] = + af == AF_INET ? (data[0] << 8) + data[1] : + 0; + +#pragma D binding "1.13" translator +translator sainfo_t < struct sockaddr *SA > { + sa_family = SA->sa_family; + family = address_family_string[SA->sa_family]; + addr = sa_data_addr[SA->sa_family, SA->sa_data]; + port = sa_data_port[SA->sa_family, SA->sa_data]; +}; + +this sainfo_t sainfo; +this ssize_t nbytes; +this string details; +this string flow; +this struct msghdr * msghdr; +this struct sockaddr * sa; + +inline string probeflow[string func] = + func == "recvfrom" ? "<-" : + func == "recvmsg" ? "<-" : + func == "recvmmsg" ? "<-" : + "->"; + +inline string af_details[sa_family_t af, string addr, uint16_t port] = + af == AF_INET ? strjoin(addr, strjoin(":", lltostr(port))) : + ""; + +$PROBE /* probe ID $ID */ +{${TRACE:+ + printf("<$ID>");} + this->details = ""; + this->flow = probeflow[probefunc]; +} + +syscall::recvfrom:entry /* probe ID $(( $ID + 1 )) */ +{${TRACE:+ + printf("<$(( $ID + 1 ))>");} + this->sa = args[4] == NULL ? + (struct sockaddr *)alloca(sizeof(struct sockaddr)) : + (struct sockaddr *)copyin(arg4, sizeof(struct sockaddr)); + this->sainfo = xlate ((struct sockaddr *)this->sa); + printf("missing closing paren\n"; +} + +syscall::recvfrom:return /* probe ID $(( $ID + 2 )) */ +{${TRACE:+ + printf("<$(( $ID + 2 ))>");} + this->nbytes = arg0; + this->details = strjoin("from ", strjoin( + strjoin(this->sainfo.family, " "), + af_details[this->sainfo.sa_family, + this->sainfo.addr, this->sainfo.port])); +} + +syscall::recvmsg:return /* probe ID $(( $ID + 3 )) */ +{${TRACE:+ + printf("<$(( $ID + 3 ))>");} + this->nbytes = arg0; +} + +syscall::sendmsg:entry /* probe ID $(( $ID + 5 )) */ +{${TRACE:+ + printf("<$(( $ID + 5 ))>");} + this->nbytes = arg2; +} + +syscall::sendto:entry /* probe ID $(( $ID + 4 )) */ +{${TRACE:+ + printf("<$(( $ID + 4 ))>");} + this->nbytes = arg2; + this->sa = arg4 == NULL ? + (struct sockaddr *)alloca(sizeof(struct sockaddr)) : + (struct sockaddr *)copyin(arg4, sizeof(struct sockaddr)); + this->sainfo = xlate ((struct sockaddr *)this->sa); + this->details = strjoin("to ", strjoin( + strjoin(this->sainfo.family, " "), + af_details[this->sainfo.sa_family, + this->sainfo.addr, this->sainfo.port])); +} +EOF +ACTIONS=$( cat <&9 ) +ID=$(( $ID + 5 )) + +############################################################ EVENT DETAILS + +exec 9<flow, + this->nbytes, + this->nbytes != 1 ? "s" : "", + this->details != "" ? " " : "", + this->details); +EOF +EVENT_DETAILS=$( cat <&9 ) + +################################################################################ +# END +################################################################################ From owner-svn-src-head@freebsd.org Sun Apr 22 03:58:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3F4DFBB78F; Sun, 22 Apr 2018 03:58:05 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82B9A6C806; Sun, 22 Apr 2018 03:58:05 +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 6374B109C9; Sun, 22 Apr 2018 03:58:05 +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 w3M3w5rI077594; Sun, 22 Apr 2018 03:58:05 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3M3w55o077592; Sun, 22 Apr 2018 03:58:05 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804220358.w3M3w55o077592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 22 Apr 2018 03:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332868 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 332868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 03:58:06 -0000 Author: jhibbits Date: Sun Apr 22 03:58:04 2018 New Revision: 332868 URL: https://svnweb.freebsd.org/changeset/base/332868 Log: Fix the build post r332859 sysentvec::sv_hwcap/sv_hwcap2 are pointers to u_long, so cpu_features* need to be u_long to use the pointers. This also requires a temporary cast in printing the bitfields, which is fine because the feature flag fields are only 32 bits anyway. Modified: head/sys/powerpc/include/cpu.h head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Sun Apr 22 02:40:21 2018 (r332867) +++ head/sys/powerpc/include/cpu.h Sun Apr 22 03:58:04 2018 (r332868) @@ -49,8 +49,8 @@ * sysctl. */ -extern int cpu_features; -extern int cpu_features2; +extern u_long cpu_features; +extern u_long cpu_features2; #define PPC_FEATURE_32 0x80000000 /* Always true */ #define PPC_FEATURE_64 0x40000000 /* Defined on a 64-bit CPU */ Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sun Apr 22 02:40:21 2018 (r332867) +++ head/sys/powerpc/powerpc/cpu.c Sun Apr 22 03:58:04 2018 (r332868) @@ -231,12 +231,12 @@ static int cpu_feature_bit(SYSCTL_HANDLER_ARGS); static char model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); -int cpu_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU; -int cpu_features2 = 0; +u_long cpu_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU; +u_long cpu_features2 = 0; SYSCTL_OPAQUE(_hw, OID_AUTO, cpu_features, CTLFLAG_RD, - &cpu_features, sizeof(cpu_features), "IX", "PowerPC CPU features"); + &cpu_features, sizeof(cpu_features), "LX", "PowerPC CPU features"); SYSCTL_OPAQUE(_hw, OID_AUTO, cpu_features2, CTLFLAG_RD, - &cpu_features2, sizeof(cpu_features2), "IX", "PowerPC CPU features 2"); + &cpu_features2, sizeof(cpu_features2), "LX", "PowerPC CPU features 2"); /* Provide some user-friendly aliases for bits in cpu_features */ SYSCTL_PROC(_hw, OID_AUTO, floatingpoint, CTLTYPE_INT | CTLFLAG_RD, @@ -307,10 +307,10 @@ cpu_setup(u_int cpuid) cpu_features |= cp->features; cpu_features2 |= cp->features2; - printf("cpu%d: Features %b\n", cpuid, cpu_features, + printf("cpu%d: Features %b\n", cpuid, (int)cpu_features, PPC_FEATURE_BITMASK); if (cpu_features2 != 0) - printf("cpu%d: Features2 %b\n", cpuid, cpu_features2, + printf("cpu%d: Features2 %b\n", cpuid, (int)cpu_features2, PPC_FEATURE2_BITMASK); /* From owner-svn-src-head@freebsd.org Sun Apr 22 06:11:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87317FA114C; Sun, 22 Apr 2018 06:11:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 389E869306; Sun, 22 Apr 2018 06:11:47 +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 337DE12047; Sun, 22 Apr 2018 06:11:47 +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 w3M6BlAr044558; Sun, 22 Apr 2018 06:11:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3M6Bl9F044551; Sun, 22 Apr 2018 06:11:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804220611.w3M6Bl9F044551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 22 Apr 2018 06:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332869 - head/contrib/ofed/libibverbs X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/contrib/ofed/libibverbs X-SVN-Commit-Revision: 332869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 06:11:47 -0000 Author: hselasky Date: Sun Apr 22 06:11:46 2018 New Revision: 332869 URL: https://svnweb.freebsd.org/changeset/base/332869 Log: Remove the "load drivers" logic from libibverbs. The "load drivers" logic in the libibverbs configuration file is relevant for Linux only. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/contrib/ofed/libibverbs/init.c Modified: head/contrib/ofed/libibverbs/init.c ============================================================================== --- head/contrib/ofed/libibverbs/init.c Sun Apr 22 03:58:04 2018 (r332868) +++ head/contrib/ofed/libibverbs/init.c Sun Apr 22 06:11:46 2018 (r332869) @@ -80,89 +80,10 @@ static struct ibv_driver *head_driver, *tail_driver; static int find_sysfs_devs(void) { -#ifdef __linux__ char class_path[IBV_SYSFS_PATH_MAX]; - DIR *class_dir; - struct dirent *dent; struct ibv_sysfs_dev *sysfs_dev = NULL; char value[8]; int ret = 0; - - if (!check_snprintf(class_path, sizeof(class_path), - "%s/class/infiniband_verbs", ibv_get_sysfs_path())) - return ENOMEM; - - class_dir = opendir(class_path); - if (!class_dir) - return ENOSYS; - - while ((dent = readdir(class_dir))) { - struct stat buf; - - if (dent->d_name[0] == '.') - continue; - - if (!sysfs_dev) - sysfs_dev = malloc(sizeof *sysfs_dev); - if (!sysfs_dev) { - ret = ENOMEM; - goto out; - } - - if (!check_snprintf(sysfs_dev->sysfs_path, sizeof sysfs_dev->sysfs_path, - "%s/%s", class_path, dent->d_name)) - continue; - - if (stat(sysfs_dev->sysfs_path, &buf)) { - fprintf(stderr, PFX "Warning: couldn't stat '%s'.\n", - sysfs_dev->sysfs_path); - continue; - } - - if (!S_ISDIR(buf.st_mode)) - continue; - - if (!check_snprintf(sysfs_dev->sysfs_name, sizeof sysfs_dev->sysfs_name, - "%s", dent->d_name)) - continue; - - if (ibv_read_sysfs_file(sysfs_dev->sysfs_path, "ibdev", - sysfs_dev->ibdev_name, - sizeof sysfs_dev->ibdev_name) < 0) { - fprintf(stderr, PFX "Warning: no ibdev class attr for '%s'.\n", - dent->d_name); - continue; - } - - if (!check_snprintf( - sysfs_dev->ibdev_path, sizeof(sysfs_dev->ibdev_path), - "%s/class/infiniband/%s", ibv_get_sysfs_path(), - sysfs_dev->ibdev_name)) - continue; - - sysfs_dev->next = sysfs_dev_list; - sysfs_dev->have_driver = 0; - if (ibv_read_sysfs_file(sysfs_dev->sysfs_path, "abi_version", - value, sizeof value) > 0) - sysfs_dev->abi_ver = strtol(value, NULL, 10); - else - sysfs_dev->abi_ver = 0; - - sysfs_dev_list = sysfs_dev; - sysfs_dev = NULL; - } - - out: - if (sysfs_dev) - free(sysfs_dev); - - closedir(class_dir); - return ret; -#else - char class_path[IBV_SYSFS_PATH_MAX]; - struct ibv_sysfs_dev *sysfs_dev = NULL; - char value[8]; - int ret = 0; int i; snprintf(class_path, sizeof class_path, "%s/class/infiniband_verbs", @@ -208,7 +129,6 @@ static int find_sysfs_devs(void) free(sysfs_dev); return ret; -#endif } void verbs_register_driver(const char *name, @@ -233,185 +153,6 @@ void verbs_register_driver(const char *name, tail_driver = driver; } -#define __IBV_QUOTE(x) #x -#define IBV_QUOTE(x) __IBV_QUOTE(x) -#define DLOPEN_TRAILER "-" IBV_QUOTE(IBV_DEVICE_LIBRARY_EXTENSION) ".so" - -static void load_driver(const char *name) -{ - char *so_name; - void *dlhandle; - - /* If the name is an absolute path then open that path after appending - the trailer suffix */ - if (name[0] == '/') { - if (asprintf(&so_name, "%s" DLOPEN_TRAILER, name) < 0) - goto out_asprintf; - dlhandle = dlopen(so_name, RTLD_NOW); - if (!dlhandle) - goto out_dlopen; - free(so_name); - return; - } - - /* If configured with a provider plugin path then try that next */ - if (sizeof(VERBS_PROVIDER_DIR) > 1) { - if (asprintf(&so_name, VERBS_PROVIDER_DIR "/lib%s" DLOPEN_TRAILER, name) < - 0) - goto out_asprintf; - dlhandle = dlopen(so_name, RTLD_NOW); - free(so_name); - if (dlhandle) - return; - } - - /* Otherwise use the system libary search path. This is the historical - behavior of libibverbs */ - if (asprintf(&so_name, "lib%s" DLOPEN_TRAILER, name) < 0) - goto out_asprintf; - dlhandle = dlopen(so_name, RTLD_NOW); - if (!dlhandle) - goto out_dlopen; - free(so_name); - return; - -out_asprintf: - fprintf(stderr, PFX "Warning: couldn't load driver '%s'.\n", name); - return; -out_dlopen: - fprintf(stderr, PFX "Warning: couldn't load driver '%s': %s\n", so_name, - dlerror()); - free(so_name); - return; -} - -static void load_drivers(void) -{ - struct ibv_driver_name *name, *next_name; - const char *env; - char *list, *env_name; - - /* - * Only use drivers passed in through the calling user's - * environment if we're not running setuid. - */ - if (getuid() == geteuid()) { - if ((env = getenv("RDMAV_DRIVERS"))) { - list = strdupa(env); - while ((env_name = strsep(&list, ":;"))) - load_driver(env_name); - } else if ((env = getenv("IBV_DRIVERS"))) { - list = strdupa(env); - while ((env_name = strsep(&list, ":;"))) - load_driver(env_name); - } - } - - for (name = driver_name_list, next_name = name ? name->next : NULL; - name; - name = next_name, next_name = name ? name->next : NULL) { - load_driver(name->name); - free(name->name); - free(name); - } -} - -static void read_config_file(const char *path) -{ - FILE *conf; - char *line = NULL; - char *config; - char *field; - size_t buflen = 0; - ssize_t len; - - conf = fopen(path, "r" STREAM_CLOEXEC); - if (!conf) { - fprintf(stderr, PFX "Warning: couldn't read config file %s.\n", - path); - return; - } - - while ((len = getline(&line, &buflen, conf)) != -1) { - config = line + strspn(line, "\t "); - if (config[0] == '\n' || config[0] == '#') - continue; - - field = strsep(&config, "\n\t "); - - if (strcmp(field, "driver") == 0 && config != NULL) { - struct ibv_driver_name *driver_name; - - config += strspn(config, "\t "); - field = strsep(&config, "\n\t "); - - driver_name = malloc(sizeof *driver_name); - if (!driver_name) { - fprintf(stderr, PFX "Warning: couldn't allocate " - "driver name '%s'.\n", field); - continue; - } - - driver_name->name = strdup(field); - if (!driver_name->name) { - fprintf(stderr, PFX "Warning: couldn't allocate " - "driver name '%s'.\n", field); - free(driver_name); - continue; - } - - driver_name->next = driver_name_list; - driver_name_list = driver_name; - } else - fprintf(stderr, PFX "Warning: ignoring bad config directive " - "'%s' in file '%s'.\n", field, path); - } - - if (line) - free(line); - fclose(conf); -} - -static void read_config(void) -{ - DIR *conf_dir; - struct dirent *dent; - char *path; - - conf_dir = opendir(IBV_CONFIG_DIR); - if (!conf_dir) { - fprintf(stderr, PFX "Warning: couldn't open config directory '%s'.\n", - IBV_CONFIG_DIR); - return; - } - - while ((dent = readdir(conf_dir))) { - struct stat buf; - - if (asprintf(&path, "%s/%s", IBV_CONFIG_DIR, dent->d_name) < 0) { - fprintf(stderr, PFX "Warning: couldn't read config file %s/%s.\n", - IBV_CONFIG_DIR, dent->d_name); - goto out; - } - - if (stat(path, &buf)) { - fprintf(stderr, PFX "Warning: couldn't stat config file '%s'.\n", - path); - goto next; - } - - if (!S_ISREG(buf.st_mode)) - goto next; - - read_config_file(path); -next: - free(path); - } - -out: - closedir(conf_dir); -} - static struct ibv_device *try_driver(struct ibv_driver *driver, struct ibv_sysfs_dev *sysfs_dev) { @@ -565,8 +306,6 @@ int ibverbs_init(struct ibv_device ***list) check_memlock_limit(); - read_config(); - ret = find_sysfs_devs(); if (ret) return -ret; @@ -602,8 +341,6 @@ int ibverbs_init(struct ibv_device ***list) } dlclose(hand); } - - load_drivers(); for (sysfs_dev = sysfs_dev_list; sysfs_dev; sysfs_dev = sysfs_dev->next) { if (sysfs_dev->have_driver) From owner-svn-src-head@freebsd.org Sun Apr 22 09:30:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5FA3FAED7C; Sun, 22 Apr 2018 09:30:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB2C78E2E; Sun, 22 Apr 2018 09:30:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AB7413F9E; Sun, 22 Apr 2018 09:30:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3M9U7Di051991; Sun, 22 Apr 2018 09:30:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3M9U788051989; Sun, 22 Apr 2018 09:30:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804220930.w3M9U788051989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 22 Apr 2018 09:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332870 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 09:30:08 -0000 Author: mjg Date: Sun Apr 22 09:30:07 2018 New Revision: 332870 URL: https://svnweb.freebsd.org/changeset/base/332870 Log: lockf: slightly depessimize 1. check if P_ADVLOCK is already set and if so, don't lock to set it (stolen from DragonFly) 2. when trying for fast path unlock, check that we are doing unlock first instead of taking the interlock for no reason (e.g. if we want to *lock*). whilere make it more likely that falling fast path will not take the interlock either by checking for state Note the code is severely pessimized both single- and multithreaded. Modified: head/sys/kern/kern_descrip.c head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Apr 22 06:11:46 2018 (r332869) +++ head/sys/kern/kern_descrip.c Sun Apr 22 09:30:07 2018 (r332870) @@ -648,9 +648,11 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ error = EBADF; break; } - PROC_LOCK(p->p_leader); - p->p_leader->p_flag |= P_ADVLOCK; - PROC_UNLOCK(p->p_leader); + if ((p->p_leader->p_flag & P_ADVLOCK) == 0) { + PROC_LOCK(p->p_leader); + p->p_leader->p_flag |= P_ADVLOCK; + PROC_UNLOCK(p->p_leader); + } error = VOP_ADVLOCK(vp, (caddr_t)p->p_leader, F_SETLK, flp, flg); break; @@ -659,9 +661,11 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ error = EBADF; break; } - PROC_LOCK(p->p_leader); - p->p_leader->p_flag |= P_ADVLOCK; - PROC_UNLOCK(p->p_leader); + if ((p->p_leader->p_flag & P_ADVLOCK) == 0) { + PROC_LOCK(p->p_leader); + p->p_leader->p_flag |= P_ADVLOCK; + PROC_UNLOCK(p->p_leader); + } error = VOP_ADVLOCK(vp, (caddr_t)p->p_leader, F_SETLK, flp, flg); break; Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Sun Apr 22 06:11:46 2018 (r332869) +++ head/sys/kern/kern_lockf.c Sun Apr 22 09:30:07 2018 (r332870) @@ -479,15 +479,15 @@ retry_setlock: /* * Avoid the common case of unlocking when inode has no locks. */ - VI_LOCK(vp); - if ((*statep) == NULL) { - if (ap->a_op != F_SETLK) { + if (ap->a_op != F_SETLK && (*statep) == NULL) { + VI_LOCK(vp); + if ((*statep) == NULL) { fl->l_type = F_UNLCK; VI_UNLOCK(vp); return (0); } + VI_UNLOCK(vp); } - VI_UNLOCK(vp); /* * Map our arguments to an existing lock owner or create one From owner-svn-src-head@freebsd.org Sun Apr 22 16:05:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 908BAFAADE5; Sun, 22 Apr 2018 16:05:30 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F43F762A8; Sun, 22 Apr 2018 16:05:30 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3714117F48; Sun, 22 Apr 2018 16:05:30 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3MG5TcA051342; Sun, 22 Apr 2018 16:05:29 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3MG5TOF051341; Sun, 22 Apr 2018 16:05:29 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201804221605.w3MG5TOF051341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Sun, 22 Apr 2018 16:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332871 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 16:05:30 -0000 Author: tijl Date: Sun Apr 22 16:05:29 2018 New Revision: 332871 URL: https://svnweb.freebsd.org/changeset/base/332871 Log: Make bufdaemon and bufspacedaemon use kthread_suspend_check instead of kproc_suspend_check. In r329612 bufspacedaemon was turned into a thread of the bufdaemon process causing both to call kproc_suspend_check with the same proc argument and that function contains the following while loop: while (SIGISMEMBER(p->p_siglist, SIGSTOP)) { wakeup(&p->p_siglist); msleep(&p->p_siglist, &p->p_mtx, PPAUSE, "kpsusp", 0); } So one thread wakes up the other and the other wakes up the first again, locking up UP machines on shutdown. Also register the shutdown handlers with SHUTDOWN_PRI_LAST + 100 so they run after the syncer has shutdown, because the syncer can cause a situation where bufdaemon help is needed to proceed. PR: 227404 Reviewed by: kib Tested by: cy, rmacklem Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Apr 22 09:30:07 2018 (r332870) +++ head/sys/kern/vfs_bio.c Sun Apr 22 16:05:29 2018 (r332871) @@ -791,9 +791,12 @@ bufspace_daemon(void *arg) { struct bufdomain *bd; + EVENTHANDLER_REGISTER(shutdown_pre_sync, kthread_shutdown, curthread, + SHUTDOWN_PRI_LAST + 100); + bd = arg; for (;;) { - kproc_suspend_check(curproc); + kthread_suspend_check(); /* * Free buffers from the clean queue until we meet our @@ -3357,8 +3360,8 @@ buf_daemon() /* * This process needs to be suspended prior to shutdown sync. */ - EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, bufdaemonproc, - SHUTDOWN_PRI_LAST); + EVENTHANDLER_REGISTER(shutdown_pre_sync, kthread_shutdown, curthread, + SHUTDOWN_PRI_LAST + 100); /* * Start the buf clean daemons as children threads. @@ -3381,7 +3384,7 @@ buf_daemon() bd_request = 0; mtx_unlock(&bdlock); - kproc_suspend_check(bufdaemonproc); + kthread_suspend_check(); /* * Save speedupreq for this pass and reset to capture new From owner-svn-src-head@freebsd.org Sun Apr 22 17:11:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7577CFAF386; Sun, 22 Apr 2018 17:11:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A70186153; Sun, 22 Apr 2018 17:11:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x233.google.com with SMTP id f3-v6so15776456iob.13; Sun, 22 Apr 2018 10:11:10 -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=1onh7fzpfGTYUS+kC1S8F4gQyK75PV3ThEue0BT8LDE=; b=eWOFQ3SzzVC7JRpbJQfWsbm2r/CO6kcDfVUZhq7qmJtVCS2PzZJaDZ+PXFc9ndEFTr QdkgVeV/LM4DRKi+kO4FwUSLDgbnaKCPuwfBqiKtQKAG/HMNr4rZjCvlzxdrVfG0AOMX P6fPL5jj/LPXwmHD64g2gHFLEM/j2889fHbViaCA7gKdhQiqJEXM/d/AbY+oiVLvRGnl 9hhwhZdm/921ioYBIF/d+xAto/9Pt7YihbBU24mWkkIKa9R1XUr1+wfXqvTKBdeR6K27 tsmiVYzeis81YRTXRa5aP8tjMS1rYqfnfdVLy9xy6z7GC+/87JYBvXKyschCgg2lUpFg ABww== 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=1onh7fzpfGTYUS+kC1S8F4gQyK75PV3ThEue0BT8LDE=; b=PZPSLWhrpkFVHKlZmz39sCUaswc1ivEgdgECeX2WHn2Rw94rb/uDe9WUDWsrpPBR3b rrAt/lr6O1brwALYVsDHXUDINquTffIZyKjm1MZYkTKMeYdEhrs/hzpoqeHmYedOPR0K ODhsfjtb4Z1OjNasYs4K/4grEK9rFugG0EnDZ3ET+j4Zcq96KMn4i75BgVOqBw9nbNSz ZL2kkN2LTR4M7nnZpTKgK6xwJR+iuuHogIU44UF4oUlrzYaTWS0SwQrOVdJf4ZgESY97 rink1yATRMooTPMPkExPZG5GZAB1wzs/USFgA2hl+Buf23CHOuwx1Cra8MitxXREbw/V E84g== X-Gm-Message-State: ALQs6tAS2PXYs2Ue8/GvSGEQ6GO2YTPLJNbjQOEVGD6TGpBt83A2m+oQ /vQcAb3Vc/un1vton//nMoY= X-Google-Smtp-Source: AIpwx4/FtUkZYLbRQ/hTFr8lZJc2uAW8NhjUelIbYEyu2z+SbJAoPhxQVhq77TAWaA/HMArewKe7fg== X-Received: by 2002:a6b:3985:: with SMTP id g127-v6mr17409061ioa.52.1524417069353; Sun, 22 Apr 2018 10:11:09 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-74.dsl.bell.ca. [184.145.252.74]) by smtp.gmail.com with ESMTPSA id t126-v6sm5014033iod.38.2018.04.22.10.11.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Apr 2018 10:11:08 -0700 (PDT) Sender: Mark Johnston Date: Sun, 22 Apr 2018 13:11:06 -0400 From: Mark Johnston To: Jonathan Looney Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332860 - head/sys/kern Message-ID: <20180422171106.GB84833@raichu> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 17:11:10 -0000 On Sat, Apr 21, 2018 at 04:33:33PM -0400, Jonathan Looney wrote: > On Sat, Apr 21, 2018 at 1:53 PM, Conrad Meyer wrote: > > > > I don't think this should be enabled by default. Can we leave it > > disabled by default and let consumers opt-in? > > I'm willing to change the default if there's a good reason or consensus for > that. However, it is not obvious to me that the default is actually wrong. > > I think its important that we remember where we are when we hit this code. > > By the time we hit this code, we've already panic'd (whether due to a > "true" panic or a violated assertion). At this point, the system is already > in an unknown/unexpected state and we want to preserve our ability to > troubleshoot and/or recover. (And, since we're running a system with > INVARIANTS, presumably the ability to troubleshoot is important.) > > We may well violate a second assertion simply because the system is in an > unknown/unexpected state. Once we do that, the question is whether we > should try to preserve the ability to troubleshoot, or should give up and > reset the system. > > All too often, my ability to debug assertion violations is hindered because > the system trips over yet another assertion while dumping the core. If we > skip the assertion, nothing bad happens. (The post-panic debugging code > already needs to deal with systems that are inconsistent, and it does a > pretty good job at it.) I think we make a decent effort to fix such problems as they arise, but you are declaring defeat on behalf of everyone. Did you make some effort to fix or report these issues before resorting to the more drastic measure taken here? > On the other hand, I really am not sure what you are worried might happen > if we skip checking assertions after we've already panic'd. As far as I can > tell, the likely worst case is that we hit a true panic of some kind. In > that case, we're no worse off than before. > > I think the one obvious exception is when we're purposely trying to > validate the post-panic debugging code. In that case, you can change the > sysctl/tunable to enable troubleshooting. What about a user whose test system panics and fails to dump? With assertions enabled, a developer has a better chance of spotting the problem. Now we need at least one extra round trip to the user to diagnose the problem, which may not be readily reproducible in the first place. > I would honestly appreciate someone explaining the dangers in disabling a > response to assertion violations after we've already panic'd and are simply > trying to troubleshoot, because they are not obvious to me. But, I could > simply be missing them. The assertions help identify code that is being executed during a dump when it shouldn't be. In general we rely on users to opt in to running INVARIANTS kernels because developers don't catch every single bug. With this change it's harder to be confident in the kernel dump code. (Or in any post-panic debugging code for that matter.) I dislike the change and would prefer the default to be inverted. At the very least I think we should print the assertion message rather than returning silently from kassert_panic(). From owner-svn-src-head@freebsd.org Sun Apr 22 19:07:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE7B0FB6999; Sun, 22 Apr 2018 19:07:00 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay116.isp.belgacom.be (mailrelay116.isp.belgacom.be [195.238.20.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C4D27DC24; Sun, 22 Apr 2018 19:06:59 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3Aos7MHhC9Jswyb73DnYKCUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSPX+oMbcNUDSrc9gkEXOFd2Cra4c0KyO6+jJYi8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6?= =?us-ascii?q?JvjvGo7Vks+7y/2+94fcbglUijexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfO?= =?us-ascii?q?pWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnM?= =?us-ascii?q?VhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykC?= =?us-ascii?q?oJOT43/n/KhMJzjq1brh2uqABwzYPPfIGYNuZycr/Bcd8GW2ZMWNtaWSxbAoO7?= =?us-ascii?q?aosCF/QPPedar4n5ulADsxy+BQ63BOzxzz9HnHn23bYn2OkmDQHG3Q4gH9YVvX?= =?us-ascii?q?rUttX6KrkdXP2owqfG1znDaOlW2Tjk5YXObxsvr/aMXbdqfsrQz0kiDw3Fjk+O?= =?us-ascii?q?poP7JDyVzfkCv3Kc7+p6WuKijXMspQJpojW3xcogl5PFipwax1zZ7yl13po5Kc?= =?us-ascii?q?OiREJmYdOpHp1dvDyAOYRsWMMtWWRotT4/yr0BpJG0YjAHyI8ixx7Dc/yHdJWI?= =?us-ascii?q?4g77WOaRPzh4gHVldaq8hxmo9Uigy+j8Wdeu0FZNtCZFjtjMtnIJ1xDJ9seHTf?= =?us-ascii?q?x9/ly/1jaKzQ/T7PpELVozlarBJJ4t2r8wlpwNvkTfBiL7m1j6gLWIekgr5+Sk?= =?us-ascii?q?8frrbqn4qpOGKoN5ig/zPrwrmsOlAOQ4NgYOX3Kc+eS5zLDj4Uz5QLdOjvAtnK?= =?us-ascii?q?nZqo7VKtoAqa6iHgBZyIEj6wywDzu+ytQXgWEHLE5ZeBKAl4XpIE/OIPbhAfek?= =?us-ascii?q?mVSjjC5nx/DYMbL7H5rANXbDkK3/crlj8EFc0xc8wcpY55JOBbELOOjzVVPptN?= =?us-ascii?q?zEEh85NBS5w/35CNV7z48eQniPDbOAPKzItV+I4vkiI+eWZIALpjnyMOMl6OP0?= =?us-ascii?q?gX8+g18dcrGj3YELZ3CgAvRmP0KZbGL3gtcbDWgGpxYxTOvviF2HUD5Te2qyUL?= =?us-ascii?q?wm5jEgE4+mA53DSZ6zj7Oaxye0A4daZmdcClCDCX3obZmLW+8QaCKOJc9sij8E?= =?us-ascii?q?Vbm6RII62xGurhH1xKR8IerP5yIUr5Xj1MJ6576bqRZn1jtyFNiU1X2MSSlek2?= =?us-ascii?q?cPWiQxwugrok134nmZ3KVSuNAeEsZcsaBnSAA/YKLdzegyINf1QQ/Ed9GSAAK6?= =?us-ascii?q?Q9eiKR8rQ98b+PNIZFxyTYbxxivf1janVudG34eAA4Y5p/rR?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2DXFgAq3dxa/5nK8VFcg0UvUw56FROMS?= =?us-ascii?q?owXAQGBczEBXZR4LoRIAoJEIjgUAQIBAQEBAQECAWscDII1IoJMAQU6HCMQCw4?= =?us-ascii?q?GBAkaCw8qHgYThRMLqUyIPoIpBYofhBqKRwKXcwiFXIhZaItxiTaIHDMhgVJNM?= =?us-ascii?q?AiCfoJIiEiFQD0wkBsBAQ?= X-IPAS-Result: =?us-ascii?q?A2DXFgAq3dxa/5nK8VFcg0UvUw56FROMSowXAQGBczEBXZR?= =?us-ascii?q?4LoRIAoJEIjgUAQIBAQEBAQECAWscDII1IoJMAQU6HCMQCw4GBAkaCw8qHgYTh?= =?us-ascii?q?RMLqUyIPoIpBYofhBqKRwKXcwiFXIhZaItxiTaIHDMhgVJNMAiCfoJIiEiFQD0?= =?us-ascii?q?wkBsBAQ?= Received: from 153.202-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.202.153]) by relay.skynet.be with ESMTP; 22 Apr 2018 21:06:58 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w3MJ6v78001291; Sun, 22 Apr 2018 21:06:57 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sun, 22 Apr 2018 21:06:56 +0200 From: Tijl Coosemans To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332489 - in head: gnu/usr.bin/gdb/kgdb sys/conf sys/dev/dcons sys/dev/hyperv/vmbus/i386 sys/dev/ppc sys/dev/syscons sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/include/pc sys... Message-ID: <20180422210656.29cb7d0a@kalimero.tijl.coosemans.org> In-Reply-To: <201804132030.w3DKUnFn050153@repo.freebsd.org> References: <201804132030.w3DKUnFn050153@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 19:07:01 -0000 On Fri, 13 Apr 2018 20:30:49 +0000 (UTC) Konstantin Belousov wrote: > Author: kib > Date: Fri Apr 13 20:30:49 2018 > New Revision: 332489 > URL: https://svnweb.freebsd.org/changeset/base/332489 > > Log: > i386 4/4G split. > > The change makes the user and kernel address spaces on i386 > independent, giving each almost the full 4G of usable virtual addresses > except for one PDE at top used for trampoline and per-CPU trampoline > stacks, and system structures that must be always mapped, namely IDT, > GDT, common TSS and LDT, and process-private TSS and LDT if allocated. Could this have broken the linux futex syscall? I have a linux program that gets stuck in linux_sys_futex and becomes unkillable. Note that the routines in sys/i386/linux/linux_support.s try to do atomic operations on user space addresses. From owner-svn-src-head@freebsd.org Sun Apr 22 19:26:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D6D1FB7D04; Sun, 22 Apr 2018 19:26:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB0DC83480; Sun, 22 Apr 2018 19:26:25 +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 w3MJQEZu079530 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 22 Apr 2018 22:26:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w3MJQEZu079530 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w3MJQErR079529; Sun, 22 Apr 2018 22:26:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Apr 2018 22:26:14 +0300 From: Konstantin Belousov To: Tijl Coosemans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332489 - in head: gnu/usr.bin/gdb/kgdb sys/conf sys/dev/dcons sys/dev/hyperv/vmbus/i386 sys/dev/ppc sys/dev/syscons sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/include/pc sys... Message-ID: <20180422192614.GW6887@kib.kiev.ua> References: <201804132030.w3DKUnFn050153@repo.freebsd.org> <20180422210656.29cb7d0a@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180422210656.29cb7d0a@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 19:26:26 -0000 On Sun, Apr 22, 2018 at 09:06:56PM +0200, Tijl Coosemans wrote: > On Fri, 13 Apr 2018 20:30:49 +0000 (UTC) Konstantin Belousov wrote: > > Author: kib > > Date: Fri Apr 13 20:30:49 2018 > > New Revision: 332489 > > URL: https://svnweb.freebsd.org/changeset/base/332489 > > > > Log: > > i386 4/4G split. > > > > The change makes the user and kernel address spaces on i386 > > independent, giving each almost the full 4G of usable virtual addresses > > except for one PDE at top used for trampoline and per-CPU trampoline > > stacks, and system structures that must be always mapped, namely IDT, > > GDT, common TSS and LDT, and process-private TSS and LDT if allocated. > > Could this have broken the linux futex syscall? I have a linux program > that gets stuck in linux_sys_futex and becomes unkillable. Note that the > routines in sys/i386/linux/linux_support.s try to do atomic operations on > user space addresses. Yes, it is quite possible. I will try to look next week. From owner-svn-src-head@freebsd.org Sun Apr 22 20:47:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E64DDFBC71E; Sun, 22 Apr 2018 20:47:16 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B8F872714; Sun, 22 Apr 2018 20:47:16 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91F241AB69; Sun, 22 Apr 2018 20:47:16 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3MKlGst093114; Sun, 22 Apr 2018 20:47:16 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3MKlG8s093112; Sun, 22 Apr 2018 20:47:16 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201804222047.w3MKlG8s093112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Sun, 22 Apr 2018 20:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332873 - in head: share/misc usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: in head: share/misc usr.bin/calendar/calendars X-SVN-Commit-Revision: 332873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 20:47:17 -0000 Author: bcran Date: Sun Apr 22 20:47:16 2018 New Revision: 332873 URL: https://svnweb.freebsd.org/changeset/base/332873 Log: Update account and given names in committers-src.dot and calendar.freebsd I have changed my given name from Bruce to Rebecca, and my FreeBSD account from brucec to bcran. Update committers-src.dot and calendar.freebsd to show these changes. Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D15125 Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Apr 22 17:56:39 2018 (r332872) +++ head/share/misc/committers-src.dot Sun Apr 22 20:47:16 2018 (r332873) @@ -122,6 +122,7 @@ avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18" avos [label="Andriy Voskoboinyk\navos@FreeBSD.org\n2015/09/24"] badger [label="Eric Badger\nbadger@FreeBSD.org\n2016/07/01"] bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"] +bcran [label="Rebecca Cran\nbcran@FreeBSD.org\n2010/01/29"] bde [label="Bruce Evans\nbde@FreeBSD.org\n1994/08/20"] bdrewery [label="Bryan Drewery\nbdrewery@FreeBSD.org\n2013/12/14"] benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"] @@ -130,7 +131,6 @@ bms [label="Bruce M Simpson\nbms@FreeBSD.org\n2003/08/ br [label="Ruslan Bukin\nbr@FreeBSD.org\n2013/09/02"] brian [label="Brian Somers\nbrian@FreeBSD.org\n1996/12/16"] brooks [label="Brooks Davis\nbrooks@FreeBSD.org\n2001/06/21"] -brucec [label="Bruce Cran\nbrucec@FreeBSD.org\n2010/01/29"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2006/02/28"] bruno [label="Bruno Ducrot\nbruno@FreeBSD.org\n2005/07/18"] bryanv [label="Bryan Venteicher\nbryanv@FreeBSD.org\n2012/11/03"] @@ -751,7 +751,7 @@ rpaulo -> jmmv rpaulo -> lidl rpaulo -> ngie -rrs -> brucec +rrs -> bcran rrs -> jchandra rrs -> tuexen Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sun Apr 22 17:56:39 2018 (r332872) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sun Apr 22 20:47:16 2018 (r332873) @@ -185,7 +185,7 @@ 05/13 Pete Fritchman born in Lansdale, Pennsylvania, United States, 1983 05/14 Tatsumi Hosokawa born in Tokyo, Japan, 1968 05/14 Shigeyuku Fukushima born in Osaka, Japan, 1974 -05/14 Bruce Cran born in Cambridge, United Kingdom, 1981 +05/14 Rebecca Cran born in Cambridge, United Kingdom, 1981 05/15 Hans Petter Selasky born in Flekkefjord, Norway, 1982 05/16 Johann Kois born in Wolfsberg, Austria, 1975 05/16 Marcus Alves Grando born in Florianopolis, Santa Catarina, Brazil, 1979 From owner-svn-src-head@freebsd.org Sun Apr 22 20:51:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A489AFBCAC5; Sun, 22 Apr 2018 20:51:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB813730DA; Sun, 22 Apr 2018 20:51: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 w3MKp3ik098408 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 22 Apr 2018 23:51:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w3MKp3ik098408 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w3MKp34B098407; Sun, 22 Apr 2018 23:51:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Apr 2018 23:51:03 +0300 From: Konstantin Belousov To: Tijl Coosemans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332489 - in head: gnu/usr.bin/gdb/kgdb sys/conf sys/dev/dcons sys/dev/hyperv/vmbus/i386 sys/dev/ppc sys/dev/syscons sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/include/pc sys... Message-ID: <20180422205103.GX6887@kib.kiev.ua> References: <201804132030.w3DKUnFn050153@repo.freebsd.org> <20180422210656.29cb7d0a@kalimero.tijl.coosemans.org> <20180422192614.GW6887@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180422192614.GW6887@kib.kiev.ua> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 20:51:18 -0000 On Sun, Apr 22, 2018 at 10:26:14PM +0300, Konstantin Belousov wrote: > On Sun, Apr 22, 2018 at 09:06:56PM +0200, Tijl Coosemans wrote: > > On Fri, 13 Apr 2018 20:30:49 +0000 (UTC) Konstantin Belousov wrote: > > Could this have broken the linux futex syscall? I have a linux program > > that gets stuck in linux_sys_futex and becomes unkillable. Note that the > > routines in sys/i386/linux/linux_support.s try to do atomic operations on > > user space addresses. > > Yes, it is quite possible. I will try to look next week. Try this. I only compile-tested it as a module. diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 7741983bcd3..a82672eaa4f 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -273,14 +273,6 @@ static int handle_futex_death(struct linux_emuldata *, uint32_t *, static int fetch_robust_entry(struct linux_robust_list **, struct linux_robust_list **, unsigned int *); -/* support.s */ -int futex_xchgl(int oparg, uint32_t *uaddr, int *oldval); -int futex_addl(int oparg, uint32_t *uaddr, int *oldval); -int futex_orl(int oparg, uint32_t *uaddr, int *oldval); -int futex_andl(int oparg, uint32_t *uaddr, int *oldval); -int futex_xorl(int oparg, uint32_t *uaddr, int *oldval); - - static int futex_copyin_timeout(int op, struct l_timespec *luts, int clockrt, struct timespec *ts) diff --git a/sys/compat/linux/linux_futex.h b/sys/compat/linux/linux_futex.h index d5798e91560..4171dd70504 100644 --- a/sys/compat/linux/linux_futex.h +++ b/sys/compat/linux/linux_futex.h @@ -78,6 +78,11 @@ extern struct mtx futex_mtx; #define FUTEX_TID_MASK 0x3fffffff #define FUTEX_BITSET_MATCH_ANY 0xffffffff +int futex_xchgl(int oparg, uint32_t *uaddr, int *oldval); +int futex_addl(int oparg, uint32_t *uaddr, int *oldval); +int futex_orl(int oparg, uint32_t *uaddr, int *oldval); +int futex_andl(int oparg, uint32_t *uaddr, int *oldval); +int futex_xorl(int oparg, uint32_t *uaddr, int *oldval); void release_futexes(struct thread *, struct linux_emuldata *); diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index ab48a533893..9fe32a20eb6 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -536,11 +536,10 @@ i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/linux/imgact_linux.c optional compat_linux +i386/linux/linux_copyout.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux -i386/linux/linux_support.s optional compat_linux \ - dependency "linux_assym.h" i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux i386/pci/pci_cfgreg.c optional pci diff --git a/sys/i386/i386/copyout.c b/sys/i386/i386/copyout.c index 3767ff9e54b..9d855eea70e 100644 --- a/sys/i386/i386/copyout.c +++ b/sys/i386/i386/copyout.c @@ -97,7 +97,7 @@ copyout_init_tramp(void) (uintptr_t)suword_fast + setidt_disp); } -static int +int cp_slow0(vm_offset_t uva, size_t len, bool write, void (*f)(vm_offset_t, void *), void *arg) { diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 828b633067d..73c3cba069f 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -55,6 +55,8 @@ struct segment_descriptor; union savefpu; void bcopyb(const void *from, void *to, size_t len); +int cp_slow0(vm_offset_t uva, size_t len, bool write, + void (*f)(vm_offset_t, void *), void *arg); void cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs)); void copyout_init_tramp(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); diff --git a/sys/i386/linux/linux_copyout.c b/sys/i386/linux/linux_copyout.c new file mode 100644 index 00000000000..6bb8165ddd9 --- /dev/null +++ b/sys/i386/linux/linux_copyout.c @@ -0,0 +1,193 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 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_compat.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +struct futex_st0 { + int oparg; + int *oldval; +}; + +static void +futex_xchgl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + + st = arg; + *st->oldval = atomic_swap_int((int *)kva, st->oparg); +} + +int +futex_xchgl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + if ((uintptr_t)uaddr + sizeof(uint32_t) < (uintptr_t)uaddr || + (uintptr_t)uaddr + sizeof(uint32_t) > VM_MAXUSER_ADDRESS) + return (-EFAULT); + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_xchgl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} + +static void +futex_addl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + + st = arg; + *st->oldval = atomic_fetchadd_int((int *)kva, st->oparg); +} + +int +futex_addl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + if ((uintptr_t)uaddr + sizeof(uint32_t) < (uintptr_t)uaddr || + (uintptr_t)uaddr + sizeof(uint32_t) > VM_MAXUSER_ADDRESS) + return (-EFAULT); + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_addl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} + +static void +futex_orl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + int old; + + st = arg; + old = *(int *)kva; + while (!atomic_fcmpset_int((int *)kva, &old, old | st->oparg)) + ; + *st->oldval = old; +} + +int +futex_orl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + if ((uintptr_t)uaddr + sizeof(uint32_t) < (uintptr_t)uaddr || + (uintptr_t)uaddr + sizeof(uint32_t) > VM_MAXUSER_ADDRESS) + return (-EFAULT); + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_orl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} + +static void +futex_andl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + int old; + + st = arg; + old = *(int *)kva; + while (!atomic_fcmpset_int((int *)kva, &old, old & st->oparg)) + ; + *st->oldval = old; +} + +int +futex_andl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + if ((uintptr_t)uaddr + sizeof(uint32_t) < (uintptr_t)uaddr || + (uintptr_t)uaddr + sizeof(uint32_t) > VM_MAXUSER_ADDRESS) + return (-EFAULT); + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_andl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} + +static void +futex_xorl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + int old; + + st = arg; + old = *(int *)kva; + while (!atomic_fcmpset_int((int *)kva, &old, old ^ st->oparg)) + ; + *st->oldval = old; +} + +int +futex_xorl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + if ((uintptr_t)uaddr + sizeof(uint32_t) < (uintptr_t)uaddr || + (uintptr_t)uaddr + sizeof(uint32_t) > VM_MAXUSER_ADDRESS) + return (-EFAULT); + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_xorl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} diff --git a/sys/i386/linux/linux_support.s b/sys/i386/linux/linux_support.s deleted file mode 100644 index fe49dd9effd..00000000000 --- a/sys/i386/linux/linux_support.s +++ /dev/null @@ -1,126 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 2006,2007 Konstantin Belousov - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "linux_assym.h" /* system definitions */ -#include /* miscellaneous asm macros */ - -#include "assym.inc" - -futex_fault_decx: - movl PCPU(CURPCB),%ecx -futex_fault: - movl $0,PCB_ONFAULT(%ecx) - movl $-EFAULT,%eax - ret - -ENTRY(futex_xchgl) - movl PCPU(CURPCB),%ecx - movl $futex_fault,PCB_ONFAULT(%ecx) - movl 4(%esp),%eax - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault - xchgl %eax,(%edx) - movl 12(%esp),%edx - movl %eax,(%edx) - xorl %eax,%eax - movl %eax,PCB_ONFAULT(%ecx) - ret - -ENTRY(futex_addl) - movl PCPU(CURPCB),%ecx - movl $futex_fault,PCB_ONFAULT(%ecx) - movl 4(%esp),%eax - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault -#ifdef SMP - lock -#endif - xaddl %eax,(%edx) - movl 12(%esp),%edx - movl %eax,(%edx) - xorl %eax,%eax - movl %eax,PCB_ONFAULT(%ecx) - ret - -ENTRY(futex_orl) - movl PCPU(CURPCB),%ecx - movl $futex_fault_decx,PCB_ONFAULT(%ecx) - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault - movl (%edx),%eax -1: movl %eax,%ecx - orl 4(%esp),%ecx -#ifdef SMP - lock -#endif - cmpxchgl %ecx,(%edx) - jnz 1b -futex_tail: - movl 12(%esp),%edx - movl %eax,(%edx) - xorl %eax,%eax - movl PCPU(CURPCB),%ecx - movl %eax,PCB_ONFAULT(%ecx) - ret - -ENTRY(futex_andl) - movl PCPU(CURPCB),%ecx - movl $futex_fault_decx,PCB_ONFAULT(%ecx) - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault - movl (%edx),%eax -1: movl %eax,%ecx - andl 4(%esp),%ecx -#ifdef SMP - lock -#endif - cmpxchgl %ecx,(%edx) - jnz 1b - jmp futex_tail - -ENTRY(futex_xorl) - movl PCPU(CURPCB),%ecx - movl $futex_fault_decx,PCB_ONFAULT(%ecx) - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault - movl (%edx),%eax -1: movl %eax,%ecx - xorl 4(%esp),%ecx -#ifdef SMP - lock -#endif - cmpxchgl %ecx,(%edx) - jnz 1b - jmp futex_tail diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 4055fcb3c8a..e49b8da15a9 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -17,8 +17,12 @@ SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c linux_event.c \ linux${SFX}_sysvec.c linux_uid16.c linux_time.c \ linux_timer.c linux_vdso.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ - device_if.h bus_if.h \ - linux${SFX}_support.s + device_if.h bus_if.h +.if ${MACHINE_CPUARCH} == "amd64" +SRCS+= linux${SFX}_support.s +.else +SRCS+= linux_copyout.c +.endif DPSRCS= assym.inc linux${SFX}_genassym.c # XXX: for assym.inc @@ -56,11 +60,11 @@ linux${SFX}_locore.o: linux${SFX}_assym.h assym.inc -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-warn-common \ ${.IMPSRC} -o ${.TARGET} +.if ${MACHINE_CPUARCH} == "amd64" linux${SFX}_support.o: linux${SFX}_assym.h assym.inc ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} -.if ${MACHINE_CPUARCH} == "amd64" ${VDSO}.so: linux${SFX}_locore.o ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \ --binary-architecture i386 linux${SFX}_locore.o ${.TARGET} From owner-svn-src-head@freebsd.org Sun Apr 22 21:28:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2611CF910BA; Sun, 22 Apr 2018 21:28:00 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0BBA7BB4D; Sun, 22 Apr 2018 21:27:59 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBCDF1B1AF; Sun, 22 Apr 2018 21:27:59 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3MLRxPR013063; Sun, 22 Apr 2018 21:27:59 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3MLRx7p013062; Sun, 22 Apr 2018 21:27:59 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201804222127.w3MLRx7p013062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Sun, 22 Apr 2018 21:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332874 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 332874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 21:28:00 -0000 Author: bcran Date: Sun Apr 22 21:27:59 2018 New Revision: 332874 URL: https://svnweb.freebsd.org/changeset/base/332874 Log: Update committers-src.dot to show the mentorship arrangement for myself: eadler has agreed to mentor me. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Apr 22 20:47:16 2018 (r332873) +++ head/share/misc/committers-src.dot Sun Apr 22 21:27:59 2018 (r332874) @@ -476,6 +476,8 @@ dwmalone -> fanf dwmalone -> peadar dwmalone -> snb +eadler -> bcran + ed -> dim ed -> gavin ed -> jilles @@ -751,7 +753,6 @@ rpaulo -> jmmv rpaulo -> lidl rpaulo -> ngie -rrs -> bcran rrs -> jchandra rrs -> tuexen From owner-svn-src-head@freebsd.org Sun Apr 22 23:10:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28AEBFA6DFE; Sun, 22 Apr 2018 23:10:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C86B6E5A2; Sun, 22 Apr 2018 23:10:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 756CD1C154; Sun, 22 Apr 2018 23:10:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3MNAbJ5063679; Sun, 22 Apr 2018 23:10:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3MNAblU063678; Sun, 22 Apr 2018 23:10:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804222310.w3MNAblU063678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 22 Apr 2018 23:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332875 - head/usr.sbin/pwd_mkdb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/pwd_mkdb X-SVN-Commit-Revision: 332875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 23:10:38 -0000 Author: emaste Date: Sun Apr 22 23:10:37 2018 New Revision: 332875 URL: https://svnweb.freebsd.org/changeset/base/332875 Log: pwd_mkdb: add deprecation notice in manpage too Followon to r332789; as reported on the -current and -stable lists and in review D15144 the -l option will be removed before FreeBSD 12.0. Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.8 ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Sun Apr 22 21:27:59 2018 (r332874) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.8 Sun Apr 22 23:10:37 2018 (r332875) @@ -28,7 +28,7 @@ .\" @(#)pwd_mkdb.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 5, 2014 +.Dd April 22, 2018 .Dt PWD_MKDB 8 .Os .Sh NAME @@ -129,6 +129,11 @@ which enables generation of legacy format .Pq v3 entries. The legacy format entries are endianness dependent. +The +.Fl l +option is deprecated and is not present in +.Fx 12.0 +and later. .Pp The following options may be specified and will affect the generation of legacy entries. From owner-svn-src-head@freebsd.org Sun Apr 22 23:51:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6993FA9989; Sun, 22 Apr 2018 23:51:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 591E876FEB; Sun, 22 Apr 2018 23:51:24 +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 540301C8C6; Sun, 22 Apr 2018 23:51:24 +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 w3MNpOIK082834; Sun, 22 Apr 2018 23:51:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3MNpOfb082833; Sun, 22 Apr 2018 23:51:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804222351.w3MNpOfb082833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 22 Apr 2018 23:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332876 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 23:51:24 -0000 Author: kevans Date: Sun Apr 22 23:51:24 2018 New Revision: 332876 URL: https://svnweb.freebsd.org/changeset/base/332876 Log: bsdgrep: Fix build failure WITHOUT_LZMA (incorrect bracket placement) Submitted by: sbruno Reported by: sbruno Modified: head/usr.bin/grep/file.c Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Sun Apr 22 23:10:37 2018 (r332875) +++ head/usr.bin/grep/file.c Sun Apr 22 23:51:24 2018 (r332876) @@ -337,8 +337,8 @@ grep_open(const char *path) lstrm.avail_out = MAXBUFSIZ; laction = LZMA_RUN; break; - } #endif + } /* Fill read buffer, also catches errors early */ if (bufrem == 0 && grep_refill(f) != 0) From owner-svn-src-head@freebsd.org Mon Apr 23 00:27:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B6D7FAC25C; Mon, 23 Apr 2018 00:27:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 057437E2F8; Mon, 23 Apr 2018 00:27:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id e20-v6so8650638itc.1; Sun, 22 Apr 2018 17:27:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=jZsboZvaYrb5vR8iukJ0KjaJ1eZrBruODEgTjNXAZPI=; b=gZ/xew5Fm6EDi+sB/NT7QH7wleD0X16ULARDyeJngLbifxnOKxsDQZ1cqtD5EOEZGH 3GmmS4PWzrAIZN87yn9FWVYWRjAWlvXFoQTtZzfao2MYOtOvoz1BRaLA8GfNASZ9Bo94 v6GqRJb8rBT4iGjcpsvsqlMeCqVrGwndkP38yN+zXcHp2TR5UcsWY9gIeAhlToKLjfHq mQvzn9ZRwaFgArPVoF09f1cDCJmsF8xrfoOoJe3DFDupb8cKotLKCFAbZaMxEtyLtDGy rOspj/Sag8K/u4Gni8Y1CDPK6DSEm/GIXDJ4CO3ba6bw9c6wRpA4bJmRQ6+3HAmm8KXj i7IQ== X-Gm-Message-State: ALQs6tBu1HxODv/YzixhojrVKddafdBUGebGmi78QIbq1CsdoO4ICsZr mwqReCofRwFVj90cUSM2xZxsSCMx X-Google-Smtp-Source: AB8JxZrbHsm9feBLpHqFROlu1Ahnb3bxka8nNIkq5JTuPiltbHIXx13+UyBzGA4RM0Fv6eM6YptWhQ== X-Received: by 2002:a24:7801:: with SMTP id p1-v6mr10355306itc.20.1524442818081; Sun, 22 Apr 2018 17:20:18 -0700 (PDT) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com. [209.85.214.41]) by smtp.gmail.com with ESMTPSA id z7-v6sm3436116itd.41.2018.04.22.17.20.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Apr 2018 17:20:17 -0700 (PDT) Received: by mail-it0-f41.google.com with SMTP id l83-v6so8791469ita.5; Sun, 22 Apr 2018 17:20:17 -0700 (PDT) X-Received: by 2002:a24:4090:: with SMTP id n138-v6mr12301076ita.135.1524442817395; Sun, 22 Apr 2018 17:20:17 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:224d:0:0:0:0:0 with HTTP; Sun, 22 Apr 2018 17:20:16 -0700 (PDT) In-Reply-To: <201804192025.w3JKPKPx014424@repo.freebsd.org> References: <201804192025.w3JKPKPx014424@repo.freebsd.org> From: Conrad Meyer Date: Sun, 22 Apr 2018 17:20:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332789 - head/usr.sbin/pwd_mkdb To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 00:27:46 -0000 Maybe Relnotes: yes? On Thu, Apr 19, 2018 at 1:25 PM, Ed Maste wrote: > Author: emaste > Date: Thu Apr 19 20:25:19 2018 > New Revision: 332789 > URL: https://svnweb.freebsd.org/changeset/base/332789 > > Log: > pwd_mkdb: warn that legacy support is deprecated (if specified) > > r283981 switched pwd_mkdb to emit only v4 database entries by default, > and introduced a -l (legacy) option emit v3 entries in addition. The > commit message claims that legacy support will be removed in 12.0, so > emit a warning now if it is used. > > Modified: > head/usr.sbin/pwd_mkdb/pwd_mkdb.c > > Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c > ============================================================================== > --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Apr 19 18:34:38 2018 (r332788) > +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Thu Apr 19 20:25:19 2018 (r332789) > @@ -166,6 +166,8 @@ main(int argc, char *argv[]) > > if (argc != 1 || (username && (*username == '+' || *username == '-'))) > usage(); > + if (lflag) > + warnx("legacy (v3) database format support is deprecated"); > > /* > * This could be changed to allow the user to interrupt. > From owner-svn-src-head@freebsd.org Mon Apr 23 07:15:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 186C8FA0A47; Mon, 23 Apr 2018 07:15:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1DC373257; Mon, 23 Apr 2018 07:15:49 +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 B829520EB8; Mon, 23 Apr 2018 07:15:49 +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 w3N7Fngr006129; Mon, 23 Apr 2018 07:15:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N7FnJk006128; Mon, 23 Apr 2018 07:15:49 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201804230715.w3N7FnJk006128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 23 Apr 2018 07:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332877 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 332877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 07:15:50 -0000 Author: delphij Date: Mon Apr 23 07:15:49 2018 New Revision: 332877 URL: https://svnweb.freebsd.org/changeset/base/332877 Log: Correct size for allocation and bzero of fdsr. MFC after: 2 weeks Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sun Apr 22 23:51:24 2018 (r332876) +++ head/usr.sbin/syslogd/syslogd.c Mon Apr 23 07:15:49 2018 (r332877) @@ -744,7 +744,7 @@ main(int argc, char *argv[]) fdsrmax = sl->sl_socket; } fdsr = (fd_set *)calloc(howmany(fdsrmax+1, NFDBITS), - sizeof(fd_mask)); + sizeof(*fdsr)); if (fdsr == NULL) errx(1, "calloc fd_set"); @@ -763,7 +763,7 @@ main(int argc, char *argv[]) } bzero(fdsr, howmany(fdsrmax+1, NFDBITS) * - sizeof(fd_mask)); + sizeof(*fdsr)); STAILQ_FOREACH(sl, &shead, next) { if (sl->sl_socket != -1 && sl->sl_recv != NULL) From owner-svn-src-head@freebsd.org Mon Apr 23 07:51:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0848FA3C5B; Mon, 23 Apr 2018 07:51:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F70A79AD0; Mon, 23 Apr 2018 07:51:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A559213BE; Mon, 23 Apr 2018 07:51:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3N7pJvj024164; Mon, 23 Apr 2018 07:51:19 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N7pJ3V024163; Mon, 23 Apr 2018 07:51:19 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804230751.w3N7pJ3V024163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Apr 2018 07:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332878 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 07:51:20 -0000 Author: mjg Date: Mon Apr 23 07:51:19 2018 New Revision: 332878 URL: https://svnweb.freebsd.org/changeset/base/332878 Log: lockf: free state only when recycling the vnode This avoids malloc/free cycles when locking/unlocking the vnode when nobody is contending. Tested by: pho Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Mon Apr 23 07:15:49 2018 (r332877) +++ head/sys/kern/kern_lockf.c Mon Apr 23 07:51:19 2018 (r332878) @@ -412,7 +412,7 @@ int lf_advlockasync(struct vop_advlockasync_args *ap, struct lockf **statep, u_quad_t size) { - struct lockf *state, *freestate = NULL; + struct lockf *state; struct flock *fl = ap->a_fl; struct lockf_entry *lock; struct vnode *vp = ap->a_vp; @@ -721,38 +721,17 @@ retry_setlock: #endif sx_xunlock(&state->ls_lock); - /* - * If we have removed the last active lock on the vnode and - * this is the last thread that was in-progress, we can free - * the state structure. We update the caller's pointer inside - * the vnode interlock but call free outside. - * - * XXX alternatively, keep the state structure around until - * the filesystem recycles - requires a callback from the - * filesystem. - */ VI_LOCK(vp); state->ls_threads--; wakeup(state); if (LIST_EMPTY(&state->ls_active) && state->ls_threads == 0) { KASSERT(LIST_EMPTY(&state->ls_pending), - ("freeing state with pending locks")); - freestate = state; - *statep = NULL; + ("freeable state with pending locks")); } VI_UNLOCK(vp); - if (freestate != NULL) { - sx_xlock(&lf_lock_states_lock); - LIST_REMOVE(freestate, ls_link); - sx_xunlock(&lf_lock_states_lock); - sx_destroy(&freestate->ls_lock); - free(freestate, M_LOCKF); - freestate = NULL; - } - if (error == EDOOFUS) { KASSERT(ap->a_op == F_SETLK, ("EDOOFUS")); goto retry_setlock; @@ -793,62 +772,62 @@ lf_purgelocks(struct vnode *vp, struct lockf **statep) KASSERT(vp->v_iflag & VI_DOOMED, ("lf_purgelocks: vp %p has not vgone yet", vp)); state = *statep; - if (state) { - *statep = NULL; - state->ls_threads++; + if (state == NULL) { VI_UNLOCK(vp); + return; + } + *statep = NULL; + state->ls_threads++; + VI_UNLOCK(vp); - sx_xlock(&state->ls_lock); - sx_xlock(&lf_owner_graph_lock); - LIST_FOREACH_SAFE(lock, &state->ls_pending, lf_link, nlock) { - LIST_REMOVE(lock, lf_link); - lf_remove_outgoing(lock); - lf_remove_incoming(lock); + sx_xlock(&state->ls_lock); + sx_xlock(&lf_owner_graph_lock); + LIST_FOREACH_SAFE(lock, &state->ls_pending, lf_link, nlock) { + LIST_REMOVE(lock, lf_link); + lf_remove_outgoing(lock); + lf_remove_incoming(lock); - /* - * If its an async lock, we can just free it - * here, otherwise we let the sleeping thread - * free it. - */ - if (lock->lf_async_task) { - lf_free_lock(lock); - } else { - lock->lf_flags |= F_INTR; - wakeup(lock); - } - } - sx_xunlock(&lf_owner_graph_lock); - sx_xunlock(&state->ls_lock); - /* - * Wait for all other threads, sleeping and otherwise - * to leave. + * If its an async lock, we can just free it + * here, otherwise we let the sleeping thread + * free it. */ - VI_LOCK(vp); - while (state->ls_threads > 1) - msleep(state, VI_MTX(vp), 0, "purgelocks", 0); - VI_UNLOCK(vp); - - /* - * We can just free all the active locks since they - * will have no dependencies (we removed them all - * above). We don't need to bother locking since we - * are the last thread using this state structure. - */ - KASSERT(LIST_EMPTY(&state->ls_pending), - ("lock pending for %p", state)); - LIST_FOREACH_SAFE(lock, &state->ls_active, lf_link, nlock) { - LIST_REMOVE(lock, lf_link); + if (lock->lf_async_task) { lf_free_lock(lock); + } else { + lock->lf_flags |= F_INTR; + wakeup(lock); } - sx_xlock(&lf_lock_states_lock); - LIST_REMOVE(state, ls_link); - sx_xunlock(&lf_lock_states_lock); - sx_destroy(&state->ls_lock); - free(state, M_LOCKF); - } else { - VI_UNLOCK(vp); } + sx_xunlock(&lf_owner_graph_lock); + sx_xunlock(&state->ls_lock); + + /* + * Wait for all other threads, sleeping and otherwise + * to leave. + */ + VI_LOCK(vp); + while (state->ls_threads > 1) + msleep(state, VI_MTX(vp), 0, "purgelocks", 0); + VI_UNLOCK(vp); + + /* + * We can just free all the active locks since they + * will have no dependencies (we removed them all + * above). We don't need to bother locking since we + * are the last thread using this state structure. + */ + KASSERT(LIST_EMPTY(&state->ls_pending), + ("lock pending for %p", state)); + LIST_FOREACH_SAFE(lock, &state->ls_active, lf_link, nlock) { + LIST_REMOVE(lock, lf_link); + lf_free_lock(lock); + } + sx_xlock(&lf_lock_states_lock); + LIST_REMOVE(state, ls_link); + sx_xunlock(&lf_lock_states_lock); + sx_destroy(&state->ls_lock); + free(state, M_LOCKF); } /* From owner-svn-src-head@freebsd.org Mon Apr 23 07:52:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66EE9FA3E9E; Mon, 23 Apr 2018 07:52:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 171E779DEA; Mon, 23 Apr 2018 07:52:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1230B214E7; Mon, 23 Apr 2018 07:52:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3N7qAGu026666; Mon, 23 Apr 2018 07:52:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N7qAq5026665; Mon, 23 Apr 2018 07:52:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804230752.w3N7qAq5026665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Apr 2018 07:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332879 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 07:52:11 -0000 Author: mjg Date: Mon Apr 23 07:52:10 2018 New Revision: 332879 URL: https://svnweb.freebsd.org/changeset/base/332879 Log: lockf: skip the hard work in lf_purgelocks if possible Tested by: pho Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Mon Apr 23 07:51:19 2018 (r332878) +++ head/sys/kern/kern_lockf.c Mon Apr 23 07:52:10 2018 (r332879) @@ -777,6 +777,12 @@ lf_purgelocks(struct vnode *vp, struct lockf **statep) return; } *statep = NULL; + if (LIST_EMPTY(&state->ls_active) && state->ls_threads == 0) { + KASSERT(LIST_EMPTY(&state->ls_pending), + ("freeing state with pending locks")); + VI_UNLOCK(vp); + goto out_free; + } state->ls_threads++; VI_UNLOCK(vp); @@ -823,6 +829,7 @@ lf_purgelocks(struct vnode *vp, struct lockf **statep) LIST_REMOVE(lock, lf_link); lf_free_lock(lock); } +out_free: sx_xlock(&lf_lock_states_lock); LIST_REMOVE(state, ls_link); sx_xunlock(&lf_lock_states_lock); From owner-svn-src-head@freebsd.org Mon Apr 23 07:52:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B522FA4174; Mon, 23 Apr 2018 07:52:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C43027A03A; Mon, 23 Apr 2018 07:52:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF29621506; Mon, 23 Apr 2018 07:52:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3N7qu2K026755; Mon, 23 Apr 2018 07:52:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N7quS8026754; Mon, 23 Apr 2018 07:52:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804230752.w3N7quS8026754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Apr 2018 07:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332880 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 07:52:57 -0000 Author: mjg Date: Mon Apr 23 07:52:56 2018 New Revision: 332880 URL: https://svnweb.freebsd.org/changeset/base/332880 Log: lockf: perform wakeup onlly when there is anybody waiting Tested by: pho Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Mon Apr 23 07:52:10 2018 (r332879) +++ head/sys/kern/kern_lockf.c Mon Apr 23 07:52:56 2018 (r332880) @@ -724,10 +724,11 @@ retry_setlock: VI_LOCK(vp); state->ls_threads--; - wakeup(state); if (LIST_EMPTY(&state->ls_active) && state->ls_threads == 0) { KASSERT(LIST_EMPTY(&state->ls_pending), ("freeable state with pending locks")); + } else { + wakeup(state); } VI_UNLOCK(vp); From owner-svn-src-head@freebsd.org Mon Apr 23 07:54:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AF8CFA43F4; Mon, 23 Apr 2018 07:54:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5B9C7A2A1; Mon, 23 Apr 2018 07:54:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B09BC21508; Mon, 23 Apr 2018 07:54:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3N7s2tB026837; Mon, 23 Apr 2018 07:54:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N7s2o3026836; Mon, 23 Apr 2018 07:54:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804230754.w3N7s2o3026836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Apr 2018 07:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332881 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 07:54:03 -0000 Author: mjg Date: Mon Apr 23 07:54:02 2018 New Revision: 332881 URL: https://svnweb.freebsd.org/changeset/base/332881 Log: lockf: skip locking the graph if not necessary (common case) Tested by: pho Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Mon Apr 23 07:52:56 2018 (r332880) +++ head/sys/kern/kern_lockf.c Mon Apr 23 07:54:02 2018 (r332881) @@ -1053,6 +1053,12 @@ lf_add_incoming(struct lockf *state, struct lockf_entr struct lockf_entry *overlap; int error; + sx_assert(&state->ls_lock, SX_XLOCKED); + if (LIST_EMPTY(&state->ls_pending)) + return (0); + + error = 0; + sx_xlock(&lf_owner_graph_lock); LIST_FOREACH(overlap, &state->ls_pending, lf_link) { if (!lf_blocks(lock, overlap)) continue; @@ -1070,10 +1076,11 @@ lf_add_incoming(struct lockf *state, struct lockf_entr */ if (error) { lf_remove_incoming(lock); - return (error); + break; } } - return (0); + sx_xunlock(&lf_owner_graph_lock); + return (error); } /* @@ -1509,9 +1516,7 @@ lf_setlock(struct lockf *state, struct lockf_entry *lo * edges from any currently pending lock that the new lock * would block. */ - sx_xlock(&lf_owner_graph_lock); error = lf_add_incoming(state, lock); - sx_xunlock(&lf_owner_graph_lock); if (error) { #ifdef LOCKF_DEBUG if (lockf_debug & 1) @@ -1840,9 +1845,7 @@ lf_split(struct lockf *state, struct lockf_entry *lock splitlock->lf_start = lock2->lf_end + 1; LIST_INIT(&splitlock->lf_outedges); LIST_INIT(&splitlock->lf_inedges); - sx_xlock(&lf_owner_graph_lock); lf_add_incoming(state, splitlock); - sx_xunlock(&lf_owner_graph_lock); lf_set_end(state, lock1, lock2->lf_start - 1, granted); From owner-svn-src-head@freebsd.org Mon Apr 23 08:23:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53F73FA6EC3; Mon, 23 Apr 2018 08:23:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09D3280CAF; Mon, 23 Apr 2018 08:23:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04909219DF; Mon, 23 Apr 2018 08:23:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3N8NAWG042320; Mon, 23 Apr 2018 08:23:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N8NAOI042319; Mon, 23 Apr 2018 08:23:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804230823.w3N8NAOI042319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Apr 2018 08:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332882 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 08:23:11 -0000 Author: mjg Date: Mon Apr 23 08:23:10 2018 New Revision: 332882 URL: https://svnweb.freebsd.org/changeset/base/332882 Log: lockf: add per-chain locks to the owner hash This combined with previous changes significantly depessimizes the behaviour under contentnion. In particular the lock1_processes test (locking/unlocking separate files) from the will-it-scale suite was executed with 128 concurrency on a 4-socket Broadwell with 128 hardware threads. Operations/second (lock+unlock) go from ~750000 to ~45000000 (6000%) For reference single-process is ~1680000 (i.e. on stock kernel the resulting perf is less than *half* of the single-threaded run), Note this still does not really scale all that well as the locks were just bolted on top of the current implementation. Significant room for improvement is still here. In particular the top performance fluctuates depending on the extent of false sharing in given run (which extends beyond the file). Added chain+lock pairs were not padded w.r.t. cacheline size. One big ticket item is the hash used for spreading threads: it used to be the process pid (which basically serialized all threaded ops). Temporarily the vnode addr was slapped in instead. Tested by: pho Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Mon Apr 23 07:54:02 2018 (r332881) +++ head/sys/kern/kern_lockf.c Mon Apr 23 08:23:10 2018 (r332882) @@ -188,7 +188,6 @@ static void lf_print_owner(struct lock_owner *); * Locks: * (s) locked by state->ls_lock * (S) locked by lf_lock_states_lock - * (l) locked by lf_lock_owners_lock * (g) locked by lf_owner_graph_lock * (c) const until freeing */ @@ -201,15 +200,20 @@ struct lock_owner { caddr_t lo_id; /* (c) Id value passed to lf_advlock */ pid_t lo_pid; /* (c) Process Id of the lock owner */ int lo_sysid; /* (c) System Id of the lock owner */ + int lo_hash; /* (c) Used to lock the appropriate chain */ struct owner_vertex *lo_vertex; /* (g) entry in deadlock graph */ }; LIST_HEAD(lock_owner_list, lock_owner); +struct lock_owner_chain { + struct sx lock; + struct lock_owner_list list; +}; + static struct sx lf_lock_states_lock; static struct lockf_list lf_lock_states; /* (S) */ -static struct sx lf_lock_owners_lock; -static struct lock_owner_list lf_lock_owners[LOCK_OWNER_HASH_SIZE]; /* (l) */ +static struct lock_owner_chain lf_lock_owners[LOCK_OWNER_HASH_SIZE]; /* * Structures for deadlock detection. @@ -283,9 +287,10 @@ lf_init(void *dummy) sx_init(&lf_lock_states_lock, "lock states lock"); LIST_INIT(&lf_lock_states); - sx_init(&lf_lock_owners_lock, "lock owners lock"); - for (i = 0; i < LOCK_OWNER_HASH_SIZE; i++) - LIST_INIT(&lf_lock_owners[i]); + for (i = 0; i < LOCK_OWNER_HASH_SIZE; i++) { + sx_init(&lf_lock_owners[i].lock, "lock owners lock"); + LIST_INIT(&lf_lock_owners[i].list); + } sx_init(&lf_owner_graph_lock, "owner graph lock"); graph_init(&lf_owner_graph); @@ -342,9 +347,9 @@ lf_alloc_lock(struct lock_owner *lo) printf("Allocated lock %p\n", lf); #endif if (lo) { - sx_xlock(&lf_lock_owners_lock); + sx_xlock(&lf_lock_owners[lo->lo_hash].lock); lo->lo_refs++; - sx_xunlock(&lf_lock_owners_lock); + sx_xunlock(&lf_lock_owners[lo->lo_hash].lock); lf->lf_owner = lo; } @@ -354,6 +359,7 @@ lf_alloc_lock(struct lock_owner *lo) static int lf_free_lock(struct lockf_entry *lock) { + struct sx *chainlock; KASSERT(lock->lf_refs > 0, ("lockf_entry negative ref count %p", lock)); if (--lock->lf_refs > 0) @@ -369,7 +375,8 @@ lf_free_lock(struct lockf_entry *lock) ("freeing lock with dependencies")); KASSERT(LIST_EMPTY(&lock->lf_inedges), ("freeing lock with dependants")); - sx_xlock(&lf_lock_owners_lock); + chainlock = &lf_lock_owners[lo->lo_hash].lock; + sx_xlock(chainlock); KASSERT(lo->lo_refs > 0, ("lock owner refcount")); lo->lo_refs--; if (lo->lo_refs == 0) { @@ -391,7 +398,7 @@ lf_free_lock(struct lockf_entry *lock) printf("Freed lock owner %p\n", lo); #endif } - sx_unlock(&lf_lock_owners_lock); + sx_unlock(chainlock); } if ((lock->lf_flags & F_REMOTE) && lock->lf_vnode) { vrele(lock->lf_vnode); @@ -494,8 +501,8 @@ retry_setlock: * if this is the first time we have seen this owner. */ hash = lf_hash_owner(id, fl, flags); - sx_xlock(&lf_lock_owners_lock); - LIST_FOREACH(lo, &lf_lock_owners[hash], lo_link) + sx_xlock(&lf_lock_owners[hash].lock); + LIST_FOREACH(lo, &lf_lock_owners[hash].list, lo_link) if (lf_owner_matches(lo, id, fl, flags)) break; if (!lo) { @@ -514,6 +521,7 @@ retry_setlock: lo->lo_refs = 1; lo->lo_flags = flags; lo->lo_id = id; + lo->lo_hash = hash; if (flags & F_REMOTE) { lo->lo_pid = fl->l_pid; lo->lo_sysid = fl->l_sysid; @@ -535,7 +543,7 @@ retry_setlock: } #endif - LIST_INSERT_HEAD(&lf_lock_owners[hash], lo, lo_link); + LIST_INSERT_HEAD(&lf_lock_owners[hash].list, lo, lo_link); } else { /* * We have seen this lock owner before, increase its @@ -544,7 +552,7 @@ retry_setlock: */ lo->lo_refs++; } - sx_xunlock(&lf_lock_owners_lock); + sx_xunlock(&lf_lock_owners[hash].lock); /* * Create the lockf structure. We initialise the lf_owner @@ -2016,12 +2024,13 @@ lf_countlocks(int sysid) int count; count = 0; - sx_xlock(&lf_lock_owners_lock); - for (i = 0; i < LOCK_OWNER_HASH_SIZE; i++) - LIST_FOREACH(lo, &lf_lock_owners[i], lo_link) + for (i = 0; i < LOCK_OWNER_HASH_SIZE; i++) { + sx_xlock(&lf_lock_owners[i].lock); + LIST_FOREACH(lo, &lf_lock_owners[i].list, lo_link) if (lo->lo_sysid == sysid) count += lo->lo_refs; - sx_xunlock(&lf_lock_owners_lock); + sx_xunlock(&lf_lock_owners[i].lock); + } return (count); } From owner-svn-src-head@freebsd.org Mon Apr 23 10:35:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69DC7FAFE46; Mon, 23 Apr 2018 10:35:01 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19E7676C15; Mon, 23 Apr 2018 10:35:01 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 107EA22E5E; Mon, 23 Apr 2018 10:35:01 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NAZ1xg007092; Mon, 23 Apr 2018 10:35:01 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NAZ0dg007086; Mon, 23 Apr 2018 10:35:00 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804231035.w3NAZ0dg007086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 23 Apr 2018 10:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332885 - in head/sys: conf dev/flash X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: conf dev/flash X-SVN-Commit-Revision: 332885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 10:35:01 -0000 Author: br Date: Mon Apr 23 10:35:00 2018 New Revision: 332885 URL: https://svnweb.freebsd.org/changeset/base/332885 Log: Add driver for Cadence Quad SPI Flash Controller found on Intel® Arria® 10 SoC. Cadence Quad SPI Flash is not generic SPI controller, but SPI flash controller, so don't use spibus here, instead provide quad spi flash interface. Since it is not on spibus, then mx25l flash device driver is not usable here, so provide new n25q flash device driver with quad spi flash interface. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10245 Added: head/sys/dev/flash/cqspi.c (contents, props changed) head/sys/dev/flash/cqspi.h (contents, props changed) head/sys/dev/flash/n25q.c (contents, props changed) head/sys/dev/flash/qspi_if.m (contents, props changed) Modified: head/sys/conf/files head/sys/dev/flash/mx25lreg.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Apr 23 09:01:25 2018 (r332884) +++ head/sys/conf/files Mon Apr 23 10:35:00 2018 (r332885) @@ -1762,7 +1762,7 @@ dev/fdt/fdt_clock_if.m optional fdt fdt_clock dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_pinctrl.c optional fdt fdt_pinctrl dev/fdt/fdt_pinctrl_if.m optional fdt fdt_pinctrl -dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand | fdt mx25l +dev/fdt/fdt_slicer.c optional fdt cfi | fdt nand | fdt mx25l | fdt n25q dev/fdt/fdt_static_dtb.S optional fdt fdt_dtb_static \ dependency "fdt_dtb_file" dev/fdt/simplebus.c optional fdt @@ -1781,7 +1781,10 @@ dev/firewire/if_fwip.c optional fwip dev/firewire/sbp.c optional sbp dev/firewire/sbp_targ.c optional sbp_targ dev/flash/at45d.c optional at45d +dev/flash/cqspi.c optional cqspi dev/flash/mx25l.c optional mx25l +dev/flash/n25q.c optional n25q +dev/flash/qspi_if.m optional cqspi | n25q dev/fxp/if_fxp.c optional fxp dev/fxp/inphy.c optional fxp dev/gem/if_gem.c optional gem @@ -3672,7 +3675,7 @@ geom/geom_disk.c standard geom/geom_dump.c standard geom/geom_event.c standard geom/geom_fox.c optional geom_fox -geom/geom_flashmap.c optional fdt cfi | fdt nand | fdt mx25l | mmcsd +geom/geom_flashmap.c optional fdt cfi | fdt nand | fdt mx25l | mmcsd | fdt n25q geom/geom_io.c standard geom/geom_kern.c standard geom/geom_map.c optional geom_map Added: head/sys/dev/flash/cqspi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/flash/cqspi.c Mon Apr 23 10:35:00 2018 (r332885) @@ -0,0 +1,768 @@ +/*- + * Copyright (c) 2017-2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Cadence Quad SPI Flash Controller driver. + * 4B-addressing mode supported only. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "qspi_if.h" + +#define CQSPI_DEBUG +#undef CQSPI_DEBUG + +#ifdef CQSPI_DEBUG +#define dprintf(fmt, ...) printf(fmt, ##__VA_ARGS__) +#else +#define dprintf(fmt, ...) +#endif + +#define CQSPI_SECTORSIZE 512 +#define TX_QUEUE_SIZE 16 +#define RX_QUEUE_SIZE 16 + +#define READ4(_sc, _reg) bus_read_4((_sc)->res[0], _reg) +#define READ2(_sc, _reg) bus_read_2((_sc)->res[0], _reg) +#define READ1(_sc, _reg) bus_read_1((_sc)->res[0], _reg) +#define WRITE4(_sc, _reg, _val) bus_write_4((_sc)->res[0], _reg, _val) +#define WRITE2(_sc, _reg, _val) bus_write_2((_sc)->res[0], _reg, _val) +#define WRITE1(_sc, _reg, _val) bus_write_1((_sc)->res[0], _reg, _val) +#define READ_DATA_4(_sc, _reg) bus_read_4((_sc)->res[1], _reg) +#define READ_DATA_1(_sc, _reg) bus_read_1((_sc)->res[1], _reg) +#define WRITE_DATA_4(_sc, _reg, _val) bus_write_4((_sc)->res[1], _reg, _val) +#define WRITE_DATA_1(_sc, _reg, _val) bus_write_1((_sc)->res[1], _reg, _val) + +struct cqspi_softc { + device_t dev; + + struct resource *res[3]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + void *ih; + uint8_t read_op_done; + uint8_t write_op_done; + + uint32_t fifo_depth; + uint32_t fifo_width; + uint32_t trigger_address; + uint32_t sram_phys; + + /* xDMA */ + xdma_controller_t *xdma_tx; + xdma_channel_t *xchan_tx; + void *ih_tx; + + xdma_controller_t *xdma_rx; + xdma_channel_t *xchan_rx; + void *ih_rx; + + struct intr_config_hook config_intrhook; + struct mtx sc_mtx; +}; + +#define CQSPI_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define CQSPI_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define CQSPI_LOCK_INIT(_sc) \ + mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ + "cqspi", MTX_DEF) +#define CQSPI_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define CQSPI_ASSERT_LOCKED(_sc) \ + mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define CQSPI_ASSERT_UNLOCKED(_sc) \ + mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +static struct resource_spec cqspi_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static struct ofw_compat_data compat_data[] = { + { "cdns,qspi-nor", 1 }, + { NULL, 0 }, +}; + +static void +cqspi_intr(void *arg) +{ + struct cqspi_softc *sc; + uint32_t pending; + + sc = arg; + + pending = READ4(sc, CQSPI_IRQSTAT); + + dprintf("%s: IRQSTAT %x\n", __func__, pending); + + if (pending & (IRQMASK_INDOPDONE | IRQMASK_INDXFRLVL | + IRQMASK_INDSRAMFULL)) { + /* TODO: PIO operation done */ + } + + WRITE4(sc, CQSPI_IRQSTAT, pending); +} + +static int +cqspi_xdma_tx_intr(void *arg, xdma_transfer_status_t *status) +{ + struct xdma_transfer_status st; + struct cqspi_softc *sc; + struct bio *bp; + int ret; + int deq; + + sc = arg; + + dprintf("%s\n", __func__); + + deq = 0; + + while (1) { + ret = xdma_dequeue_bio(sc->xchan_tx, &bp, &st); + if (ret != 0) { + break; + } + sc->write_op_done = 1; + deq++; + } + + if (deq > 1) + device_printf(sc->dev, + "Warning: more than 1 tx bio dequeued\n"); + + wakeup(&sc->xdma_tx); + + return (0); +} + +static int +cqspi_xdma_rx_intr(void *arg, xdma_transfer_status_t *status) +{ + struct xdma_transfer_status st; + struct cqspi_softc *sc; + struct bio *bp; + int ret; + int deq; + + sc = arg; + + dprintf("%s\n", __func__); + + deq = 0; + + while (1) { + ret = xdma_dequeue_bio(sc->xchan_rx, &bp, &st); + if (ret != 0) { + break; + } + sc->read_op_done = 1; + deq++; + } + + if (deq > 1) + device_printf(sc->dev, + "Warning: more than 1 rx bio dequeued\n"); + + wakeup(&sc->xdma_rx); + + return (0); +} + +static int +cqspi_wait_for_completion(struct cqspi_softc *sc) +{ + int timeout; + int i; + + timeout = 10000; + + for (i = timeout; i > 0; i--) { + if ((READ4(sc, CQSPI_FLASHCMD) & FLASHCMD_CMDEXECSTAT) == 0) { + break; + } + } + + if (i == 0) { + device_printf(sc->dev, "%s: cmd timed out: %x\n", + __func__, READ4(sc, CQSPI_FLASHCMD)); + return (-1); + } + + return (0); +} + +static int +cqspi_cmd_write_addr(struct cqspi_softc *sc, uint8_t cmd, + uint32_t addr, uint32_t len) +{ + uint32_t reg; + int ret; + + dprintf("%s: %x\n", __func__, cmd); + + WRITE4(sc, CQSPI_FLASHCMDADDR, addr); + reg = (cmd << FLASHCMD_CMDOPCODE_S); + reg |= (FLASHCMD_ENCMDADDR); + reg |= ((len - 1) << FLASHCMD_NUMADDRBYTES_S); + WRITE4(sc, CQSPI_FLASHCMD, reg); + + reg |= FLASHCMD_EXECCMD; + WRITE4(sc, CQSPI_FLASHCMD, reg); + + ret = cqspi_wait_for_completion(sc); + + return (ret); +} + +static int +cqspi_cmd_write(struct cqspi_softc *sc, uint8_t cmd, + uint8_t *addr, uint32_t len) +{ + uint32_t reg; + int ret; + + reg = (cmd << FLASHCMD_CMDOPCODE_S); + WRITE4(sc, CQSPI_FLASHCMD, reg); + reg |= FLASHCMD_EXECCMD; + WRITE4(sc, CQSPI_FLASHCMD, reg); + + ret = cqspi_wait_for_completion(sc); + + return (ret); +} + +static int +cqspi_cmd_read(struct cqspi_softc *sc, uint8_t cmd, + uint8_t *addr, uint32_t len) +{ + uint32_t data; + uint32_t reg; + uint8_t *buf; + int ret; + int i; + + if (len > 8) { + device_printf(sc->dev, "Failed to read data\n"); + return (-1); + } + + dprintf("%s: %x\n", __func__, cmd); + + buf = (uint8_t *)addr; + + reg = (cmd << FLASHCMD_CMDOPCODE_S); + reg |= ((len - 1) << FLASHCMD_NUMRDDATABYTES_S); + reg |= FLASHCMD_ENRDDATA; + WRITE4(sc, CQSPI_FLASHCMD, reg); + + reg |= FLASHCMD_EXECCMD; + WRITE4(sc, CQSPI_FLASHCMD, reg); + + ret = cqspi_wait_for_completion(sc); + if (ret != 0) { + device_printf(sc->dev, "%s: cmd failed: %x\n", + __func__, cmd); + return (ret); + } + + data = READ4(sc, CQSPI_FLASHCMDRDDATALO); + + for (i = 0; i < len; i++) + buf[i] = (data >> (i * 8)) & 0xff; + + return (0); +} + +static int +cqspi_wait_ready(struct cqspi_softc *sc) +{ + uint8_t data; + int ret; + + do { + ret = cqspi_cmd_read(sc, CMD_READ_STATUS, &data, 1); + } while (data & STATUS_WIP); + + return (0); +} + +static int +cqspi_write_reg(device_t dev, device_t child, + uint8_t opcode, uint8_t *addr, uint32_t len) +{ + struct cqspi_softc *sc; + int ret; + + sc = device_get_softc(dev); + + ret = cqspi_cmd_write(sc, opcode, addr, len); + + return (ret); +} + +static int +cqspi_read_reg(device_t dev, device_t child, + uint8_t opcode, uint8_t *addr, uint32_t len) +{ + struct cqspi_softc *sc; + int ret; + + sc = device_get_softc(dev); + + ret = cqspi_cmd_read(sc, opcode, addr, len); + + return (ret); +} + +static int +cqspi_wait_idle(struct cqspi_softc *sc) +{ + uint32_t reg; + + do { + reg = READ4(sc, CQSPI_CFG); + if (reg & CFG_IDLE) { + break; + } + } while (1); + + return (0); +} + +static int +cqspi_erase(device_t dev, device_t child, off_t offset) +{ + struct cqspi_softc *sc; + int ret; + + sc = device_get_softc(dev); + + cqspi_wait_idle(sc); + cqspi_wait_ready(sc); + ret = cqspi_cmd_write(sc, CMD_WRITE_ENABLE, 0, 0); + + cqspi_wait_idle(sc); + cqspi_wait_ready(sc); + ret = cqspi_cmd_write_addr(sc, CMD_QUAD_SECTOR_ERASE, offset, 4); + + cqspi_wait_idle(sc); + + return (0); +} + +static int +cqspi_write(device_t dev, device_t child, struct bio *bp, + off_t offset, caddr_t data, off_t count) +{ + struct cqspi_softc *sc; + uint32_t reg; + + dprintf("%s: offset 0x%llx count %lld bytes\n", + __func__, offset, count); + + sc = device_get_softc(dev); + + cqspi_wait_ready(sc); + reg = cqspi_cmd_write(sc, CMD_WRITE_ENABLE, 0, 0); + + cqspi_wait_idle(sc); + cqspi_wait_ready(sc); + cqspi_wait_idle(sc); + + reg = DMAPER_NUMSGLREQBYTES_4; + reg |= DMAPER_NUMBURSTREQBYTES_4; + WRITE4(sc, CQSPI_DMAPER, reg); + + WRITE4(sc, CQSPI_INDWRWATER, 64); + WRITE4(sc, CQSPI_INDWR, INDRD_IND_OPS_DONE_STATUS); + WRITE4(sc, CQSPI_INDWR, 0); + + WRITE4(sc, CQSPI_INDWRCNT, count); + WRITE4(sc, CQSPI_INDWRSTADDR, offset); + + reg = (0 << DEVWR_DUMMYWRCLKS_S); + reg |= DEVWR_DATA_WIDTH_QUAD; + reg |= DEVWR_ADDR_WIDTH_SINGLE; + reg |= (CMD_QUAD_PAGE_PROGRAM << DEVWR_WROPCODE_S); + WRITE4(sc, CQSPI_DEVWR, reg); + + reg = DEVRD_DATA_WIDTH_QUAD; + reg |= DEVRD_ADDR_WIDTH_SINGLE; + reg |= DEVRD_INST_WIDTH_SINGLE; + WRITE4(sc, CQSPI_DEVRD, reg); + + xdma_enqueue_bio(sc->xchan_tx, &bp, + sc->sram_phys, 4, 4, XDMA_MEM_TO_DEV); + xdma_queue_submit(sc->xchan_tx); + + sc->write_op_done = 0; + + WRITE4(sc, CQSPI_INDWR, INDRD_START); + + while (sc->write_op_done == 0) + tsleep(&sc->xdma_tx, PCATCH | PZERO, "spi", hz/2); + + cqspi_wait_idle(sc); + + return (0); +} + +static int +cqspi_read(device_t dev, device_t child, struct bio *bp, + off_t offset, caddr_t data, off_t count) +{ + struct cqspi_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + dprintf("%s: offset 0x%llx count %lld bytes\n", + __func__, offset, count); + + cqspi_wait_idle(sc); + + reg = DMAPER_NUMSGLREQBYTES_4; + reg |= DMAPER_NUMBURSTREQBYTES_4; + WRITE4(sc, CQSPI_DMAPER, reg); + + WRITE4(sc, CQSPI_INDRDWATER, 64); + WRITE4(sc, CQSPI_INDRD, INDRD_IND_OPS_DONE_STATUS); + WRITE4(sc, CQSPI_INDRD, 0); + + WRITE4(sc, CQSPI_INDRDCNT, count); + WRITE4(sc, CQSPI_INDRDSTADDR, offset); + + reg = (0 << DEVRD_DUMMYRDCLKS_S); + reg |= DEVRD_DATA_WIDTH_QUAD; + reg |= DEVRD_ADDR_WIDTH_SINGLE; + reg |= DEVRD_INST_WIDTH_SINGLE; + reg |= DEVRD_ENMODEBITS; + reg |= (CMD_READ_4B_QUAD_OUTPUT << DEVRD_RDOPCODE_S); + WRITE4(sc, CQSPI_DEVRD, reg); + + WRITE4(sc, CQSPI_MODEBIT, 0xff); + WRITE4(sc, CQSPI_IRQMASK, 0); + + xdma_enqueue_bio(sc->xchan_rx, &bp, sc->sram_phys, 4, 4, + XDMA_DEV_TO_MEM); + xdma_queue_submit(sc->xchan_rx); + + sc->read_op_done = 0; + + WRITE4(sc, CQSPI_INDRD, INDRD_START); + + while (sc->read_op_done == 0) + tsleep(&sc->xdma_rx, PCATCH | PZERO, "spi", hz/2); + + cqspi_wait_idle(sc); + + return (0); +} + +static int +cqspi_init(struct cqspi_softc *sc) +{ + pcell_t dts_value[1]; + phandle_t node; + uint32_t reg; + int len; + + device_printf(sc->dev, "Module ID %x\n", + READ4(sc, CQSPI_MODULEID)); + + if ((node = ofw_bus_get_node(sc->dev)) == -1) { + return (ENXIO); + } + + if ((len = OF_getproplen(node, "cdns,fifo-depth")) <= 0) { + return (ENXIO); + } + OF_getencprop(node, "cdns,fifo-depth", dts_value, len); + sc->fifo_depth = dts_value[0]; + + if ((len = OF_getproplen(node, "cdns,fifo-width")) <= 0) { + return (ENXIO); + } + OF_getencprop(node, "cdns,fifo-width", dts_value, len); + sc->fifo_width = dts_value[0]; + + if ((len = OF_getproplen(node, "cdns,trigger-address")) <= 0) { + return (ENXIO); + } + OF_getencprop(node, "cdns,trigger-address", dts_value, len); + sc->trigger_address = dts_value[0]; + + /* Disable controller */ + reg = READ4(sc, CQSPI_CFG); + reg &= ~(CFG_EN); + WRITE4(sc, CQSPI_CFG, reg); + + reg = READ4(sc, CQSPI_DEVSZ); + reg &= ~(DEVSZ_NUMADDRBYTES_M); + reg |= ((4 - 1) - DEVSZ_NUMADDRBYTES_S); + WRITE4(sc, CQSPI_DEVSZ, reg); + + WRITE4(sc, CQSPI_SRAMPART, sc->fifo_depth/2); + + /* TODO: calculate baud rate and delay values. */ + + reg = READ4(sc, CQSPI_CFG); + /* Configure baud rate */ + reg &= ~(CFG_BAUD_M); + reg |= CFG_BAUD12; + reg |= CFG_ENDMA; + WRITE4(sc, CQSPI_CFG, reg); + + reg = (3 << DELAY_NSS_S); + reg |= (3 << DELAY_BTWN_S); + reg |= (1 << DELAY_AFTER_S); + reg |= (1 << DELAY_INIT_S); + WRITE4(sc, CQSPI_DELAY, reg); + + READ4(sc, CQSPI_RDDATACAP); + reg &= ~(RDDATACAP_DELAY_M); + reg |= (1 << RDDATACAP_DELAY_S); + WRITE4(sc, CQSPI_RDDATACAP, reg); + + /* Enable controller */ + reg = READ4(sc, CQSPI_CFG); + reg |= (CFG_EN); + WRITE4(sc, CQSPI_CFG, reg); + + return (0); +} + +static int +cqspi_add_devices(device_t dev) +{ + phandle_t child, node; + device_t child_dev; + int error; + + node = ofw_bus_get_node(dev); + + for (child = OF_child(node); child != 0; child = OF_peer(child)) { + child_dev = + simplebus_add_device(dev, child, 0, NULL, -1, NULL); + if (child_dev == NULL) { + return (ENXIO); + } + + error = device_probe_and_attach(child_dev); + if (error != 0) { + printf("can't probe and attach: %d\n", error); + } + } + + return (0); +} + +static void +cqspi_delayed_attach(void *arg) +{ + struct cqspi_softc *sc; + + sc = arg; + + cqspi_add_devices(sc->dev); + bus_generic_attach(sc->dev); + + config_intrhook_disestablish(&sc->config_intrhook); +} + +static int +cqspi_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, "Cadence Quad SPI controller"); + + return (0); +} + +static int +cqspi_attach(device_t dev) +{ + struct cqspi_softc *sc; + uint32_t caps; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, cqspi_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Memory interface */ + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + sc->sram_phys = rman_get_start(sc->res[1]); + + /* Setup interrupt handlers */ + if (bus_setup_intr(sc->dev, sc->res[2], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, cqspi_intr, sc, &sc->ih)) { + device_printf(sc->dev, "Unable to setup intr\n"); + return (ENXIO); + } + + CQSPI_LOCK_INIT(sc); + + caps = 0; + + /* Get xDMA controller. */ + sc->xdma_tx = xdma_ofw_get(sc->dev, "tx"); + if (sc->xdma_tx == NULL) { + device_printf(dev, "Can't find DMA controller.\n"); + return (ENXIO); + } + + sc->xdma_rx = xdma_ofw_get(sc->dev, "rx"); + if (sc->xdma_rx == NULL) { + device_printf(dev, "Can't find DMA controller.\n"); + return (ENXIO); + } + + /* Alloc xDMA virtual channels. */ + sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, caps); + if (sc->xchan_tx == NULL) { + device_printf(dev, "Can't alloc virtual DMA channel.\n"); + return (ENXIO); + } + + sc->xchan_rx = xdma_channel_alloc(sc->xdma_rx, caps); + if (sc->xchan_rx == NULL) { + device_printf(dev, "Can't alloc virtual DMA channel.\n"); + return (ENXIO); + } + + /* Setup xDMA interrupt handlers. */ + error = xdma_setup_intr(sc->xchan_tx, cqspi_xdma_tx_intr, + sc, &sc->ih_tx); + if (error) { + device_printf(sc->dev, + "Can't setup xDMA interrupt handler.\n"); + return (ENXIO); + } + + error = xdma_setup_intr(sc->xchan_rx, cqspi_xdma_rx_intr, + sc, &sc->ih_rx); + if (error) { + device_printf(sc->dev, + "Can't setup xDMA interrupt handler.\n"); + return (ENXIO); + } + + xdma_prep_sg(sc->xchan_tx, TX_QUEUE_SIZE, MAXPHYS, 8, 16, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR); + xdma_prep_sg(sc->xchan_rx, TX_QUEUE_SIZE, MAXPHYS, 8, 16, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR); + + cqspi_init(sc); + + sc->config_intrhook.ich_func = cqspi_delayed_attach; + sc->config_intrhook.ich_arg = sc; + if (config_intrhook_establish(&sc->config_intrhook) != 0) { + device_printf(dev, "config_intrhook_establish failed\n"); + return (ENOMEM); + } + + return (0); +} + +static int +cqspi_detach(device_t dev) +{ + + return (ENXIO); +} + +static device_method_t cqspi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, cqspi_probe), + DEVMETHOD(device_attach, cqspi_attach), + DEVMETHOD(device_detach, cqspi_detach), + + /* Quad SPI Flash Interface */ + DEVMETHOD(qspi_read_reg, cqspi_read_reg), + DEVMETHOD(qspi_write_reg, cqspi_write_reg), + DEVMETHOD(qspi_read, cqspi_read), + DEVMETHOD(qspi_write, cqspi_write), + DEVMETHOD(qspi_erase, cqspi_erase), + + { 0, 0 } +}; + +static devclass_t cqspi_devclass; + +DEFINE_CLASS_1(cqspi, cqspi_driver, cqspi_methods, + sizeof(struct cqspi_softc), simplebus_driver); + +DRIVER_MODULE(cqspi, simplebus, cqspi_driver, cqspi_devclass, 0, 0); Added: head/sys/dev/flash/cqspi.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/flash/cqspi.h Mon Apr 23 10:35:00 2018 (r332885) @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 2017-2018 Ruslan Bukin + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _CQSPI_H_ +#define _CQSPI_H_ + +#define CQSPI_CFG 0x00 /* QSPI Configuration */ +#define CFG_IDLE (1 << 31) +#define CFG_ENDMA (1 << 15) +#define CFG_IDLE (1 << 31) +#define CFG_BAUD_S 19 +#define CFG_BAUD_M (0xf << CFG_BAUD_S) +#define CFG_BAUD2 (0 << CFG_BAUD_S) +#define CFG_BAUD4 (1 << CFG_BAUD_S) +#define CFG_BAUD6 (2 << CFG_BAUD_S) +#define CFG_BAUD8 (3 << CFG_BAUD_S) +#define CFG_BAUD10 (4 << CFG_BAUD_S) +#define CFG_BAUD12 (5 << CFG_BAUD_S) +#define CFG_BAUD14 (6 << CFG_BAUD_S) +#define CFG_BAUD16 (7 << CFG_BAUD_S) +#define CFG_BAUD18 (8 << CFG_BAUD_S) +#define CFG_BAUD20 (9 << CFG_BAUD_S) +#define CFG_BAUD22 (10 << CFG_BAUD_S) +#define CFG_BAUD24 (11 << CFG_BAUD_S) +#define CFG_BAUD26 (12 << CFG_BAUD_S) +#define CFG_BAUD28 (13 << CFG_BAUD_S) +#define CFG_BAUD30 (14 << CFG_BAUD_S) +#define CFG_BAUD32 (0xf << CFG_BAUD_S) +#define CFG_EN (1 << 0) +#define CQSPI_DEVRD 0x04 /* Device Read Instruction Configuration */ +#define DEVRD_DUMMYRDCLKS_S 24 +#define DEVRD_ENMODEBITS (1 << 20) +#define DEVRD_DATA_WIDTH_S 16 +#define DEVRD_DATA_WIDTH_QUAD (2 << DEVRD_DATA_WIDTH_S) +#define DEVRD_ADDR_WIDTH_S 12 +#define DEVRD_ADDR_WIDTH_SINGLE (0 << DEVRD_ADDR_WIDTH_S) +#define DEVRD_INST_WIDTH_S 8 +#define DEVRD_INST_WIDTH_SINGLE (0 << DEVRD_INST_WIDTH_S) +#define DEVRD_RDOPCODE_S 0 +#define CQSPI_DEVWR 0x08 /* Device Write Instruction Configuration */ +#define DEVWR_DUMMYWRCLKS_S 24 +#define DEVWR_WROPCODE_S 0 +#define DEVWR_DATA_WIDTH_S 16 +#define DEVWR_DATA_WIDTH_QUAD (2 << DEVWR_DATA_WIDTH_S) +#define DEVWR_ADDR_WIDTH_S 12 +#define DEVWR_ADDR_WIDTH_SINGLE (0 << DEVWR_ADDR_WIDTH_S) +#define CQSPI_DELAY 0x0C /* QSPI Device Delay Register */ +#define DELAY_NSS_S 24 +#define DELAY_BTWN_S 16 +#define DELAY_AFTER_S 8 +#define DELAY_INIT_S 0 +#define CQSPI_RDDATACAP 0x10 /* Read Data Capture Register */ +#define RDDATACAP_DELAY_S 1 +#define RDDATACAP_DELAY_M (0xf << RDDATACAP_DELAY_S) +#define CQSPI_DEVSZ 0x14 /* Device Size Configuration Register */ +#define DEVSZ_NUMADDRBYTES_S 0 +#define DEVSZ_NUMADDRBYTES_M (0xf << DEVSZ_NUMADDRBYTES_S) +#define CQSPI_SRAMPART 0x18 /* SRAM Partition Configuration Register */ +#define CQSPI_INDADDRTRIG 0x1C /* Indirect AHB Address Trigger Register */ +#define CQSPI_DMAPER 0x20 /* DMA Peripheral Configuration Register */ +#define DMAPER_NUMSGLREQBYTES_S 0 +#define DMAPER_NUMBURSTREQBYTES_S 8 +#define DMAPER_NUMSGLREQBYTES_4 (2 << DMAPER_NUMSGLREQBYTES_S); +#define DMAPER_NUMBURSTREQBYTES_4 (2 << DMAPER_NUMBURSTREQBYTES_S); +#define CQSPI_REMAPADDR 0x24 /* Remap Address Register */ +#define CQSPI_MODEBIT 0x28 /* Mode Bit Configuration */ +#define CQSPI_SRAMFILL 0x2C /* SRAM Fill Register */ +#define CQSPI_TXTHRESH 0x30 /* TX Threshold Register */ +#define CQSPI_RXTHRESH 0x34 /* RX Threshold Register */ +#define CQSPI_IRQSTAT 0x40 /* Interrupt Status Register */ +#define CQSPI_IRQMASK 0x44 /* Interrupt Mask */ +#define IRQMASK_INDSRAMFULL (1 << 12) +#define IRQMASK_INDXFRLVL (1 << 6) +#define IRQMASK_INDOPDONE (1 << 2) +#define CQSPI_LOWWRPROT 0x50 /* Lower Write Protection */ +#define CQSPI_UPPWRPROT 0x54 /* Upper Write Protection */ +#define CQSPI_WRPROT 0x58 /* Write Protection Control Register */ +#define CQSPI_INDRD 0x60 /* Indirect Read Transfer Control Register */ +#define INDRD_IND_OPS_DONE_STATUS (1 << 5) +#define INDRD_START (1 << 0) +#define CQSPI_INDRDWATER 0x64 /* Indirect Read Transfer Watermark Register */ +#define CQSPI_INDRDSTADDR 0x68 /* Indirect Read Transfer Start Address Register */ +#define CQSPI_INDRDCNT 0x6C /* Indirect Read Transfer Number Bytes Register */ +#define CQSPI_INDWR 0x70 /* Indirect Write Transfer Control Register */ +#define CQSPI_INDWRWATER 0x74 /* Indirect Write Transfer Watermark Register */ +#define CQSPI_INDWRSTADDR 0x78 /* Indirect Write Transfer Start Address Register */ +#define CQSPI_INDWRCNT 0x7C /* Indirect Write Transfer Number Bytes Register */ +#define CQSPI_FLASHCMD 0x90 /* Flash Command Control Register */ +#define FLASHCMD_NUMADDRBYTES_S 16 +#define FLASHCMD_NUMRDDATABYTES_S 20 +#define FLASHCMD_NUMRDDATABYTES_M (0x7 << FLASHCMD_NUMRDDATABYTES_S) +#define FLASHCMD_ENCMDADDR (1 << 19) +#define FLASHCMD_ENRDDATA (1 << 23) +#define FLASHCMD_CMDOPCODE_S 24 +#define FLASHCMD_CMDOPCODE_M (0xff << FLASHCMD_CMDOPCODE_S) +#define FLASHCMD_CMDEXECSTAT (1 << 1) /* Command execution in progress. */ +#define FLASHCMD_EXECCMD (1 << 0) /* Execute the command. */ +#define CQSPI_FLASHCMDADDR 0x94 /* Flash Command Address Registers */ +#define CQSPI_FLASHCMDRDDATALO 0xA0 /* Flash Command Read Data Register (Lower) */ +#define CQSPI_FLASHCMDRDDATAUP 0xA4 /* Flash Command Read Data Register (Upper) */ +#define CQSPI_FLASHCMDWRDATALO 0xA8 /* Flash Command Write Data Register (Lower) */ +#define CQSPI_FLASHCMDWRDATAUP 0xAC /* Flash Command Write Data Register (Upper) */ +#define CQSPI_MODULEID 0xFC /* Module ID Register */ + +#endif /* !_CQSPI_H_ */ Modified: head/sys/dev/flash/mx25lreg.h ============================================================================== --- head/sys/dev/flash/mx25lreg.h Mon Apr 23 09:01:25 2018 (r332884) +++ head/sys/dev/flash/mx25lreg.h Mon Apr 23 10:35:00 2018 (r332885) @@ -50,6 +50,11 @@ #define CMD_ENTER_4B_MODE 0xB7 #define CMD_EXIT_4B_MODE 0xE9 +/* Quad 4B-addressing operations. */ +#define CMD_QUAD_SECTOR_ERASE 0xDC +#define CMD_QUAD_PAGE_PROGRAM 0x34 +#define CMD_READ_4B_QUAD_OUTPUT 0x6C + /* * Status register flags */ Added: head/sys/dev/flash/n25q.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/flash/n25q.c Mon Apr 23 10:35:00 2018 (r332885) @@ -0,0 +1,490 @@ +/*- + * Copyright (c) 2006 M. Warner Losh. All rights reserved. + * Copyright (c) 2009 Oleksandr Tymoshenko. All rights reserved. + * Copyright (c) 2017 Ruslan Bukin + * Copyright (c) 2018 Ian Lepore. All rights reserved. + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* n25q Quad SPI Flash driver. */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Apr 23 12:20:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87762FB77E6; Mon, 23 Apr 2018 12:20:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D5866D7D0; Mon, 23 Apr 2018 12:20:08 +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 33FD524259; Mon, 23 Apr 2018 12:20:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NCK8rD056607; Mon, 23 Apr 2018 12:20:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NCK8jM056606; Mon, 23 Apr 2018 12:20:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804231220.w3NCK8jM056606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 23 Apr 2018 12:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332886 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 332886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 12:20:08 -0000 Author: ae Date: Mon Apr 23 12:20:07 2018 New Revision: 332886 URL: https://svnweb.freebsd.org/changeset/base/332886 Log: icmp6_reflect() sends ICMPv6 message with new IPv6 header. So, it is considered as originated by our host packet. And thus rcvif should be NULL, since it is used by ipfw(4) to determine that packet was originated from this host. Some of icmp6_reflect() consumers reuse mbuf and m_pkthdr without resetting rcvif pointer. To avoid this always reset m_pkthdr.rcvif pointer to NULL in icmp6_reflect(). Also remove such line and comment describing this from icmp6_error(), since it does not longer matters. PR: 227674 Reported by: eugen MFC after: 1 week Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Mon Apr 23 10:35:00 2018 (r332885) +++ head/sys/netinet6/icmp6.c Mon Apr 23 12:20:07 2018 (r332886) @@ -383,15 +383,6 @@ icmp6_error(struct mbuf *m, int type, int code, int pa icmp6->icmp6_code = code; icmp6->icmp6_pptr = htonl((u_int32_t)param); - /* - * icmp6_reflect() is designed to be in the input path. - * icmp6_error() can be called from both input and output path, - * and if we are in output path rcvif could contain bogus value. - * clear m->m_pkthdr.rcvif for safety, we should have enough scope - * information in ip header (nip6). - */ - m->m_pkthdr.rcvif = NULL; - ICMP6STAT_INC(icp6s_outhist[type]); icmp6_reflect(m, sizeof(struct ip6_hdr)); /* header order: IPv6 - ICMPv6 */ @@ -2183,7 +2174,7 @@ icmp6_reflect(struct mbuf *m, size_t off) */ m->m_flags &= ~(M_BCAST|M_MCAST); - + m->m_pkthdr.rcvif = NULL; ip6_output(m, NULL, NULL, 0, NULL, &outif, NULL); if (outif) icmp6_ifoutstat_inc(outif, type, code); From owner-svn-src-head@freebsd.org Mon Apr 23 12:23:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E5EDFB7CCA; Mon, 23 Apr 2018 12:23:06 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4C8D6DF9C; Mon, 23 Apr 2018 12:23:05 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF955243DD; Mon, 23 Apr 2018 12:23:05 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NCN5lr061421; Mon, 23 Apr 2018 12:23:05 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NCN527061419; Mon, 23 Apr 2018 12:23:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <201804231223.w3NCN527061419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 23 Apr 2018 12:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332887 - in head/sys: arm/conf dts/arm X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: arm/conf dts/arm X-SVN-Commit-Revision: 332887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 12:23:06 -0000 Author: br Date: Mon Apr 23 12:23:05 2018 New Revision: 332887 URL: https://svnweb.freebsd.org/changeset/base/332887 Log: Enable ARM PL330 DMA engine and Cadence Quad SPI flash controller on Intel Arria 10 SoC boards. Tested on Intel Arria 10 SoC Development Kit. Sponsored by: DARPA, AFRL Modified: head/sys/arm/conf/SOCFPGA head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts Modified: head/sys/arm/conf/SOCFPGA ============================================================================== --- head/sys/arm/conf/SOCFPGA Mon Apr 23 12:20:07 2018 (r332886) +++ head/sys/arm/conf/SOCFPGA Mon Apr 23 12:23:05 2018 (r332887) @@ -47,6 +47,10 @@ options INTRNG # ARM MPCore timer device mpcore_timer +# DMA support +device xdma +device pl330 + # MMC/SD/SDIO Card slot support device mmc # mmc/sd bus device mmcsd # mmc/sd flash cards @@ -80,6 +84,8 @@ device iicbus # SPI device spibus +device cqspi +device n25q # Ethernet device ether Modified: head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts ============================================================================== --- head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts Mon Apr 23 12:20:07 2018 (r332886) +++ head/sys/dts/arm/socfpga_arria10_socdk_sdmmc.dts Mon Apr 23 12:23:05 2018 (r332887) @@ -84,3 +84,37 @@ &usb0 { dr_mode = "host"; }; + +&qspi { + status = "okay"; + + dmas = <&pdma 24>, <&pdma 25>; + dma-names = "tx", "rx"; + + flash0: n25q00@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "n25q00aa"; + reg = <0>; + spi-max-frequency = <100000000>; + + m25p,fast-read; + cdns,page-size = <256>; + cdns,block-size = <16>; + cdns,read-delay = <4>; + cdns,tshsl-ns = <50>; + cdns,tsd2d-ns = <50>; + cdns,tchsh-ns = <4>; + cdns,tslch-ns = <4>; + + partition@qspi-boot { + label = "boot"; + reg = <0x0 0x2720000>; + }; + + partition@qspi-rootfs { + label = "rootfs"; + reg = <0x2720000 0x58E0000>; + }; + }; +}; From owner-svn-src-head@freebsd.org Mon Apr 23 13:43:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1965FBD2DC; Mon, 23 Apr 2018 13:43:14 +0000 (UTC) (envelope-from thj@freebsd.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (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 56F9A7E9CC; Mon, 23 Apr 2018 13:43:14 +0000 (UTC) (envelope-from thj@freebsd.org) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id CE591213A3; Mon, 23 Apr 2018 09:43:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 23 Apr 2018 09:43:12 -0400 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-sender:x-me-sender:x-sasl-enc; s=fm2; bh=M24abb gA3clQHb96otz1yybk6HvkU8rgVNzp/xwMBg4=; b=OYk2YyIMGUtK2mMAvPwq8f yH40EpQRSwPGEpdSzfv2XAgdYTziltpyttIJ3ciK/2kV/WeK2e4qUUhQQQacjtG9 NNWrjvUW34gqj04iX9zhqzfWczO3L0oZBgx0L2fLrqQLQxdCtF74VZgPNyQxxOSM PkmZWrGdqvp4tQunyXkrES9sjmX8/g8wAsYdA2N90RbIGNucYirwAUtcjO7ZHytX j71LjyKGO5lY8vtAhRis94ikyPD9BsF4IHE07jvSddnnDSK4/aZaioIFatxqYgZk 6pynfhVKj1TYUZZpzx5gktDWqhsQPOqQCedEP4UXQhvQCVbJ3480cTJwN/FAY74w == X-ME-Sender: Received: from tom-desk.erg.abdn.ac.uk (tom-desk.erg.abdn.ac.uk [139.133.204.4]) by mail.messagingengine.com (Postfix) with ESMTPA id D23B5E5082; Mon, 23 Apr 2018 09:43:11 -0400 (EDT) Date: Mon, 23 Apr 2018 14:43:04 +0100 From: Tom Jones To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330834 - head/sys/dev/vt/hw/vga Message-ID: <20180423134304.GB74306@tom-desk.erg.abdn.ac.uk> References: <201803130938.w2D9csB4099299@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201803130938.w2D9csB4099299@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 13:43:14 -0000 On Tue, Mar 13, 2018 at 09:38:54AM +0000, Roger Pau Monn wrote: > Author: royger > Date: Tue Mar 13 09:38:53 2018 > New Revision: 330834 > URL: https://svnweb.freebsd.org/changeset/base/330834 > > Log: > vt_vga: check if VGA is available from ACPI FADT table > > On x86 the IA-PC Boot Flags in the FADT can signal whether VGA is > available or not. > > Sponsored by: Citrix systems R&D > Reviewed by: marcel > Differential revision: https://reviews.freebsd.org/D14397 > > Modified: > head/sys/dev/vt/hw/vga/vt_vga.c Hi, Running the latest vm snapshots on bhyve, /dev/ttyv[0-b] devices are not created leading to getty spamming the console: Apr 23 13:28:49 freebsd getty[710]: open /dev/ttyv6: No such file or directory Apr 23 13:28:49 freebsd getty[709]: open /dev/ttyv1: No such file or directory Apr 23 13:28:49 freebsd getty[715]: open /dev/ttyv5: No such file or directory Apr 23 13:28:49 freebsd getty[713]: open /dev/ttyv7: No such file or directory Tracking through snapshots the change is somewhere between: good ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/12.0-CURRENT/amd64/20180307/ bad ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/12.0-CURRENT/amd64/20180315/ reverting r330834 returns to the old behaviour. - [tj] From owner-svn-src-head@freebsd.org Mon Apr 23 14:52:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A912AFA2783 for ; Mon, 23 Apr 2018 14:52:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25AD76E899 for ; Mon, 23 Apr 2018 14:52:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id e20-v6so11026219itc.1 for ; Mon, 23 Apr 2018 07:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=TSZLPFboDydYFm9/SPBJlMQopAcPg5h4dxJ+WCy6nv0=; b=v9gtUylOcv5/k16JQo1fHr6TSnGwopN6/sKTel8rkx5Lp+YdT740fO3II5NU36El5r ZEc7RhZHZd8tLv/Gw9c3LpaXft0OTr9umhUPZ+EEnpnTLY4oCiT16YgrNIK2gLZIN1nr sDdGjbJGEDOwaMfQ+NJ8fVdVL7cetX+bjnIQUweKOJLYh0qtA7POl6oLv+ZOBryLn9cq E3THqh78QM1usmDiFLqQUNrhc9L9EVGn8CmsEwz0JM0hUDHEcwXscfHsOVcvhLLeX6Qp Zl4O8mQn0Ikmir/hj+2kn18J46fA+YVaWOlJVt3XXx98cAxoJdM3St/muv6h4xdIpTuG rnmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=TSZLPFboDydYFm9/SPBJlMQopAcPg5h4dxJ+WCy6nv0=; b=ljhzWsERKOy6ChC9/Lte5nptjDcWAodbPb6wFv9g/fadbwyUxRFJDOoXru34/IVIEm Mj0tLcKMkYx8h3RQJKYaF4MGoPFsod/Cpw5t+pqf8yIlYLca51AOvGbB3okexXMGp2zy JElMSrKpfk0yMlDk/MYTQ5N2JVSFdRCzFfPqgTxMQLmD54j+/nuqVW3QJBkd2u0FUlWM ws3cUfNmDw2wMMSQONk49h7fcik7hDuggNEI+6pNkChsy0VkNA9FjX8T3OBiorTOR5hj sZzkJOCJ6KfzCURze8aCT7P/iQeeXfz4JwVLSkjUjizzEijL4N2totsN/x6Ma3QM3YWy vZuw== X-Gm-Message-State: ALQs6tB6kc1qUyoTTmDFYxwqVtQuHQ5F4tmaSqLxnVOrHP1p5jw9Z/hu NvU73Ti3pK7NCj/lBpDSKOZ2cIUqjaN3XTXpfPpbPA== X-Google-Smtp-Source: AB8JxZoiUAbBK9BEoGTUVCi9aGpWLfG7qnKLGCGh/SRWEzS/JuifLaIRgQVe3KWRTUq0gdEp6Qp9hGtxLMmN76dSYu4= X-Received: by 2002:a24:1fc7:: with SMTP id d190-v6mr13687524itd.57.1524495132478; Mon, 23 Apr 2018 07:52:12 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a604:0:0:0:0:0 with HTTP; Mon, 23 Apr 2018 07:52:11 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: <20180423134304.GB74306@tom-desk.erg.abdn.ac.uk> References: <201803130938.w2D9csB4099299@repo.freebsd.org> <20180423134304.GB74306@tom-desk.erg.abdn.ac.uk> From: Warner Losh Date: Mon, 23 Apr 2018 08:52:11 -0600 X-Google-Sender-Auth: EKTpSu4g4AhG80wk96PjcAUdY3Q Message-ID: Subject: Re: svn commit: r330834 - head/sys/dev/vt/hw/vga To: Tom Jones Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 14:52:13 -0000 On Mon, Apr 23, 2018 at 7:43 AM, Tom Jones wrote: > On Tue, Mar 13, 2018 at 09:38:54AM +0000, Roger Pau Monn=C3=A9 wrote: > > Author: royger > > Date: Tue Mar 13 09:38:53 2018 > > New Revision: 330834 > > URL: https://svnweb.freebsd.org/changeset/base/330834 > > > > Log: > > vt_vga: check if VGA is available from ACPI FADT table > > > > On x86 the IA-PC Boot Flags in the FADT can signal whether VGA is > > available or not. > > > > Sponsored by: Citrix systems R&D > > Reviewed by: marcel > > Differential revision: https://reviews.freebsd.org/D14397 > > > > Modified: > > head/sys/dev/vt/hw/vga/vt_vga.c > > Hi, > > Running the latest vm snapshots on bhyve, /dev/ttyv[0-b] devices are not > created leading to getty spamming the console: > > Apr 23 13:28:49 freebsd getty[710]: open /dev/ttyv6: No such file or > directory > Apr 23 13:28:49 freebsd getty[709]: open /dev/ttyv1: No such file or > directory > Apr 23 13:28:49 freebsd getty[715]: open /dev/ttyv5: No such file or > directory > Apr 23 13:28:49 freebsd getty[713]: open /dev/ttyv7: No such file or > directory > > Tracking through snapshots the change is somewhere between: > > good ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/ > 12.0-CURRENT/amd64/20180307/ > bad ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/ > 12.0-CURRENT/amd64/20180315/ > > reverting r330834 returns to the old behaviour. > You need to change /etc/ttys to have 'onifexists' or 'off' for those devices. There was a change to init/getty to support pluggable TTYs that is causing it. Historically, there was no 'onifexists' so init/getty basically stopped looking at a device that wasn't there. Now we have TTYs that we want to present a getty on come and go, we need to adapt. Warner From owner-svn-src-head@freebsd.org Mon Apr 23 14:58:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20ADDFA31A1 for ; Mon, 23 Apr 2018 14:58:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E51170D49 for ; Mon, 23 Apr 2018 14:58:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id 71-v6so11044341ith.2 for ; Mon, 23 Apr 2018 07:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Of4uTWiTSZ/s0xq7/JgwvY2nJbF1fX4cl3YrxnUC2lw=; b=dJ/vHc0aQdXhcNOmTFAzHANDMoMaaxIzfK6tt6qPw6ldAROwUbdL4XrVzJq8nx2sUs WmqEB2j3ZSww6n5Z5EqmGzKurDBP321IAYeAzFLyC34dkTfWpXSxoOkVvsOO/LmIHYXk 5OIXthZmRK800S7VP7u+LzP4ORu6FJ/xitS+wZ0vDOxalg1QQR5naPDWDyPzT+gcQG0g W2WMVnJXdUuT5AGquO+eiimrodKF7GfbvU3oOoeDHiRAaSr3fBzDIEkiu3vuTlPbLpDQ 0bIFUU33bot/kR2Es5GoS9cZ+hUVRkRcHiZovaNHNwSLp63NS2GmbuX+X5V983MqGPZ2 ZmsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Of4uTWiTSZ/s0xq7/JgwvY2nJbF1fX4cl3YrxnUC2lw=; b=VE8WJ2cu6nQJ7AxsfQvJo6TYE9SZfxrDRUEuMjK8iZGVS65zNN91mtWkPWW85PiV2l j7tDFlEiG8Go921rx1Yd76vXsewO0p0ns47jT1S3qcm/kcyyRtVHCHdk2O3RXwNngHex WaKOBh6ZGY/jhg2NgZNnUMl/mcsnMupVCuXxrVFLeFGr0pIAKTRtN/cNcuEix6mLECf+ XpOz5C8xk/UXiBX7hodbaKfNBb2ANcKGQcp+sSPWi10xF6vvxz2KN53CBH4JS5B92jki PGDXlU7X4PIXNObik54QiJcgSP4J8PeZ8tGCPz6+N17fanVGidZn79RZn9+4sBTUEwaZ 15CA== X-Gm-Message-State: ALQs6tAXIJHx2wJyJ6Xqt6EzwjKJ9pmQ8igMimUdx+gNfAVOIATr/8eA 4X+K9qimFABl3H6fIt2+iJs998ICyjgm13zS+VjbWQ== X-Google-Smtp-Source: AB8JxZpv6mRoYH6tI8v9T7PZmj6+RVIBSKj7Qm8LoTJtl3rNxmLlOl9lAwtQ0Do9P6dno9xlWrQ76UYjR2idfPiF7sw= X-Received: by 2002:a24:ad64:: with SMTP id a36-v6mr14023493itj.1.1524495521914; Mon, 23 Apr 2018 07:58:41 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a604:0:0:0:0:0 with HTTP; Mon, 23 Apr 2018 07:58:41 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: References: <201803130938.w2D9csB4099299@repo.freebsd.org> <20180423134304.GB74306@tom-desk.erg.abdn.ac.uk> From: Warner Losh Date: Mon, 23 Apr 2018 08:58:41 -0600 X-Google-Sender-Auth: qtYvUvxXBpkMsOusnIxb2iCaIgs Message-ID: Subject: Re: svn commit: r330834 - head/sys/dev/vt/hw/vga To: Tom Jones Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 14:58:43 -0000 On Mon, Apr 23, 2018 at 8:52 AM, Warner Losh wrote: > > > On Mon, Apr 23, 2018 at 7:43 AM, Tom Jones wrote: > >> On Tue, Mar 13, 2018 at 09:38:54AM +0000, Roger Pau Monn=C3=A9 wrote: >> > Author: royger >> > Date: Tue Mar 13 09:38:53 2018 >> > New Revision: 330834 >> > URL: https://svnweb.freebsd.org/changeset/base/330834 >> > >> > Log: >> > vt_vga: check if VGA is available from ACPI FADT table >> > >> > On x86 the IA-PC Boot Flags in the FADT can signal whether VGA is >> > available or not. >> > >> > Sponsored by: Citrix systems R&D >> > Reviewed by: marcel >> > Differential revision: https://reviews.freebsd.org/D14397 >> > >> > Modified: >> > head/sys/dev/vt/hw/vga/vt_vga.c >> >> Hi, >> >> Running the latest vm snapshots on bhyve, /dev/ttyv[0-b] devices are not >> created leading to getty spamming the console: >> >> Apr 23 13:28:49 freebsd getty[710]: open /dev/ttyv6: No such file or >> directory >> Apr 23 13:28:49 freebsd getty[709]: open /dev/ttyv1: No such file or >> directory >> Apr 23 13:28:49 freebsd getty[715]: open /dev/ttyv5: No such file or >> directory >> Apr 23 13:28:49 freebsd getty[713]: open /dev/ttyv7: No such file or >> directory >> >> Tracking through snapshots the change is somewhere between: >> >> good ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/12.0- >> CURRENT/amd64/20180307/ >> bad ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/12.0- >> CURRENT/amd64/20180315/ >> >> reverting r330834 returns to the old behaviour. >> > > You need to change /etc/ttys to have 'onifexists' or 'off' for those > devices. There was a change to init/getty to support pluggable TTYs that = is > causing it. Historically, there was no 'onifexists' so init/getty basical= ly > stopped looking at a device that wasn't there. Now we have TTYs that we > want to present a getty on come and go, we need to adapt. > https://reviews.freebsd.org/D15169 fixes the problem. Warner From owner-svn-src-head@freebsd.org Mon Apr 23 15:18:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6B37FA40DF; Mon, 23 Apr 2018 15:18:26 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3221D75994; Mon, 23 Apr 2018 15:18:25 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-f180.google.com with SMTP id w3-v6so42356283wrg.2; Mon, 23 Apr 2018 08:18:25 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jWmlCEJhd8ABkez4PY1knsndZr/lglqnSEhBO8nZbE0=; b=dI8AUs8X5mc6VrK4TqrwazAMqe6RS4em7p76sZtHpyUH3ZEMJTGB/g8lrquAmFmlcO H0fNMB3fLv4eCbeG1GaNxOZpko7Q8NwtsJr3h82J8f1utXkgIHlBp8Wsq4yyxz4tLNj4 r6KAGGVYxYwm5TP5d4Bukx9o7KSCgGAK0qzkuHZFb1siKdqxdKw2hRWyRck3/2C7LA9G RtTqJjCHjLRvmE8QJH/oQ1cmbR+XrRkuvIQbOlidDFySa7BoNXv+L7hkB/qIE2MYs6E5 ec1BkOMtXCQhYfjdgoZ6JOvhGqaw1fQerzhw1Bm95bVzfWXFkRkRyvrQ/8SjyqjFJjYW /qYA== X-Gm-Message-State: ALQs6tBi8dGYbrvLTNB6Mb7dpBZ1ftFxwkvc8GNKXVQBXiAU+8lbjR/3 qtE1XodmNL67sWSor9uL7gQWr62w X-Google-Smtp-Source: AIpwx49jqxToTJoh54/ElNv3aXPu6F3W213jIt547Sxfe592GS/4bqzt4+xmzCd3gwr7KrrfWUqDiQ== X-Received: by 10.80.137.123 with SMTP id f56mr2556888edf.206.1524496353962; Mon, 23 Apr 2018 08:12:33 -0700 (PDT) Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com. [209.85.128.169]) by smtp.gmail.com with ESMTPSA id v17sm7128578edl.47.2018.04.23.08.12.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 08:12:33 -0700 (PDT) Received: by mail-wr0-f169.google.com with SMTP id c14-v6so2199059wrd.4; Mon, 23 Apr 2018 08:12:33 -0700 (PDT) X-Received: by 2002:adf:884c:: with SMTP id e12-v6mr18367098wre.30.1524496352914; Mon, 23 Apr 2018 08:12:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.199.203 with HTTP; Mon, 23 Apr 2018 08:12:32 -0700 (PDT) In-Reply-To: <20180422171106.GB84833@raichu> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180422171106.GB84833@raichu> From: "Jonathan T. Looney" Date: Mon, 23 Apr 2018 11:12:32 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332860 - head/sys/kern To: Mark Johnston Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 15:18:27 -0000 Hi Mark, Let me start by saying that I appreciate your well-reasoned response. (I think) I understand your reasoning, I appreciate your well-explained argument, and I respect your opinion. I just wanted to make that clear up front. On Sun, Apr 22, 2018 at 1:11 PM, Mark Johnston wrote: > > > All too often, my ability to debug assertion violations is hindered because > > the system trips over yet another assertion while dumping the core. If we > > skip the assertion, nothing bad happens. (The post-panic debugging code > > already needs to deal with systems that are inconsistent, and it does a > > pretty good job at it.) > > I think we make a decent effort to fix such problems as they arise, but > you are declaring defeat on behalf of everyone. Did you make some effort > to fix or report these issues before resorting to the more drastic > measure taken here? We try to report or fix them as they arise. However, you don't know there is a problem until you actually run into it. And, you don't run into the problem until you can't get a core dump due to the assertion. (And, with elusive problems, it isn't always easy to duplicate them. So, fixing the assertion is sometimes "too late".) > > On the other hand, I really am not sure what you are worried might happen > > if we skip checking assertions after we've already panic'd. As far as I can > > tell, the likely worst case is that we hit a true panic of some kind. In > > that case, we're no worse off than before. > > > > I think the one obvious exception is when we're purposely trying to > > validate the post-panic debugging code. In that case, you can change the > > sysctl/tunable to enable troubleshooting. > > What about a user whose test system panics and fails to dump? With > assertions enabled, a developer has a better chance of spotting the > problem. Now we need at least one extra round trip to the user to > diagnose the problem, which may not be readily reproducible in the first > place. That's true. However, this is equally true in the other direction: Prior to this change, when a user tripped over an assertion and was unable to get a coredump due to a second post-panic assertion, it took (at least) another round-trip to get a coredump. First, without the capability to ignore assertions after a panic (introduced by this commit), you would need to fix the actual assertion to enable the user to get a coredump. At minimum, I think this change has value in that case. This change gives you a mechanism to get a coredump without requiring that you fix the assertion and get the user to recompile with the patch. But, moreover, if we change the default back to panic'ing on a second assertion, we will hamper our ability to get usable reports about elusive bugs. If we leave the default "as is", it won't take an extra round-trip to tell the user how to get a coredump. If we change the default (or, perhaps more correctly, "restore the prior default"), we will still need a second round-trip to get coredumps. That makes it tough to chase elusive bugs. > > I would honestly appreciate someone explaining the dangers in disabling a > > response to assertion violations after we've already panic'd and are simply > > trying to troubleshoot, because they are not obvious to me. But, I could > > simply be missing them. > > The assertions help identify code that is being executed during a dump > when it shouldn't be. In general we rely on users to opt in to running > INVARIANTS kernels because developers don't catch every single bug. With > this change it's harder to be confident in the kernel dump code. (Or in > any post-panic debugging code for that matter.) I can appreciate that. I am generally skeptical of the value of assertions in general-use code after a panic, since we already know the system is in an inconsistent/unexpected state. And, it is hard to predict all the various ways it could possibly be broken. However, I do recognize that there is code which specifically is written to run post-panic, and which has assertions which SHOULD be true, even after a panic. > I dislike the change and would prefer the default to be inverted. At the > very least I think we should print the assertion message rather than > returning silently from kassert_panic(). I still think this change has value (as described above). I can understand the argument for changing the default. In fact, after thinking about your email, I'm leaning towards doing that. But, I want to ponder it more today. If we leave the default alone, I agree we should print the assertion message (albeit with some rate limit). Jonathan From owner-svn-src-head@freebsd.org Mon Apr 23 16:07:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35882FA587A for ; Mon, 23 Apr 2018 16:07:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B02F5809A2 for ; Mon, 23 Apr 2018 16:07:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id y128-v6so19095318iod.4 for ; Mon, 23 Apr 2018 09:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=oawvsSmOiJWb5tMjiSLRsp58BTv+snGWdLXEJpaaGbw=; b=C5PUylckkubi7NrhaU98CNigrGBzFpuqbqvUS7oKBeHw4EpRTHEP6hBYqqsZT1hOYn rqNV4iXqhjDiTXKXzIaBChlnNGZ6ywCnIQl+wnlPphgavDUa7Vml9SOcw6cH+GACAxue SdK/h39utxJglFgbkmp6UmEv4xXBLLQKtC7ImuMTeS7ujYUucN2gTK+q5Lz5LwvkQfZj 3MmJIcS7zCJo6ALE0udw2+fB1fOtnJqYDFiBmeKkjo2AP4a9HEaGZhjjk5ujR0uLHYX2 MH4mpL8AmN0XJ0hHnQPa/pvRMy6PWQ4h9kW+/U4buPw4/dTedDIlw1HmTek8OUBtwCKZ Ne5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=oawvsSmOiJWb5tMjiSLRsp58BTv+snGWdLXEJpaaGbw=; b=Y4cBymCZcq/ImkBjszXhTQcRjGcKiSn0ePamztXaskY+1LhMCp++9AQ4RnySUVqrsa Wj/QAuMMGCRash3FxuqTRYk5l+QzZ/sTU5f2iI94dHBn95zedP0pvc+c0zpoyTXEl7WN nhrYGtQFPcfD6lNhCKRchH99uR7Os3reU1vXC0BwSvPP9F6CEajCfjn3JW38G8DcQjGh nBG6lYc/smPBhT/Nykztu+J98XAfwY4i+MFMsbhjlFJpGNIHDfPtZ2qWvnuhar2Dxk8c lK7KHUjzOl5d/21a4DpJV8i+GsRTU4p9Bd2YBoxB7nuovdKsI4xPv9V5gtzkBfemVGCt UjIA== X-Gm-Message-State: ALQs6tASAZJedt7m2J7p8Rww1qsm4eQc7TUZwuZ4j72ymaRs6uBHOqPp Sfu3MQFbT/7lr2Zp4nCiurp/Nq5zoOcjiUeat1+TGw== X-Google-Smtp-Source: AB8JxZpuFonqREYBRVMEO7Kb9pYLV9pjvkkQYy41EEdeSAQbcXgjSGJ61wUvYf1QKzM09XzTvSxrjewMXs3cYPG343g= X-Received: by 2002:a6b:d404:: with SMTP id l4-v6mr19844971iog.37.1524499623955; Mon, 23 Apr 2018 09:07:03 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a604:0:0:0:0:0 with HTTP; Mon, 23 Apr 2018 09:07:03 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180422171106.GB84833@raichu> From: Warner Losh Date: Mon, 23 Apr 2018 10:07:03 -0600 X-Google-Sender-Auth: pjIesHLsvT6PsJ78FZiHWack1HY Message-ID: Subject: Re: svn commit: r332860 - head/sys/kern To: "Jonathan T. Looney" Cc: Mark Johnston , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 16:07:05 -0000 On Mon, Apr 23, 2018 at 9:12 AM, Jonathan T. Looney wrote: > > If we leave the default alone, I agree we should print the assertion > message (albeit with some rate limit). > We should print the first N asserts we hit during a kernel panic core dump, then stop. I'd suggest N should be 10 or 20. For me, the only asserts that have value during a panic are the ones that prevent bad things from happening. The only bad thing that really can happen is either wedging the machine, so we don't finish the dump (watchdogs solve that) or writing to a naughty place (defined as not within the bounds of a swap partition). I'm having a hard time seeing in what actual value assertions that aren't related to either of these areas buy us. Warner From owner-svn-src-head@freebsd.org Mon Apr 23 16:38:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DCA7FA63CB; Mon, 23 Apr 2018 16:38:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BDC968C41; Mon, 23 Apr 2018 16:38:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 316FD26B3D; Mon, 23 Apr 2018 16:38:28 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NGcS7T085927; Mon, 23 Apr 2018 16:38:28 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NGcR8b085925; Mon, 23 Apr 2018 16:38:27 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804231638.w3NGcR8b085925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 23 Apr 2018 16:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332890 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 332890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 16:38:28 -0000 Author: sbruno Date: Mon Apr 23 16:38:27 2018 New Revision: 332890 URL: https://svnweb.freebsd.org/changeset/base/332890 Log: hda(4) - add quirk for Dell XPS9560 audio gleaned and massages from linux https://github.com/freebsd/freebsd/pull/137 Submitted by: K Staring MFC after: 3 days Relnotes: yes Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Apr 23 14:22:16 2018 (r332889) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Mon Apr 23 16:38:27 2018 (r332890) @@ -410,6 +410,15 @@ hdac_pin_patch(struct hdaa_widget *w) patch = "as=1 seq=15"; break; } + } else if (id == HDA_CODEC_ALC298 && subid == DELL_XPS9560_SUBVENDOR) { + switch (nid) { + case 24: + config = 0x01a1913c; + break; + case 26: + config = 0x01a1913d; + break; + } } if (patch != NULL) Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Mon Apr 23 14:22:16 2018 (r332889) +++ head/sys/dev/sound/pci/hda/hdac.h Mon Apr 23 16:38:27 2018 (r332890) @@ -201,6 +201,7 @@ #define DELL_I1300_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01c9) #define DELL_XPSM1210_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01d7) #define DELL_OPLX745_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x01da) +#define DELL_XPS9560_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0x07be) #define DELL_ALL_SUBVENDOR HDA_MODEL_CONSTRUCT(DELL, 0xffff) /* Clevo */ From owner-svn-src-head@freebsd.org Mon Apr 23 16:50:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6149FA6704; Mon, 23 Apr 2018 16:50:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72FFB6C60A; Mon, 23 Apr 2018 16:50:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5543526CCB; Mon, 23 Apr 2018 16:50:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NGocTs090798; Mon, 23 Apr 2018 16:50:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NGocYP090796; Mon, 23 Apr 2018 16:50:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804231650.w3NGocYP090796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 23 Apr 2018 16:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332891 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 332891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 16:50:39 -0000 Author: jhb Date: Mon Apr 23 16:50:37 2018 New Revision: 332891 URL: https://svnweb.freebsd.org/changeset/base/332891 Log: Fix some harmless type mismatches in the ARM atomic_cmpset implementations. The return value of atomic_cmpset() and atomic_fcmpset() is an int (which is really a bool) that has the values 0 or 1. Some of the inlines were using the type being operated on (e.g. uint32_t) as either the return type of the function, or the type of a local 'ret' variable used to hold the return value. Fix all of these to just use plain 'int'. Due to C promotion rules and the fact that the value can only be 0 or 1, these should all be harmless. Reviewed by: imp (only the v4 ones) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15147 Modified: head/sys/arm/include/atomic-v4.h head/sys/arm/include/atomic-v6.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Mon Apr 23 16:38:27 2018 (r332890) +++ head/sys/arm/include/atomic-v4.h Mon Apr 23 16:50:37 2018 (r332891) @@ -115,7 +115,7 @@ atomic_clear_64(volatile uint64_t *address, uint64_t c static __inline int atomic_fcmpset_32(volatile u_int32_t *p, volatile u_int32_t *cmpval, volatile u_int32_t newval) { - u_int32_t ret; + int ret; __with_interrupts_disabled( { @@ -134,7 +134,7 @@ atomic_fcmpset_32(volatile u_int32_t *p, volatile u_in static __inline int atomic_fcmpset_64(volatile u_int64_t *p, volatile u_int64_t *cmpval, volatile u_int64_t newval) { - u_int64_t ret; + int ret; __with_interrupts_disabled( { @@ -149,7 +149,7 @@ atomic_fcmpset_64(volatile u_int64_t *p, volatile u_in return (ret); } -static __inline u_int32_t +static __inline int atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) { int ret; @@ -166,7 +166,7 @@ atomic_cmpset_32(volatile u_int32_t *p, volatile u_int return (ret); } -static __inline u_int64_t +static __inline int atomic_cmpset_64(volatile u_int64_t *p, volatile u_int64_t cmpval, volatile u_int64_t newval) { int ret; @@ -296,7 +296,7 @@ atomic_clear_32(volatile uint32_t *address, uint32_t c } -static __inline u_int32_t +static __inline int atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) { int done, ras_start = ARM_RAS_START; Modified: head/sys/arm/include/atomic-v6.h ============================================================================== --- head/sys/arm/include/atomic-v6.h Mon Apr 23 16:38:27 2018 (r332890) +++ head/sys/arm/include/atomic-v6.h Mon Apr 23 16:50:37 2018 (r332891) @@ -209,7 +209,7 @@ atomic_fcmpset_32(volatile uint32_t *p, uint32_t *cmpv return (!ret); } -static __inline uint64_t +static __inline int atomic_fcmpset_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) { uint64_t tmp; @@ -235,7 +235,7 @@ atomic_fcmpset_64(volatile uint64_t *p, uint64_t *cmpv return (!ret); } -static __inline u_long +static __inline int atomic_fcmpset_long(volatile u_long *p, u_long *cmpval, u_long newval) { @@ -243,38 +243,38 @@ atomic_fcmpset_long(volatile u_long *p, u_long *cmpval (uint32_t *)cmpval, newval)); } -static __inline uint64_t +static __inline int atomic_fcmpset_acq_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) { - uint64_t ret; + int ret; ret = atomic_fcmpset_64(p, cmpval, newval); dmb(); return (ret); } -static __inline u_long +static __inline int atomic_fcmpset_acq_long(volatile u_long *p, u_long *cmpval, u_long newval) { - u_long ret; + int ret; ret = atomic_fcmpset_long(p, cmpval, newval); dmb(); return (ret); } -static __inline uint32_t +static __inline int atomic_fcmpset_acq_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) { - uint32_t ret; + int ret; ret = atomic_fcmpset_32(p, cmpval, newval); dmb(); return (ret); } -static __inline uint32_t +static __inline int atomic_fcmpset_rel_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) { @@ -282,7 +282,7 @@ atomic_fcmpset_rel_32(volatile uint32_t *p, uint32_t * return (atomic_fcmpset_32(p, cmpval, newval)); } -static __inline uint64_t +static __inline int atomic_fcmpset_rel_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) { @@ -290,7 +290,7 @@ atomic_fcmpset_rel_64(volatile uint64_t *p, uint64_t * return (atomic_fcmpset_64(p, cmpval, newval)); } -static __inline u_long +static __inline int atomic_fcmpset_rel_long(volatile u_long *p, u_long *cmpval, u_long newval) { @@ -298,10 +298,10 @@ atomic_fcmpset_rel_long(volatile u_long *p, u_long *cm return (atomic_fcmpset_long(p, cmpval, newval)); } -static __inline uint32_t +static __inline int atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { - uint32_t ret; + int ret; __asm __volatile( "1: ldrex %0, [%1] \n" @@ -349,44 +349,44 @@ atomic_cmpset_64(volatile uint64_t *p, uint64_t cmpval return (ret); } -static __inline u_long +static __inline int atomic_cmpset_long(volatile u_long *p, u_long cmpval, u_long newval) { return (atomic_cmpset_32((volatile uint32_t *)p, cmpval, newval)); } -static __inline uint32_t +static __inline int atomic_cmpset_acq_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { - uint32_t ret; + int ret; ret = atomic_cmpset_32(p, cmpval, newval); dmb(); return (ret); } -static __inline uint64_t +static __inline int atomic_cmpset_acq_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) { - uint64_t ret; + int ret; ret = atomic_cmpset_64(p, cmpval, newval); dmb(); return (ret); } -static __inline u_long +static __inline int atomic_cmpset_acq_long(volatile u_long *p, u_long cmpval, u_long newval) { - u_long ret; + int ret; ret = atomic_cmpset_long(p, cmpval, newval); dmb(); return (ret); } -static __inline uint32_t +static __inline int atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { @@ -394,7 +394,7 @@ atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cm return (atomic_cmpset_32(p, cmpval, newval)); } -static __inline uint64_t +static __inline int atomic_cmpset_rel_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) { @@ -402,7 +402,7 @@ atomic_cmpset_rel_64(volatile uint64_t *p, uint64_t cm return (atomic_cmpset_64(p, cmpval, newval)); } -static __inline u_long +static __inline int atomic_cmpset_rel_long(volatile u_long *p, u_long cmpval, u_long newval) { From owner-svn-src-head@freebsd.org Mon Apr 23 17:00:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96A00FA6B63; Mon, 23 Apr 2018 17:00: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DE646CEB5; Mon, 23 Apr 2018 17:00: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 349F526E84; Mon, 23 Apr 2018 17:00: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 w3NH0FXW096150; Mon, 23 Apr 2018 17:00:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NH0FpG096149; Mon, 23 Apr 2018 17:00:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804231700.w3NH0FpG096149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 23 Apr 2018 17:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332892 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 332892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 17:00:16 -0000 Author: jhb Date: Mon Apr 23 17:00:15 2018 New Revision: 332892 URL: https://svnweb.freebsd.org/changeset/base/332892 Log: Implement 32-bit atomic_fcmpset() in userland for armv4/v5. - Add an implementation of atomic_fcmpset_32() using RAS for armv4/v5. This fixes recent world breakage due to use of atomic_fcmpset() in userland. - While here, be more careful to not expose wrapper macros for 64-bit atomic_*cmpset to userland for armv4/v5 as only 32-bit cmpset is implemented. This has been reviewed, but not runtime-tested, but should fix the arm.arm and arm.armeb worlds that have been broken for a while. Reviewed by: imp MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D15147 Modified: head/sys/arm/include/atomic-v4.h Modified: head/sys/arm/include/atomic-v4.h ============================================================================== --- head/sys/arm/include/atomic-v4.h Mon Apr 23 16:50:37 2018 (r332891) +++ head/sys/arm/include/atomic-v4.h Mon Apr 23 17:00:15 2018 (r332892) @@ -321,6 +321,33 @@ atomic_cmpset_32(volatile u_int32_t *p, volatile u_int return (done); } +static __inline int +atomic_fcmpset_32(volatile u_int32_t *p, volatile u_int32_t *cmpval, volatile u_int32_t newval) +{ + int done, oldval, ras_start = ARM_RAS_START; + + __asm __volatile("1:\n" + "adr %1, 1b\n" + "str %1, [%0]\n" + "adr %1, 2f\n" + "str %1, [%0, #4]\n" + "ldr %1, [%2]\n" + "ldr %5, [%3]\n" + "cmp %1, %5\n" + "streq %4, [%2]\n" + "2:\n" + "mov %5, #0\n" + "str %5, [%0]\n" + "mov %5, #0xffffffff\n" + "str %5, [%0, #4]\n" + "strne %1, [%3]\n" + "moveq %1, #1\n" + "movne %1, #0\n" + : "+r" (ras_start), "=r" (done) ,"+r" (p) + , "+r" (cmpval), "+r" (newval), "+r" (oldval) : : "cc", "memory"); + return (done); +} + static __inline uint32_t atomic_fetchadd_32(volatile uint32_t *p, uint32_t v) { @@ -409,14 +436,18 @@ atomic_swap_32(volatile u_int32_t *p, u_int32_t v) #define atomic_fcmpset_rel_32 atomic_fcmpset_32 #define atomic_fcmpset_acq_32 atomic_fcmpset_32 +#ifdef _KERNEL #define atomic_fcmpset_rel_64 atomic_fcmpset_64 #define atomic_fcmpset_acq_64 atomic_fcmpset_64 +#endif #define atomic_fcmpset_acq_long atomic_fcmpset_long #define atomic_fcmpset_rel_long atomic_fcmpset_long #define atomic_cmpset_rel_32 atomic_cmpset_32 #define atomic_cmpset_acq_32 atomic_cmpset_32 +#ifdef _KERNEL #define atomic_cmpset_rel_64 atomic_cmpset_64 #define atomic_cmpset_acq_64 atomic_cmpset_64 +#endif #define atomic_set_rel_32 atomic_set_32 #define atomic_set_acq_32 atomic_set_32 #define atomic_clear_rel_32 atomic_clear_32 @@ -463,8 +494,6 @@ atomic_cmpset_long(volatile u_long *dst, u_long old, u return (atomic_cmpset_32((volatile uint32_t *)dst, old, newe)); } -#ifdef _KERNEL -/* atomic_fcmpset_32 is only defined for the kernel */ static __inline u_long atomic_fcmpset_long(volatile u_long *dst, u_long *old, u_long newe) { @@ -472,7 +501,6 @@ atomic_fcmpset_long(volatile u_long *dst, u_long *old, return (atomic_fcmpset_32((volatile uint32_t *)dst, (uint32_t *)old, newe)); } -#endif static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) From owner-svn-src-head@freebsd.org Mon Apr 23 18:00:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95FE8FA811B; Mon, 23 Apr 2018 18:00:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27E4379ED7; Mon, 23 Apr 2018 18:00:29 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x232.google.com with SMTP id x144-v6so10077514itc.0; Mon, 23 Apr 2018 11:00:29 -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=zZT8MgWChhmxDSxmLi/sM6NaY155dT3q38e0D9fLA/U=; b=OUjHIa9SwVIgmWvGgpKwddpr7lfsSe93IyZ2CIoMjlEeXscVwgPF0nLpCfAWRswDKn +f4yEZuRUXDlPcjLpzyRXwKyLCDyul0p5hedZ8UovKF9pzql7nYWvFLoECZ3LV2tQeq4 /ju1PyP12vHSXbb6qQh3h1SvwQM4QfSAyIeFmGPGtdXfCjntuseAepfoBM75pm7ywthR WNphPBB5n2t8HdqWwuZ+F8nsN/7qHF3BrREV+yOOilBV2Jvyx5g4OSadG7AzGeqLZv2O q5Y6hDcOuS7219j89Nsb6mJT0uIMJ3bQ25ShTZqh8ShN/sCpWkxo0+P844xFQGvKx4x7 o0iA== 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=zZT8MgWChhmxDSxmLi/sM6NaY155dT3q38e0D9fLA/U=; b=HggF7touDbGCied51heTMhA2HyFbslIs/rFp75yDZ4ndCusyB/avfO2EvLQlOUwi76 ccMwDrjn+qG13APsCz4/U24lBbc7jKCSF9Ng+40qekjEJObNNEHnNtUlQT0iOjk0MMqV +tdsd1kP5nWnjX9/EXsf1f2EBVDN9/ba4zQ8rPc9mYs3nQhpq4ywkdO29xpXvMad+fCh L2dqLia39cBiXaqNcGcvtgQpxbDVOMX5kLNXc+EaOxeesRmPJrL9OXQPD/aq6zQLerie c8/j+8D3KQJ/fLFkyxnAw2bH3NoFZGV9FN7E3YSNRupeAy0e9MmfLWaAPZQbHY0JD+y0 VsQg== X-Gm-Message-State: ALQs6tAusQFYBZLK23qPg7qc4iw/G3m7ix1yT2nj2OwtXT/hz8a+YywT 6mhppZw559X9BFD97w1Dxetocw== X-Google-Smtp-Source: AB8JxZqig/hapimEzuS3YBZbzUotArJt2IkGgbr0WvRjO7wU49W70n+9WbOzifXWz3F+FQdQA/t53Q== X-Received: by 2002:a24:740a:: with SMTP id o10-v6mr15613878itc.82.1524506428051; Mon, 23 Apr 2018 11:00:28 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-74.dsl.bell.ca. [184.145.252.74]) by smtp.gmail.com with ESMTPSA id z88-v6sm2650595ioi.25.2018.04.23.11.00.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 11:00:26 -0700 (PDT) Sender: Mark Johnston Date: Mon, 23 Apr 2018 14:00:24 -0400 From: Mark Johnston To: "Jonathan T. Looney" Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332860 - head/sys/kern Message-ID: <20180423180024.GC84833@raichu> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180422171106.GB84833@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 18:00:29 -0000 On Mon, Apr 23, 2018 at 11:12:32AM -0400, Jonathan T. Looney wrote: > Hi Mark, > > Let me start by saying that I appreciate your well-reasoned response. (I > think) I understand your reasoning, I appreciate your well-explained > argument, and I respect your opinion. I just wanted to make that clear up > front. > > On Sun, Apr 22, 2018 at 1:11 PM, Mark Johnston wrote: > > > > > All too often, my ability to debug assertion violations is hindered > because > > > the system trips over yet another assertion while dumping the core. If > we > > > skip the assertion, nothing bad happens. (The post-panic debugging code > > > already needs to deal with systems that are inconsistent, and it does a > > > pretty good job at it.) > > > > I think we make a decent effort to fix such problems as they arise, but > > you are declaring defeat on behalf of everyone. Did you make some effort > > to fix or report these issues before resorting to the more drastic > > measure taken here? > > We try to report or fix them as they arise. However, you don't know there > is a problem until you actually run into it. And, you don't run into the > problem until you can't get a core dump due to the assertion. > > (And, with elusive problems, it isn't always easy to duplicate them. So, > fixing the assertion is sometimes "too late".) Sure, this is true. But unless it's a problem in practice it's obviously preferable to keep assertions enabled. Kernel dumping itself is a fundamentally unreliable mechanism, but it works well enough to be useful. I basically never see problems with post-panic assertion failures, and I test the kernel dump code a fair bit. Isilon exercises that code quite a lot as well without any problems that I'm aware of, and I can't think of any reports of such assertion failures that weren't quickly fixed. So I'm wondering what problems exist in your specific environment that we might instead address surgically. (I could very well be wrong about how widespread post-panic assertion failures are. We've had problems of this sort before, e.g., with the updated DRM graphics drivers, where the code to grab the console after a panic didn't work properly. There, the bandaid was to just disable that specific mechanism.) > > > On the other hand, I really am not sure what you are worried might > happen > > > if we skip checking assertions after we've already panic'd. As far as I > can > > > tell, the likely worst case is that we hit a true panic of some kind. In > > > that case, we're no worse off than before. > > > > > > I think the one obvious exception is when we're purposely trying to > > > validate the post-panic debugging code. In that case, you can change the > > > sysctl/tunable to enable troubleshooting. > > > > What about a user whose test system panics and fails to dump? With > > assertions enabled, a developer has a better chance of spotting the > > problem. Now we need at least one extra round trip to the user to > > diagnose the problem, which may not be readily reproducible in the first > > place. > > That's true. However, this is equally true in the other direction: Prior to > this change, when a user tripped over an assertion and was unable to get a > coredump due to a second post-panic assertion, it took (at least) another > round-trip to get a coredump. > > First, without the capability to ignore assertions after a panic > (introduced by this commit), you would need to fix the actual assertion to > enable the user to get a coredump. At minimum, I think this change has > value in that case. This change gives you a mechanism to get a coredump > without requiring that you fix the assertion and get the user to recompile > with the patch. > > But, moreover, if we change the default back to panic'ing on a second > assertion, we will hamper our ability to get usable reports about elusive > bugs. If we leave the default "as is", it won't take an extra round-trip to > tell the user how to get a coredump. If we change the default (or, perhaps > more correctly, "restore the prior default"), we will still need a second > round-trip to get coredumps. That makes it tough to chase elusive bugs. I agree with what you're saying. I'm thinking more of the long-term effects of this change and am concerned that it increases the potential for actual bugs to appear in the kernel dump code paths. Those types of bugs are often quite tricky to track down from a single instance, and can cause dumps to fail. If that starts to happen, we're basically back to where we started. From owner-svn-src-head@freebsd.org Mon Apr 23 18:33:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88E4EFA8E93; Mon, 23 Apr 2018 18:33:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BC8E82FAC; Mon, 23 Apr 2018 18:33:27 +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 35CC327E71; Mon, 23 Apr 2018 18:33:27 +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 w3NIXR29047812; Mon, 23 Apr 2018 18:33:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NIXRi7047811; Mon, 23 Apr 2018 18:33:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804231833.w3NIXRi7047811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 23 Apr 2018 18:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332893 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 332893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 18:33:27 -0000 Author: emaste Date: Mon Apr 23 18:33:26 2018 New Revision: 332893 URL: https://svnweb.freebsd.org/changeset/base/332893 Log: Map FreeBSD EDOOFUS to Linux EINVAL Previously EDOOFUS mapped to EBUSY. EINVAL seems more appropriate. Discussed with: cem MFC after: 1 week Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/compat/linux/linux_errno.inc Modified: head/sys/compat/linux/linux_errno.inc ============================================================================== --- head/sys/compat/linux/linux_errno.inc Mon Apr 23 17:00:15 2018 (r332892) +++ head/sys/compat/linux/linux_errno.inc Mon Apr 23 18:33:26 2018 (r332893) @@ -132,7 +132,7 @@ const int linux_errtbl[ELAST + 1] = { -125, -84, -61, - -16, /* EDOOFUS -> EBUSY */ + -22, /* EDOOFUS -> EINVAL */ -74, -72, From owner-svn-src-head@freebsd.org Mon Apr 23 19:51:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6B2DFAA6D7; Mon, 23 Apr 2018 19:51:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73B0D746CE; Mon, 23 Apr 2018 19:51:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E568A4F; Mon, 23 Apr 2018 19:51:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NJp1Ja084905; Mon, 23 Apr 2018 19:51:01 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NJp0Se084895; Mon, 23 Apr 2018 19:51:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804231951.w3NJp0Se084895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 23 Apr 2018 19:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332894 - in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys X-SVN-Commit-Revision: 332894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 19:51:02 -0000 Author: sbruno Date: Mon Apr 23 19:51:00 2018 New Revision: 332894 URL: https://svnweb.freebsd.org/changeset/base/332894 Log: Load balance sockets with new SO_REUSEPORT_LB option This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple programs or threads to bind to the same port and incoming connections will be load balanced using a hash function. Most of the code was copied from a similar patch for DragonflyBSD. However, in DragonflyBSD, load balancing is a global on/off setting and can not be set per socket. This patch allows for simultaneous use of both the current SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system. Required changes to structures Globally change so_options from 16 to 32 bit value to allow for more options. Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets. Limitations As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or threads sharing the same socket). Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D11003 Modified: head/cddl/lib/libdtrace/tcp.d head/sys/kern/uipc_debug.c head/sys/kern/uipc_socket.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c head/sys/sys/socket.h head/sys/sys/socketvar.h Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Mon Apr 23 18:33:26 2018 (r332893) +++ head/cddl/lib/libdtrace/tcp.d Mon Apr 23 19:51:00 2018 (r332894) @@ -192,12 +192,12 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport); tcps_laddr = p == NULL ? 0 : p->t_inpcb->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie46_local.ia46_addr4.s_addr) : - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie6_local); + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr); tcps_raddr = p == NULL ? 0 : p->t_inpcb->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie46_foreign.ia46_addr4.s_addr) : - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr); tcps_state = p == NULL ? -1 : p->t_state; tcps_iss = p == NULL ? 0 : p->iss; tcps_irs = p == NULL ? 0 : p->irs; Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Mon Apr 23 18:33:26 2018 (r332893) +++ head/sys/kern/uipc_debug.c Mon Apr 23 19:51:00 2018 (r332894) @@ -77,7 +77,7 @@ db_print_sotype(short so_type) } static void -db_print_sooptions(short so_options) +db_print_sooptions(int so_options) { int comma; @@ -120,6 +120,10 @@ db_print_sooptions(short so_options) } if (so_options & SO_REUSEPORT) { db_printf("%sSO_REUSEPORT", comma ? ", " : ""); + comma = 1; + } + if (so_options & SO_REUSEPORT_LB) { + db_printf("%sSO_REUSEPORT_LB", comma ? ", " : ""); comma = 1; } if (so_options & SO_TIMESTAMP) { Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Apr 23 18:33:26 2018 (r332893) +++ head/sys/kern/uipc_socket.c Mon Apr 23 19:51:00 2018 (r332894) @@ -1057,6 +1057,100 @@ sofree(struct socket *so) } /* + * Let socket in same load balance group (same port and address) + * inherit pending sockets of the closing socket. + * + * "so_inh" will inherit sockets from "so" + */ +void +soinherit(struct socket *so, struct socket *so_inh) +{ + TAILQ_HEAD(, socket) comp, incomp; + struct socket *sp, *head, *head_inh; + int qlen, incqlen; + + KASSERT(so->so_options & SO_ACCEPTCONN, + ("so does not accept connection")); + KASSERT(so_inh->so_options & SO_ACCEPTCONN, + ("so_inh does not accept connection")); + + +restart: + SOCK_LOCK(so); + if ((head = so->so_listen) != NULL && + __predict_false(SOLISTEN_TRYLOCK(head) == 0)) { + SOCK_UNLOCK(so); + goto restart; + } + +restart_inh: + SOCK_LOCK(so_inh); + if ((head_inh = so_inh->so_listen) != NULL && + __predict_false(SOLISTEN_TRYLOCK(head_inh) == 0)) { + SOCK_UNLOCK(so_inh); + goto restart_inh; + } + + TAILQ_INIT(&comp); + TAILQ_INIT(&incomp); + + /* + * Save completed queue and incompleted queue + */ + TAILQ_CONCAT(&comp, &so->sol_comp, so_list); + qlen = so->sol_qlen; + so->sol_qlen = 0; + + TAILQ_CONCAT(&incomp, &so->sol_incomp, so_list); + incqlen = so->sol_incqlen; + so->sol_incqlen = 0; + + /* + * Append the saved completed queue and incompleted + * queue to the socket inherits them. + * + * XXX + * This may temporarily break the inheriting socket's + * so_qlimit. + */ + TAILQ_FOREACH(sp, &comp, so_list) { + refcount_acquire(&so_inh->so_count); + sp->so_listen = so_inh; + crfree(sp->so_cred); + sp->so_cred = crhold(so_inh->so_cred); + } + + TAILQ_FOREACH(sp, &incomp, so_list) { + refcount_acquire(&so_inh->so_count); + sp->so_listen = so_inh; + crfree(sp->so_cred); + sp->so_cred = crhold(so_inh->so_cred); + } + + TAILQ_CONCAT(&so_inh->sol_comp, &comp, so_list); + so_inh->sol_qlen += qlen; + + TAILQ_CONCAT(&so_inh->sol_incomp, &incomp, so_list); + so_inh->sol_incqlen += incqlen; + + SOCK_UNLOCK(so); + if(head != NULL) + SOLISTEN_UNLOCK(head); + + SOCK_UNLOCK(so_inh); + if(head_inh != NULL) { + if(qlen > 0) { + /* + * "New" connections have arrived + */ + solisten_wakeup(head_inh); + } else { + SOLISTEN_UNLOCK(head_inh); + } + } +} + +/* * Close a socket on last file table reference removal. Initiate disconnect * if connected. Free socket when disconnect complete. * @@ -2776,6 +2870,7 @@ sosetopt(struct socket *so, struct sockopt *sopt) case SO_BROADCAST: case SO_REUSEADDR: case SO_REUSEPORT: + case SO_REUSEPORT_LB: case SO_OOBINLINE: case SO_TIMESTAMP: case SO_BINTIME: @@ -2994,6 +3089,7 @@ sogetopt(struct socket *so, struct sockopt *sopt) case SO_KEEPALIVE: case SO_REUSEADDR: case SO_REUSEPORT: + case SO_REUSEPORT_LB: case SO_BROADCAST: case SO_OOBINLINE: case SO_ACCEPTCONN: Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Apr 23 18:33:26 2018 (r332893) +++ head/sys/netinet/in_pcb.c Mon Apr 23 19:51:00 2018 (r332894) @@ -108,6 +108,9 @@ __FBSDID("$FreeBSD$"); #include +#define INPCBLBGROUP_SIZMIN 8 +#define INPCBLBGROUP_SIZMAX 256 + static struct callout ipport_tick_callout; /* @@ -217,7 +220,186 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtim * functions often modify hash chains or addresses in pcbs. */ +static struct inpcblbgroup * +in_pcblbgroup_alloc(struct inpcblbgrouphead *hdr, u_char vflag, + uint16_t port, const union in_dependaddr *addr, int size) +{ + struct inpcblbgroup *grp; + + size_t bytes = __offsetof(struct inpcblbgroup, il_inp[size]); + grp = malloc(bytes, M_PCB, M_ZERO | M_NOWAIT); + if(!grp) + return NULL; + grp->il_vflag = vflag; + grp->il_lport = port; + grp->il_dependladdr = *addr; + grp->il_inpsiz = size; + LIST_INSERT_HEAD(hdr, grp, il_list); + + return grp; +} + +static void +in_pcblbgroup_free(struct inpcblbgroup *grp) +{ + LIST_REMOVE(grp, il_list); + free(grp, M_TEMP); +} + +static struct inpcblbgroup * +in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, + struct inpcblbgroup *old_grp, int size) +{ + struct inpcblbgroup *grp; + int i; + + grp = in_pcblbgroup_alloc(hdr, old_grp->il_vflag, + old_grp->il_lport, &old_grp->il_dependladdr, size); + if(!grp) + return NULL; + + KASSERT(old_grp->il_inpcnt < grp->il_inpsiz, + ("invalid new local group size %d and old local group count %d", + grp->il_inpsiz, old_grp->il_inpcnt)); + for (i = 0; i < old_grp->il_inpcnt; ++i) + grp->il_inp[i] = old_grp->il_inp[i]; + grp->il_inpcnt = old_grp->il_inpcnt; + + in_pcblbgroup_free(old_grp); + + return grp; +} + /* + * Add PCB to lb group (load balance used by SO_REUSEPORT_LB) + */ +static int +in_pcbinslbgrouphash(struct inpcb *inp, struct inpcbinfo *pcbinfo) +{ + struct inpcblbgrouphead *hdr; + struct inpcblbgroup *grp; + + uint16_t hashmask = pcbinfo->ipi_lbgrouphashmask; + uint16_t lport = inp->inp_lport; + uint32_t group_index = INP_PCBLBGROUP_PORTHASH(lport, hashmask); + + hdr = &pcbinfo->ipi_lbgrouphashbase[group_index]; + + struct ucred *cred; + + if (pcbinfo->ipi_lbgrouphashbase == NULL) + return 0; + + /* + * don't allow jailed socket to join local group + */ + if (inp->inp_socket != NULL) + cred = inp->inp_socket->so_cred; + else + cred = NULL; + if (cred != NULL && jailed(cred)) + return 0; + +#ifdef INET6 + /* + * don't allow IPv4 mapped INET6 wild socket + */ + if ((inp->inp_vflag & INP_IPV4) && + inp->inp_laddr.s_addr == INADDR_ANY && + INP_CHECK_SOCKAF(inp->inp_socket, AF_INET6)) { + return 0; + } +#endif + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBLBGROUP_PORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; + + LIST_FOREACH(grp, hdr, il_list) { + if (grp->il_vflag == inp->inp_vflag && + grp->il_lport == inp->inp_lport && + memcmp(&grp->il_dependladdr, + &inp->inp_inc.inc_ie.ie_dependladdr, + sizeof(grp->il_dependladdr)) == 0) { + break; + } + } + if (grp == NULL) { + /* Create new load balance group */ + grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag, + inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, + INPCBLBGROUP_SIZMIN); + if(!grp) + return (ENOBUFS); + } else if (grp->il_inpcnt == grp->il_inpsiz) { + if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { + static int limit_logged = 0; + + if (!limit_logged) { + limit_logged = 1; + printf("lb group port %d, " + "limit reached\n", ntohs(grp->il_lport)); + } + return 0; + } + + /* Expand this local group */ + grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); + if(!grp) + return (ENOBUFS); + } + + KASSERT(grp->il_inpcnt < grp->il_inpsiz, + ("invalid local group size %d and count %d", + grp->il_inpsiz, grp->il_inpcnt)); + + grp->il_inp[grp->il_inpcnt] = inp; + grp->il_inpcnt++; + return 0; +} + +static void +in_pcbremlbgrouphash(struct inpcb *inp, struct inpcbinfo *pcbinfo) +{ + struct inpcblbgrouphead *hdr; + struct inpcblbgroup *grp; + + if (pcbinfo->ipi_lbgrouphashbase == NULL) + return; + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBLBGROUP_PORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; + + LIST_FOREACH(grp, hdr, il_list) { + int i; + + for (i = 0; i < grp->il_inpcnt; ++i) { + if (grp->il_inp[i] != inp) + continue; + + if (grp->il_inpcnt == 1) { + /* Free this local group */ + in_pcblbgroup_free(grp); + } else { + /* Pull up inpcbs */ + for (; i + 1 < grp->il_inpcnt; ++i) + grp->il_inp[i] = grp->il_inp[i + 1]; + grp->il_inpcnt--; + + if (grp->il_inpsiz > INPCBLBGROUP_SIZMIN && + grp->il_inpcnt <= (grp->il_inpsiz / 4)) { + /* Shrink this local group */ + struct inpcblbgroup *new_grp = + in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2); + if(new_grp) + grp = new_grp; + } + } + return; + } + } +} + +/* * Different protocols initialize their inpcbs differently - giving * different name to the lock. But they all are disposed the same. */ @@ -252,6 +434,8 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char &pcbinfo->ipi_hashmask); pcbinfo->ipi_porthashbase = hashinit(porthash_nelements, M_PCB, &pcbinfo->ipi_porthashmask); + pcbinfo->ipi_lbgrouphashbase = hashinit(hash_nelements, M_PCB, + &pcbinfo->ipi_lbgrouphashmask); #ifdef PCBGROUP in_pcbgroup_init(pcbinfo, hashfields, hash_nelements); #endif @@ -275,6 +459,8 @@ in_pcbinfo_destroy(struct inpcbinfo *pcbinfo) hashdestroy(pcbinfo->ipi_hashbase, M_PCB, pcbinfo->ipi_hashmask); hashdestroy(pcbinfo->ipi_porthashbase, M_PCB, pcbinfo->ipi_porthashmask); + hashdestroy(pcbinfo->ipi_lbgrouphashbase, M_PCB, + pcbinfo->ipi_lbgrouphashmask); #ifdef PCBGROUP in_pcbgroup_destroy(pcbinfo); #endif @@ -513,18 +699,20 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp /* * Return cached socket options. */ -short +int inp_so_options(const struct inpcb *inp) { - short so_options; + int so_options; - so_options = 0; + so_options = 0; - if ((inp->inp_flags2 & INP_REUSEPORT) != 0) - so_options |= SO_REUSEPORT; - if ((inp->inp_flags2 & INP_REUSEADDR) != 0) - so_options |= SO_REUSEADDR; - return (so_options); + if ((inp->inp_flags2 & INP_REUSEPORT_LB) != 0) + so_options |= SO_REUSEPORT_LB; + if ((inp->inp_flags2 & INP_REUSEPORT) != 0) + so_options |= SO_REUSEPORT; + if ((inp->inp_flags2 & INP_REUSEADDR) != 0) + so_options |= SO_REUSEADDR; + return (so_options); } #endif /* INET || INET6 */ @@ -581,6 +769,12 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n int error; /* + * XXX Maybe we could let SO_REUSEPORT_LB set SO_REUSEPORT bit here + * so that we don't have to add to the (already messy) code below + */ + int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); + + /* * No state changes, so read locks are sufficient here. */ INP_LOCK_ASSERT(inp); @@ -591,7 +785,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n laddr.s_addr = *laddrp; if (nam != NULL && laddr.s_addr != INADDR_ANY) return (EINVAL); - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { if ((error = prison_local_ip4(cred, &laddr)) != 0) @@ -628,16 +822,20 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n */ if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; + // XXX: How to deal with SO_REUSEPORT_LB here? + // Added equivalent treatment as SO_REUSEPORT here for now + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT_LB)) != 0) + reuseport_lb = SO_REUSEADDR|SO_REUSEPORT_LB; } else if (sin->sin_addr.s_addr != INADDR_ANY) { sin->sin_port = 0; /* yech... */ bzero(&sin->sin_zero, sizeof(sin->sin_zero)); /* - * Is the address a local IP address? + * Is the address a local IP address? * If INP_BINDANY is set, then the socket may be bound * to any endpoint address, local or not. */ if ((inp->inp_flags & INP_BINDANY) == 0 && - ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) + ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) return (EADDRNOTAVAIL); } laddr = sin->sin_addr; @@ -667,7 +865,8 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n ntohl(t->inp_faddr.s_addr) == INADDR_ANY) && (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - (t->inp_flags2 & INP_REUSEPORT) == 0) && + (t->inp_flags2 & INP_REUSEPORT) || + (t->inp_flags2 & INP_REUSEPORT_LB) == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); @@ -692,11 +891,14 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n */ tw = intotw(t); if (tw == NULL || - (reuseport & tw->tw_so_options) == 0) + ((reuseport & tw->tw_so_options) == 0 && + (reuseport_lb & tw->tw_so_options) == 0)) { return (EADDRINUSE); + } } else if (t && - ((inp->inp_flags2 & INP_BINDMULTI) == 0) && - (reuseport & inp_so_options(t)) == 0) { + ((inp->inp_flags2 & INP_BINDMULTI) == 0) && + (reuseport & inp_so_options(t)) == 0 && + (reuseport_lb & inp_so_options(t)) == 0) { #ifdef INET6 if (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || @@ -705,7 +907,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n (inp->inp_vflag & INP_IPV6PROTO) == 0 || (t->inp_vflag & INP_IPV6PROTO) == 0) #endif - return (EADDRINUSE); + return (EADDRINUSE); if (t && (! in_pcbbind_check_bindmulti(inp, t))) return (EADDRINUSE); } @@ -1409,6 +1611,7 @@ in_pcbdrop(struct inpcb *inp) struct inpcbport *phd = inp->inp_phd; INP_HASH_WLOCK(inp->inp_pcbinfo); + in_pcbremlbgrouphash(inp, inp->inp_pcbinfo); LIST_REMOVE(inp, inp_hash); LIST_REMOVE(inp, inp_portlist); if (LIST_FIRST(&phd->phd_pcblist) == NULL) { @@ -1669,6 +1872,98 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i } #undef INP_LOOKUP_MAPPED_PCB_COST +struct inpcb * +in_pcblookup_lbgroup_last(const struct inpcb *inp) +{ + const struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; + const struct inpcblbgrouphead *hdr; + const struct inpcblbgroup *grp; + int i; + + if (pcbinfo->ipi_lbgrouphashbase == NULL) + return NULL; + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBLBGROUP_PORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; + + LIST_FOREACH(grp, hdr, il_list) { + if (grp->il_vflag == inp->inp_vflag && + grp->il_lport == inp->inp_lport && + memcmp(&grp->il_dependladdr, + &inp->inp_inc.inc_ie.ie_dependladdr, + sizeof(grp->il_dependladdr)) == 0) { + break; + } + } + if (grp == NULL || grp->il_inpcnt == 1) + return NULL; + + KASSERT(grp->il_inpcnt >= 2, + ("invalid lbgroup inp count %d", grp->il_inpcnt)); + for (i = 0; i < grp->il_inpcnt; ++i) { + if (grp->il_inp[i] == inp) { + int last = grp->il_inpcnt - 1; + + if (i == last) + last = grp->il_inpcnt - 2; + return grp->il_inp[last]; + } + } + return NULL; +} + +static struct inpcb * +in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, + const struct in_addr *laddr, uint16_t lport, const struct in_addr *faddr, + uint16_t fport, int lookupflags) +{ + struct inpcb *local_wild = NULL; + const struct inpcblbgrouphead *hdr; + struct inpcblbgroup *grp; + struct inpcblbgroup *grp_local_wild; + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBLBGROUP_PORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; + + /* + * Order of socket selection: + * 1. non-wild. + * 2. wild (if lookupflags contains INPLOOKUP_WILDCARD). + * + * NOTE: + * - Load balanced group does not contain jailed sockets + * - Load balanced group does not contain IPv4 mapped INET6 wild sockets + */ + LIST_FOREACH(grp, hdr, il_list) { +#ifdef INET6 + if (!(grp->il_vflag & INP_IPV4)) + continue; +#endif + + if (grp->il_lport == lport) { + + uint32_t idx = 0; + int pkt_hash = INP_PCBLBGROUP_PKTHASH(faddr->s_addr, lport, fport); + + idx = pkt_hash % grp->il_inpcnt; + + if (grp->il_laddr.s_addr == laddr->s_addr) { + return grp->il_inp[idx]; + } else { + if (grp->il_laddr.s_addr == INADDR_ANY && + (lookupflags & INPLOOKUP_WILDCARD)) { + local_wild = grp->il_inp[idx]; + grp_local_wild = grp; + } + } + } + } + if (local_wild != NULL) { + return local_wild; + } + return NULL; +} + #ifdef PCBGROUP /* * Lookup PCB in hash list, using pcbgroup tables. @@ -1948,6 +2243,18 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st return (tmpinp); /* + * Then look in lb group (for wildcard match) + */ + if (pcbinfo->ipi_lbgrouphashbase != NULL && + (lookupflags & INPLOOKUP_WILDCARD)) { + inp = in_pcblookup_lbgroup(pcbinfo, &laddr, lport, &faddr, fport, + lookupflags); + if (inp != NULL) { + return inp; + } + } + + /* * Then look for a wildcard match, if requested. */ if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { @@ -2164,6 +2471,7 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct inpcbport *phd; u_int32_t hashkey_faddr; + int so_options; INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -2184,7 +2492,21 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr pcbporthash = &pcbinfo->ipi_porthashbase[ INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_porthashmask)]; + /* + * Add entry in lb group + * Only do this if SO_REUSEPORT_LB is set + */ + so_options = inp_so_options(inp); + if(so_options & SO_REUSEPORT_LB) { + int ret = in_pcbinslbgrouphash(inp, pcbinfo); + if(ret) { + // pcb lb group malloc fail (ret=ENOBUFS) + return ret; + } + } + + /* * Go through port list and look for a head for this lport. */ LIST_FOREACH(phd, pcbporthash, phd_hash) { @@ -2310,6 +2632,10 @@ in_pcbremlists(struct inpcb *inp) struct inpcbport *phd = inp->inp_phd; INP_HASH_WLOCK(pcbinfo); + + // XXX Only do if SO_REUSEPORT_LB set? + in_pcbremlbgrouphash(inp, pcbinfo); + LIST_REMOVE(inp, inp_hash); LIST_REMOVE(inp, inp_portlist); if (LIST_FIRST(&phd->phd_pcblist) == NULL) { Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon Apr 23 18:33:26 2018 (r332893) +++ head/sys/netinet/in_pcb.h Mon Apr 23 19:51:00 2018 (r332894) @@ -78,6 +78,11 @@ struct in_addr_4in6 { struct in_addr ia46_addr4; }; +union in_dependaddr { + struct in_addr_4in6 id46_addr; + struct in6_addr id6_addr; +}; + /* * NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has * some extra padding to accomplish this. @@ -88,22 +93,14 @@ struct in_endpoints { u_int16_t ie_fport; /* foreign port */ u_int16_t ie_lport; /* local port */ /* protocol dependent part, local and foreign addr */ - union { - /* foreign host table entry */ - struct in_addr_4in6 ie46_foreign; - struct in6_addr ie6_foreign; - } ie_dependfaddr; - union { - /* local host table entry */ - struct in_addr_4in6 ie46_local; - struct in6_addr ie6_local; - } ie_dependladdr; + union in_dependaddr ie_dependfaddr; /* foreign host table entry */ + union in_dependaddr ie_dependladdr; /* local host table entry */ +#define ie_faddr ie_dependfaddr.id46_addr.ia46_addr4 +#define ie_laddr ie_dependladdr.id46_addr.ia46_addr4 +#define ie6_faddr ie_dependfaddr.id6_addr +#define ie6_laddr ie_dependladdr.id6_addr u_int32_t ie6_zoneid; /* scope zone id */ }; -#define ie_faddr ie_dependfaddr.ie46_foreign.ia46_addr4 -#define ie_laddr ie_dependladdr.ie46_local.ia46_addr4 -#define ie6_faddr ie_dependfaddr.ie6_foreign -#define ie6_laddr ie_dependladdr.ie6_local /* * XXX The defines for inc_* are hacks and should be changed to direct @@ -407,6 +404,21 @@ struct inpcbport { u_short phd_port; }; +struct inpcblbgroup { + LIST_ENTRY(inpcblbgroup) il_list; + uint16_t il_lport; + u_char il_vflag; + u_char il_pad; + uint32_t il_pad2; + union in_dependaddr il_dependladdr; +#define il_laddr il_dependladdr.id46_addr.ia46_addr4 +#define il6_laddr il_dependladdr.id6_addr + uint32_t il_inpsiz; /* size of il_inp[] */ + uint32_t il_inpcnt; /* # of elem in il_inp[] */ + struct inpcb *il_inp[]; +}; +LIST_HEAD(inpcblbgrouphead, inpcblbgroup); + /*- * Global data structure for each high-level protocol (UDP, TCP, ...) in both * IPv4 and IPv6. Holds inpcb lists and information for managing them. @@ -500,6 +512,13 @@ struct inpcbinfo { u_long ipi_wildmask; /* (p) */ /* + * Load balanced group used by the SO_REUSEPORT_LB option, + * hashed by local address and local port. + */ + struct inpcblbgrouphead *ipi_lbgrouphashbase; + u_long ipi_lbgrouphashmask; + + /* * Pointer to network stack instance */ struct vnet *ipi_vnet; /* (c) */ @@ -585,7 +604,7 @@ struct tcpcb * inp_inpcbtotcpcb(struct inpcb *inp); void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp); -short inp_so_options(const struct inpcb *inp); +int inp_so_options(const struct inpcb *inp); #endif /* _KERNEL */ @@ -648,6 +667,10 @@ short inp_so_options(const struct inpcb *inp); (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask)) #define INP_PCBPORTHASH(lport, mask) \ (ntohs((lport)) & (mask)) +#define INP_PCBLBGROUP_PORTHASH(lport, mask) \ + (ntohs((lport)) & (mask)) +#define INP_PCBLBGROUP_PKTHASH(faddr, lport, fport) \ + ((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) #define INP6_PCBHASHKEY(faddr) ((faddr)->s6_addr32[3]) /* @@ -716,6 +739,7 @@ short inp_so_options(const struct inpcb *inp); #define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ #define INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ #define INP_CANNOT_DO_ECN 0x00001000 /* The stack does not do ECN */ +#define INP_REUSEPORT_LB 0x00002000 /* SO_REUSEPORT_LB option is set */ /* * Flags passed to in_pcblookup*() functions. @@ -818,6 +842,8 @@ struct inpcb * struct inpcb * in_pcblookup(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *); +struct inpcb * + in_pcblookup_lbgroup_last(const struct inpcb *inp); struct inpcb * in_pcblookup_mbuf(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *, struct mbuf *); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Apr 23 18:33:26 2018 (r332893) +++ head/sys/netinet/ip_output.c Mon Apr 23 19:51:00 2018 (r332894) @@ -986,6 +986,15 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) INP_WUNLOCK(inp); error = 0; break; + case SO_REUSEPORT_LB: + INP_WLOCK(inp); + if ((so->so_options & SO_REUSEPORT_LB) != 0) + inp->inp_flags2 |= INP_REUSEPORT_LB; + else + inp->inp_flags2 &= ~INP_REUSEPORT_LB; + INP_WUNLOCK(inp); + error = 0; + break; case SO_SETFIB: INP_WLOCK(inp); inp->inp_inc.inc_fibnum = so->so_fibnum; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Apr 23 18:33:26 2018 (r332893) +++ head/sys/netinet/tcp_subr.c Mon Apr 23 19:51:00 2018 (r332894) @@ -1956,10 +1956,28 @@ tcp_close(struct tcpcb *tp) { struct inpcb *inp = tp->t_inpcb; struct socket *so; + struct inpcb *inp_inh = NULL; + int listen = tp->t_state & TCPS_LISTEN; INP_INFO_LOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); + if (listen) { + /* + * Pending socket/syncache inheritance + * + * If this is a listen(2) socket, find another listen(2) + * socket in the same local group, which could inherit + * the syncache and sockets pending on the completion + * and incompletion queues. + * + * NOTE: + * Currently the inheritance could only happen on the + * listen(2) sockets with SO_REUSEPORT_LB set. + */ + inp_inh = in_pcblookup_lbgroup_last(inp); + } + #ifdef TCP_OFFLOAD if (tp->t_state == TCPS_LISTEN) tcp_offload_listen_stop(tp); @@ -1979,7 +1997,16 @@ tcp_close(struct tcpcb *tp) tcp_state_change(tp, TCPS_CLOSED); KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); so = inp->inp_socket; + soisdisconnected(so); + + if(listen) + { + if(inp_inh != NULL && inp_inh->inp_socket != NULL) { + soinherit(so, inp_inh->inp_socket); + } + } + if (inp->inp_flags & INP_SOCKREF) { KASSERT(so->so_state & SS_PROTOREF, ("tcp_close: !SS_PROTOREF")); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Apr 23 18:33:26 2018 (r332893) +++ head/sys/netinet/udp_usrreq.c Mon Apr 23 19:51:00 2018 (r332894) @@ -612,7 +612,7 @@ udp_input(struct mbuf **mp, int *offp, int proto) * will never clear these options after setting them. */ if ((last->inp_socket->so_options & - (SO_REUSEPORT|SO_REUSEADDR)) == 0) + (SO_REUSEPORT|SO_REUSEPORT_LB|SO_REUSEADDR)) == 0) break; } Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon Apr 23 18:33:26 2018 (r332893) +++ head/sys/netinet6/in6_pcb.c Mon Apr 23 19:51:00 2018 (r332894) @@ -125,6 +125,12 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, int error, lookupflags = 0; int reuseport = (so->so_options & SO_REUSEPORT); + /* + * XXX Maybe we could let SO_REUSEPORT_LB set SO_REUSEPORT bit here + * so that we don't have to add to the (already messy) code below + */ + int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); + INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -132,7 +138,7 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, return (EADDRNOTAVAIL); if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) return (EINVAL); - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { if ((error = prison_local_ip6(cred, &inp->in6p_laddr, @@ -166,6 +172,10 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, */ if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; + // XXX: How to deal with SO_REUSEPORT_LB here? + // Added equivalent treatment as SO_REUSEPORT here for now + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT_LB)) != 0) + reuseport_lb = SO_REUSEADDR|SO_REUSEPORT_LB; } else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct ifaddr *ifa; @@ -214,7 +224,8 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr) || - (t->inp_flags2 & INP_REUSEPORT) == 0) && + (t->inp_flags2 & INP_REUSEPORT) || + (t->inp_flags2 & INP_REUSEPORT_LB) == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); @@ -264,34 +275,39 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, */ tw = intotw(t); if (tw == NULL || - (reuseport & tw->tw_so_options) == 0) + ((reuseport & tw->tw_so_options) == 0 && + (reuseport_lb & tw->tw_so_options) == 0)) return (EADDRINUSE); - } else if (t && (reuseport & inp_so_options(t)) == 0) { + } else if (t && (reuseport & inp_so_options(t)) == 0 && + (reuseport_lb & inp_so_options(t)) == 0) { return (EADDRINUSE); } #ifdef INET if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 && - IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct sockaddr_in sin; in6_sin6_2_sin(&sin, sin6); t = in_pcblookup_local(pcbinfo, sin.sin_addr, - lport, lookupflags, cred); + lport, lookupflags, cred); if (t && t->inp_flags & INP_TIMEWAIT) { tw = intotw(t); if (tw == NULL) return (EADDRINUSE); if ((reuseport & tw->tw_so_options) == 0 - && (ntohl(t->inp_laddr.s_addr) != - INADDR_ANY || ((inp->inp_vflag & - INP_IPV6PROTO) == - (t->inp_vflag & INP_IPV6PROTO)))) + && (reuseport_lb & tw->tw_so_options) == 0 + && (ntohl(t->inp_laddr.s_addr) != + INADDR_ANY || ((inp->inp_vflag & + INP_IPV6PROTO) == + (t->inp_vflag & INP_IPV6PROTO)))) return (EADDRINUSE); } else if (t && - (reuseport & inp_so_options(t)) == 0 && - (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - (t->inp_vflag & INP_IPV6PROTO) != 0)) + (reuseport & inp_so_options(t)) == 0 && + (reuseport_lb & inp_so_options(t)) == 0 && + (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || + (t->inp_vflag & INP_IPV6PROTO) != 0)) { return (EADDRINUSE); + } } #endif } @@ -856,6 +872,54 @@ in6_rtchange(struct inpcb *inp, int errno) return inp; } +static struct inpcb * +in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, + const struct in6_addr *laddr, uint16_t lport, const struct in6_addr *faddr, + uint16_t fport, int lookupflags) +{ + struct inpcb *local_wild = NULL; + const struct inpcblbgrouphead *hdr; + struct inpcblbgroup *grp; + struct inpcblbgroup *grp_local_wild; + + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBLBGROUP_PORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; + + /* + * Order of socket selection: + * 1. non-wild. + * 2. wild (if lookupflags contains INPLOOKUP_WILDCARD). + * + * NOTE: + * - Load balanced group does not contain jailed sockets + * - Load balanced does not contain IPv4 mapped INET6 wild sockets + */ + LIST_FOREACH(grp, hdr, il_list) { + + if (grp->il_lport == lport) { + uint32_t idx = 0; + int pkt_hash = INP_PCBLBGROUP_PKTHASH( + INP6_PCBHASHKEY(faddr), lport, fport); + + idx = pkt_hash % grp->il_inpcnt; + + if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) { + return grp->il_inp[idx]; + } else { + if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && + (lookupflags & INPLOOKUP_WILDCARD)) { + local_wild = grp->il_inp[idx]; + grp_local_wild = grp; + } + } + } + } + if (local_wild != NULL) { + return local_wild; + } + return NULL; +} + #ifdef PCBGROUP /* * Lookup PCB in hash list, using pcbgroup tables. @@ -1057,6 +1121,8 @@ found: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Apr 23 21:10:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B9AFAB860; Mon, 23 Apr 2018 21:10:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7E9386CC2; Mon, 23 Apr 2018 21:10:33 +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 E2DB016E8; Mon, 23 Apr 2018 21:10:33 +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 w3NLAXMx024799; Mon, 23 Apr 2018 21:10:33 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NLAX9P024793; Mon, 23 Apr 2018 21:10:33 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804232110.w3NLAX9P024793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 23 Apr 2018 21:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332895 - in head: lib/libifconfig sbin/etherswitchcfg sbin/ifconfig sys/net X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: lib/libifconfig sbin/etherswitchcfg sbin/ifconfig sys/net X-SVN-Commit-Revision: 332895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 21:10:34 -0000 Author: brooks Date: Mon Apr 23 21:10:33 2018 New Revision: 332895 URL: https://svnweb.freebsd.org/changeset/base/332895 Log: Finish removing FDDI and tokenring media support. This fixes media display for 802.11 wireless devices. Software outside the base system that uses these media types and defines should use #ifdef IFM_FDDI or IFM_TOKEN to include or remove support. Reported by: zeising Reviewed by: emaste, kib, zeising Tested by: zeising Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15170 Modified: head/lib/libifconfig/libifconfig_media.c head/sbin/etherswitchcfg/ifmedia.c head/sbin/ifconfig/ifmedia.c head/sys/net/if_media.c head/sys/net/if_media.h Modified: head/lib/libifconfig/libifconfig_media.c ============================================================================== --- head/lib/libifconfig/libifconfig_media.c Mon Apr 23 19:51:00 2018 (r332894) +++ head/lib/libifconfig/libifconfig_media.c Mon Apr 23 21:10:33 2018 (r332895) @@ -77,15 +77,6 @@ static struct ifmedia_description ifm_subtype_ethernet static struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] = IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_tokenring_descriptions[] = - IFM_SUBTYPE_TOKENRING_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_tokenring_aliases[] = - IFM_SUBTYPE_TOKENRING_ALIASES; - -static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = - IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -155,24 +146,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_ethernet_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_tokenring_descriptions[0], 0 }, - { &ifm_subtype_tokenring_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_tokenring_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: head/sbin/etherswitchcfg/ifmedia.c ============================================================================== --- head/sbin/etherswitchcfg/ifmedia.c Mon Apr 23 19:51:00 2018 (r332894) +++ head/sbin/etherswitchcfg/ifmedia.c Mon Apr 23 21:10:33 2018 (r332895) @@ -363,15 +363,6 @@ static struct ifmedia_description ifm_subtype_ethernet static struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] = IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_tokenring_descriptions[] = - IFM_SUBTYPE_TOKENRING_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_tokenring_aliases[] = - IFM_SUBTYPE_TOKENRING_ALIASES; - -static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = - IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -437,24 +428,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_ethernet_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_tokenring_descriptions[0], 0 }, - { &ifm_subtype_tokenring_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_tokenring_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Mon Apr 23 19:51:00 2018 (r332894) +++ head/sbin/ifconfig/ifmedia.c Mon Apr 23 21:10:33 2018 (r332895) @@ -380,15 +380,6 @@ static struct ifmedia_description ifm_subtype_ethernet static struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] = IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS; -static struct ifmedia_description ifm_subtype_tokenring_descriptions[] = - IFM_SUBTYPE_TOKENRING_DESCRIPTIONS; - -static struct ifmedia_description ifm_subtype_tokenring_aliases[] = - IFM_SUBTYPE_TOKENRING_ALIASES; - -static struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = - IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; - static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -454,24 +445,6 @@ static struct ifmedia_type_to_subtype ifmedia_types_to { &ifm_shared_option_descriptions[0], 0 }, { &ifm_shared_option_aliases[0], 1 }, { &ifm_subtype_ethernet_option_descriptions[0], 0 }, - { NULL, 0 }, - }, - { - { NULL, 0 }, - }, - }, - { - { - { &ifm_subtype_shared_descriptions[0], 0 }, - { &ifm_subtype_shared_aliases[0], 1 }, - { &ifm_subtype_tokenring_descriptions[0], 0 }, - { &ifm_subtype_tokenring_aliases[0], 1 }, - { NULL, 0 }, - }, - { - { &ifm_shared_option_descriptions[0], 0 }, - { &ifm_shared_option_aliases[0], 1 }, - { &ifm_subtype_tokenring_option_descriptions[0], 0 }, { NULL, 0 }, }, { Modified: head/sys/net/if_media.c ============================================================================== --- head/sys/net/if_media.c Mon Apr 23 19:51:00 2018 (r332894) +++ head/sys/net/if_media.c Mon Apr 23 21:10:33 2018 (r332895) @@ -399,12 +399,6 @@ struct ifmedia_description ifm_subtype_ethernet_descri struct ifmedia_description ifm_subtype_ethernet_option_descriptions[] = IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS; -struct ifmedia_description ifm_subtype_tokenring_descriptions[] = - IFM_SUBTYPE_TOKENRING_DESCRIPTIONS; - -struct ifmedia_description ifm_subtype_tokenring_option_descriptions[] = - IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS; - struct ifmedia_description ifm_subtype_ieee80211_descriptions[] = IFM_SUBTYPE_IEEE80211_DESCRIPTIONS; @@ -437,11 +431,6 @@ struct ifmedia_type_to_subtype ifmedia_types_to_subtyp { &ifm_subtype_ethernet_descriptions[0], &ifm_subtype_ethernet_option_descriptions[0], - NULL, - }, - { - &ifm_subtype_tokenring_descriptions[0], - &ifm_subtype_tokenring_option_descriptions[0], NULL, }, { Modified: head/sys/net/if_media.h ============================================================================== --- head/sys/net/if_media.h Mon Apr 23 19:51:00 2018 (r332894) +++ head/sys/net/if_media.h Mon Apr 23 21:10:33 2018 (r332895) @@ -217,32 +217,6 @@ uint64_t ifmedia_baudrate(int); #define IFM_ETH_XSHIFT 6 /* shift XTYPE next to TMASK */ /* - * Token ring - */ -#define IFM_TOKEN 0x00000040 -#define IFM_TOK_STP4 3 /* Shielded twisted pair 4m - DB9 */ -#define IFM_TOK_STP16 4 /* Shielded twisted pair 16m - DB9 */ -#define IFM_TOK_UTP4 5 /* Unshielded twisted pair 4m - RJ45 */ -#define IFM_TOK_UTP16 6 /* Unshielded twisted pair 16m - RJ45 */ -#define IFM_TOK_STP100 7 /* Shielded twisted pair 100m - DB9 */ -#define IFM_TOK_UTP100 8 /* Unshielded twisted pair 100m - RJ45 */ -#define IFM_TOK_ETR 0x00000200 /* Early token release */ -#define IFM_TOK_SRCRT 0x00000400 /* Enable source routing features */ -#define IFM_TOK_ALLR 0x00000800 /* All routes / Single route bcast */ -#define IFM_TOK_DTR 0x00002000 /* Dedicated token ring */ -#define IFM_TOK_CLASSIC 0x00004000 /* Classic token ring */ -#define IFM_TOK_AUTO 0x00008000 /* Automatic Dedicate/Classic token ring */ - -/* - * FDDI - */ -#define IFM_FDDI 0x00000060 -#define IFM_FDDI_SMF 3 /* Single-mode fiber */ -#define IFM_FDDI_MMF 4 /* Multi-mode fiber */ -#define IFM_FDDI_UTP 5 /* CDDI / UTP */ -#define IFM_FDDI_DA 0x00000100 /* Dual attach / single attach */ - -/* * IEEE 802.11 Wireless */ #define IFM_IEEE80211 0x00000080 @@ -393,8 +367,6 @@ struct ifmedia_description { #define IFM_TYPE_DESCRIPTIONS { \ { IFM_ETHER, "Ethernet" }, \ - { IFM_TOKEN, "Token ring" }, \ - { IFM_FDDI, "FDDI" }, \ { IFM_IEEE80211, "IEEE 802.11 Wireless Ethernet" }, \ { IFM_ATM, "ATM" }, \ { 0, NULL }, \ @@ -511,55 +483,6 @@ struct ifmedia_description { { 0, NULL }, \ } -#define IFM_SUBTYPE_TOKENRING_DESCRIPTIONS { \ - { IFM_TOK_STP4, "DB9/4Mbit" }, \ - { IFM_TOK_STP16, "DB9/16Mbit" }, \ - { IFM_TOK_UTP4, "UTP/4Mbit" }, \ - { IFM_TOK_UTP16, "UTP/16Mbit" }, \ - { IFM_TOK_STP100, "STP/100Mbit" }, \ - { IFM_TOK_UTP100, "UTP/100Mbit" }, \ - { 0, NULL }, \ -} - -#define IFM_SUBTYPE_TOKENRING_ALIASES { \ - { IFM_TOK_STP4, "4STP" }, \ - { IFM_TOK_STP16, "16STP" }, \ - { IFM_TOK_UTP4, "4UTP" }, \ - { IFM_TOK_UTP16, "16UTP" }, \ - { IFM_TOK_STP100, "100STP" }, \ - { IFM_TOK_UTP100, "100UTP" }, \ - { 0, NULL }, \ -} - -#define IFM_SUBTYPE_TOKENRING_OPTION_DESCRIPTIONS { \ - { IFM_TOK_ETR, "EarlyTokenRelease" }, \ - { IFM_TOK_SRCRT, "SourceRouting" }, \ - { IFM_TOK_ALLR, "AllRoutes" }, \ - { IFM_TOK_DTR, "Dedicated" }, \ - { IFM_TOK_CLASSIC,"Classic" }, \ - { IFM_TOK_AUTO, " " }, \ - { 0, NULL }, \ -} - -#define IFM_SUBTYPE_FDDI_DESCRIPTIONS { \ - { IFM_FDDI_SMF, "Single-mode" }, \ - { IFM_FDDI_MMF, "Multi-mode" }, \ - { IFM_FDDI_UTP, "UTP" }, \ - { 0, NULL }, \ -} - -#define IFM_SUBTYPE_FDDI_ALIASES { \ - { IFM_FDDI_SMF, "SMF" }, \ - { IFM_FDDI_MMF, "MMF" }, \ - { IFM_FDDI_UTP, "CDDI" }, \ - { 0, NULL }, \ -} - -#define IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS { \ - { IFM_FDDI_DA, "Dual-attach" }, \ - { 0, NULL }, \ -} - #define IFM_SUBTYPE_IEEE80211_DESCRIPTIONS { \ { IFM_IEEE80211_FH1, "FH/1Mbps" }, \ { IFM_IEEE80211_FH2, "FH/2Mbps" }, \ @@ -797,15 +720,6 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_25G_ACC, IF_Gbps(25ULL) }, \ { IFM_ETHER | IFM_25G_AOC, IF_Gbps(25ULL) }, \ \ - { IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) }, \ - { IFM_TOKEN | IFM_TOK_STP16, IF_Mbps(16) }, \ - { IFM_TOKEN | IFM_TOK_UTP4, IF_Mbps(4) }, \ - { IFM_TOKEN | IFM_TOK_UTP16, IF_Mbps(16) }, \ - \ - { IFM_FDDI | IFM_FDDI_SMF, IF_Mbps(100) }, \ - { IFM_FDDI | IFM_FDDI_MMF, IF_Mbps(100) }, \ - { IFM_FDDI | IFM_FDDI_UTP, IF_Mbps(100) }, \ - \ { IFM_IEEE80211 | IFM_IEEE80211_FH1, IF_Mbps(1) }, \ { IFM_IEEE80211 | IFM_IEEE80211_FH2, IF_Mbps(2) }, \ { IFM_IEEE80211 | IFM_IEEE80211_DS2, IF_Mbps(2) }, \ @@ -842,10 +756,6 @@ struct ifmedia_status_description { #define IFM_STATUS_DESCRIPTIONS { \ { IFM_ETHER, IFM_AVALID, IFM_ACTIVE, \ { "no carrier", "active" } }, \ - { IFM_FDDI, IFM_AVALID, IFM_ACTIVE, \ - { "no ring", "inserted" } }, \ - { IFM_TOKEN, IFM_AVALID, IFM_ACTIVE, \ - { "no ring", "inserted" } }, \ { IFM_IEEE80211, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ { IFM_ATM, IFM_AVALID, IFM_ACTIVE, \ From owner-svn-src-head@freebsd.org Mon Apr 23 21:36:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CB0DFAC007; Mon, 23 Apr 2018 21:36:39 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay114.isp.belgacom.be (mailrelay114.isp.belgacom.be [195.238.20.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 967B06CAA3; Mon, 23 Apr 2018 21:36:38 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AW/8q3BY0wTyQVahsAyEGBI//LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZoM+/bnLW6fgltlLVR4KTs6sC17KN9fi4EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQpFiCazbL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+?= =?us-ascii?q?RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPC?= =?us-ascii?q?TQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjmk8qxlSgLniD?= =?us-ascii?q?0fOjA38G/ZlNF+gqFZrxKvqBNw34HabZqJNPd8Yq/RYc8WSXZfUstXSidPApm8?= =?us-ascii?q?b4wKD+cZI+hYrov9p18TphagAgmsA/jvxSFNhnDs2606yPkqHAba3AwhHdIOtG?= =?us-ascii?q?/ZotXvNKgMT++40bTGwzvZY/NRwzf955HFfxY8qv+PRbJ9acncxVQ1Gw/bgVic?= =?us-ascii?q?tJbpMy2J2ugTqWSX8uptWOyphmU6sQ9+uCKvyd0pioTRg4IVzU3L+jthzYYuIN?= =?us-ascii?q?24VFZ7Ydm5EJtMry2aN5V5QsclQ2xwuyY10LkGuZ++fCcU0pQnwATTa+CGc4iK?= =?us-ascii?q?5hLvTvqeITB/hHJ+Zr2/ggy98U67yuHmUcm0yllKojJEktnKqH8NywTe58uaRv?= =?us-ascii?q?dn4Eus1iuD2xrN5u1YP0w4j7fXJp4vz7Iok5ocq0XDHiv4mEXsi6+Wc10p+vSp?= =?us-ascii?q?6+TlZrXrvZGcN5VqhQ7gKasugdGwDf4/MggUUGiX4f6826H7/U3lXLVKieU7kq?= =?us-ascii?q?resJDBOcQbp625DBRL3YYn8Bu/ADKm384ZnXkDNl5KZBWHj426c23JddP/C+yj?= =?us-ascii?q?ilKwkTEj7f3COaD6BYuFenvEi6vgfrxw72ZTzQMyyZZU4JcCWZ8bJ/emZk7zsJ?= =?us-ascii?q?TzCRgiPgm9xf2vXMl81Ic2d3iCD4WiHOXVq1DetbFnGPWFeIJA4GW1EPMi/fO7?= =?us-ascii?q?1XI=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2CLDgD6UN5a/5nK8VFcg0UvU4EIKIxKj?= =?us-ascii?q?BkBAYFzMQFdhmyODIR2AoJmIjcVAQIBAQEBAQECAWsogjUigkwBBTocIxALDgo?= =?us-ascii?q?JGgsPEhgeBhOEdwMZqnmHDQ2BK4I5ih+EGoJPh3gCl0csCItDgnJoi3GJdodcM?= =?us-ascii?q?iKBUk0wCIJ+gkiOCD0wkF4BAQ?= X-IPAS-Result: =?us-ascii?q?A2CLDgD6UN5a/5nK8VFcg0UvU4EIKIxKjBkBAYFzMQFdhmy?= =?us-ascii?q?ODIR2AoJmIjcVAQIBAQEBAQECAWsogjUigkwBBTocIxALDgoJGgsPEhgeBhOEd?= =?us-ascii?q?wMZqnmHDQ2BK4I5ih+EGoJPh3gCl0csCItDgnJoi3GJdodcMiKBUk0wCIJ+gki?= =?us-ascii?q?OCD0wkF4BAQ?= Received: from 153.202-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.202.153]) by relay.skynet.be with ESMTP; 23 Apr 2018 23:35:27 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w3NLZRu4001311; Mon, 23 Apr 2018 23:35:27 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Mon, 23 Apr 2018 23:35:26 +0200 From: Tijl Coosemans To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332489 - in head: gnu/usr.bin/gdb/kgdb sys/conf sys/dev/dcons sys/dev/hyperv/vmbus/i386 sys/dev/ppc sys/dev/syscons sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/include/pc sys... Message-ID: <20180423233526.2eb5aaab@kalimero.tijl.coosemans.org> In-Reply-To: <20180422205103.GX6887@kib.kiev.ua> References: <201804132030.w3DKUnFn050153@repo.freebsd.org> <20180422210656.29cb7d0a@kalimero.tijl.coosemans.org> <20180422192614.GW6887@kib.kiev.ua> <20180422205103.GX6887@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 21:36:39 -0000 On Sun, 22 Apr 2018 23:51:03 +0300 Konstantin Belousov wrote: > On Sun, Apr 22, 2018 at 10:26:14PM +0300, Konstantin Belousov wrote: >> On Sun, Apr 22, 2018 at 09:06:56PM +0200, Tijl Coosemans wrote: >>> Could this have broken the linux futex syscall? I have a linux program >>> that gets stuck in linux_sys_futex and becomes unkillable. Note that the >>> routines in sys/i386/linux/linux_support.s try to do atomic operations on >>> user space addresses. >> >> Yes, it is quite possible. I will try to look next week. > > Try this. I only compile-tested it as a module. Yes, this fixes it. That was quick, thanks! From owner-svn-src-head@freebsd.org Mon Apr 23 22:16:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E2F2FAC951; Mon, 23 Apr 2018 22:16:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 348537610A; Mon, 23 Apr 2018 22:16:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 4B7FC10AFD3; Mon, 23 Apr 2018 18:16:53 -0400 (EDT) From: John Baldwin To: Rebecca Cran Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332874 - head/share/misc Date: Mon, 23 Apr 2018 14:36:23 -0700 Message-ID: <12038037.U46LTusdCP@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201804222127.w3MLRx7p013062@repo.freebsd.org> References: <201804222127.w3MLRx7p013062@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 23 Apr 2018 18:16:53 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 22:16:55 -0000 On Sunday, April 22, 2018 09:27:59 PM Rebecca Cran wrote: > Author: bcran > Date: Sun Apr 22 21:27:59 2018 > New Revision: 332874 > URL: https://svnweb.freebsd.org/changeset/base/332874 > > Log: > Update committers-src.dot to show the mentorship arrangement for myself: eadler has agreed to mentor me. > > Modified: > head/share/misc/committers-src.dot > > Modified: head/share/misc/committers-src.dot > ============================================================================== > --- head/share/misc/committers-src.dot Sun Apr 22 20:47:16 2018 (r332873) > +++ head/share/misc/committers-src.dot Sun Apr 22 21:27:59 2018 (r332874) > @@ -476,6 +476,8 @@ dwmalone -> fanf > dwmalone -> peadar > dwmalone -> snb > > +eadler -> bcran > + > ed -> dim > ed -> gavin > ed -> jilles > @@ -751,7 +753,6 @@ rpaulo -> jmmv > rpaulo -> lidl > rpaulo -> ngie > > -rrs -> bcran > rrs -> jchandra > rrs -> tuexen It's probably ok to leave Randall's line in place here. This file documents the historical state rather than the current state so that one can see the developers "family tree" as it were and it is not unusual for a developer to have multiple mentors either. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Apr 23 22:16:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52E1AFAC972; Mon, 23 Apr 2018 22:16:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8586A761A9; Mon, 23 Apr 2018 22:16:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id DFEA010AFD2; Mon, 23 Apr 2018 18:16:51 -0400 (EDT) From: John Baldwin To: Mark Johnston Cc: "Jonathan T. Looney" , cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332860 - head/sys/kern Date: Mon, 23 Apr 2018 15:04:31 -0700 Message-ID: <1739228.8pyHcvzasL@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180423180024.GC84833@raichu> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180423180024.GC84833@raichu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 23 Apr 2018 18:16:52 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 22:16:59 -0000 On Monday, April 23, 2018 02:00:24 PM Mark Johnston wrote: > On Mon, Apr 23, 2018 at 11:12:32AM -0400, Jonathan T. Looney wrote: > > Hi Mark, > > > > Let me start by saying that I appreciate your well-reasoned response. (I > > think) I understand your reasoning, I appreciate your well-explained > > argument, and I respect your opinion. I just wanted to make that clear up > > front. > > > > On Sun, Apr 22, 2018 at 1:11 PM, Mark Johnston wrote: > > > > > > > All too often, my ability to debug assertion violations is hindered > > because > > > > the system trips over yet another assertion while dumping the core. If > > we > > > > skip the assertion, nothing bad happens. (The post-panic debugging code > > > > already needs to deal with systems that are inconsistent, and it does a > > > > pretty good job at it.) > > > > > > I think we make a decent effort to fix such problems as they arise, but > > > you are declaring defeat on behalf of everyone. Did you make some effort > > > to fix or report these issues before resorting to the more drastic > > > measure taken here? > > > > We try to report or fix them as they arise. However, you don't know there > > is a problem until you actually run into it. And, you don't run into the > > problem until you can't get a core dump due to the assertion. > > > > (And, with elusive problems, it isn't always easy to duplicate them. So, > > fixing the assertion is sometimes "too late".) > > Sure, this is true. But unless it's a problem in practice it's obviously > preferable to keep assertions enabled. Kernel dumping itself is a > fundamentally unreliable mechanism, but it works well enough to be > useful. I basically never see problems with post-panic assertion > failures, and I test the kernel dump code a fair bit. Isilon exercises > that code quite a lot as well without any problems that I'm aware of, > and I can't think of any reports of such assertion failures that weren't > quickly fixed. So I'm wondering what problems exist in your specific > environment that we might instead address surgically. > > (I could very well be wrong about how widespread post-panic assertion > failures are. We've had problems of this sort before, e.g., with the > updated DRM graphics drivers, where the code to grab the console after a > panic didn't work properly. There, the bandaid was to just disable that > specific mechanism.) I think this is actually a key question. In my experience to date I have not encountered a large number of post-panic assertion failures. Given that we already break all locks and disable assertions for locks I'd be curious which assertions are actually failing. My inclination given my experiences to date would be to explicitly ignore those as we do for locking if it is constrained set rather than blacklisting all of them. However, I would be most interested in seeing some examples of assertions that are failing. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Apr 23 22:28:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52E28FACC27; Mon, 23 Apr 2018 22:28:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05A257905E; Mon, 23 Apr 2018 22:28:50 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F07CA236F; Mon, 23 Apr 2018 22:28:49 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NMSnWw063631; Mon, 23 Apr 2018 22:28:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NMSnLS063630; Mon, 23 Apr 2018 22:28:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804232228.w3NMSnLS063630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 23 Apr 2018 22:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332896 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 22:28:50 -0000 Author: mjg Date: Mon Apr 23 22:28:49 2018 New Revision: 332896 URL: https://svnweb.freebsd.org/changeset/base/332896 Log: malloc: stop reading the subzone if MALLOC_DEBUG_MAXZONES == 1 (the default) malloc was showing at the top of profile during while running microbenchmarks. #define DTMALLOC_PROBE_MAX 2 struct malloc_type_internal { uint32_t mti_probes[DTMALLOC_PROBE_MAX]; u_char mti_zone; struct malloc_type_stats mti_stats[MAXCPU]; }; Reading mti_zone it wastes a cacheline to hold mti_probes + mti_zone (which we know is 0) + part of malloc stats of the first cpu which on top induces false-sharing. In particular will-it-scale lock1_processes -t 128 -s 10: before: average:45879692 after: average:51655596 Note the counters can be padded but the right fix is to move them to counter(9), leaving the struct read-only after creation (modulo dtrace probes). Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Apr 23 21:10:33 2018 (r332895) +++ head/sys/kern/kern_malloc.c Mon Apr 23 22:28:49 2018 (r332896) @@ -296,22 +296,49 @@ SYSCTL_UINT(_debug_malloc, OID_AUTO, zone_offset, CTLF &zone_offset, 0, "Separate malloc types by examining the " "Nth character in the malloc type short description."); -static u_int -mtp_get_subzone(const char *desc) +static void +mtp_set_subzone(struct malloc_type *mtp) { + struct malloc_type_internal *mtip; + const char *desc; size_t len; u_int val; + mtip = mtp->ks_handle; + desc = mtp->ks_shortdesc; if (desc == NULL || (len = strlen(desc)) == 0) - return (0); - val = desc[zone_offset % len]; - return (val % numzones); + val = 0; + else + val = desc[zone_offset % len]; + mtip->mti_zone = (val % numzones); } + +static inline u_int +mtp_get_subzone(struct malloc_type *mtp) +{ + struct malloc_type_internal *mtip; + + mtip = mtp->ks_handle; + + KASSERT(mtip->mti_zone < numzones, + ("mti_zone %u out of range %d", + mtip->mti_zone, numzones)); + return (mtip->mti_zone); +} #elif MALLOC_DEBUG_MAXZONES == 0 #error "MALLOC_DEBUG_MAXZONES must be positive." #else +static void +mtp_set_subzone(struct malloc_type *mtp) +{ + struct malloc_type_internal *mtip; + + mtip = mtp->ks_handle; + mtip->mti_zone = 0; +} + static inline u_int -mtp_get_subzone(const char *desc) +mtp_get_subzone(struct malloc_type *mtp) { return (0); @@ -521,7 +548,6 @@ void * malloc(size_t size, struct malloc_type *mtp, int flags) { int indx; - struct malloc_type_internal *mtip; caddr_t va; uma_zone_t zone; #if defined(DEBUG_REDZONE) @@ -534,14 +560,10 @@ malloc(size_t size, struct malloc_type *mtp, int flags #endif if (size <= kmem_zmax) { - mtip = mtp->ks_handle; if (size & KMEM_ZMASK) size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; indx = kmemsize[size >> KMEM_ZSHIFT]; - KASSERT(mtip->mti_zone < numzones, - ("mti_zone %u out of range %d", - mtip->mti_zone, numzones)); - zone = kmemzones[indx].kz_zone[mtip->mti_zone]; + zone = kmemzones[indx].kz_zone[mtp_get_subzone(mtp)]; #ifdef MALLOC_PROFILE krequests[size >> KMEM_ZSHIFT]++; #endif @@ -571,7 +593,6 @@ malloc_domain(size_t size, struct malloc_type *mtp, in int flags) { int indx; - struct malloc_type_internal *mtip; caddr_t va; uma_zone_t zone; #if defined(DEBUG_REDZONE) @@ -583,14 +604,10 @@ malloc_domain(size_t size, struct malloc_type *mtp, in return (va); #endif if (size <= kmem_zmax) { - mtip = mtp->ks_handle; if (size & KMEM_ZMASK) size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; indx = kmemsize[size >> KMEM_ZSHIFT]; - KASSERT(mtip->mti_zone < numzones, - ("mti_zone %u out of range %d", - mtip->mti_zone, numzones)); - zone = kmemzones[indx].kz_zone[mtip->mti_zone]; + zone = kmemzones[indx].kz_zone[mtp_get_subzone(mtp)]; #ifdef MALLOC_PROFILE krequests[size >> KMEM_ZSHIFT]++; #endif @@ -973,7 +990,7 @@ malloc_init(void *data) mtip = uma_zalloc(mt_zone, M_WAITOK | M_ZERO); mtp->ks_handle = mtip; - mtip->mti_zone = mtp_get_subzone(mtp->ks_shortdesc); + mtp_set_subzone(mtp); mtx_lock(&malloc_mtx); mtp->ks_next = kmemstatistics; From owner-svn-src-head@freebsd.org Mon Apr 23 22:30:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED091FACCDF; Mon, 23 Apr 2018 22:30:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98DD979272; Mon, 23 Apr 2018 22:30:17 +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 93B4D2373; Mon, 23 Apr 2018 22:30:17 +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 w3NMUHJn063749; Mon, 23 Apr 2018 22:30:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NMUHVe063748; Mon, 23 Apr 2018 22:30:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804232230.w3NMUHVe063748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 23 Apr 2018 22:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332897 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 332897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 22:30:18 -0000 Author: imp Date: Mon Apr 23 22:30:17 2018 New Revision: 332897 URL: https://svnweb.freebsd.org/changeset/base/332897 Log: Migrate to make_dev_s interface to populate /dev/nvmeX entries Submitted by: Michael Hordijk Differential Revision: https://reviews.freebsd.org/D15162 Modified: head/sys/dev/nvme/nvme_ns.c Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Mon Apr 23 22:28:49 2018 (r332896) +++ head/sys/dev/nvme/nvme_ns.c Mon Apr 23 22:30:17 2018 (r332897) @@ -494,7 +494,9 @@ int nvme_ns_construct(struct nvme_namespace *ns, uint32_t id, struct nvme_controller *ctrlr) { + struct make_dev_args md_args; struct nvme_completion_poll_status status; + int res; int unit; uint16_t oncs; uint8_t dsm; @@ -590,15 +592,20 @@ nvme_ns_construct(struct nvme_namespace *ns, uint32_t */ unit = device_get_unit(ctrlr->dev) * NVME_MAX_NAMESPACES + ns->id - 1; - ns->cdev = make_dev_credf(0, &nvme_ns_cdevsw, unit, - NULL, UID_ROOT, GID_WHEEL, 0600, "nvme%dns%d", + make_dev_args_init(&md_args); + md_args.mda_devsw = &nvme_ns_cdevsw; + md_args.mda_unit = unit; + md_args.mda_mode = 0600; + res = make_dev_s(&md_args, &ns->cdev, "nvme%dns%d", device_get_unit(ctrlr->dev), ns->id); + if (res != 0) + return (ENXIO); + #ifdef NVME_UNMAPPED_BIO_SUPPORT ns->cdev->si_flags |= SI_UNMAPPED; #endif - if (ns->cdev != NULL) - ns->cdev->si_drv1 = ns; + ns->cdev->si_drv1 = ns; return (0); } From owner-svn-src-head@freebsd.org Mon Apr 23 23:07:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84FE4FAD97E; Mon, 23 Apr 2018 23:07:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37BC68043C; Mon, 23 Apr 2018 23:07:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32C7029E1; Mon, 23 Apr 2018 23:07:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NN7wU8083802; Mon, 23 Apr 2018 23:07:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NN7wtm083801; Mon, 23 Apr 2018 23:07:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201804232307.w3NN7wtm083801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 23 Apr 2018 23:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332898 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/X86 X-SVN-Commit-Revision: 332898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 23:07:58 -0000 Author: dim Date: Mon Apr 23 23:07:57 2018 New Revision: 332898 URL: https://svnweb.freebsd.org/changeset/base/332898 Log: Pull in r329771 from upstream llvm trunk (by Craig Topper): [X86] In X86FlagsCopyLowering, when rewriting a memory setcc we need to emit an explicit MOV8mr instruction. Previously the code only knew how to handle setcc to a register. This should fix a crash in the chromium build. This fixes various assertion failures while building ports targeting i386: * www/firefox: isReg() && "This is not a register operand!" * www/iridium, www/qt5-webengine: (I.atEnd() || std::next(I) == def_instr_end()) && "getVRegDef assumes a single definition or no definition" * devel/powerpc64-gcc: FromReg != ToReg && "Cannot replace a reg with itself" Reported by: jbeich PR: 225330, 227686, 227698, 227699 MFC after: 1 week X-MFC-With: r332833 Modified: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Modified: head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Mon Apr 23 22:30:17 2018 (r332897) +++ head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Mon Apr 23 23:07:57 2018 (r332898) @@ -770,8 +770,27 @@ void X86FlagsCopyLoweringPass::rewriteSetCC(MachineBas if (!CondReg) CondReg = promoteCondToReg(TestMBB, TestPos, TestLoc, Cond); - // Rewriting this is trivial: we just replace the register and remove the - // setcc. - MRI->replaceRegWith(SetCCI.getOperand(0).getReg(), CondReg); + // Rewriting a register def is trivial: we just replace the register and + // remove the setcc. + if (!SetCCI.mayStore()) { + assert(SetCCI.getOperand(0).isReg() && + "Cannot have a non-register defined operand to SETcc!"); + MRI->replaceRegWith(SetCCI.getOperand(0).getReg(), CondReg); + SetCCI.eraseFromParent(); + return; + } + + // Otherwise, we need to emit a store. + auto MIB = BuildMI(*SetCCI.getParent(), SetCCI.getIterator(), + SetCCI.getDebugLoc(), TII->get(X86::MOV8mr)); + // Copy the address operands. + for (int i = 0; i < X86::AddrNumOperands; ++i) + MIB.add(SetCCI.getOperand(i)); + + MIB.addReg(CondReg); + + MIB->setMemRefs(SetCCI.memoperands_begin(), SetCCI.memoperands_end()); + SetCCI.eraseFromParent(); + return; } From owner-svn-src-head@freebsd.org Tue Apr 24 01:04:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2A6FB0140; Tue, 24 Apr 2018 01:04:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30E6F7B7EC; Tue, 24 Apr 2018 01:04:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 126B54138; Tue, 24 Apr 2018 01:04:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O14ACF046501; Tue, 24 Apr 2018 01:04:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O14AYG046498; Tue, 24 Apr 2018 01:04:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804240104.w3O14AYG046498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 24 Apr 2018 01:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332900 - in head/sys: cddl/dev/sdt kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/dev/sdt kern sys X-SVN-Commit-Revision: 332900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 01:04:11 -0000 Author: mjg Date: Tue Apr 24 01:04:10 2018 New Revision: 332900 URL: https://svnweb.freebsd.org/changeset/base/332900 Log: lockstat: track lockstat just like sdt probes In particular flip the frequently tested var to bool. Modified: head/sys/cddl/dev/sdt/sdt.c head/sys/kern/kern_lockstat.c head/sys/sys/lockstat.h Modified: head/sys/cddl/dev/sdt/sdt.c ============================================================================== --- head/sys/cddl/dev/sdt/sdt.c Tue Apr 24 00:47:17 2018 (r332899) +++ head/sys/cddl/dev/sdt/sdt.c Tue Apr 24 01:04:10 2018 (r332900) @@ -77,6 +77,7 @@ static void sdt_kld_unload_try(void *, struct linker_f static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers"); static int sdt_probes_enabled_count; +static int lockstat_enabled_count; static dtrace_pattr_t sdt_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, @@ -208,8 +209,11 @@ sdt_enable(void *arg __unused, dtrace_id_t id, void *p probe->id = id; probe->sdtp_lf->nenabled++; - if (strcmp(probe->prov->name, "lockstat") == 0) - lockstat_enabled++; + if (strcmp(probe->prov->name, "lockstat") == 0) { + lockstat_enabled_count++; + if (lockstat_enabled_count == 1) + lockstat_enabled = true; + } sdt_probes_enabled_count++; if (sdt_probes_enabled_count == 1) sdt_probes_enabled = true; @@ -225,8 +229,11 @@ sdt_disable(void *arg __unused, dtrace_id_t id, void * sdt_probes_enabled_count--; if (sdt_probes_enabled_count == 0) sdt_probes_enabled = false; - if (strcmp(probe->prov->name, "lockstat") == 0) - lockstat_enabled--; + if (strcmp(probe->prov->name, "lockstat") == 0) { + lockstat_enabled_count--; + if (lockstat_enabled_count == 0) + lockstat_enabled = false; + } probe->id = 0; probe->sdtp_lf->nenabled--; } Modified: head/sys/kern/kern_lockstat.c ============================================================================== --- head/sys/kern/kern_lockstat.c Tue Apr 24 00:47:17 2018 (r332899) +++ head/sys/kern/kern_lockstat.c Tue Apr 24 01:04:10 2018 (r332900) @@ -64,7 +64,7 @@ SDT_PROBE_DEFINE1(lockstat, , , sx__downgrade, "struct SDT_PROBE_DEFINE2(lockstat, , , thread__spin, "struct mtx *", "uint64_t"); -volatile int __read_frequently lockstat_enabled; +volatile bool __read_frequently lockstat_enabled; uint64_t lockstat_nsecs(struct lock_object *lo) Modified: head/sys/sys/lockstat.h ============================================================================== --- head/sys/sys/lockstat.h Tue Apr 24 00:47:17 2018 (r332899) +++ head/sys/sys/lockstat.h Tue Apr 24 01:04:10 2018 (r332900) @@ -70,7 +70,7 @@ SDT_PROBE_DECLARE(lockstat, , , thread__spin); #define LOCKSTAT_WRITER 0 #define LOCKSTAT_READER 1 -extern volatile int lockstat_enabled; +extern volatile bool lockstat_enabled; #ifdef KDTRACE_HOOKS From owner-svn-src-head@freebsd.org Tue Apr 24 01:06:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 047D2FB02E2; Tue, 24 Apr 2018 01:06:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F6CF7C226; Tue, 24 Apr 2018 01:06:20 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98AC2413F; Tue, 24 Apr 2018 01:06:20 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O16K3X046621; Tue, 24 Apr 2018 01:06:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O16KY3046619; Tue, 24 Apr 2018 01:06:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804240106.w3O16KY3046619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 24 Apr 2018 01:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332901 - in head/sys: cddl/dev/dtmalloc kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/dev/dtmalloc kern X-SVN-Commit-Revision: 332901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 01:06:21 -0000 Author: mjg Date: Tue Apr 24 01:06:20 2018 New Revision: 332901 URL: https://svnweb.freebsd.org/changeset/base/332901 Log: dtrace: depessimize dtmalloc when dtrace is active Each malloc/free was testing dtrace_malloc_enabled and forcing extra reads from the malloc type struct to see if perhaps a dtmalloc probe was on. Treat it like lockstat and sdt: have a global bolean. Modified: head/sys/cddl/dev/dtmalloc/dtmalloc.c head/sys/kern/kern_malloc.c Modified: head/sys/cddl/dev/dtmalloc/dtmalloc.c ============================================================================== --- head/sys/cddl/dev/dtmalloc/dtmalloc.c Tue Apr 24 01:04:10 2018 (r332900) +++ head/sys/cddl/dev/dtmalloc/dtmalloc.c Tue Apr 24 01:06:20 2018 (r332901) @@ -36,6 +36,9 @@ #include #include +extern bool dtrace_malloc_enabled; +static uint32_t dtrace_malloc_enabled_count; + static d_open_t dtmalloc_open; static int dtmalloc_unload(void); static void dtmalloc_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); @@ -152,6 +155,9 @@ dtmalloc_enable(void *arg, dtrace_id_t id, void *parg) { uint32_t *p = parg; *p = id; + dtrace_malloc_enabled_count++; + if (dtrace_malloc_enabled_count == 1) + dtrace_malloc_enabled = true; } static void @@ -159,6 +165,9 @@ dtmalloc_disable(void *arg, dtrace_id_t id, void *parg { uint32_t *p = parg; *p = 0; + dtrace_malloc_enabled_count--; + if (dtrace_malloc_enabled_count == 0) + dtrace_malloc_enabled = false; } static void Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Apr 24 01:04:10 2018 (r332900) +++ head/sys/kern/kern_malloc.c Tue Apr 24 01:06:20 2018 (r332901) @@ -93,7 +93,8 @@ __FBSDID("$FreeBSD$"); #ifdef KDTRACE_HOOKS #include -dtrace_malloc_probe_func_t dtrace_malloc_probe; +bool __read_frequently dtrace_malloc_enabled; +dtrace_malloc_probe_func_t __read_mostly dtrace_malloc_probe; #endif #if defined(INVARIANTS) || defined(MALLOC_MAKE_FAILURES) || \ @@ -376,7 +377,7 @@ malloc_type_zone_allocated(struct malloc_type *mtp, un mtsp->mts_size |= 1 << zindx; #ifdef KDTRACE_HOOKS - if (dtrace_malloc_probe != NULL) { + if (__predict_false(dtrace_malloc_enabled)) { uint32_t probe_id = mtip->mti_probes[DTMALLOC_PROBE_MALLOC]; if (probe_id != 0) (dtrace_malloc_probe)(probe_id, @@ -415,7 +416,7 @@ malloc_type_freed(struct malloc_type *mtp, unsigned lo mtsp->mts_numfrees++; #ifdef KDTRACE_HOOKS - if (dtrace_malloc_probe != NULL) { + if (__predict_false(dtrace_malloc_enabled)) { uint32_t probe_id = mtip->mti_probes[DTMALLOC_PROBE_FREE]; if (probe_id != 0) (dtrace_malloc_probe)(probe_id, From owner-svn-src-head@freebsd.org Tue Apr 24 01:22:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46BEAFB1363; Tue, 24 Apr 2018 01:22:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 767DF7DE30; Tue, 24 Apr 2018 01:22:57 +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 7177144C4; Tue, 24 Apr 2018 01:22:57 +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 w3O1MvKQ056294; Tue, 24 Apr 2018 01:22:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O1MvgU056293; Tue, 24 Apr 2018 01:22:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804240122.w3O1MvgU056293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 24 Apr 2018 01:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332902 - head/usr.sbin/pwd_mkdb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/pwd_mkdb X-SVN-Commit-Revision: 332902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 01:22:58 -0000 Author: emaste Date: Tue Apr 24 01:22:57 2018 New Revision: 332902 URL: https://svnweb.freebsd.org/changeset/base/332902 Log: pwd_mkdb: default to network (big) endian hash order For cross-architecture reproducibility. The db(3) functions work with hashes of either endianness, and the current (v4) version password db entries already store integers in network order. Do so with the hash as well so that identical password databases can be created on big- and little-endian hosts. The -B and -L flags exist to set the endianness for legacy (v3) entries when the -l flag is used, and they will still control hash endianness (at least until the backwards compatibility infrastructure is removed). MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Tue Apr 24 01:06:20 2018 (r332901) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Tue Apr 24 01:22:57 2018 (r332902) @@ -77,7 +77,7 @@ static HASHINFO openinfo = { 256, /* nelem */ 2048 * 1024, /* cachesize */ NULL, /* hash() */ - BYTE_ORDER /* lorder */ + BIG_ENDIAN /* lorder */ }; static enum state { FILE_INSECURE, FILE_SECURE, FILE_ORIG } clean; From owner-svn-src-head@freebsd.org Tue Apr 24 04:07:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9762FB87B2; Tue, 24 Apr 2018 04:07:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7359E843E6; Tue, 24 Apr 2018 04:07:51 +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 6B4C160CD; Tue, 24 Apr 2018 04:07:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O47pVX036565; Tue, 24 Apr 2018 04:07:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O47pXT036564; Tue, 24 Apr 2018 04:07:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201804240407.w3O47pXT036564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 24 Apr 2018 04:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332905 - head/usr.sbin/camdd X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.sbin/camdd X-SVN-Commit-Revision: 332905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 04:07:52 -0000 Author: delphij Date: Tue Apr 24 04:07:51 2018 New Revision: 332905 URL: https://svnweb.freebsd.org/changeset/base/332905 Log: Use calloc() instead of malloc+bzero. Reviewed by: ken, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D15166 Modified: head/usr.sbin/camdd/camdd.c Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Tue Apr 24 03:07:49 2018 (r332904) +++ head/usr.sbin/camdd/camdd.c Tue Apr 24 04:07:51 2018 (r332905) @@ -596,14 +596,12 @@ camdd_alloc_dev(camdd_dev_type dev_type, struct kevent size_t ke_size; int retval = 0; - dev = malloc(sizeof(*dev)); + dev = calloc(1, sizeof(*dev)); if (dev == NULL) { warn("%s: unable to malloc %zu bytes", __func__, sizeof(*dev)); goto bailout; } - bzero(dev, sizeof(*dev)); - dev->dev_type = dev_type; dev->io_timeout = timeout; dev->retry_count = retry_count; @@ -636,12 +634,11 @@ camdd_alloc_dev(camdd_dev_type dev_type, struct kevent } ke_size = sizeof(struct kevent) * (num_ke + 4); - ke = malloc(ke_size); + ke = calloc(1, ke_size); if (ke == NULL) { warn("%s: unable to malloc %zu bytes", __func__, ke_size); goto bailout; } - bzero(ke, ke_size); if (num_ke > 0) bcopy(new_ke, ke, num_ke * sizeof(struct kevent)); @@ -688,13 +685,12 @@ camdd_alloc_buf(struct camdd_dev *dev, camdd_buf_type break; } - buf = malloc(sizeof(*buf)); + buf = calloc(1, sizeof(*buf)); if (buf == NULL) { warn("unable to allocate %zu bytes", sizeof(*buf)); goto bailout_error; } - bzero(buf, sizeof(*buf)); buf->buf_type = buf_type; buf->dev = dev; switch (buf_type) { From owner-svn-src-head@freebsd.org Tue Apr 24 05:20:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F587FBB313; Tue, 24 Apr 2018 05:20: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E21B672D83; Tue, 24 Apr 2018 05:20: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 DCE2D6CA9; Tue, 24 Apr 2018 05:20: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 w3O5KGb6071085; Tue, 24 Apr 2018 05:20:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O5KG3D071084; Tue, 24 Apr 2018 05:20:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804240520.w3O5KG3D071084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 05:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332906 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 332906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 05:20:17 -0000 Author: jhb Date: Tue Apr 24 05:20:16 2018 New Revision: 332906 URL: https://svnweb.freebsd.org/changeset/base/332906 Log: Extend support for ptrace() tests using breakpoints. - Use a single list of platforms to define HAVE_BREAKPOINT for platforms that expose a functional breakpoint() inline to userland. Replace existing lists of platform tests with HAVE_BREAKPOINT instead. - Add support for advancing PC past a breakpoint inserted via breakpoint() to support the existing ptrace__PT_CONTINUE_different_thread test on non-x86 platforms (x86 advances the PC past the breakpoint instruction, but other platforms do not). This is implemented by defining a new SKIP_BREAK macro which accepts a pointer to a 'struct reg' as its sole argument and modifies the contents to advance the PC. The intention is to use it in between PT_GETREGS and PT_SETREGS. Tested on: amd64, i386, mips (after adding a breakpoint() to mips) MFC after: 1 month Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Tue Apr 24 04:07:51 2018 (r332905) +++ head/tests/sys/kern/ptrace_test.c Tue Apr 24 05:20:16 2018 (r332906) @@ -52,6 +52,27 @@ __FBSDID("$FreeBSD$"); #include /* + * Architectures with a user-visible breakpoint(). + */ +#if defined(__amd64__) || defined(__i386__) || defined(__sparc64__) +#define HAVE_BREAKPOINT +#endif + +/* + * Adjust PC to skip over a breakpoint when stopped for a breakpoint trap. + */ +#ifdef HAVE_BREAKPOINT +#if defined(__amd64__) || defined(__i386__) +#define SKIP_BREAK(reg) +#elif defined(__sparc64__) +#define SKIP_BREAK(reg) do { \ + (reg)->r_tpc = (reg)->r_tnpc + 4; \ + (reg)->r_tnpc += 8; \ +} while (0) +#endif +#endif + +/* * A variant of ATF_REQUIRE that is suitable for use in child * processes. This only works if the parent process is tripped up by * the early exit and fails some requirement itself. @@ -1688,12 +1709,8 @@ ATF_TC_BODY(ptrace__ptrace_vfork_follow, tc) ATF_REQUIRE(errno == ECHILD); } +#ifdef HAVE_BREAKPOINT /* - * XXX: There's nothing inherently platform specific about this test, however a - * userspace visible breakpoint() is a prerequisite. - */ - #if defined(__amd64__) || defined(__i386__) || defined(__sparc64__) -/* * Verify that no more events are reported after PT_KILL except for the * process exit when stopped due to a breakpoint trap. */ @@ -1738,7 +1755,7 @@ ATF_TC_BODY(ptrace__PT_KILL_breakpoint, tc) ATF_REQUIRE(wpid == -1); ATF_REQUIRE(errno == ECHILD); } -#endif /* defined(__amd64__) || defined(__i386__) || defined(__sparc64__) */ +#endif /* HAVE_BREAKPOINT */ /* * Verify that no more events are reported after PT_KILL except for the @@ -3468,11 +3485,7 @@ ATF_TC_BODY(ptrace__PT_STEP_with_signal, tc) ATF_REQUIRE(errno == ECHILD); } -#if defined(__amd64__) || defined(__i386__) -/* - * Only x86 both define breakpoint() and have a PC after breakpoint so - * that restarting doesn't retrigger the breakpoint. - */ +#if defined(HAVE_BREAKPOINT) && defined(SKIP_BREAK) static void * continue_thread(void *arg __unused) { @@ -3506,6 +3519,7 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_different_thread, tc) pid_t fpid, wpid; lwpid_t lwps[2]; bool hit_break[2]; + struct reg reg; int i, j, status; ATF_REQUIRE((fpid = fork()) != -1); @@ -3579,6 +3593,9 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_different_thread, tc) else i = 1; hit_break[i] = true; + ATF_REQUIRE(ptrace(PT_GETREGS, pl.pl_lwpid, (caddr_t)®, 0) != -1); + SKIP_BREAK(®); + ATF_REQUIRE(ptrace(PT_SETREGS, pl.pl_lwpid, (caddr_t)®, 0) != -1); /* * Resume both threads but pass the other thread's LWPID to @@ -3616,6 +3633,11 @@ ATF_TC_BODY(ptrace__PT_CONTINUE_different_thread, tc) ATF_REQUIRE_MSG(!hit_break[i], "double breakpoint event"); hit_break[i] = true; + ATF_REQUIRE(ptrace(PT_GETREGS, pl.pl_lwpid, (caddr_t)®, + 0) != -1); + SKIP_BREAK(®); + ATF_REQUIRE(ptrace(PT_SETREGS, pl.pl_lwpid, (caddr_t)®, + 0) != -1); } ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); @@ -3663,7 +3685,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__event_mask); ATF_TP_ADD_TC(tp, ptrace__ptrace_vfork); ATF_TP_ADD_TC(tp, ptrace__ptrace_vfork_follow); -#if defined(__amd64__) || defined(__i386__) || defined(__sparc64__) +#ifdef HAVE_BREAKPOINT ATF_TP_ADD_TC(tp, ptrace__PT_KILL_breakpoint); #endif ATF_TP_ADD_TC(tp, ptrace__PT_KILL_system_call); @@ -3688,7 +3710,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__event_mask_sigkill_discard); ATF_TP_ADD_TC(tp, ptrace__PT_ATTACH_with_SBDRY_thread); ATF_TP_ADD_TC(tp, ptrace__PT_STEP_with_signal); -#if defined(__amd64__) || defined(__i386__) +#if defined(HAVE_BREAKPOINT) && defined(SKIP_BREAK) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread); #endif From owner-svn-src-head@freebsd.org Tue Apr 24 05:26:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8DBFBB7D9; Tue, 24 Apr 2018 05:26:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0326174DEB; Tue, 24 Apr 2018 05:26:29 +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 EE5F66E53; Tue, 24 Apr 2018 05:26:28 +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 w3O5QS0V075837; Tue, 24 Apr 2018 05:26:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O5QSnB075835; Tue, 24 Apr 2018 05:26:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804240526.w3O5QSnB075835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 05:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332907 - in head: sys/mips/include tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sys/mips/include tests/sys/kern X-SVN-Commit-Revision: 332907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 05:26:30 -0000 Author: jhb Date: Tue Apr 24 05:26:28 2018 New Revision: 332907 URL: https://svnweb.freebsd.org/changeset/base/332907 Log: Expose breakpoint() to userland from on MIPS. Enable ptrace() tests using breakpoint on MIPS as well. Tested on: mips64 MFC after: 1 month Modified: head/sys/mips/include/cpufunc.h head/tests/sys/kern/ptrace_test.c Modified: head/sys/mips/include/cpufunc.h ============================================================================== --- head/sys/mips/include/cpufunc.h Tue Apr 24 05:20:16 2018 (r332906) +++ head/sys/mips/include/cpufunc.h Tue Apr 24 05:26:28 2018 (r332907) @@ -108,6 +108,12 @@ mips_wbflush(void) #endif } +static __inline void +breakpoint(void) +{ + __asm __volatile ("break"); +} + #ifdef _KERNEL /* * XXX @@ -363,12 +369,6 @@ get_intr_mask(void) { return (mips_rd_status() & MIPS_SR_INT_MASK); -} - -static __inline void -breakpoint(void) -{ - __asm __volatile ("break"); } #if defined(__GNUC__) && !defined(__mips_o32) Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Tue Apr 24 05:20:16 2018 (r332906) +++ head/tests/sys/kern/ptrace_test.c Tue Apr 24 05:26:28 2018 (r332907) @@ -54,7 +54,8 @@ __FBSDID("$FreeBSD$"); /* * Architectures with a user-visible breakpoint(). */ -#if defined(__amd64__) || defined(__i386__) || defined(__sparc64__) +#if defined(__amd64__) || defined(__i386__) || defined(__mips__) || \ + defined(__sparc64__) #define HAVE_BREAKPOINT #endif @@ -64,6 +65,8 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_BREAKPOINT #if defined(__amd64__) || defined(__i386__) #define SKIP_BREAK(reg) +#elif defined(__mips__) +#define SKIP_BREAK(reg) ((reg)->r_regs[PC] += 4) #elif defined(__sparc64__) #define SKIP_BREAK(reg) do { \ (reg)->r_tpc = (reg)->r_tnpc + 4; \ From owner-svn-src-head@freebsd.org Tue Apr 24 05:30:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 779E2FBB9A3; Tue, 24 Apr 2018 05:30:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 200F475C9B; Tue, 24 Apr 2018 05:30:06 +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 1AF136E62; Tue, 24 Apr 2018 05:30:06 +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 w3O5U5KJ076035; Tue, 24 Apr 2018 05:30:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O5U5Fw076034; Tue, 24 Apr 2018 05:30:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804240530.w3O5U5Fw076034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 05:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332908 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 332908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 05:30:06 -0000 Author: jhb Date: Tue Apr 24 05:30:05 2018 New Revision: 332908 URL: https://svnweb.freebsd.org/changeset/base/332908 Log: Add two tests for TRAP_* signal codes for SIGTRAP. - ptrace__breakpoint_siginfo tests that a SIGTRAP for a software breakpoint in userland triggers a SIGTRAP with a signal code of TRAP_BRKPT. - ptrace__step_siginfo tests that a SIGTRAP reported for a step after stepping via PT_STEP or PT_SETSTEP has a signal code of TRAP_TRACE. Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Tue Apr 24 05:26:28 2018 (r332907) +++ head/tests/sys/kern/ptrace_test.c Tue Apr 24 05:30:05 2018 (r332908) @@ -3488,6 +3488,110 @@ ATF_TC_BODY(ptrace__PT_STEP_with_signal, tc) ATF_REQUIRE(errno == ECHILD); } +#ifdef HAVE_BREAKPOINT +/* + * Verify that a SIGTRAP event with the TRAP_BRKPT code is reported + * for a breakpoint trap. + */ +ATF_TC_WITHOUT_HEAD(ptrace__breakpoint_siginfo); +ATF_TC_BODY(ptrace__breakpoint_siginfo, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + breakpoint(); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + /* Continue the child ignoring the SIGSTOP. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The second wait() should report hitting the breakpoint. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE((pl.pl_flags & PL_FLAG_SI) != 0); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGTRAP); + ATF_REQUIRE(pl.pl_siginfo.si_code == TRAP_BRKPT); + + /* Kill the child process. */ + ATF_REQUIRE(ptrace(PT_KILL, fpid, 0, 0) == 0); + + /* The last wait() should report the SIGKILL. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSIGNALED(status)); + ATF_REQUIRE(WTERMSIG(status) == SIGKILL); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} +#endif /* HAVE_BREAKPOINT */ + +/* + * Verify that a SIGTRAP event with the TRAP_TRACE code is reported + * for a single-step trap from PT_STEP. + */ +ATF_TC_WITHOUT_HEAD(ptrace__step_siginfo); +ATF_TC_BODY(ptrace__step_siginfo, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + exit(1); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + /* Step the child ignoring the SIGSTOP. */ + ATF_REQUIRE(ptrace(PT_STEP, fpid, (caddr_t)1, 0) == 0); + + /* The second wait() should report a single-step trap. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE((pl.pl_flags & PL_FLAG_SI) != 0); + ATF_REQUIRE(pl.pl_siginfo.si_signo == SIGTRAP); + ATF_REQUIRE(pl.pl_siginfo.si_code == TRAP_TRACE); + + /* Continue the child process. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + #if defined(HAVE_BREAKPOINT) && defined(SKIP_BREAK) static void * continue_thread(void *arg __unused) @@ -3713,6 +3817,10 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__event_mask_sigkill_discard); ATF_TP_ADD_TC(tp, ptrace__PT_ATTACH_with_SBDRY_thread); ATF_TP_ADD_TC(tp, ptrace__PT_STEP_with_signal); +#ifdef HAVE_BREAKPOINT + ATF_TP_ADD_TC(tp, ptrace__breakpoint_siginfo); +#endif + ATF_TP_ADD_TC(tp, ptrace__step_siginfo); #if defined(HAVE_BREAKPOINT) && defined(SKIP_BREAK) ATF_TP_ADD_TC(tp, ptrace__PT_CONTINUE_different_thread); #endif From owner-svn-src-head@freebsd.org Tue Apr 24 05:33:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2899EFBBC7F; Tue, 24 Apr 2018 05:33:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C83187618C; Tue, 24 Apr 2018 05:33: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 C0E6C6FEF; Tue, 24 Apr 2018 05:33: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 w3O5XHD8081020; Tue, 24 Apr 2018 05:33:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O5XHLc081019; Tue, 24 Apr 2018 05:33:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804240533.w3O5XHLc081019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 05:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332909 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 332909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 05:33:18 -0000 Author: jhb Date: Tue Apr 24 05:33:17 2018 New Revision: 332909 URL: https://svnweb.freebsd.org/changeset/base/332909 Log: Report proper signal codes for SIGTRAP traps on MIPS. - Use TRAP_TRACE for traps after stepping via PT_STEP. - Use TRAP_BRKPT for software breakpoint traps and watchpoint traps. This was tested via the recently added siginfo ptrace() tests. PT_STEP on MIPS has several bugs that prevent it from working yet, but this does fix the ptrace__breakpoint_siginfo test on MIPS. Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Apr 24 05:30:05 2018 (r332908) +++ head/sys/mips/mips/trap.c Tue Apr 24 05:33:17 2018 (r332909) @@ -840,6 +840,7 @@ dofault: if (td->td_md.md_ss_addr != va || instr != MIPS_BREAK_SSTEP) { i = SIGTRAP; + ucode = TRAP_BRKPT; addr = trapframe->pc; break; } @@ -851,6 +852,7 @@ dofault: */ addr = trapframe->pc; i = SIGTRAP; + ucode = TRAP_TRACE; break; } @@ -865,6 +867,7 @@ dofault: va += sizeof(int); printf("watch exception @ %p\n", (void *)va); i = SIGTRAP; + ucode = TRAP_BRKPT; addr = va; break; } From owner-svn-src-head@freebsd.org Tue Apr 24 05:42:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB782FBC0A2; Tue, 24 Apr 2018 05:42:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E89A78C70; Tue, 24 Apr 2018 05:42:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78E38707A; Tue, 24 Apr 2018 05:42:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O5gArj084509; Tue, 24 Apr 2018 05:42:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O5gAto084508; Tue, 24 Apr 2018 05:42:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804240542.w3O5gAto084508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 05:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332910 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 332910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 05:42:11 -0000 Author: jhb Date: Tue Apr 24 05:42:10 2018 New Revision: 332910 URL: https://svnweb.freebsd.org/changeset/base/332910 Log: Relock PROC_LOCK before one failure case in ptrace_single_step(). The MIPS ptrace_single_step() unlocks the PROC_LOCK while reading and writing instructions from userland. One failure case was not reacquiring the lock before returning. Modified: head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Tue Apr 24 05:33:17 2018 (r332909) +++ head/sys/mips/mips/pm_machdep.c Tue Apr 24 05:42:10 2018 (r332910) @@ -260,6 +260,7 @@ ptrace_single_step(struct thread *td) if (td->td_md.md_ss_addr) { printf("SS %s (%d): breakpoint already set at %x (va %x)\n", p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ + PROC_LOCK(p); return (EFAULT); } td->td_md.md_ss_addr = va; From owner-svn-src-head@freebsd.org Tue Apr 24 06:10:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6D01FBCD12; Tue, 24 Apr 2018 06:10:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9565A7FCBE; Tue, 24 Apr 2018 06:10:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C21F74E8; Tue, 24 Apr 2018 06:10:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O6AagW096285; Tue, 24 Apr 2018 06:10:36 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O6AaUg096284; Tue, 24 Apr 2018 06:10:36 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804240610.w3O6AaUg096284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 24 Apr 2018 06:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332911 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 06:10:37 -0000 Author: mjg Date: Tue Apr 24 06:10:36 2018 New Revision: 332911 URL: https://svnweb.freebsd.org/changeset/base/332911 Log: lockf: change the owner hash from pid to vnode-based This adds a bit missed due to the patch split, see r332882 Tested by: pho Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Tue Apr 24 05:42:10 2018 (r332910) +++ head/sys/kern/kern_lockf.c Tue Apr 24 06:10:36 2018 (r332911) @@ -105,7 +105,7 @@ struct owner_graph; #define SELF 0x1 #define OTHERS 0x2 static void lf_init(void *); -static int lf_hash_owner(caddr_t, struct flock *, int); +static int lf_hash_owner(caddr_t, struct vnode *, struct flock *, int); static int lf_owner_matches(struct lock_owner *, caddr_t, struct flock *, int); static struct lockf_entry * @@ -301,7 +301,7 @@ SYSINIT(lf_init, SI_SUB_LOCK, SI_ORDER_FIRST, lf_init, * Generate a hash value for a lock owner. */ static int -lf_hash_owner(caddr_t id, struct flock *fl, int flags) +lf_hash_owner(caddr_t id, struct vnode *vp, struct flock *fl, int flags) { uint32_t h; @@ -311,9 +311,7 @@ lf_hash_owner(caddr_t id, struct flock *fl, int flags) } else if (flags & F_FLOCK) { h = ((uintptr_t) id) >> 7; } else { - struct proc *p = (struct proc *) id; - h = HASHSTEP(0, p->p_pid); - h = HASHSTEP(h, 0); + h = ((uintptr_t) vp) >> 7; } return (h % LOCK_OWNER_HASH_SIZE); @@ -500,7 +498,7 @@ retry_setlock: * Map our arguments to an existing lock owner or create one * if this is the first time we have seen this owner. */ - hash = lf_hash_owner(id, fl, flags); + hash = lf_hash_owner(id, vp, fl, flags); sx_xlock(&lf_lock_owners[hash].lock); LIST_FOREACH(lo, &lf_lock_owners[hash].list, lo_link) if (lf_owner_matches(lo, id, fl, flags)) From owner-svn-src-head@freebsd.org Tue Apr 24 09:42:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0841BFC1AAD; Tue, 24 Apr 2018 09:42:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEFF572494; Tue, 24 Apr 2018 09:42:58 +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 AA077117F6; Tue, 24 Apr 2018 09:42:58 +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 w3O9gwmS006589; Tue, 24 Apr 2018 09:42:58 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O9gwCx006587; Tue, 24 Apr 2018 09:42:58 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201804240942.w3O9gwCx006587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 24 Apr 2018 09:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332918 - in head/sys: dev/acpica x86/acpica X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: dev/acpica x86/acpica X-SVN-Commit-Revision: 332918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 09:42:59 -0000 Author: avg Date: Tue Apr 24 09:42:58 2018 New Revision: 332918 URL: https://svnweb.freebsd.org/changeset/base/332918 Log: add a new ACPI suspend debugging knob, debug.acpi.suspend_deep_bounce This sysctl allows a deeper dive into the sleep abyss comparing to debug.acpi.suspend_bounce. When the new sysctl is set the system will execute the suspend sequence up to the call to AcpiEnterSleepState(). That includes saving processor contexts and parking APs. Then, instead of actually entering the sleep state, the BSP will call resumectx() to emulate the wakeup. The APs should get restarted by the sequence of Init and Startup IPIs that BSP sends to them. MFC after: 8 days Modified: head/sys/dev/acpica/acpi.c head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Apr 24 08:48:20 2018 (r332917) +++ head/sys/dev/acpica/acpi.c Tue Apr 24 09:42:58 2018 (r332918) @@ -291,6 +291,11 @@ static int acpi_susp_bounce; SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, &acpi_susp_bounce, 0, "Don't actually suspend, just test devices."); +int acpi_susp_deep_bounce; +SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_deep_bounce, CTLFLAG_RW, + &acpi_susp_deep_bounce, 0, "Don't actually suspend, " + "bail out just before entering the sleep state."); + /* * ACPI can only be loaded as a module by the loader; activating it after * system bootstrap time is not useful, and can be fatal to the system. Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Tue Apr 24 08:48:20 2018 (r332917) +++ head/sys/x86/acpica/acpi_wakeup.c Tue Apr 24 09:42:58 2018 (r332918) @@ -79,6 +79,7 @@ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); extern int acpi_resume_beep; extern int acpi_reset_video; +extern int acpi_susp_deep_bounce; #ifdef SMP extern struct susppcb **susppcbs; @@ -263,6 +264,9 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) */ PTD[KPTDI] = PTD[LOWPTDI]; #endif + + if (acpi_susp_deep_bounce) + resumectx(pcb); /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) From owner-svn-src-head@freebsd.org Tue Apr 24 12:50:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3824FA326D; Tue, 24 Apr 2018 12:50:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5FC37AC4B; Tue, 24 Apr 2018 12:50:22 +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 A0D221346F; Tue, 24 Apr 2018 12:50:22 +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 w3OCoMA3096611; Tue, 24 Apr 2018 12:50:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OCoLkY096603; Tue, 24 Apr 2018 12:50:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804241250.w3OCoLkY096603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Apr 2018 12:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332930 - in head/sys: compat/linux conf i386/i386 i386/include i386/linux modules/linux X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: compat/linux conf i386/i386 i386/include i386/linux modules/linux X-SVN-Commit-Revision: 332930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 12:50:23 -0000 Author: kib Date: Tue Apr 24 12:50:21 2018 New Revision: 332930 URL: https://svnweb.freebsd.org/changeset/base/332930 Log: Fix futexes on i386 after the 4/4G split. Use proper method to access userspace. For now, only the slow copyout path is implemented. Reported and tested by: tijl (previous version) Sponsored by: The FreeBSD Foundation Added: head/sys/i386/linux/linux_copyout.c - copied, changed from r332929, head/sys/i386/linux/linux_support.s Deleted: head/sys/i386/linux/linux_support.s Modified: head/sys/compat/linux/linux_futex.c head/sys/compat/linux/linux_futex.h head/sys/conf/files.i386 head/sys/i386/i386/copyout.c head/sys/i386/include/md_var.h head/sys/modules/linux/Makefile Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Tue Apr 24 12:17:28 2018 (r332929) +++ head/sys/compat/linux/linux_futex.c Tue Apr 24 12:50:21 2018 (r332930) @@ -273,14 +273,6 @@ static int handle_futex_death(struct linux_emuldata *, static int fetch_robust_entry(struct linux_robust_list **, struct linux_robust_list **, unsigned int *); -/* support.s */ -int futex_xchgl(int oparg, uint32_t *uaddr, int *oldval); -int futex_addl(int oparg, uint32_t *uaddr, int *oldval); -int futex_orl(int oparg, uint32_t *uaddr, int *oldval); -int futex_andl(int oparg, uint32_t *uaddr, int *oldval); -int futex_xorl(int oparg, uint32_t *uaddr, int *oldval); - - static int futex_copyin_timeout(int op, struct l_timespec *luts, int clockrt, struct timespec *ts) Modified: head/sys/compat/linux/linux_futex.h ============================================================================== --- head/sys/compat/linux/linux_futex.h Tue Apr 24 12:17:28 2018 (r332929) +++ head/sys/compat/linux/linux_futex.h Tue Apr 24 12:50:21 2018 (r332930) @@ -78,6 +78,11 @@ extern struct mtx futex_mtx; #define FUTEX_TID_MASK 0x3fffffff #define FUTEX_BITSET_MATCH_ANY 0xffffffff +int futex_xchgl(int oparg, uint32_t *uaddr, int *oldval); +int futex_addl(int oparg, uint32_t *uaddr, int *oldval); +int futex_orl(int oparg, uint32_t *uaddr, int *oldval); +int futex_andl(int oparg, uint32_t *uaddr, int *oldval); +int futex_xorl(int oparg, uint32_t *uaddr, int *oldval); void release_futexes(struct thread *, struct linux_emuldata *); Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Apr 24 12:17:28 2018 (r332929) +++ head/sys/conf/files.i386 Tue Apr 24 12:50:21 2018 (r332930) @@ -536,11 +536,10 @@ i386/ibcs2/ibcs2_xenix.c optional ibcs2 i386/ibcs2/ibcs2_xenix_sysent.c optional ibcs2 i386/ibcs2/imgact_coff.c optional ibcs2 i386/linux/imgact_linux.c optional compat_linux +i386/linux/linux_copyout.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux i386/linux/linux_machdep.c optional compat_linux i386/linux/linux_ptrace.c optional compat_linux -i386/linux/linux_support.s optional compat_linux \ - dependency "linux_assym.h" i386/linux/linux_sysent.c optional compat_linux i386/linux/linux_sysvec.c optional compat_linux i386/pci/pci_cfgreg.c optional pci Modified: head/sys/i386/i386/copyout.c ============================================================================== --- head/sys/i386/i386/copyout.c Tue Apr 24 12:17:28 2018 (r332929) +++ head/sys/i386/i386/copyout.c Tue Apr 24 12:50:21 2018 (r332930) @@ -97,7 +97,7 @@ copyout_init_tramp(void) (uintptr_t)suword_fast + setidt_disp); } -static int +int cp_slow0(vm_offset_t uva, size_t len, bool write, void (*f)(vm_offset_t, void *), void *arg) { Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Tue Apr 24 12:17:28 2018 (r332929) +++ head/sys/i386/include/md_var.h Tue Apr 24 12:50:21 2018 (r332930) @@ -55,6 +55,8 @@ struct segment_descriptor; union savefpu; void bcopyb(const void *from, void *to, size_t len); +int cp_slow0(vm_offset_t uva, size_t len, bool write, + void (*f)(vm_offset_t, void *), void *arg); void cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs)); void copyout_init_tramp(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); Copied and modified: head/sys/i386/linux/linux_copyout.c (from r332929, head/sys/i386/linux/linux_support.s) ============================================================================== --- head/sys/i386/linux/linux_support.s Tue Apr 24 12:17:28 2018 (r332929, copy source) +++ head/sys/i386/linux/linux_copyout.c Tue Apr 24 12:50:21 2018 (r332930) @@ -1,9 +1,12 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2006,2007 Konstantin Belousov + * Copyright (c) 2018 The FreeBSD Foundation * All rights reserved. * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,7 +19,7 @@ * 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 + * 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) @@ -24,103 +27,152 @@ * 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 "linux_assym.h" /* system definitions */ -#include /* miscellaneous asm macros */ +#include +__FBSDID("$FreeBSD$"); -#include "assym.inc" +#include "opt_compat.h" -futex_fault_decx: - movl PCPU(CURPCB),%ecx -futex_fault: - movl $0,PCB_ONFAULT(%ecx) - movl $-EFAULT,%eax - ret +#include +#include +#include +#include +#include +#include +#include +#include +#include -ENTRY(futex_xchgl) - movl PCPU(CURPCB),%ecx - movl $futex_fault,PCB_ONFAULT(%ecx) - movl 4(%esp),%eax - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault - xchgl %eax,(%edx) - movl 12(%esp),%edx - movl %eax,(%edx) - xorl %eax,%eax - movl %eax,PCB_ONFAULT(%ecx) - ret +#include +#include -ENTRY(futex_addl) - movl PCPU(CURPCB),%ecx - movl $futex_fault,PCB_ONFAULT(%ecx) - movl 4(%esp),%eax - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault -#ifdef SMP - lock -#endif - xaddl %eax,(%edx) - movl 12(%esp),%edx - movl %eax,(%edx) - xorl %eax,%eax - movl %eax,PCB_ONFAULT(%ecx) - ret +#include +#include -ENTRY(futex_orl) - movl PCPU(CURPCB),%ecx - movl $futex_fault_decx,PCB_ONFAULT(%ecx) - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault - movl (%edx),%eax -1: movl %eax,%ecx - orl 4(%esp),%ecx -#ifdef SMP - lock -#endif - cmpxchgl %ecx,(%edx) - jnz 1b -futex_tail: - movl 12(%esp),%edx - movl %eax,(%edx) - xorl %eax,%eax - movl PCPU(CURPCB),%ecx - movl %eax,PCB_ONFAULT(%ecx) - ret +struct futex_st0 { + int oparg; + int *oldval; +}; -ENTRY(futex_andl) - movl PCPU(CURPCB),%ecx - movl $futex_fault_decx,PCB_ONFAULT(%ecx) - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault - movl (%edx),%eax -1: movl %eax,%ecx - andl 4(%esp),%ecx -#ifdef SMP - lock -#endif - cmpxchgl %ecx,(%edx) - jnz 1b - jmp futex_tail +static void +futex_xchgl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; -ENTRY(futex_xorl) - movl PCPU(CURPCB),%ecx - movl $futex_fault_decx,PCB_ONFAULT(%ecx) - movl 8(%esp),%edx - cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault - movl (%edx),%eax -1: movl %eax,%ecx - xorl 4(%esp),%ecx -#ifdef SMP - lock -#endif - cmpxchgl %ecx,(%edx) - jnz 1b - jmp futex_tail + st = arg; + *st->oldval = atomic_swap_int((int *)kva, st->oparg); +} + +int +futex_xchgl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_xchgl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} + +static void +futex_addl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + + st = arg; + *st->oldval = atomic_fetchadd_int((int *)kva, st->oparg); +} + +int +futex_addl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_addl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} + +static void +futex_orl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + int old; + + st = arg; + old = *(int *)kva; + while (!atomic_fcmpset_int((int *)kva, &old, old | st->oparg)) + ; + *st->oldval = old; +} + +int +futex_orl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_orl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} + +static void +futex_andl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + int old; + + st = arg; + old = *(int *)kva; + while (!atomic_fcmpset_int((int *)kva, &old, old & st->oparg)) + ; + *st->oldval = old; +} + +int +futex_andl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_andl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} + +static void +futex_xorl_slow0(vm_offset_t kva, void *arg) +{ + struct futex_st0 *st; + int old; + + st = arg; + old = *(int *)kva; + while (!atomic_fcmpset_int((int *)kva, &old, old ^ st->oparg)) + ; + *st->oldval = old; +} + +int +futex_xorl(int oparg, uint32_t *uaddr, int *oldval) +{ + struct futex_st0 st; + + st.oparg = oparg; + st.oldval = oldval; + if (cp_slow0((vm_offset_t)uaddr, sizeof(uint32_t), true, + futex_xorl_slow0, &st) != 0) + return (-EFAULT); + return (0); +} Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Tue Apr 24 12:17:28 2018 (r332929) +++ head/sys/modules/linux/Makefile Tue Apr 24 12:50:21 2018 (r332930) @@ -17,8 +17,12 @@ SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c li linux${SFX}_sysvec.c linux_uid16.c linux_time.c \ linux_timer.c linux_vdso.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ - device_if.h bus_if.h \ - linux${SFX}_support.s + device_if.h bus_if.h +.if ${MACHINE_CPUARCH} == "amd64" +SRCS+= linux${SFX}_support.s +.else +SRCS+= linux_copyout.c +.endif DPSRCS= assym.inc linux${SFX}_genassym.c # XXX: for assym.inc @@ -56,11 +60,11 @@ linux${SFX}_locore.o: linux${SFX}_assym.h assym.inc -Wl,-soname=${VDSO}.so.1,--eh-frame-hdr,-warn-common \ ${.IMPSRC} -o ${.TARGET} +.if ${MACHINE_CPUARCH} == "amd64" linux${SFX}_support.o: linux${SFX}_assym.h assym.inc ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ ${.IMPSRC} -o ${.TARGET} -.if ${MACHINE_CPUARCH} == "amd64" ${VDSO}.so: linux${SFX}_locore.o ${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd \ --binary-architecture i386 linux${SFX}_locore.o ${.TARGET} From owner-svn-src-head@freebsd.org Tue Apr 24 13:07:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36E58FA394C; Tue, 24 Apr 2018 13:07:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB7ED800B1; Tue, 24 Apr 2018 13:07:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1974137A9; Tue, 24 Apr 2018 13:07:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OD7HGD006311; Tue, 24 Apr 2018 13:07:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OD7Hi7006309; Tue, 24 Apr 2018 13:07:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201804241307.w3OD7Hi7006309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 24 Apr 2018 13:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332931 - in head/sys: conf dev/amdsbwd X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head/sys: conf dev/amdsbwd X-SVN-Commit-Revision: 332931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 13:07:18 -0000 Author: eadler Date: Tue Apr 24 13:07:17 2018 New Revision: 332931 URL: https://svnweb.freebsd.org/changeset/base/332931 Log: [amdsbwd] teach amdsbwd that it has options AMDSBWD_DEBUG was previously checked for as a #define but it was not possible to define it Reviewed by: kevans Discussed with: kenm Modified: head/sys/conf/options head/sys/dev/amdsbwd/amdsbwd.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Apr 24 12:50:21 2018 (r332930) +++ head/sys/conf/options Tue Apr 24 13:07:17 2018 (r332931) @@ -1006,3 +1006,6 @@ EKCD opt_ekcd.h # NVME options NVME_USE_NVD opt_nvme.h + +# amdsbwd options +AMDSBWD_DEBUG opt_amdsbwd.h Modified: head/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- head/sys/dev/amdsbwd/amdsbwd.c Tue Apr 24 12:50:21 2018 (r332930) +++ head/sys/dev/amdsbwd/amdsbwd.c Tue Apr 24 13:07:17 2018 (r332931) @@ -49,6 +49,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_amdsbwd.h" + #include #include #include From owner-svn-src-head@freebsd.org Tue Apr 24 13:44:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D3DFA4BA1; Tue, 24 Apr 2018 13:44:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 97FE3865A7; Tue, 24 Apr 2018 13:44:19 +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 92F5013E20; Tue, 24 Apr 2018 13:44:19 +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 w3ODiJTo026012; Tue, 24 Apr 2018 13:44:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ODiJta026011; Tue, 24 Apr 2018 13:44:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804241344.w3ODiJta026011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Apr 2018 13:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332932 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 332932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 13:44:20 -0000 Author: kib Date: Tue Apr 24 13:44:19 2018 New Revision: 332932 URL: https://svnweb.freebsd.org/changeset/base/332932 Log: Correct undesirable interaction between caching of %cr4 in bhyve and invltlb_glob(). Reviewed by: grehan, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15138 Modified: head/sys/amd64/vmm/vmm_host.c Modified: head/sys/amd64/vmm/vmm_host.c ============================================================================== --- head/sys/amd64/vmm/vmm_host.c Tue Apr 24 13:07:17 2018 (r332931) +++ head/sys/amd64/vmm/vmm_host.c Tue Apr 24 13:44:19 2018 (r332932) @@ -61,7 +61,16 @@ vmm_host_state_init(void) */ vmm_host_cr0 = rcr0() | CR0_TS; - vmm_host_cr4 = rcr4(); + /* + * On non-PCID or PCID but without INVPCID support machines, + * we flush kernel i.e. global TLB entries, by temporary + * clearing the CR4.PGE bit, see invltlb_glob(). If + * preemption occurs at the wrong time, cached vmm_host_cr4 + * might store the value with CR4.PGE cleared. Since FreeBSD + * requires support for PG_G on amd64, just set it + * unconditionally. + */ + vmm_host_cr4 = rcr4() | CR4_PGE; /* * Only permit a guest to use XSAVE if the host is using From owner-svn-src-head@freebsd.org Tue Apr 24 14:02:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F13AFA5FBA; Tue, 24 Apr 2018 14:02:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C62D36BA23; Tue, 24 Apr 2018 14:02:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C117014191; Tue, 24 Apr 2018 14:02:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OE2k9n037328; Tue, 24 Apr 2018 14:02:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OE2k3L037327; Tue, 24 Apr 2018 14:02:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804241402.w3OE2k3L037327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Apr 2018 14:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332934 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 332934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 14:02:47 -0000 Author: kib Date: Tue Apr 24 14:02:46 2018 New Revision: 332934 URL: https://svnweb.freebsd.org/changeset/base/332934 Log: Use relaxed atomics to access the monitor line. We must ensure that accesses occur, they do not have any other compiler-visible effects. Bruce found some situations where optimization could remove an access, and provided a patch to use volatile qualifier for the state variables. Since volatile behaviour there is the compiler-specific interpretation of the keyword, use relaxed atomics instead, which gives exactly the desired semantic. Noted by and discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue Apr 24 13:52:39 2018 (r332933) +++ head/sys/x86/x86/cpu_machdep.c Tue Apr 24 14:02:46 2018 (r332934) @@ -163,12 +163,12 @@ acpi_cpu_idle_mwait(uint32_t mwait_hint) */ state = (int *)PCPU_PTR(monitorbuf); - KASSERT(*state == STATE_SLEEPING, - ("cpu_mwait_cx: wrong monitorbuf state")); - *state = STATE_MWAIT; + KASSERT(atomic_load_int(state) == STATE_SLEEPING, + ("cpu_mwait_cx: wrong monitorbuf state")); + atomic_store_int(state, STATE_MWAIT); handle_ibrs_entry(); cpu_monitor(state, 0, 0); - if (*state == STATE_MWAIT) + if (atomic_load_int(state) == STATE_MWAIT) cpu_mwait(MWAIT_INTRBREAK, mwait_hint); handle_ibrs_exit(); @@ -176,7 +176,7 @@ acpi_cpu_idle_mwait(uint32_t mwait_hint) * We should exit on any event that interrupts mwait, because * that event might be a wanted interrupt. */ - *state = STATE_RUNNING; + atomic_store_int(state, STATE_RUNNING); } /* Get current clock frequency for the given cpu id. */ @@ -408,7 +408,7 @@ cpu_idle_acpi(sbintime_t sbt) int *state; state = (int *)PCPU_PTR(monitorbuf); - *state = STATE_SLEEPING; + atomic_store_int(state, STATE_SLEEPING); /* See comments in cpu_idle_hlt(). */ disable_intr(); @@ -418,7 +418,7 @@ cpu_idle_acpi(sbintime_t sbt) cpu_idle_hook(sbt); else acpi_cpu_c1(); - *state = STATE_RUNNING; + atomic_store_int(state, STATE_RUNNING); } static void @@ -427,7 +427,7 @@ cpu_idle_hlt(sbintime_t sbt) int *state; state = (int *)PCPU_PTR(monitorbuf); - *state = STATE_SLEEPING; + atomic_store_int(state, STATE_SLEEPING); /* * Since we may be in a critical section from cpu_idle(), if @@ -450,7 +450,7 @@ cpu_idle_hlt(sbintime_t sbt) enable_intr(); else acpi_cpu_c1(); - *state = STATE_RUNNING; + atomic_store_int(state, STATE_RUNNING); } static void @@ -459,21 +459,22 @@ cpu_idle_mwait(sbintime_t sbt) int *state; state = (int *)PCPU_PTR(monitorbuf); - *state = STATE_MWAIT; + atomic_store_int(state, STATE_MWAIT); /* See comments in cpu_idle_hlt(). */ disable_intr(); if (sched_runnable()) { + atomic_store_int(state, STATE_RUNNING); enable_intr(); - *state = STATE_RUNNING; return; } + cpu_monitor(state, 0, 0); - if (*state == STATE_MWAIT) + if (atomic_load_int(state) == STATE_MWAIT) __asm __volatile("sti; mwait" : : "a" (MWAIT_C1), "c" (0)); else enable_intr(); - *state = STATE_RUNNING; + atomic_store_int(state, STATE_RUNNING); } static void @@ -483,7 +484,7 @@ cpu_idle_spin(sbintime_t sbt) int i; state = (int *)PCPU_PTR(monitorbuf); - *state = STATE_RUNNING; + atomic_store_int(state, STATE_RUNNING); /* * The sched_runnable() call is racy but as long as there is @@ -577,20 +578,21 @@ out: int cpu_idle_wakeup(int cpu) { - struct pcpu *pcpu; int *state; - pcpu = pcpu_find(cpu); - state = (int *)pcpu->pc_monitorbuf; - /* - * This doesn't need to be atomic since missing the race will - * simply result in unnecessary IPIs. - */ - if (*state == STATE_SLEEPING) + state = (int *)pcpu_find(cpu)->pc_monitorbuf; + switch (atomic_load_int(state)) { + case STATE_SLEEPING: return (0); - if (*state == STATE_MWAIT) - *state = STATE_RUNNING; - return (1); + case STATE_MWAIT: + atomic_store_int(state, STATE_RUNNING); + return (1); + case STATE_RUNNING: + return (1); + default: + panic("bad monitor state"); + return (1); + } } /* From owner-svn-src-head@freebsd.org Tue Apr 24 14:49:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AC9CFA7E76; Tue, 24 Apr 2018 14:49:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4885B76C3E; Tue, 24 Apr 2018 14:49:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F37C14858; Tue, 24 Apr 2018 14:49:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OEnAZA057704; Tue, 24 Apr 2018 14:49:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OEn9TJ057700; Tue, 24 Apr 2018 14:49:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201804241449.w3OEn9TJ057700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 24 Apr 2018 14:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332936 - in head/sys: compat/linprocfs fs/procfs X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head/sys: compat/linprocfs fs/procfs X-SVN-Commit-Revision: 332936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 14:49:10 -0000 Author: eadler Date: Tue Apr 24 14:49:09 2018 New Revision: 332936 URL: https://svnweb.freebsd.org/changeset/base/332936 Log: [procfs] Split procfs_attr into multiple functions Reviewed by: des, kib Discussed with: mmacy Differential Revision: https://reviews.freebsd.org/D15150 Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs.c head/sys/fs/procfs/procfs.h Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Apr 24 14:35:39 2018 (r332935) +++ head/sys/compat/linprocfs/linprocfs.c Tue Apr 24 14:49:09 2018 (r332936) @@ -1591,7 +1591,7 @@ linprocfs_init(PFS_INIT_ARGS) pfs_create_file(dir, "maps", &linprocfs_doprocmaps, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "mem", &procfs_doprocmem, - &procfs_attr, &procfs_candebug, NULL, PFS_RDWR|PFS_RAW); + procfs_attr_rw, &procfs_candebug, NULL, PFS_RDWR | PFS_RAW); pfs_create_file(dir, "mounts", &linprocfs_domtab, NULL, NULL, NULL, PFS_RD); pfs_create_link(dir, "root", &linprocfs_doprocroot, Modified: head/sys/fs/procfs/procfs.c ============================================================================== --- head/sys/fs/procfs/procfs.c Tue Apr 24 14:35:39 2018 (r332935) +++ head/sys/fs/procfs/procfs.c Tue Apr 24 14:49:09 2018 (r332936) @@ -98,24 +98,10 @@ procfs_docurproc(PFS_FILL_ARGS) return (0); } -/* - * Adjust mode for some nodes that need it - */ -int -procfs_attr(PFS_ATTR_ARGS) -{ +static int +procfs_attr(PFS_ATTR_ARGS, int mode) { - /* XXX inefficient, split into separate functions */ - if (strcmp(pn->pn_name, "note") == 0 || - strcmp(pn->pn_name, "notepg") == 0) - vap->va_mode = 0200; - else if (strcmp(pn->pn_name, "mem") == 0 || - strcmp(pn->pn_name, "regs") == 0 || - strcmp(pn->pn_name, "dbregs") == 0 || - strcmp(pn->pn_name, "fpregs") == 0 || - strcmp(pn->pn_name, "osrel") == 0) - vap->va_mode = 0600; - + vap->va_mode = mode; if (p != NULL) { PROC_LOCK_ASSERT(p, MA_OWNED); @@ -126,6 +112,27 @@ procfs_attr(PFS_ATTR_ARGS) return (0); } +int +procfs_attr_all_rx(PFS_ATTR_ARGS) +{ + + return (procfs_attr(td, p, pn, vap, 0555)); +} + +int +procfs_attr_rw(PFS_ATTR_ARGS) +{ + + return (procfs_attr(td, p, pn, vap, 0600)); +} + +int +procfs_attr_w(PFS_ATTR_ARGS) +{ + + return (procfs_attr(td, p, pn, vap, 0200)); +} + /* * Visibility: some files only exist for non-system processes * Non-static because linprocfs uses it. @@ -164,33 +171,33 @@ procfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, 0); dir = pfs_create_dir(root, "pid", - procfs_attr, NULL, NULL, PFS_PROCDEP); + procfs_attr_all_rx, NULL, NULL, PFS_PROCDEP); pfs_create_file(dir, "cmdline", procfs_doproccmdline, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "dbregs", procfs_doprocdbregs, - procfs_attr, procfs_candebug, NULL, PFS_RDWR|PFS_RAW); + procfs_attr_rw, procfs_candebug, NULL, PFS_RDWR | PFS_RAW); pfs_create_file(dir, "etype", procfs_doproctype, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "fpregs", procfs_doprocfpregs, - procfs_attr, procfs_candebug, NULL, PFS_RDWR|PFS_RAW); + procfs_attr_rw, procfs_candebug, NULL, PFS_RDWR | PFS_RAW); pfs_create_file(dir, "map", procfs_doprocmap, NULL, procfs_notsystem, NULL, PFS_RD); node = pfs_create_file(dir, "mem", procfs_doprocmem, - procfs_attr, procfs_candebug, NULL, PFS_RDWR|PFS_RAW); + procfs_attr_rw, procfs_candebug, NULL, PFS_RDWR | PFS_RAW); node->pn_ioctl = procfs_ioctl; node->pn_close = procfs_close; pfs_create_file(dir, "note", procfs_doprocnote, - procfs_attr, procfs_candebug, NULL, PFS_WR); + procfs_attr_w, procfs_candebug, NULL, PFS_WR); pfs_create_file(dir, "notepg", procfs_doprocnote, - procfs_attr, procfs_candebug, NULL, PFS_WR); + procfs_attr_w, procfs_candebug, NULL, PFS_WR); pfs_create_file(dir, "regs", procfs_doprocregs, - procfs_attr, procfs_candebug, NULL, PFS_RDWR|PFS_RAW); + procfs_attr_rw, procfs_candebug, NULL, PFS_RDWR | PFS_RAW); pfs_create_file(dir, "rlimit", procfs_doprocrlimit, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "status", procfs_doprocstatus, NULL, NULL, NULL, PFS_RD); pfs_create_file(dir, "osrel", procfs_doosrel, - procfs_attr, procfs_candebug, NULL, PFS_RDWR); + procfs_attr_rw, procfs_candebug, NULL, PFS_RDWR); pfs_create_link(dir, "file", procfs_doprocfile, NULL, procfs_notsystem, NULL, 0); Modified: head/sys/fs/procfs/procfs.h ============================================================================== --- head/sys/fs/procfs/procfs.h Tue Apr 24 14:35:39 2018 (r332935) +++ head/sys/fs/procfs/procfs.h Tue Apr 24 14:49:09 2018 (r332936) @@ -57,7 +57,9 @@ int procfs_ioctl(PFS_IOCTL_ARGS); int procfs_close(PFS_CLOSE_ARGS); /* Attributes */ -int procfs_attr(PFS_ATTR_ARGS); +int procfs_attr_w(PFS_ATTR_ARGS); +int procfs_attr_rw(PFS_ATTR_ARGS); +int procfs_attr_all_rx(PFS_ATTR_ARGS); /* Visibility */ int procfs_notsystem(PFS_VIS_ARGS); From owner-svn-src-head@freebsd.org Tue Apr 24 15:59:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D7FEFAA530; Tue, 24 Apr 2018 15:59:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3E86686E7; Tue, 24 Apr 2018 15:59:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEE7E153C2; Tue, 24 Apr 2018 15:59:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OFxdIS092311; Tue, 24 Apr 2018 15:59:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OFxd2N092310; Tue, 24 Apr 2018 15:59:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804241559.w3OFxd2N092310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Apr 2018 15:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332940 - head/lib/libc/secure X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/secure X-SVN-Commit-Revision: 332940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 15:59:40 -0000 Author: kib Date: Tue Apr 24 15:59:39 2018 New Revision: 332940 URL: https://svnweb.freebsd.org/changeset/base/332940 Log: Carefully update stack guard bytes inside __guard_setup(). This is necessary to make sure that functions that can have stack protection are not used to update the stack guard. If not, the stack guard check would fail when it shouldn't. guard_setup() calls elf_aux_info(), which, in turn, calls memcpy() to update stack_chk_guard. If either elf_aux_info() or memcpy() have stack protection enabled, __stack_chk_guard will be modified before returning from them, causing the stack protection check to fail. This change uses a temporary buffer to delay changing __stack_chk_guard until elf_aux_info() returns. Submitted by: Luis Pires MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15173 Modified: head/lib/libc/secure/stack_protector.c Modified: head/lib/libc/secure/stack_protector.c ============================================================================== --- head/lib/libc/secure/stack_protector.c Tue Apr 24 15:04:07 2018 (r332939) +++ head/lib/libc/secure/stack_protector.c Tue Apr 24 15:59:39 2018 (r332940) @@ -54,15 +54,27 @@ static void __guard_setup(void) { static const int mib[2] = { CTL_KERN, KERN_ARND }; + volatile long tmp_stack_chk_guard[nitems(__stack_chk_guard)]; size_t len; - int error; + int error, idx; if (__stack_chk_guard[0] != 0) return; - error = _elf_aux_info(AT_CANARY, __stack_chk_guard, - sizeof(__stack_chk_guard)); - if (error == 0 && __stack_chk_guard[0] != 0) + /* + * Avoid using functions which might have stack protection + * enabled, to update the __stack_chk_guard. First fetch the + * data into a temporal array, then do manual volatile copy to + * not allow optimizer to call memcpy() behind us. + */ + error = _elf_aux_info(AT_CANARY, (void *)tmp_stack_chk_guard, + sizeof(tmp_stack_chk_guard)); + if (error == 0 && tmp_stack_chk_guard[0] != 0) { + for (idx = 0; idx < nitems(__stack_chk_guard); idx++) { + __stack_chk_guard[idx] = tmp_stack_chk_guard[idx]; + tmp_stack_chk_guard[idx] = 0; + } return; + } len = sizeof(__stack_chk_guard); if (__sysctl(mib, nitems(mib), __stack_chk_guard, &len, NULL, 0) == From owner-svn-src-head@freebsd.org Tue Apr 24 17:22:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F55FAC95D; Tue, 24 Apr 2018 17:22:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AE947CA23; Tue, 24 Apr 2018 17:22:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 334A41620B; Tue, 24 Apr 2018 17:22:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OHMIH1037535; Tue, 24 Apr 2018 17:22:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHMId3037534; Tue, 24 Apr 2018 17:22:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804241722.w3OHMId3037534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 17:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332944 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 332944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:22:21 -0000 Author: jhb Date: Tue Apr 24 17:22:17 2018 New Revision: 332944 URL: https://svnweb.freebsd.org/changeset/base/332944 Log: Use a cleaner test for the branch delay (BD) bit in DELAYBRANCH. Rather than casting the value of cause to int and checking for a negative value to determine if bit 31 is set, use a binary and with MIPS_CR_BR_DELAY. Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Apr 24 17:13:31 2018 (r332943) +++ head/sys/mips/mips/trap.c Tue Apr 24 17:22:17 2018 (r332944) @@ -281,7 +281,7 @@ struct trapdebug trapdebug[TRAPSIZE], *trp = trapdebug #endif #define KERNLAND(x) ((vm_offset_t)(x) >= VM_MIN_KERNEL_ADDRESS && (vm_offset_t)(x) < VM_MAX_KERNEL_ADDRESS) -#define DELAYBRANCH(x) ((int)(x) < 0) +#define DELAYBRANCH(x) ((x) & MIPS_CR_BR_DELAY) /* * MIPS load/store access type From owner-svn-src-head@freebsd.org Tue Apr 24 17:24:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 238B1FAC9FB; Tue, 24 Apr 2018 17:24:34 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B0A57DF7B; Tue, 24 Apr 2018 17:24:33 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-f43.google.com with SMTP id i3so2157158wmf.3; Tue, 24 Apr 2018 10:24:33 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sOsxpNhhMFAJcJ3lR2pV10lyaKBlZXQx+N0RpeSQ3Wc=; b=hFJ5yr0UPecRCfDunpLpKMrWjsomqI8j20CGcb/DN4PcR93Q5FRgVR9kwsAOagh+HS 1K43AZnbM0XQIMjocl1CgFEGliSSQObRt2MsY67WEWi/kwUOrFyoqZX4moSg1DOcWmCn GxoajMoV5cD3at8eeG+pkquC+3R1CkYkEhpMz8fACLWoGHXY2nCSBOfDJ/CnfkyblP3A ksILdHz/cgtxzASPXX+A8vI8GWr/vv2wGmENwauHS6YKZT5cKOiQBfHPnaj8vbOuKtxH SKkmzDJz5JHKbV2DutY5D0g2ctKDu5GGRIaDhhNXHBT8t7Rn/jkP74j8gWA1L6k5IT5E vS0g== X-Gm-Message-State: ALQs6tAPyWPl46XZ6mVJABJ2otA4MOGNyPBCtiCIkqtlcVSs/e41tKb4 YCufhh2wGU6KOIy1v+H/h7jrQK8kXrU= X-Google-Smtp-Source: AIpwx49qlLf4/QDCClIo/DpTOq54F0+hAgRKRuPqQSsq0SqNFtXI/S+8U2sQtj6r0tSd0lWVbdht0Q== X-Received: by 10.80.243.149 with SMTP id g21mr34011885edm.13.1524590672106; Tue, 24 Apr 2018 10:24:32 -0700 (PDT) Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com. [209.85.128.172]) by smtp.gmail.com with ESMTPSA id m20sm169242edq.46.2018.04.24.10.24.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 10:24:31 -0700 (PDT) Received: by mail-wr0-f172.google.com with SMTP id p18-v6so31552212wrm.1; Tue, 24 Apr 2018 10:24:31 -0700 (PDT) X-Received: by 2002:adf:8b44:: with SMTP id v4-v6mr19751462wra.99.1524590671260; Tue, 24 Apr 2018 10:24:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.199.203 with HTTP; Tue, 24 Apr 2018 10:24:30 -0700 (PDT) In-Reply-To: <1739228.8pyHcvzasL@ralph.baldwin.cx> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180423180024.GC84833@raichu> <1739228.8pyHcvzasL@ralph.baldwin.cx> From: "Jonathan T. Looney" Date: Tue, 24 Apr 2018 13:24:30 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332860 - head/sys/kern To: John Baldwin Cc: Mark Johnston , cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:24:34 -0000 On Mon, Apr 23, 2018 at 6:04 PM, John Baldwin wrote: > > I think this is actually a key question. In my experience to date I have not > encountered a large number of post-panic assertion failures. Given that > we already break all locks and disable assertions for locks I'd be curious > which assertions are actually failing. My inclination given my experiences > to date would be to explicitly ignore those as we do for locking if it is > constrained set rather than blacklisting all of them. However, I would be > most interested in seeing some examples of assertions that are failing. The latest example (the one that prompted me to finally commit this) is in lockmgr_sunlock_try(): 'panic: Assertion (*xp & ~LK_EXCLUSIVE_SPINNERS) == LK_SHARERS_LOCK(1) failed at /usr/src/sys/kern/kern_lock.c:541' I don't see any obvious recent changes that would have caused this, so this is probably a case where a change to another file suddenly made us trip over this assert. And, that really illustrates my overall point: most assertions in general-use code have limited value after a panic. We expect developers to write high-quality assertions so we can catch bugs. This requires that they understand how their code will be used. However, once we've panic'd, many assumptions behind code change and the assertions are no longer valid. (And, sometimes, it is difficult for a developer to predict how these things will change in a panic situation.) We can either play whack-a-mole to modify assertions as we trip over them in our post-panic work, or we can switch to an opt-in model where we only check assertions which the developer actually intends to run post-panic. Playing whack-a-mole seems like a Sisyphean task which will burn out developers and/or frustrate people who run INVARIANTS kernels. Switching to an opt-in model seems like the better long-term strategy. Having said all of that, I am cognizant of at least two things: 1) Mark Johnston has done a lot of work in coredumps and thinks there are post-panic assertions that have value. 2) Until we have both agreement to switch our post-panic assertion paradigm and also infrastructure to allow developers to opt in, it probably is not wise to disable all assertions by default. So, I will follow Mark's suggestions: I will change the default. I will also change the code so we print a limited number of failed assertions. However, I think that changing the post-panic assertion paradigm is an important conversation to have. We want people to run our INVARIANTS kernels. And, we want to get high-quality reports from those. I think we could better serve those goals by changing the post-panic assertion paradigm. Jonathan From owner-svn-src-head@freebsd.org Tue Apr 24 17:31:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D35FACBD0; Tue, 24 Apr 2018 17:31:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B38647E8A2; Tue, 24 Apr 2018 17:31:20 +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 AE7F116360; Tue, 24 Apr 2018 17:31:20 +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 w3OHVKNf038581; Tue, 24 Apr 2018 17:31:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHVKDF038580; Tue, 24 Apr 2018 17:31:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804241731.w3OHVKDF038580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 17:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332945 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 332945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:31:21 -0000 Author: jhb Date: Tue Apr 24 17:31:20 2018 New Revision: 332945 URL: https://svnweb.freebsd.org/changeset/base/332945 Log: Don't fetch the current instruction for faults on user "trap" instructions. The value of 'instr' was not used to handle the fault. Reported by: GCC's -Wunused-but-set-variable Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Apr 24 17:22:17 2018 (r332944) +++ head/sys/mips/mips/trap.c Tue Apr 24 17:31:20 2018 (r332945) @@ -875,15 +875,12 @@ dofault: case T_TRAP + T_USER: { intptr_t va; - uint32_t instr; struct trapframe *locr0 = td->td_frame; /* compute address of trap instruction */ va = trapframe->pc; if (DELAYBRANCH(trapframe->cause)) va += sizeof(int); - /* read break instruction */ - instr = fuword32((caddr_t)va); if (DELAYBRANCH(trapframe->cause)) { /* Check BD bit */ locr0->pc = MipsEmulateBranch(locr0, trapframe->pc, 0, From owner-svn-src-head@freebsd.org Tue Apr 24 17:39:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA9DDFAD030; Tue, 24 Apr 2018 17:39:01 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65FD87F310; Tue, 24 Apr 2018 17:39:01 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 76EEE2700351; Tue, 24 Apr 2018 13:38:55 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 76EEE2700351 Authentication-Results: duke.cs.duke.edu; dmarc=none header.from=cs.duke.edu DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1524591535; bh=AIigYlzXYmmqwvkspdwHcRTl+o7DiR8sfyXVCqzRnTU=; h=Subject:To:From:Date:From; b=DDC/JuMczayhGDq5EP8EQDTQGZHRVjW2khwE0QOCz79hoL+rd/osJvyAf5kFvLSB5 ZADqTCYz2yiOIjrzuYjkIOsUp13vDDJFjFVZ+TrbyInzsbYeheCq6LrXLrH5xoXb0d TnjQBmViLeDLyfSD5k8T/0GzFYnOXf5vn9hvkQdfc0g2AyhnqvRpbF2hP/8SXsEzfP w4nKfAIWz1VeFCSWEiilj1+bkWg+aNeFBTOuqk/8zFAYAkMcEzZZpEoNuvnfRK3gDw MMk9h4Fz3hMAm21xi635sq5ikupNRqkM2tWtXHsOIeaYd/zXjEonyuB8MCjrpDlVq0 f/tm9shO7Fzsw== Subject: Re: svn commit: r332860 - head/sys/kern To: "Jonathan T. Looney" , John Baldwin Cc: Mark Johnston , cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180423180024.GC84833@raichu> <1739228.8pyHcvzasL@ralph.baldwin.cx> From: Andrew Gallatin Message-ID: <744fa604-c33c-5f58-6443-4c485136b4fb@cs.duke.edu> Date: Tue, 24 Apr 2018 13:38:53 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:39:01 -0000 On 04/24/18 13:24, Jonathan T. Looney wrote: > On Mon, Apr 23, 2018 at 6:04 PM, John Baldwin > wrote: > > > > I think this is actually a key question.  In my experience to date I > have not > > encountered a large number of post-panic assertion failures.  Given that > > we already break all locks and disable assertions for locks I'd be > curious > > which assertions are actually failing.  My inclination given my > experiences > > to date would be to explicitly ignore those as we do for locking if it is > > constrained set rather than blacklisting all of them.  However, I > would be > > most interested in seeing some examples of assertions that are failing. > > The latest example (the one that prompted me to finally commit this) is > in lockmgr_sunlock_try(): 'panic: Assertion (*xp & > ~LK_EXCLUSIVE_SPINNERS) == LK_SHARERS_LOCK(1) failed at > /usr/src/sys/kern/kern_lock.c:541' > > I don't see any obvious recent changes that would have caused this, so > this is probably a case where a change to another file suddenly made us > trip over this assert. FWIW, that assertion has prevented me from getting a dump from an INVARIANTS kernel for at least a year. Drew From owner-svn-src-head@freebsd.org Tue Apr 24 17:40:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 519CAFAD0BF; Tue, 24 Apr 2018 17:40:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D41137F4AB; Tue, 24 Apr 2018 17:40:06 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x231.google.com with SMTP id t123-v6so23688540iof.7; Tue, 24 Apr 2018 10:40:06 -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=kz0qiVVI/RL4n1eO1doYqsiwE5Y4ja9IzI9Xdp4/Pks=; b=ZqvOwhjenhMYSlkFWw+vFxwzwZUX6TL9jQEDcTkOdPXYJlIaeSIw8Km5PmFwKySDJG m6jrc+u7kukCCV9hOmVXSMm92KJNE5EjsdhDnmqzu8y2DmMLHpA7VWb2UMF5ToKddLjm ToX0qYswh7jCB9zoUG9+mZJk6tzQKbtFBt3u64ohvNBxGqnLNgRYJ+8/Bj8WFn/i0jA0 xkQ/XuzBfaBhn5DrnK/Ik4mdG80GAF3LsEzYqdaCF6opEPkJb1plPzCq1AxK/EH4eBba z+BrMiU1KzY1q8JQfsdSMUJaLT40y3NDmdBJ56lwDUrKxK+h8vNvXvdzDXV7aVQIv1Cr xkQg== 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=kz0qiVVI/RL4n1eO1doYqsiwE5Y4ja9IzI9Xdp4/Pks=; b=mGZdjLuAzDR1TK/IGgz0TAo9UDdMZXQJIiufAgE9dORRACdcxbtYLx9ySW0I8rWWm2 VAopVg3XqPFYh29No84C4ses4ocbR0+L7n7En8yfXrk+h0ceLCRIU7eXODjzA8Cl+hDG ffwI919vxNz4344e6pePyZYjGHS5TON3AsKiRVIXt0vSEdRceG2mlYHuuwcAoShqwSCN LfWHfeSX92n8WeL+FP30gF+/5gXD88Yb3oBeuH5HXlHChJK6YJdDwsFNO2n7c4L2hbva m/o8bEzkYmg5BnUFqbAkwMe7X42mzX02tRQfE+0RN181V2MOoxdUtl2Q3LaRkDask4r1 e4Cg== X-Gm-Message-State: ALQs6tCq6+Xa78m5F3wnZkOg0xARfPC/EKTba1nYNaJa5zFBS3/0WuNG gUJJ4Dgxm/b+quBvkSWGe4ZvKw== X-Google-Smtp-Source: AB8JxZoN8gcUVtRxTMSYN9TzzUX3Nai+F6BSzA75CC+MliKYHdbNTbc5yoODfzpG2wq9IItCs11dTw== X-Received: by 2002:a6b:ae49:: with SMTP id x70-v6mr16179920ioe.148.1524591605839; Tue, 24 Apr 2018 10:40:05 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-74.dsl.bell.ca. [184.145.252.74]) by smtp.gmail.com with ESMTPSA id z88-v6sm3844811ioi.25.2018.04.24.10.40.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 10:40:05 -0700 (PDT) Sender: Mark Johnston Date: Tue, 24 Apr 2018 13:40:02 -0400 From: Mark Johnston To: "Jonathan T. Looney" Cc: John Baldwin , cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332860 - head/sys/kern Message-ID: <20180424174002.GB27358@raichu> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180423180024.GC84833@raichu> <1739228.8pyHcvzasL@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:40:07 -0000 On Tue, Apr 24, 2018 at 01:24:30PM -0400, Jonathan T. Looney wrote: > On Mon, Apr 23, 2018 at 6:04 PM, John Baldwin wrote: > > > > I think this is actually a key question. In my experience to date I have > not > > encountered a large number of post-panic assertion failures. Given that > > we already break all locks and disable assertions for locks I'd be curious > > which assertions are actually failing. My inclination given my > experiences > > to date would be to explicitly ignore those as we do for locking if it is > > constrained set rather than blacklisting all of them. However, I would be > > most interested in seeing some examples of assertions that are failing. > > The latest example (the one that prompted me to finally commit this) is in > lockmgr_sunlock_try(): 'panic: Assertion (*xp & ~LK_EXCLUSIVE_SPINNERS) == > LK_SHARERS_LOCK(1) failed at /usr/src/sys/kern/kern_lock.c:541' > > I don't see any obvious recent changes that would have caused this, so this > is probably a case where a change to another file suddenly made us trip > over this assert. > > And, that really illustrates my overall point: Mine too. :) Why is anything trying to acquire a lockmgr lock after a panic? What is the stack? I suspect that CAM is completing non-dump CCBs after a panic, which can cause deadlocks if the completion handler needs to perform a TLB shootdown after destroying a mapping, for example. In fact, I had forgotten that Isilon has some CAM patches which attempt to address this because of the problems that such deadlocks had caused. I will work on getting these reviewed and upstreamed. > most assertions in > general-use code have limited value after a panic. > > We expect developers to write high-quality assertions so we can catch bugs. > This requires that they understand how their code will be used. However, > once we've panic'd, many assumptions behind code change and the assertions > are no longer valid. (And, sometimes, it is difficult for a developer to > predict how these things will change in a panic situation.) We can either > play whack-a-mole to modify assertions as we trip over them in our > post-panic work, or we can switch to an opt-in model where we only check > assertions which the developer actually intends to run post-panic. > > Playing whack-a-mole seems like a Sisyphean task which will burn out > developers and/or frustrate people who run INVARIANTS kernels. Switching to > an opt-in model seems like the better long-term strategy. > > Having said all of that, I am cognizant of at least two things: > 1) Mark Johnston has done a lot of work in coredumps and thinks there are > post-panic assertions that have value. > 2) Until we have both agreement to switch our post-panic assertion paradigm > and also infrastructure to allow developers to opt in, it probably is not > wise to disable all assertions by default. > > So, I will follow Mark's suggestions: I will change the default. I will > also change the code so we print a limited number of failed assertions. Thanks. > However, I think that changing the post-panic assertion paradigm is an > important conversation to have. We want people to run our INVARIANTS > kernels. And, we want to get high-quality reports from those. I think we > could better serve those goals by changing the post-panic assertion > paradigm. > > Jonathan From owner-svn-src-head@freebsd.org Tue Apr 24 17:42:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F9D1FAD2B5; Tue, 24 Apr 2018 17:42: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E31F0808EE; Tue, 24 Apr 2018 17:42:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDE581657B; Tue, 24 Apr 2018 17:42:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OHgPhs046529; Tue, 24 Apr 2018 17:42:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHgPtD046528; Tue, 24 Apr 2018 17:42:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804241742.w3OHgPtD046528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 24 Apr 2018 17:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332949 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:42:26 -0000 Author: markj Date: Tue Apr 24 17:42:25 2018 New Revision: 332949 URL: https://svnweb.freebsd.org/changeset/base/332949 Log: Use dead_bpf_if instead of bp_null. This fixes a -Wunused error when DEV_BPF and NETGRAPH_BPF are not defined. Also remove a stray semicolon added in r332812. X-MFC with: r332812 Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Apr 24 17:37:29 2018 (r332948) +++ head/sys/net/bpf.c Tue Apr 24 17:42:25 2018 (r332949) @@ -2663,7 +2663,7 @@ bpfdetach(struct ifnet *ifp) */ BPFIF_WLOCK(bp); bp->bif_flags |= BPFIF_FLAG_DYING; - *bp->bif_bpf = (struct bpf_if *)&dead_bpf_if;; + *bp->bif_bpf = (struct bpf_if *)&dead_bpf_if; BPFIF_WUNLOCK(bp); CTR4(KTR_NET, "%s: sheduling free for encap %d (%p) for if %p", @@ -2982,13 +2982,13 @@ bpf_stats_sysctl(SYSCTL_HANDLER_ARGS) SYSINIT(bpfdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,bpf_drvinit,NULL); #else /* !DEV_BPF && !NETGRAPH_BPF */ + /* * NOP stubs to allow bpf-using drivers to load and function. * * A 'better' implementation would allow the core bpf functionality * to be loaded at runtime. */ -static struct bpf_if bp_null; void bpf_tap(struct bpf_if *bp, u_char *pkt, u_int pktlen) @@ -3016,7 +3016,7 @@ void bpfattach2(struct ifnet *ifp, u_int dlt, u_int hdrlen, struct bpf_if **driverp) { - *driverp = &bp_null; + *driverp = (struct bpf_if *)&dead_bpf_if; } void From owner-svn-src-head@freebsd.org Tue Apr 24 17:46:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2A61FAD520; Tue, 24 Apr 2018 17:46:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CAA882358; Tue, 24 Apr 2018 17:46:34 +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 8545E1659C; Tue, 24 Apr 2018 17:46:34 +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 w3OHkYi8047849; Tue, 24 Apr 2018 17:46:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHkXr2047838; Tue, 24 Apr 2018 17:46:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804241746.w3OHkXr2047838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 24 Apr 2018 17:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332950 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 332950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:46:35 -0000 Author: trasz Date: Tue Apr 24 17:46:33 2018 New Revision: 332950 URL: https://svnweb.freebsd.org/changeset/base/332950 Log: Use more common format for sysctls/tunables descriptions in USB man pages. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/ehci.4 head/share/man/man4/ohci.4 head/share/man/man4/ucom.4 head/share/man/man4/ugen.4 head/share/man/man4/uhci.4 head/share/man/man4/uhid.4 head/share/man/man4/ukbd.4 head/share/man/man4/ums.4 head/share/man/man4/uplcom.4 head/share/man/man4/usb.4 head/share/man/man4/xhci.4 Modified: head/share/man/man4/ehci.4 ============================================================================== --- head/share/man/man4/ehci.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/ehci.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt EHCI 4 .Os .Sh NAME @@ -88,16 +88,14 @@ The default value is 0 (off). .It Va hw.usb.ehci.no_hs This tunable disables USB devices to attach like HIGH-speed ones and will force all attached devices to attach to the FULL- or LOW-speed companion controller. The default value is 0 (off). -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.ehci -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.ehci.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/ohci.4 ============================================================================== --- head/share/man/man4/ohci.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/ohci.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt OHCI 4 .Os .Sh NAME @@ -59,16 +59,14 @@ NVIDIA nForce3 .It Sun PCIO-2 (RIO USB) .El -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.ohci -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.ohci.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/ucom.4 ============================================================================== --- head/share/man/man4/ucom.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/ucom.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt UCOM 4 .Os .Sh NAME @@ -63,20 +63,18 @@ This means that normal programs such as or .Xr ppp 8 can be used to access the device. -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.ucom -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va pps_mode" -.It Va debug +.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.ucom.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. -.It Va pps_mode +.It Va hw.usb.ucom.pps_mode Enables and configure PPS capture mode as described below. .Sh Pulse Per Second (PPS) Timing Interface The Modified: head/share/man/man4/ugen.4 ============================================================================== --- head/share/man/man4/ugen.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/ugen.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt UGEN 4 .Os .Sh NAME @@ -291,16 +291,14 @@ and .Va alt_index should be set to .Dv USB_CURRENT_ALT_INDEX . -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.ugen -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.ugen.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/uhci.4 ============================================================================== --- head/share/man/man4/uhci.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/uhci.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt UHCI 4 .Os .Sh NAME @@ -49,16 +49,14 @@ Intel 82371SB (PIIX3) .It VIA 83C572 .El -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.uhci -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.uhci.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/uhid.4 ============================================================================== --- head/share/man/man4/uhid.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/uhid.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt UHID 4 .Os .Sh NAME @@ -127,16 +127,14 @@ Use to send data to the device. Data should be written in chunks of the size prescribed by the report descriptor. -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.uhid -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.uhid.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/ukbd.4 ============================================================================== --- head/share/man/man4/ukbd.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/ukbd.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt UKBD 4 .Os .Sh NAME @@ -136,16 +136,14 @@ or Do not allow the user to change the keymap. Note that these options also affect the AT keyboard driver, .Xr atkbd 4 . -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.ukbd -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.ukbd.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/ums.4 ============================================================================== --- head/share/man/man4/ums.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/ums.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt UMS 4 .Os .Sh NAME @@ -64,16 +64,14 @@ type device. See .Xr moused 8 for an explanation of these mouse types. -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.ums -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.ums.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/uplcom.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt UPLCOM 4 .Os .Sh NAME @@ -180,16 +180,14 @@ YC-Cable USB-Serial Adapter .It Zeagle N2iTion3 Diving Computer .El -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.uplcom -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.uplcom.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/usb.4 ============================================================================== --- head/share/man/man4/usb.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/usb.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt USB 4 .Os .Sh NAME @@ -131,16 +131,14 @@ Any interface specific driver can attach to the device .It If none is found, generic interface class drivers can attach. .El -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. Modified: head/share/man/man4/xhci.4 ============================================================================== --- head/share/man/man4/xhci.4 Tue Apr 24 17:42:25 2018 (r332949) +++ head/share/man/man4/xhci.4 Tue Apr 24 17:46:33 2018 (r332950) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2017 +.Dd April 24, 2018 .Dt XHCI 4 .Os .Sh NAME @@ -56,16 +56,14 @@ driver supports .Tn XHCI compatible controllers having PCI class 12 (serial bus), subclass 3 (USB) and programming interface 48 (XHCI). -.Sh MIB Variables -The -.Nm -driver exposes the following variables in the -.Va hw.usb.xhci -branch of the -.Xr sysctl 3 -MIB: -.Bl -tag -width ".Va debug" -.It Va debug +.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.xhci.debug Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. From owner-svn-src-head@freebsd.org Tue Apr 24 17:53:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90005FAD899; Tue, 24 Apr 2018 17:53: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37180840F1; Tue, 24 Apr 2018 17:53: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 31A571672A; Tue, 24 Apr 2018 17:53: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 w3OHrHv8052859; Tue, 24 Apr 2018 17:53:17 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHrGri052856; Tue, 24 Apr 2018 17:53:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804241753.w3OHrGri052856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 17:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332951 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 332951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:53:17 -0000 Author: jhb Date: Tue Apr 24 17:53:16 2018 New Revision: 332951 URL: https://svnweb.freebsd.org/changeset/base/332951 Log: Fix PT_STEP single-stepping for mips. Note that GDB at least implements single stepping for MIPS using software breakpoints explicitly rather than using PT_STEP, so this has only been tested via tests in ptrace_test which now pass rather than fail. - Fix several places to use uintptr_t instead of int for virtual addresses. - Check for errors from ptrace_read_int() when setting a breakpoint for a step. - Properly check for errors from ptrace_write_int() as it returns non-zero, not negative values on failure. - Change the error returns for ptrace_read_int() and ptrace_write_int() from ENOMEM to EFAULT. - Clear a single step breakpoint when it traps rather than waiting for it to be cleared from ptrace(). This matches the behavior of the arm port and in general seems a bit more reliable than waiting for ptrace() to clear it via FIX_SSTEP. - Drop the PROC_LOCK around ptrace_write_int() in ptrace_clear_single_step() since it can sleep. - Reorder the breakpoint handler in trap() to only read the instruction if the address matches the current thread's breakpoint address. - Replace various #if 0'd debugging printfs with KTR_PTRACE traces. Tested on: mips64 Modified: head/sys/mips/include/proc.h head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/trap.c Modified: head/sys/mips/include/proc.h ============================================================================== --- head/sys/mips/include/proc.h Tue Apr 24 17:46:33 2018 (r332950) +++ head/sys/mips/include/proc.h Tue Apr 24 17:53:16 2018 (r332951) @@ -55,7 +55,7 @@ struct mdthread { #else int md_upte[KSTACK_PAGES]; #endif - int md_ss_addr; /* single step address for ptrace */ + uintptr_t md_ss_addr; /* single step address for ptrace */ int md_ss_instr; /* single step instruction for ptrace */ register_t md_saved_intr; u_int md_spinlock_count; Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Tue Apr 24 17:46:33 2018 (r332950) +++ head/sys/mips/mips/pm_machdep.c Tue Apr 24 17:53:16 2018 (r332951) @@ -216,29 +216,29 @@ ptrace_set_pc(struct thread *td, unsigned long addr) } static int -ptrace_read_int(struct thread *td, off_t addr, int *v) +ptrace_read_int(struct thread *td, uintptr_t addr, int *v) { if (proc_readmem(td, td->td_proc, addr, v, sizeof(*v)) != sizeof(*v)) - return (ENOMEM); + return (EFAULT); return (0); } static int -ptrace_write_int(struct thread *td, off_t addr, int v) +ptrace_write_int(struct thread *td, uintptr_t addr, int v) { if (proc_writemem(td, td->td_proc, addr, &v, sizeof(v)) != sizeof(v)) - return (ENOMEM); + return (EFAULT); return (0); } int ptrace_single_step(struct thread *td) { - unsigned va; + uintptr_t va; struct trapframe *locr0 = td->td_frame; - int i; + int error; int bpinstr = MIPS_BREAK_SSTEP; int curinstr; struct proc *p; @@ -248,46 +248,52 @@ ptrace_single_step(struct thread *td) /* * Fetch what's at the current location. */ - ptrace_read_int(td, (off_t)locr0->pc, &curinstr); + error = ptrace_read_int(td, locr0->pc, &curinstr); + if (error) + goto out; + CTR3(KTR_PTRACE, + "ptrace_single_step: tid %d, current instr at %#lx: %#08x", + td->td_tid, locr0->pc, curinstr); + /* compute next address after current location */ - if(curinstr != 0) { + if (locr0->cause & MIPS_CR_BR_DELAY) { va = MipsEmulateBranch(locr0, locr0->pc, locr0->fsr, (uintptr_t)&curinstr); } else { va = locr0->pc + 4; } if (td->td_md.md_ss_addr) { - printf("SS %s (%d): breakpoint already set at %x (va %x)\n", + printf("SS %s (%d): breakpoint already set at %lx (va %lx)\n", p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ - PROC_LOCK(p); - return (EFAULT); + error = EFAULT; + goto out; } td->td_md.md_ss_addr = va; /* * Fetch what's at the current location. */ - ptrace_read_int(td, (off_t)va, &td->td_md.md_ss_instr); + error = ptrace_read_int(td, (off_t)va, &td->td_md.md_ss_instr); + if (error) + goto out; /* * Store breakpoint instruction at the "next" location now. */ - i = ptrace_write_int (td, va, bpinstr); + error = ptrace_write_int(td, va, bpinstr); /* - * The sync'ing of I & D caches is done by procfs_domem() - * through procfs_rwmem(). + * The sync'ing of I & D caches is done by proc_rwmem() + * through proc_writemem(). */ +out: PROC_LOCK(p); - if (i < 0) - return (EFAULT); -#if 0 - printf("SS %s (%d): breakpoint set at %x: %x (pc %x) br %x\n", - p->p_comm, p->p_pid, p->p_md.md_ss_addr, - p->p_md.md_ss_instr, locr0->pc, curinstr); /* XXX */ -#endif - return (0); + if (error == 0) + CTR3(KTR_PTRACE, + "ptrace_single_step: tid %d, break set at %#lx: (%#08x)", + td->td_tid, va, td->td_md.md_ss_instr); + return (error); } @@ -471,8 +477,8 @@ exec_setregs(struct thread *td, struct image_params *i int ptrace_clear_single_step(struct thread *td) { - int i; struct proc *p; + int error; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -482,12 +488,19 @@ ptrace_clear_single_step(struct thread *td) /* * Restore original instruction and clear BP */ - i = ptrace_write_int (td, td->td_md.md_ss_addr, td->td_md.md_ss_instr); + PROC_UNLOCK(p); + CTR3(KTR_PTRACE, + "ptrace_clear_single_step: tid %d, restore instr at %#lx: %#08x", + td->td_tid, td->td_md.md_ss_addr, td->td_md.md_ss_instr); + error = ptrace_write_int(td, td->td_md.md_ss_addr, + td->td_md.md_ss_instr); + PROC_LOCK(p); - /* The sync'ing of I & D caches is done by procfs_domem(). */ + /* The sync'ing of I & D caches is done by proc_rwmem(). */ - if (i < 0) { - log(LOG_ERR, "SS %s %d: can't restore instruction at %x: %x\n", + if (error != 0) { + log(LOG_ERR, + "SS %s %d: can't restore instruction at %lx: %x\n", p->p_comm, p->p_pid, td->td_md.md_ss_addr, td->td_md.md_ss_instr); } Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Apr 24 17:46:33 2018 (r332950) +++ head/sys/mips/mips/trap.c Tue Apr 24 17:53:16 2018 (r332951) @@ -526,7 +526,7 @@ trap(struct trapframe *trapframe) char *msg = NULL; intptr_t addr = 0; register_t pc; - int cop; + int cop, error; register_t *frame_regs; trapdebug_enter(trapframe, 0); @@ -825,34 +825,34 @@ dofault: intptr_t va; uint32_t instr; + i = SIGTRAP; + ucode = TRAP_BRKPT; + addr = trapframe->pc; + /* compute address of break instruction */ va = trapframe->pc; if (DELAYBRANCH(trapframe->cause)) va += sizeof(int); + if (td->td_md.md_ss_addr != va) + break; + /* read break instruction */ instr = fuword32((caddr_t)va); -#if 0 - printf("trap: %s (%d) breakpoint %x at %x: (adr %x ins %x)\n", - p->p_comm, p->p_pid, instr, trapframe->pc, - p->p_md.md_ss_addr, p->p_md.md_ss_instr); /* XXX */ -#endif - if (td->td_md.md_ss_addr != va || - instr != MIPS_BREAK_SSTEP) { - i = SIGTRAP; - ucode = TRAP_BRKPT; - addr = trapframe->pc; + + if (instr != MIPS_BREAK_SSTEP) break; - } - /* - * The restoration of the original instruction and - * the clearing of the breakpoint will be done later - * by the call to ptrace_clear_single_step() in - * issignal() when SIGTRAP is processed. - */ - addr = trapframe->pc; - i = SIGTRAP; - ucode = TRAP_TRACE; + + CTR3(KTR_PTRACE, + "trap: tid %d, single step at %#lx: %#08x", + td->td_tid, va, instr); + PROC_LOCK(p); + _PHOLD(p); + error = ptrace_clear_single_step(td); + _PRELE(p); + PROC_UNLOCK(p); + if (error == 0) + ucode = TRAP_TRACE; break; } From owner-svn-src-head@freebsd.org Tue Apr 24 18:15:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB26EFAE6EC; Tue, 24 Apr 2018 18:15:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54F0168FF3; Tue, 24 Apr 2018 18:15:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id E59E110B45D; Tue, 24 Apr 2018 14:15:35 -0400 (EDT) From: John Baldwin To: "Jonathan T. Looney" Cc: Mark Johnston , cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332860 - head/sys/kern Date: Tue, 24 Apr 2018 10:45:54 -0700 Message-ID: <1701991.xdIdhqUnOe@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <1739228.8pyHcvzasL@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 24 Apr 2018 14:15:36 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:15:37 -0000 On Tuesday, April 24, 2018 01:24:30 PM Jonathan T. Looney wrote: > On Mon, Apr 23, 2018 at 6:04 PM, John Baldwin wrote: > > > > I think this is actually a key question. In my experience to date I have > not > > encountered a large number of post-panic assertion failures. Given that > > we already break all locks and disable assertions for locks I'd be curious > > which assertions are actually failing. My inclination given my > experiences > > to date would be to explicitly ignore those as we do for locking if it is > > constrained set rather than blacklisting all of them. However, I would be > > most interested in seeing some examples of assertions that are failing. > > The latest example (the one that prompted me to finally commit this) is in > lockmgr_sunlock_try(): 'panic: Assertion (*xp & ~LK_EXCLUSIVE_SPINNERS) == > LK_SHARERS_LOCK(1) failed at /usr/src/sys/kern/kern_lock.c:541' So that's one of the few assertions in a locking primitive that hasn't been explicitly neutered. I would neuter it explicitly by adjusting that assertion to not fail if panicstr != NULL. lockmgr() itself is mostly neutered already, though I would move the existing panicstr check in _lockmgr_args slightly higher above the list of KASSERT()'s. I would say this is just a bug in lockmgr in that it isn't careful to break locks and ignore assertions during a panic. I consider locking assertions to be a class that should be neutered, but I think it's a different argument to expand that to ignoring all assertions. Do you have any examples of non-locking assertions? > I don't see any obvious recent changes that would have caused this, so this > is probably a case where a change to another file suddenly made us trip > over this assert. It's arguably a bug in r313683 which is only a year old. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Apr 24 18:28:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDBA2FAEE91; Tue, 24 Apr 2018 18:28:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83EA46D2B8; Tue, 24 Apr 2018 18:28:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f179.google.com with SMTP id d26-v6so23858667ioc.2; Tue, 24 Apr 2018 11:28:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=FCqNQQp3avmniwZtJRI+1VOj2A2tQJ70Vv3PIl4IriI=; b=RV92pxD3LeFXudpiswXk4nGepKr1I7lV0r8lb+TjfP0+qdbjeC+5SaWXuOsWSiQV/t 96EEJ5WJEyjKUa6Pu49Lfj6Zau3/HMMLJLJCuhUUqiUwUPvnmwwQk7OUR/haXXWPAX7A zNji/ofp2bZyKF8nkhXhHmzur9CiRHsPxthNiG1ndGw5V7+1qivamnClQNfXyEQoGuXz LiGURnVTpUssi/2Pat3StJMgwkifG21FaMPdmu24BD9BSA8dvc6Ko15x01oYWOmv6zyU sXihZBUJiRvraSd46jYDMDfPGxd287smbmbpXp7Toepr1xoJ4AI4m3qwtuAKIZHMXL/o tZtg== X-Gm-Message-State: ALQs6tA7mI+tjHhN5NUcr9rKR0QHuDIpy0P2ipcf6S5RkgHkVDlUIhst nTeGLNF88ObdII9MxQsgD1LJ18c1 X-Google-Smtp-Source: AIpwx4+GcJtXo2GTfw9b9o28n0GB+dli1xRKmVUDLnWbwr2e4qgWlZt18mRbv7eInu4zm5PimJg6UA== X-Received: by 2002:a6b:6f0a:: with SMTP id k10-v6mr6117078ioc.93.1524594494578; Tue, 24 Apr 2018 11:28:14 -0700 (PDT) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com. [209.85.223.178]) by smtp.gmail.com with ESMTPSA id t65-v6sm7172152iof.88.2018.04.24.11.28.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 11:28:14 -0700 (PDT) Received: by mail-io0-f178.google.com with SMTP id f3-v6so23830520iob.13; Tue, 24 Apr 2018 11:28:14 -0700 (PDT) X-Received: by 2002:a6b:3f05:: with SMTP id m5-v6mr26638281ioa.220.1524594494121; Tue, 24 Apr 2018 11:28:14 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:224d:0:0:0:0:0 with HTTP; Tue, 24 Apr 2018 11:28:13 -0700 (PDT) In-Reply-To: <744fa604-c33c-5f58-6443-4c485136b4fb@cs.duke.edu> References: <201804211705.w3LH50Dk056339@repo.freebsd.org> <20180423180024.GC84833@raichu> <1739228.8pyHcvzasL@ralph.baldwin.cx> <744fa604-c33c-5f58-6443-4c485136b4fb@cs.duke.edu> From: Conrad Meyer Date: Tue, 24 Apr 2018 11:28:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332860 - head/sys/kern To: Andrew Gallatin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:28:22 -0000 Next time you encounter something like this, please file a bug. There's no reason to have broken kernel dumps for a year. It took 10 minutes to diagnose. On Tue, Apr 24, 2018 at 10:38 AM, Andrew Gallatin wrote: > On 04/24/18 13:24, Jonathan T. Looney wrote: >> >> On Mon, Apr 23, 2018 at 6:04 PM, John Baldwin > > wrote: >> > >> > I think this is actually a key question. In my experience to date I >> have not >> > encountered a large number of post-panic assertion failures. Given >> that >> > we already break all locks and disable assertions for locks I'd be >> curious >> > which assertions are actually failing. My inclination given my >> experiences >> > to date would be to explicitly ignore those as we do for locking if it >> is >> > constrained set rather than blacklisting all of them. However, I would >> be >> > most interested in seeing some examples of assertions that are failing. >> >> The latest example (the one that prompted me to finally commit this) is in >> lockmgr_sunlock_try(): 'panic: Assertion (*xp & ~LK_EXCLUSIVE_SPINNERS) == >> LK_SHARERS_LOCK(1) failed at /usr/src/sys/kern/kern_lock.c:541' >> >> I don't see any obvious recent changes that would have caused this, so >> this is probably a case where a change to another file suddenly made us trip >> over this assert. > > > FWIW, that assertion has prevented me from getting a dump from an > INVARIANTS kernel for at least a year. > > Drew From owner-svn-src-head@freebsd.org Tue Apr 24 18:41:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 065D5FAF2F4; Tue, 24 Apr 2018 18:41: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0346700C6; Tue, 24 Apr 2018 18:41:14 +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 AB34E16DDC; Tue, 24 Apr 2018 18:41:14 +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 w3OIfEbB074132; Tue, 24 Apr 2018 18:41:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIfE0U074131; Tue, 24 Apr 2018 18:41:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804241841.w3OIfE0U074131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 24 Apr 2018 18:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332957 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:41:15 -0000 Author: cem Date: Tue Apr 24 18:41:14 2018 New Revision: 332957 URL: https://svnweb.freebsd.org/changeset/base/332957 Log: lockmgr: Add missed neutering during panic r313683 introduced new lockmgr APIs that missed the panic-time neutering present in the rest of our locks. Correct that by adding the usual check. Additionally, move the __lockmgr_args neutering above the assertions at the top of the function. Drop the interlock unlock because we shouldn't have an unneutered interlock either. No point trying to unlock it. PR: 227749 Reported by: jtl Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Apr 24 18:19:30 2018 (r332956) +++ head/sys/kern/kern_lock.c Tue Apr 24 18:41:14 2018 (r332957) @@ -918,6 +918,9 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, s u_int op; bool locked; + if (__predict_false(panicstr != NULL)) + return (0); + op = flags & LK_TYPE_MASK; locked = false; switch (op) { @@ -1100,6 +1103,9 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, const char *file; int line; + if (__predict_false(panicstr != NULL)) + return (0); + file = __FILE__; line = __LINE__; @@ -1146,6 +1152,9 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo int contested = 0; #endif + if (panicstr != NULL) + return (0); + error = 0; tid = (uintptr_t)curthread; op = (flags & LK_TYPE_MASK); @@ -1172,11 +1181,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo lk->lock_object.lo_name, file, line)); class = (flags & LK_INTERLOCK) ? LOCK_CLASS(ilk) : NULL; - if (panicstr != NULL) { - if (flags & LK_INTERLOCK) - class->lc_unlock(ilk); - return (0); - } if (lk->lock_object.lo_flags & LK_NOSHARE) { switch (op) { From owner-svn-src-head@freebsd.org Tue Apr 24 18:47:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C6B1FAF5D3; Tue, 24 Apr 2018 18:47:36 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B27CA7160B; Tue, 24 Apr 2018 18:47:35 +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 AC0B716F2F; Tue, 24 Apr 2018 18:47:35 +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 w3OIlZsD078177; Tue, 24 Apr 2018 18:47:35 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIlZ1M078176; Tue, 24 Apr 2018 18:47:35 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804241847.w3OIlZ1M078176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 24 Apr 2018 18:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332958 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:47:36 -0000 Author: jtl Date: Tue Apr 24 18:47:35 2018 New Revision: 332958 URL: https://svnweb.freebsd.org/changeset/base/332958 Log: Update r332860 by changing the default from suppressing post-panic assertions to not suppressing post-panic assertions. There are some post-panic assertions that are valuable and we shouldn't default to disabling them. However, when a user trips over them, the user can still adjust the tunable/sysctl to suppress them temporarily to get conduct troubleshooting (e.g. get a core dump). Reported by: cem, markj Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Apr 24 18:41:14 2018 (r332957) +++ head/sys/kern/kern_shutdown.c Tue Apr 24 18:47:35 2018 (r332958) @@ -642,7 +642,7 @@ static int kassert_do_log = 1; static int kassert_log_pps_limit = 4; static int kassert_log_mute_at = 0; static int kassert_log_panic_at = 0; -static int kassert_suppress_in_panic = 1; +static int kassert_suppress_in_panic = 0; static int kassert_warnings = 0; SYSCTL_NODE(_debug, OID_AUTO, kassert, CTLFLAG_RW, NULL, "kassert options"); From owner-svn-src-head@freebsd.org Tue Apr 24 18:54:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66FADFAF977; Tue, 24 Apr 2018 18:54:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1791B7324F; Tue, 24 Apr 2018 18:54:21 +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 126C0170D7; Tue, 24 Apr 2018 18:54:21 +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 w3OIsKlk083233; Tue, 24 Apr 2018 18:54:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIsKuQ083232; Tue, 24 Apr 2018 18:54:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804241854.w3OIsKuQ083232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 24 Apr 2018 18:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332959 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:54:21 -0000 Author: cem Date: Tue Apr 24 18:54:20 2018 New Revision: 332959 URL: https://svnweb.freebsd.org/changeset/base/332959 Log: panic: Optionally, trace secondary panics To diagnose and fix secondary panics, it is useful to have a stack trace. When panic tracing is enabled, optionally trace secondary panics as well. The option is configured with the tunable/sysctl debug.trace_all_panics. (The original concern that inspired only tracing the primary panic was likely that the secondary trace may scroll the original panic message or trace off the screen. This is less of a concern for serial consoles with logging. Not everything has a serial console, though, so the behavior is optional.) Discussed with: jhb Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Apr 24 18:47:35 2018 (r332958) +++ head/sys/kern/kern_shutdown.c Tue Apr 24 18:54:20 2018 (r332959) @@ -124,12 +124,16 @@ SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, #ifdef KDB_TRACE static int trace_on_panic = 1; +static bool trace_all_panics = true; #else static int trace_on_panic = 0; +static bool trace_all_panics = false; #endif SYSCTL_INT(_debug, OID_AUTO, trace_on_panic, CTLFLAG_RWTUN | CTLFLAG_SECURE, &trace_on_panic, 0, "Print stack trace on kernel panic"); +SYSCTL_BOOL(_debug, OID_AUTO, trace_all_panics, CTLFLAG_RWTUN, + &trace_all_panics, 0, "Print stack traces on secondary kernel panics"); #endif /* KDB */ static int sync_on_panic = 0; @@ -829,7 +833,7 @@ vpanic(const char *fmt, va_list ap) #endif printf("time = %jd\n", (intmax_t )time_second); #ifdef KDB - if (newpanic && trace_on_panic) + if ((newpanic || trace_all_panics) && trace_on_panic) kdb_backtrace(); if (debugger_on_panic) kdb_enter(KDB_WHY_PANIC, "panic"); From owner-svn-src-head@freebsd.org Tue Apr 24 18:59:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40067FAFB60; Tue, 24 Apr 2018 18:59:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E836B734DC; Tue, 24 Apr 2018 18:59:40 +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 E2B1C170F1; Tue, 24 Apr 2018 18:59:40 +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 w3OIxe8e083464; Tue, 24 Apr 2018 18:59:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIxetg083463; Tue, 24 Apr 2018 18:59:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804241859.w3OIxetg083463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 24 Apr 2018 18:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332960 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:59:41 -0000 Author: cem Date: Tue Apr 24 18:59:40 2018 New Revision: 332960 URL: https://svnweb.freebsd.org/changeset/base/332960 Log: Fix debug.kassert.do_log description text This has been an (incorrect) copy-paste duplicate of debug.kassert.warn_only since it was originally committed in r243980. Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Apr 24 18:54:20 2018 (r332959) +++ head/sys/kern/kern_shutdown.c Tue Apr 24 18:59:40 2018 (r332960) @@ -667,7 +667,8 @@ SYSCTL_UINT(_debug_kassert, OID_AUTO, do_ktr, CTLFLAG_ #endif SYSCTL_INT(_debug_kassert, OID_AUTO, do_log, CTLFLAG_RWTUN, - &kassert_do_log, 0, "KASSERT triggers a panic (1) or just a warning (0)"); + &kassert_do_log, 0, + "If warn_only is enabled, log (1) or do not log (0) assertion violations"); SYSCTL_INT(_debug_kassert, OID_AUTO, warnings, CTLFLAG_RWTUN, &kassert_warnings, 0, "number of KASSERTs that have been triggered"); From owner-svn-src-head@freebsd.org Tue Apr 24 19:09:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBAFBFAFFFA; Tue, 24 Apr 2018 19:09: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8683476216; Tue, 24 Apr 2018 19:09: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 7D5A11728B; Tue, 24 Apr 2018 19:09: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 w3OJ9rqY088431; Tue, 24 Apr 2018 19:09:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OJ9ra9088430; Tue, 24 Apr 2018 19:09:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804241909.w3OJ9ra9088430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 24 Apr 2018 19:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332961 - head/sys/dev/usb/serial X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/usb/serial X-SVN-Commit-Revision: 332961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:09:54 -0000 Author: manu Date: Tue Apr 24 19:09:53 2018 New Revision: 332961 URL: https://svnweb.freebsd.org/changeset/base/332961 Log: uslcom: Apply style(9) and be consistant with function names MFC after: 1 week Modified: head/sys/dev/usb/serial/uslcom.c Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Tue Apr 24 18:59:40 2018 (r332960) +++ head/sys/dev/usb/serial/uslcom.c Tue Apr 24 19:09:53 2018 (r332961) @@ -64,7 +64,7 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, debug, CTLFLAG_RW &uslcom_debug, 0, "Debug level"); #endif -#define USLCOM_BULK_BUF_SIZE 1024 +#define USLCOM_BULK_BUF_SIZE 1024 #define USLCOM_CONFIG_INDEX 0 /* Request types */ @@ -73,13 +73,13 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, debug, CTLFLAG_RW /* Request codes */ #define USLCOM_IFC_ENABLE 0x00 -#define USLCOM_SET_BAUDDIV 0x01 +#define USLCOM_SET_BAUDDIV 0x01 #define USLCOM_SET_LINE_CTL 0x03 #define USLCOM_SET_BREAK 0x05 #define USLCOM_SET_MHS 0x07 #define USLCOM_GET_MDMSTS 0x08 #define USLCOM_SET_FLOW 0x13 -#define USLCOM_SET_BAUDRATE 0x1e +#define USLCOM_SET_BAUDRATE 0x1e #define USLCOM_VENDOR_SPECIFIC 0xff /* USLCOM_IFC_ENABLE values */ @@ -87,7 +87,7 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, debug, CTLFLAG_RW #define USLCOM_IFC_ENABLE_EN 0x01 /* USLCOM_SET_MHS/USLCOM_GET_MDMSTS values */ -#define USLCOM_MHS_DTR_ON 0x0001 +#define USLCOM_MHS_DTR_ON 0x0001 #define USLCOM_MHS_DTR_SET 0x0100 #define USLCOM_MHS_RTS_ON 0x0002 #define USLCOM_MHS_RTS_SET 0x0200 @@ -112,11 +112,11 @@ SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, debug, CTLFLAG_RW #define USLCOM_SET_BREAK_ON 0x01 /* USLCOM_SET_FLOW values - 1st word */ -#define USLCOM_FLOW_DTR_ON 0x00000001 /* DTR static active */ -#define USLCOM_FLOW_CTS_HS 0x00000008 /* CTS handshake */ +#define USLCOM_FLOW_DTR_ON 0x00000001 /* DTR static active */ +#define USLCOM_FLOW_CTS_HS 0x00000008 /* CTS handshake */ /* USLCOM_SET_FLOW values - 2nd word */ -#define USLCOM_FLOW_RTS_ON 0x00000040 /* RTS static active */ -#define USLCOM_FLOW_RTS_HS 0x00000080 /* RTS handshake */ +#define USLCOM_FLOW_RTS_ON 0x00000040 /* RTS static active */ +#define USLCOM_FLOW_RTS_HS 0x00000080 /* RTS handshake */ /* USLCOM_VENDOR_SPECIFIC values */ #define USLCOM_GET_PARTNUM 0x370B @@ -146,10 +146,10 @@ struct uslcom_softc { struct usb_device *sc_udev; struct mtx sc_mtx; - uint8_t sc_msr; - uint8_t sc_lsr; - uint8_t sc_iface_no; - uint8_t sc_partnum; + uint8_t sc_msr; + uint8_t sc_lsr; + uint8_t sc_iface_no; + uint8_t sc_partnum; }; static device_probe_t uslcom_probe; @@ -161,18 +161,18 @@ static usb_callback_t uslcom_write_callback; static usb_callback_t uslcom_read_callback; static usb_callback_t uslcom_control_callback; -static void uslcom_free(struct ucom_softc *); -static void uslcom_open(struct ucom_softc *); -static void uslcom_close(struct ucom_softc *); +static void uslcom_free(struct ucom_softc *); static uint8_t uslcom_get_partnum(struct uslcom_softc *); -static void uslcom_set_dtr(struct ucom_softc *, uint8_t); -static void uslcom_set_rts(struct ucom_softc *, uint8_t); -static void uslcom_set_break(struct ucom_softc *, uint8_t); +static void uslcom_cfg_open(struct ucom_softc *); +static void uslcom_cfg_close(struct ucom_softc *); +static void uslcom_cfg_set_dtr(struct ucom_softc *, uint8_t); +static void uslcom_cfg_set_rts(struct ucom_softc *, uint8_t); +static void uslcom_cfg_set_break(struct ucom_softc *, uint8_t); +static void uslcom_cfg_param(struct ucom_softc *, struct termios *); +static void uslcom_cfg_get_status(struct ucom_softc *, uint8_t *, uint8_t *); static int uslcom_ioctl(struct ucom_softc *, uint32_t, caddr_t, int, - struct thread *); + struct thread *); static int uslcom_pre_param(struct ucom_softc *, struct termios *); -static void uslcom_param(struct ucom_softc *, struct termios *); -static void uslcom_get_status(struct ucom_softc *, uint8_t *, uint8_t *); static void uslcom_start_read(struct ucom_softc *); static void uslcom_stop_read(struct ucom_softc *); static void uslcom_start_write(struct ucom_softc *); @@ -180,7 +180,6 @@ static void uslcom_stop_write(struct ucom_softc *); static void uslcom_poll(struct ucom_softc *ucom); static const struct usb_config uslcom_config[USLCOM_N_TRANSFER] = { - [USLCOM_BULK_DT_WR] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, @@ -210,15 +209,15 @@ static const struct usb_config uslcom_config[USLCOM_N_ }; static struct ucom_callback uslcom_callback = { - .ucom_cfg_open = &uslcom_open, - .ucom_cfg_close = &uslcom_close, - .ucom_cfg_get_status = &uslcom_get_status, - .ucom_cfg_set_dtr = &uslcom_set_dtr, - .ucom_cfg_set_rts = &uslcom_set_rts, - .ucom_cfg_set_break = &uslcom_set_break, - .ucom_ioctl = &uslcom_ioctl, - .ucom_cfg_param = &uslcom_param, + .ucom_cfg_get_status = &uslcom_cfg_get_status, + .ucom_cfg_set_dtr = &uslcom_cfg_set_dtr, + .ucom_cfg_set_rts = &uslcom_cfg_set_rts, + .ucom_cfg_set_break = &uslcom_cfg_set_break, + .ucom_cfg_open = &uslcom_cfg_open, + .ucom_cfg_close = &uslcom_cfg_close, + .ucom_cfg_param = &uslcom_cfg_param, .ucom_pre_param = &uslcom_pre_param, + .ucom_ioctl = &uslcom_ioctl, .ucom_start_read = &uslcom_start_read, .ucom_stop_read = &uslcom_stop_read, .ucom_start_write = &uslcom_start_write, @@ -499,7 +498,7 @@ uslcom_free(struct ucom_softc *ucom) } static void -uslcom_open(struct ucom_softc *ucom) +uslcom_cfg_open(struct ucom_softc *ucom) { struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; @@ -510,7 +509,7 @@ uslcom_open(struct ucom_softc *ucom) USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000)) { DPRINTF("UART enable failed (ignored)\n"); } @@ -520,7 +519,7 @@ uslcom_open(struct ucom_softc *ucom) } static void -uslcom_close(struct ucom_softc *ucom) +uslcom_cfg_close(struct ucom_softc *ucom) { struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; @@ -534,7 +533,7 @@ uslcom_close(struct ucom_softc *ucom) USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000)) { DPRINTF("UART disable failed (ignored)\n"); } @@ -563,13 +562,13 @@ uslcom_get_partnum(struct uslcom_softc *sc) } static void -uslcom_set_dtr(struct ucom_softc *ucom, uint8_t onoff) +uslcom_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff) { - struct uslcom_softc *sc = ucom->sc_parent; + struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; uint16_t ctl; - DPRINTF("onoff = %d\n", onoff); + DPRINTF("onoff = %d\n", onoff); ctl = onoff ? USLCOM_MHS_DTR_ON : 0; ctl |= USLCOM_MHS_DTR_SET; @@ -580,20 +579,20 @@ uslcom_set_dtr(struct ucom_softc *ucom, uint8_t onoff) USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000)) { DPRINTF("Setting DTR failed (ignored)\n"); } } static void -uslcom_set_rts(struct ucom_softc *ucom, uint8_t onoff) +uslcom_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff) { - struct uslcom_softc *sc = ucom->sc_parent; + struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; uint16_t ctl; - DPRINTF("onoff = %d\n", onoff); + DPRINTF("onoff = %d\n", onoff); ctl = onoff ? USLCOM_MHS_RTS_ON : 0; ctl |= USLCOM_MHS_RTS_SET; @@ -604,7 +603,7 @@ uslcom_set_rts(struct ucom_softc *ucom, uint8_t onoff) USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000)) { DPRINTF("Setting DTR failed (ignored)\n"); } @@ -619,7 +618,7 @@ uslcom_pre_param(struct ucom_softc *ucom, struct termi } static void -uslcom_param(struct ucom_softc *ucom, struct termios *t) +uslcom_cfg_param(struct ucom_softc *ucom, struct termios *t) { struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; @@ -635,9 +634,9 @@ uslcom_param(struct ucom_softc *ucom, struct termios * USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(baudrate)); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, &baudrate, 0, 1000)) { - DPRINTF("Set baudrate failed (ignored)\n"); + printf("Set baudrate failed (ignored)\n"); } if (t->c_cflag & CSTOPB) @@ -672,11 +671,11 @@ uslcom_param(struct ucom_softc *ucom, struct termios * USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000)) { DPRINTF("Set format failed (ignored)\n"); } - + if (t->c_cflag & CRTSCTS) { flowctrl[0] = htole32(USLCOM_FLOW_DTR_ON | USLCOM_FLOW_CTS_HS); flowctrl[1] = htole32(USLCOM_FLOW_RTS_HS); @@ -692,14 +691,14 @@ uslcom_param(struct ucom_softc *ucom, struct termios * USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(flowctrl)); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, flowctrl, 0, 1000)) { DPRINTF("Set flowcontrol failed (ignored)\n"); } } static void -uslcom_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr) +uslcom_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr) { struct uslcom_softc *sc = ucom->sc_parent; @@ -711,9 +710,9 @@ uslcom_get_status(struct ucom_softc *ucom, uint8_t *ls } static void -uslcom_set_break(struct ucom_softc *ucom, uint8_t onoff) +uslcom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff) { - struct uslcom_softc *sc = ucom->sc_parent; + struct uslcom_softc *sc = ucom->sc_parent; struct usb_device_request req; uint16_t brk = onoff ? USLCOM_SET_BREAK_ON : USLCOM_SET_BREAK_OFF; @@ -723,7 +722,7 @@ uslcom_set_break(struct ucom_softc *ucom, uint8_t onof USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, 0); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000)) { DPRINTF("Set BREAK failed (ignored)\n"); } @@ -752,7 +751,7 @@ uslcom_ioctl(struct ucom_softc *ucom, uint32_t cmd, ca USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(latch)); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, &latch, 0, 1000)) { DPRINTF("Get LATCH failed\n"); error = EIO; @@ -771,7 +770,7 @@ uslcom_ioctl(struct ucom_softc *ucom, uint32_t cmd, ca USETW(req.wIndex, (*(int *)data)); USETW(req.wLength, 0); - if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, + if (ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom, &req, NULL, 0, 1000)) { DPRINTF("Set LATCH failed\n"); error = EIO; @@ -886,7 +885,7 @@ uslcom_control_callback(struct usb_xfer *xfer, usb_err USETW(req.wValue, 0); USETW(req.wIndex, sc->sc_iface_no); USETW(req.wLength, sizeof(buf)); - + usbd_xfer_set_frames(xfer, 2); usbd_xfer_set_frame_len(xfer, 0, sizeof(req)); usbd_xfer_set_frame_len(xfer, 1, sizeof(buf)); From owner-svn-src-head@freebsd.org Tue Apr 24 19:10:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 017EAFB0068; Tue, 24 Apr 2018 19:10:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A41817639C; Tue, 24 Apr 2018 19:10: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 9F25F172A2; Tue, 24 Apr 2018 19:10: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 w3OJApPw089228; Tue, 24 Apr 2018 19:10:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OJApeD089227; Tue, 24 Apr 2018 19:10:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804241910.w3OJApeD089227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 24 Apr 2018 19:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332962 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:10:52 -0000 Author: cem Date: Tue Apr 24 19:10:51 2018 New Revision: 332962 URL: https://svnweb.freebsd.org/changeset/base/332962 Log: Do not totally silence suppressed secondary kasserts unless debug.kassert.do_log is disabled To totally silence and ignore secondary kassert violations after a primary panic, set debug.kassert.do_log=0 and debug.kassert.suppress_in_panic=1. Additional assertion warnings shouldn't block core dump and may alert the developer to another erroneous condition. Secondary stack traces may be printed, identically to the unsuppressed case where panic() is reentered -- controlled via debug.trace_all_panics. Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Apr 24 19:09:53 2018 (r332961) +++ head/sys/kern/kern_shutdown.c Tue Apr 24 19:10:51 2018 (r332962) @@ -718,13 +718,24 @@ kassert_panic(const char *fmt, ...) static char buf[256]; va_list ap; - /* If we already panic'd, don't create a double-fault. */ - if (panicstr != NULL && kassert_suppress_in_panic) - return; - va_start(ap, fmt); (void)vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); + + /* + * If we are suppressing secondary panics, log the warning but do not + * re-enter panic/kdb. + */ + if (panicstr != NULL && kassert_suppress_in_panic) { + if (kassert_do_log) { + printf("KASSERT failed: %s\n", buf); +#ifdef KDB + if (trace_all_panics && trace_on_panic) + kdb_backtrace(); +#endif + } + return; + } /* * panic if we're not just warning, or if we've exceeded From owner-svn-src-head@freebsd.org Tue Apr 24 19:11:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 467D6FB00A3; Tue, 24 Apr 2018 19:11:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC3B5764CA; Tue, 24 Apr 2018 19:11:05 +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 E72C6172BB; Tue, 24 Apr 2018 19:11:05 +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 w3OJB5oZ089308; Tue, 24 Apr 2018 19:11:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OJB50x089307; Tue, 24 Apr 2018 19:11:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804241911.w3OJB50x089307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 24 Apr 2018 19:11:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332963 - head/sys/dev/usb/serial X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/usb/serial X-SVN-Commit-Revision: 332963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:11:06 -0000 Author: manu Date: Tue Apr 24 19:11:05 2018 New Revision: 332963 URL: https://svnweb.freebsd.org/changeset/base/332963 Log: uslcom: Both CP2104 and CP2105 can support up to 2Mbps baudrate MFC after: 1 week Modified: head/sys/dev/usb/serial/uslcom.c Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Tue Apr 24 19:10:51 2018 (r332962) +++ head/sys/dev/usb/serial/uslcom.c Tue Apr 24 19:11:05 2018 (r332963) @@ -612,7 +612,22 @@ uslcom_cfg_set_rts(struct ucom_softc *ucom, uint8_t on static int uslcom_pre_param(struct ucom_softc *ucom, struct termios *t) { - if (t->c_ospeed <= 0 || t->c_ospeed > 921600) + struct uslcom_softc *sc = ucom->sc_parent; + uint32_t maxspeed; + + switch (sc->sc_partnum) { + case USLCOM_PARTNUM_CP2104: + case USLCOM_PARTNUM_CP2105: + maxspeed = 2000000; + break; + case USLCOM_PARTNUM_CP2101: + case USLCOM_PARTNUM_CP2102: + case USLCOM_PARTNUM_CP2103: + default: + maxspeed = 921600; + break; + } + if (t->c_ospeed <= 0 || t->c_ospeed > maxspeed) return (EINVAL); return (0); } From owner-svn-src-head@freebsd.org Tue Apr 24 19:18:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF4ABFB0590; Tue, 24 Apr 2018 19:18:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7435277EA1; Tue, 24 Apr 2018 19:18:34 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x234.google.com with SMTP id p3-v6so16495269itc.0; Tue, 24 Apr 2018 12:18:34 -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=DQrHZ+m9M56ZtphAdQZzMjEmgLupnBue47wxv3V0MHU=; b=ljvkjFTP1sdr9YrzHNOxM5ilLa3GUBsXqqvhhRFC4syi/zTlDMNKCWNJzq0sjnPcQT TwkuIBLqTNU4Oboa8IiZolM9mn2fNZpsOtkeSbq2vhTYYj6wMjX7VjZUnsNjXafio8yk xvW5mlkbihsgEbensB0I7G5NbTGkPIzZpAZXIpE7AYcTijX8k83cFNrG5RrKIF76xJ2U uUI7o9ArHgvFOvq9GPlEU8mpK/Jrw5cEO3Lj4cnoj000YHOuLcWbeOG+PABZ1/2WNNdu I5Skl0T4HZk6Z8+aVPxY4GPMJEUfaoFyH73DTohh5N7pNDWyMiK17xNucpnRIf9KFqjt Oo5g== 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=DQrHZ+m9M56ZtphAdQZzMjEmgLupnBue47wxv3V0MHU=; b=dfVREGbN51aWUtmcaTGg7hgExdVRGgZzAQ65fC8K9u+X5H0s6p2ajS9OZSNcrhwkcW djkv59iskIxcDPdnqBxV4tEQkm/lk8Er+71BRYteFLKlcbSpVCsAG6BeMOcoHEhaR1RV 6R8fngmBp3Qs/fQwVz1GPlAJbISt4W+Uq+Y38l7/Ix2t69YjUXvD3UFqAe9XFE69UM7L huJQvJ5O1ykICxysdTpC+lhBlXprZNQZ0ZqD/7IcGPq8Y/euDdHSVif40D5EiYX2E6uN MkTFx27IoHALxcHIPf6zealQ7MMZa1Ti9JJf6BBIL/L8TWpW1KzBK7Zb05ppyzf/2c8W l4Ow== X-Gm-Message-State: ALQs6tDEnej08pPj/OGUGlRjqc9a/prhE2JzWFFtFlPPn3VmtLF5CE2Z VXTdMUpfXvD2FZVBVzyf24J4oQ== X-Google-Smtp-Source: AB8JxZorxJKnrPQI2eXVCQGzLgA+RKlFsLf5PdRQmWpM2WfUWLIOi1h6SXN2AXm2CDEtlgFn/XSnTw== X-Received: by 2002:a24:4f46:: with SMTP id c67-v6mr21068784itb.66.1524597513421; Tue, 24 Apr 2018 12:18:33 -0700 (PDT) Received: from raichu (toroon0560w-lp130-04-184-145-252-74.dsl.bell.ca. [184.145.252.74]) by smtp.gmail.com with ESMTPSA id m184-v6sm6368692ioa.27.2018.04.24.12.18.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 12:18:32 -0700 (PDT) Sender: Mark Johnston Date: Tue, 24 Apr 2018 15:18:28 -0400 From: Mark Johnston To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332894 - in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys Message-ID: <20180424191828.GA8078@raichu> References: <201804231951.w3NJp0Se084895@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804231951.w3NJp0Se084895@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:18:35 -0000 On Mon, Apr 23, 2018 at 07:51:00PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Mon Apr 23 19:51:00 2018 > New Revision: 332894 > URL: https://svnweb.freebsd.org/changeset/base/332894 > > Log: > Load balance sockets with new SO_REUSEPORT_LB option > > This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple > programs or threads to bind to the same port and incoming connections will be > load balanced using a hash function. > > Most of the code was copied from a similar patch for DragonflyBSD. > > However, in DragonflyBSD, load balancing is a global on/off setting and can not > be set per socket. This patch allows for simultaneous use of both the current > SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system. > > Required changes to structures > Globally change so_options from 16 to 32 bit value to allow for more options. > Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets. > > Limitations > As DragonflyBSD, a load balance group is limited to 256 pcbs > (256 programs or threads sharing the same socket). > > Submitted by: Johannes Lundberg > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D11003 > > Modified: > head/cddl/lib/libdtrace/tcp.d > head/sys/kern/uipc_debug.c > head/sys/kern/uipc_socket.c > head/sys/netinet/in_pcb.c > head/sys/netinet/in_pcb.h > head/sys/netinet/ip_output.c > head/sys/netinet/tcp_subr.c > head/sys/netinet/udp_usrreq.c > head/sys/netinet6/in6_pcb.c > head/sys/netinet6/in6_src.c > head/sys/netinet6/ip6_output.c > head/sys/netinet6/udp6_usrreq.c > head/sys/sys/socket.h > head/sys/sys/socketvar.h > > Modified: head/cddl/lib/libdtrace/tcp.d > ============================================================================== > --- head/cddl/lib/libdtrace/tcp.d Mon Apr 23 18:33:26 2018 (r332893) > +++ head/cddl/lib/libdtrace/tcp.d Mon Apr 23 19:51:00 2018 (r332894) > @@ -192,12 +192,12 @@ translator tcpsinfo_t < struct tcpcb *p > { > tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport); > tcps_laddr = p == NULL ? 0 : > p->t_inpcb->inp_vflag == INP_IPV4 ? > - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie46_local.ia46_addr4.s_addr) : > - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie6_local); > + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : > + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr); > tcps_raddr = p == NULL ? 0 : > p->t_inpcb->inp_vflag == INP_IPV4 ? > - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie46_foreign.ia46_addr4.s_addr) : > - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); > + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : > + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr); > tcps_state = p == NULL ? -1 : p->t_state; > tcps_iss = p == NULL ? 0 : p->iss; > tcps_irs = p == NULL ? 0 : p->irs; A similar change is needed in udp.d. Without it, libdtrace fails to compile its libraries when initializing a consumer, so dtrace(1) is currently unusable on head without "-x nolibs". From owner-svn-src-head@freebsd.org Tue Apr 24 19:23:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF16FB0A91; Tue, 24 Apr 2018 19:23:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 377E878383; Tue, 24 Apr 2018 19:23:27 +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 2FB8C175AC; Tue, 24 Apr 2018 19:23:27 +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 w3OJNQYi098367; Tue, 24 Apr 2018 19:23:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OJNQW1098366; Tue, 24 Apr 2018 19:23:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804241923.w3OJNQW1098366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 24 Apr 2018 19:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332964 - head/usr.bin/kdump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/kdump X-SVN-Commit-Revision: 332964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:23:27 -0000 Author: emaste Date: Tue Apr 24 19:23:26 2018 New Revision: 332964 URL: https://svnweb.freebsd.org/changeset/base/332964 Log: kdump: simplify/remove per-arch #ifdefs It is acceptable for syscallabi to map SV_ABI to SYSDECODE_ABI on all architectures; libsysdecode will return not-found sentinel values if it does not have a syscall name or errno mapping for a given architecture. Also, use __LP64__ for the SV_ILP32 -> SYSDECODE_ABI_LINUX32 mapping, for any future 32- on 64-bit linuxulator implementation. Reviewed by: jhb Sponsored by: Turing Robotic Industries Inc. Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue Apr 24 19:11:05 2018 (r332963) +++ head/usr.bin/kdump/kdump.c Tue Apr 24 19:23:26 2018 (r332964) @@ -758,18 +758,14 @@ syscallabi(u_int sv_flags) switch (sv_flags & SV_ABI_MASK) { case SV_ABI_FREEBSD: return (SYSDECODE_ABI_FREEBSD); -#if defined(__amd64__) || defined(__i386__) case SV_ABI_LINUX: -#ifdef __amd64__ +#ifdef __LP64__ if (sv_flags & SV_ILP32) return (SYSDECODE_ABI_LINUX32); #endif return (SYSDECODE_ABI_LINUX); -#endif -#if defined(__aarch64__) || defined(__amd64__) case SV_ABI_CLOUDABI: return (SYSDECODE_ABI_CLOUDABI64); -#endif default: return (SYSDECODE_ABI_UNKNOWN); } From owner-svn-src-head@freebsd.org Tue Apr 24 19:26:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54314FB0BE0; Tue, 24 Apr 2018 19:26:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 031CC79256; Tue, 24 Apr 2018 19:26:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1ED7175B3; Tue, 24 Apr 2018 19:26:58 +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 w3OJQwD5098531; Tue, 24 Apr 2018 19:26:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OJQwal098530; Tue, 24 Apr 2018 19:26:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804241926.w3OJQwal098530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 24 Apr 2018 19:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332965 - head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD X-SVN-Commit-Revision: 332965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:26:59 -0000 Author: emaste Date: Tue Apr 24 19:26:58 2018 New Revision: 332965 URL: https://svnweb.freebsd.org/changeset/base/332965 Log: lldb: remove assertion that target_arch is FreeBSD The target is not necessarily a FreeBSD binary - for example, it may be a Linux binary running under the linuxulator. Basic ptrace (live) debugging already worked in this case, except for the assertion. Sponsored by: Turing Robotic Industries Inc. Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Modified: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp ============================================================================== --- head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Tue Apr 24 19:23:26 2018 (r332964) +++ head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp Tue Apr 24 19:26:58 2018 (r332965) @@ -169,7 +169,6 @@ lldb::RegisterContextSP FreeBSDThread::GetRegisterCont RegisterInfoInterface *reg_interface = NULL; const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture(); - assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD); switch (target_arch.GetMachine()) { case llvm::Triple::aarch64: reg_interface = new RegisterInfoPOSIX_arm64(target_arch); From owner-svn-src-head@freebsd.org Tue Apr 24 19:51:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20450FB15DF; Tue, 24 Apr 2018 19:51:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C296380A1B; Tue, 24 Apr 2018 19:51:05 +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 BD9D017930; Tue, 24 Apr 2018 19:51:05 +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 w3OJp5GY009249; Tue, 24 Apr 2018 19:51:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OJp5rh009247; Tue, 24 Apr 2018 19:51:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804241951.w3OJp5rh009247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 24 Apr 2018 19:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332966 - in head: share/man/man4 sys/dev/lmc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/lmc X-SVN-Commit-Revision: 332966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:51:06 -0000 Author: emaste Date: Tue Apr 24 19:51:05 2018 New Revision: 332966 URL: https://svnweb.freebsd.org/changeset/base/332966 Log: Add deprecation notice for lmc(4) We intend to remove support before FreeBSD 12 is branched. These are available only as 32-bit PCI devices. The driver has an ambiguous license and I have not been successful in contacting the driver's author in order to address this. The planned deprecation has been announced on -current and -stable; if we receive feedback that the driver is still useful and we are able to resolve the license issue this deprecation notice can be reverted. Reviewed by: bapt, brooks, imp, rgrimes MFC after: 2 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15182 Modified: head/share/man/man4/lmc.4 head/sys/dev/lmc/if_lmc.c Modified: head/share/man/man4/lmc.4 ============================================================================== --- head/share/man/man4/lmc.4 Tue Apr 24 19:26:58 2018 (r332965) +++ head/share/man/man4/lmc.4 Tue Apr 24 19:51:05 2018 (r332966) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd February 8, 2012 +.Dd April 24, 2018 .Dt LMC 4 .Os .\" @@ -88,6 +88,13 @@ SPPP nor Netgraph are configured into the kernel. Netgraph and SPPP can both be enabled; Netgraph will be used if the .Va rawdata hook is connected. +.\" +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 12.0 +and later. .\" .Sh DESCRIPTION .\" Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Tue Apr 24 19:26:58 2018 (r332965) +++ head/sys/dev/lmc/if_lmc.c Tue Apr 24 19:51:05 2018 (r332966) @@ -4547,6 +4547,7 @@ fbsd_attach(device_t dev) /* Start the card and attach a kernel interface and line protocol. */ if ((error = attach_card(sc, ""))) detach_card(sc); + gone_in_dev(dev, 12, "lmc(4) driver"); return error; } From owner-svn-src-head@freebsd.org Tue Apr 24 19:55:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 003B5FB1719; Tue, 24 Apr 2018 19:55:13 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A29E980EF4; Tue, 24 Apr 2018 19:55:13 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C8A217AA8; Tue, 24 Apr 2018 19:55:13 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OJtDrY014137; Tue, 24 Apr 2018 19:55:13 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OJtCls014127; Tue, 24 Apr 2018 19:55:12 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804241955.w3OJtCls014127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 24 Apr 2018 19:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332967 - in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys X-SVN-Commit-Revision: 332967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:55:14 -0000 Author: sbruno Date: Tue Apr 24 19:55:12 2018 New Revision: 332967 URL: https://svnweb.freebsd.org/changeset/base/332967 Log: Revert r332894 at the request of the submitter. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Modified: head/cddl/lib/libdtrace/tcp.d head/sys/kern/uipc_debug.c head/sys/kern/uipc_socket.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c head/sys/sys/socket.h head/sys/sys/socketvar.h Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Tue Apr 24 19:51:05 2018 (r332966) +++ head/cddl/lib/libdtrace/tcp.d Tue Apr 24 19:55:12 2018 (r332967) @@ -192,12 +192,12 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport); tcps_laddr = p == NULL ? 0 : p->t_inpcb->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr); + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie46_local.ia46_addr4.s_addr) : + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.ie6_local); tcps_raddr = p == NULL ? 0 : p->t_inpcb->inp_vflag == INP_IPV4 ? - inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : - inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr); + inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie46_foreign.ia46_addr4.s_addr) : + inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); tcps_state = p == NULL ? -1 : p->t_state; tcps_iss = p == NULL ? 0 : p->iss; tcps_irs = p == NULL ? 0 : p->irs; Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Tue Apr 24 19:51:05 2018 (r332966) +++ head/sys/kern/uipc_debug.c Tue Apr 24 19:55:12 2018 (r332967) @@ -77,7 +77,7 @@ db_print_sotype(short so_type) } static void -db_print_sooptions(int so_options) +db_print_sooptions(short so_options) { int comma; @@ -120,10 +120,6 @@ db_print_sooptions(int so_options) } if (so_options & SO_REUSEPORT) { db_printf("%sSO_REUSEPORT", comma ? ", " : ""); - comma = 1; - } - if (so_options & SO_REUSEPORT_LB) { - db_printf("%sSO_REUSEPORT_LB", comma ? ", " : ""); comma = 1; } if (so_options & SO_TIMESTAMP) { Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Tue Apr 24 19:51:05 2018 (r332966) +++ head/sys/kern/uipc_socket.c Tue Apr 24 19:55:12 2018 (r332967) @@ -1057,100 +1057,6 @@ sofree(struct socket *so) } /* - * Let socket in same load balance group (same port and address) - * inherit pending sockets of the closing socket. - * - * "so_inh" will inherit sockets from "so" - */ -void -soinherit(struct socket *so, struct socket *so_inh) -{ - TAILQ_HEAD(, socket) comp, incomp; - struct socket *sp, *head, *head_inh; - int qlen, incqlen; - - KASSERT(so->so_options & SO_ACCEPTCONN, - ("so does not accept connection")); - KASSERT(so_inh->so_options & SO_ACCEPTCONN, - ("so_inh does not accept connection")); - - -restart: - SOCK_LOCK(so); - if ((head = so->so_listen) != NULL && - __predict_false(SOLISTEN_TRYLOCK(head) == 0)) { - SOCK_UNLOCK(so); - goto restart; - } - -restart_inh: - SOCK_LOCK(so_inh); - if ((head_inh = so_inh->so_listen) != NULL && - __predict_false(SOLISTEN_TRYLOCK(head_inh) == 0)) { - SOCK_UNLOCK(so_inh); - goto restart_inh; - } - - TAILQ_INIT(&comp); - TAILQ_INIT(&incomp); - - /* - * Save completed queue and incompleted queue - */ - TAILQ_CONCAT(&comp, &so->sol_comp, so_list); - qlen = so->sol_qlen; - so->sol_qlen = 0; - - TAILQ_CONCAT(&incomp, &so->sol_incomp, so_list); - incqlen = so->sol_incqlen; - so->sol_incqlen = 0; - - /* - * Append the saved completed queue and incompleted - * queue to the socket inherits them. - * - * XXX - * This may temporarily break the inheriting socket's - * so_qlimit. - */ - TAILQ_FOREACH(sp, &comp, so_list) { - refcount_acquire(&so_inh->so_count); - sp->so_listen = so_inh; - crfree(sp->so_cred); - sp->so_cred = crhold(so_inh->so_cred); - } - - TAILQ_FOREACH(sp, &incomp, so_list) { - refcount_acquire(&so_inh->so_count); - sp->so_listen = so_inh; - crfree(sp->so_cred); - sp->so_cred = crhold(so_inh->so_cred); - } - - TAILQ_CONCAT(&so_inh->sol_comp, &comp, so_list); - so_inh->sol_qlen += qlen; - - TAILQ_CONCAT(&so_inh->sol_incomp, &incomp, so_list); - so_inh->sol_incqlen += incqlen; - - SOCK_UNLOCK(so); - if(head != NULL) - SOLISTEN_UNLOCK(head); - - SOCK_UNLOCK(so_inh); - if(head_inh != NULL) { - if(qlen > 0) { - /* - * "New" connections have arrived - */ - solisten_wakeup(head_inh); - } else { - SOLISTEN_UNLOCK(head_inh); - } - } -} - -/* * Close a socket on last file table reference removal. Initiate disconnect * if connected. Free socket when disconnect complete. * @@ -2870,7 +2776,6 @@ sosetopt(struct socket *so, struct sockopt *sopt) case SO_BROADCAST: case SO_REUSEADDR: case SO_REUSEPORT: - case SO_REUSEPORT_LB: case SO_OOBINLINE: case SO_TIMESTAMP: case SO_BINTIME: @@ -3089,7 +2994,6 @@ sogetopt(struct socket *so, struct sockopt *sopt) case SO_KEEPALIVE: case SO_REUSEADDR: case SO_REUSEPORT: - case SO_REUSEPORT_LB: case SO_BROADCAST: case SO_OOBINLINE: case SO_ACCEPTCONN: Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Tue Apr 24 19:51:05 2018 (r332966) +++ head/sys/netinet/in_pcb.c Tue Apr 24 19:55:12 2018 (r332967) @@ -108,9 +108,6 @@ __FBSDID("$FreeBSD$"); #include -#define INPCBLBGROUP_SIZMIN 8 -#define INPCBLBGROUP_SIZMAX 256 - static struct callout ipport_tick_callout; /* @@ -220,186 +217,7 @@ SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtim * functions often modify hash chains or addresses in pcbs. */ -static struct inpcblbgroup * -in_pcblbgroup_alloc(struct inpcblbgrouphead *hdr, u_char vflag, - uint16_t port, const union in_dependaddr *addr, int size) -{ - struct inpcblbgroup *grp; - - size_t bytes = __offsetof(struct inpcblbgroup, il_inp[size]); - grp = malloc(bytes, M_PCB, M_ZERO | M_NOWAIT); - if(!grp) - return NULL; - grp->il_vflag = vflag; - grp->il_lport = port; - grp->il_dependladdr = *addr; - grp->il_inpsiz = size; - LIST_INSERT_HEAD(hdr, grp, il_list); - - return grp; -} - -static void -in_pcblbgroup_free(struct inpcblbgroup *grp) -{ - LIST_REMOVE(grp, il_list); - free(grp, M_TEMP); -} - -static struct inpcblbgroup * -in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, - struct inpcblbgroup *old_grp, int size) -{ - struct inpcblbgroup *grp; - int i; - - grp = in_pcblbgroup_alloc(hdr, old_grp->il_vflag, - old_grp->il_lport, &old_grp->il_dependladdr, size); - if(!grp) - return NULL; - - KASSERT(old_grp->il_inpcnt < grp->il_inpsiz, - ("invalid new local group size %d and old local group count %d", - grp->il_inpsiz, old_grp->il_inpcnt)); - for (i = 0; i < old_grp->il_inpcnt; ++i) - grp->il_inp[i] = old_grp->il_inp[i]; - grp->il_inpcnt = old_grp->il_inpcnt; - - in_pcblbgroup_free(old_grp); - - return grp; -} - /* - * Add PCB to lb group (load balance used by SO_REUSEPORT_LB) - */ -static int -in_pcbinslbgrouphash(struct inpcb *inp, struct inpcbinfo *pcbinfo) -{ - struct inpcblbgrouphead *hdr; - struct inpcblbgroup *grp; - - uint16_t hashmask = pcbinfo->ipi_lbgrouphashmask; - uint16_t lport = inp->inp_lport; - uint32_t group_index = INP_PCBLBGROUP_PORTHASH(lport, hashmask); - - hdr = &pcbinfo->ipi_lbgrouphashbase[group_index]; - - struct ucred *cred; - - if (pcbinfo->ipi_lbgrouphashbase == NULL) - return 0; - - /* - * don't allow jailed socket to join local group - */ - if (inp->inp_socket != NULL) - cred = inp->inp_socket->so_cred; - else - cred = NULL; - if (cred != NULL && jailed(cred)) - return 0; - -#ifdef INET6 - /* - * don't allow IPv4 mapped INET6 wild socket - */ - if ((inp->inp_vflag & INP_IPV4) && - inp->inp_laddr.s_addr == INADDR_ANY && - INP_CHECK_SOCKAF(inp->inp_socket, AF_INET6)) { - return 0; - } -#endif - - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; - - LIST_FOREACH(grp, hdr, il_list) { - if (grp->il_vflag == inp->inp_vflag && - grp->il_lport == inp->inp_lport && - memcmp(&grp->il_dependladdr, - &inp->inp_inc.inc_ie.ie_dependladdr, - sizeof(grp->il_dependladdr)) == 0) { - break; - } - } - if (grp == NULL) { - /* Create new load balance group */ - grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag, - inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr, - INPCBLBGROUP_SIZMIN); - if(!grp) - return (ENOBUFS); - } else if (grp->il_inpcnt == grp->il_inpsiz) { - if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { - static int limit_logged = 0; - - if (!limit_logged) { - limit_logged = 1; - printf("lb group port %d, " - "limit reached\n", ntohs(grp->il_lport)); - } - return 0; - } - - /* Expand this local group */ - grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2); - if(!grp) - return (ENOBUFS); - } - - KASSERT(grp->il_inpcnt < grp->il_inpsiz, - ("invalid local group size %d and count %d", - grp->il_inpsiz, grp->il_inpcnt)); - - grp->il_inp[grp->il_inpcnt] = inp; - grp->il_inpcnt++; - return 0; -} - -static void -in_pcbremlbgrouphash(struct inpcb *inp, struct inpcbinfo *pcbinfo) -{ - struct inpcblbgrouphead *hdr; - struct inpcblbgroup *grp; - - if (pcbinfo->ipi_lbgrouphashbase == NULL) - return; - - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; - - LIST_FOREACH(grp, hdr, il_list) { - int i; - - for (i = 0; i < grp->il_inpcnt; ++i) { - if (grp->il_inp[i] != inp) - continue; - - if (grp->il_inpcnt == 1) { - /* Free this local group */ - in_pcblbgroup_free(grp); - } else { - /* Pull up inpcbs */ - for (; i + 1 < grp->il_inpcnt; ++i) - grp->il_inp[i] = grp->il_inp[i + 1]; - grp->il_inpcnt--; - - if (grp->il_inpsiz > INPCBLBGROUP_SIZMIN && - grp->il_inpcnt <= (grp->il_inpsiz / 4)) { - /* Shrink this local group */ - struct inpcblbgroup *new_grp = - in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2); - if(new_grp) - grp = new_grp; - } - } - return; - } - } -} - -/* * Different protocols initialize their inpcbs differently - giving * different name to the lock. But they all are disposed the same. */ @@ -434,8 +252,6 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char &pcbinfo->ipi_hashmask); pcbinfo->ipi_porthashbase = hashinit(porthash_nelements, M_PCB, &pcbinfo->ipi_porthashmask); - pcbinfo->ipi_lbgrouphashbase = hashinit(hash_nelements, M_PCB, - &pcbinfo->ipi_lbgrouphashmask); #ifdef PCBGROUP in_pcbgroup_init(pcbinfo, hashfields, hash_nelements); #endif @@ -459,8 +275,6 @@ in_pcbinfo_destroy(struct inpcbinfo *pcbinfo) hashdestroy(pcbinfo->ipi_hashbase, M_PCB, pcbinfo->ipi_hashmask); hashdestroy(pcbinfo->ipi_porthashbase, M_PCB, pcbinfo->ipi_porthashmask); - hashdestroy(pcbinfo->ipi_lbgrouphashbase, M_PCB, - pcbinfo->ipi_lbgrouphashmask); #ifdef PCBGROUP in_pcbgroup_destroy(pcbinfo); #endif @@ -699,20 +513,18 @@ in_pcb_lport(struct inpcb *inp, struct in_addr *laddrp /* * Return cached socket options. */ -int +short inp_so_options(const struct inpcb *inp) { - int so_options; + short so_options; - so_options = 0; + so_options = 0; - if ((inp->inp_flags2 & INP_REUSEPORT_LB) != 0) - so_options |= SO_REUSEPORT_LB; - if ((inp->inp_flags2 & INP_REUSEPORT) != 0) - so_options |= SO_REUSEPORT; - if ((inp->inp_flags2 & INP_REUSEADDR) != 0) - so_options |= SO_REUSEADDR; - return (so_options); + if ((inp->inp_flags2 & INP_REUSEPORT) != 0) + so_options |= SO_REUSEPORT; + if ((inp->inp_flags2 & INP_REUSEADDR) != 0) + so_options |= SO_REUSEADDR; + return (so_options); } #endif /* INET || INET6 */ @@ -769,12 +581,6 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n int error; /* - * XXX Maybe we could let SO_REUSEPORT_LB set SO_REUSEPORT bit here - * so that we don't have to add to the (already messy) code below - */ - int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); - - /* * No state changes, so read locks are sufficient here. */ INP_LOCK_ASSERT(inp); @@ -785,7 +591,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n laddr.s_addr = *laddrp; if (nam != NULL && laddr.s_addr != INADDR_ANY) return (EINVAL); - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { if ((error = prison_local_ip4(cred, &laddr)) != 0) @@ -822,20 +628,16 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n */ if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; - // XXX: How to deal with SO_REUSEPORT_LB here? - // Added equivalent treatment as SO_REUSEPORT here for now - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT_LB)) != 0) - reuseport_lb = SO_REUSEADDR|SO_REUSEPORT_LB; } else if (sin->sin_addr.s_addr != INADDR_ANY) { sin->sin_port = 0; /* yech... */ bzero(&sin->sin_zero, sizeof(sin->sin_zero)); /* - * Is the address a local IP address? + * Is the address a local IP address? * If INP_BINDANY is set, then the socket may be bound * to any endpoint address, local or not. */ if ((inp->inp_flags & INP_BINDANY) == 0 && - ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) + ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) return (EADDRNOTAVAIL); } laddr = sin->sin_addr; @@ -865,8 +667,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n ntohl(t->inp_faddr.s_addr) == INADDR_ANY) && (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - (t->inp_flags2 & INP_REUSEPORT) || - (t->inp_flags2 & INP_REUSEPORT_LB) == 0) && + (t->inp_flags2 & INP_REUSEPORT) == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); @@ -891,14 +692,11 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n */ tw = intotw(t); if (tw == NULL || - ((reuseport & tw->tw_so_options) == 0 && - (reuseport_lb & tw->tw_so_options) == 0)) { + (reuseport & tw->tw_so_options) == 0) return (EADDRINUSE); - } } else if (t && - ((inp->inp_flags2 & INP_BINDMULTI) == 0) && - (reuseport & inp_so_options(t)) == 0 && - (reuseport_lb & inp_so_options(t)) == 0) { + ((inp->inp_flags2 & INP_BINDMULTI) == 0) && + (reuseport & inp_so_options(t)) == 0) { #ifdef INET6 if (ntohl(sin->sin_addr.s_addr) != INADDR_ANY || @@ -907,7 +705,7 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *n (inp->inp_vflag & INP_IPV6PROTO) == 0 || (t->inp_vflag & INP_IPV6PROTO) == 0) #endif - return (EADDRINUSE); + return (EADDRINUSE); if (t && (! in_pcbbind_check_bindmulti(inp, t))) return (EADDRINUSE); } @@ -1611,7 +1409,6 @@ in_pcbdrop(struct inpcb *inp) struct inpcbport *phd = inp->inp_phd; INP_HASH_WLOCK(inp->inp_pcbinfo); - in_pcbremlbgrouphash(inp, inp->inp_pcbinfo); LIST_REMOVE(inp, inp_hash); LIST_REMOVE(inp, inp_portlist); if (LIST_FIRST(&phd->phd_pcblist) == NULL) { @@ -1872,98 +1669,6 @@ in_pcblookup_local(struct inpcbinfo *pcbinfo, struct i } #undef INP_LOOKUP_MAPPED_PCB_COST -struct inpcb * -in_pcblookup_lbgroup_last(const struct inpcb *inp) -{ - const struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; - const struct inpcblbgrouphead *hdr; - const struct inpcblbgroup *grp; - int i; - - if (pcbinfo->ipi_lbgrouphashbase == NULL) - return NULL; - - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; - - LIST_FOREACH(grp, hdr, il_list) { - if (grp->il_vflag == inp->inp_vflag && - grp->il_lport == inp->inp_lport && - memcmp(&grp->il_dependladdr, - &inp->inp_inc.inc_ie.ie_dependladdr, - sizeof(grp->il_dependladdr)) == 0) { - break; - } - } - if (grp == NULL || grp->il_inpcnt == 1) - return NULL; - - KASSERT(grp->il_inpcnt >= 2, - ("invalid lbgroup inp count %d", grp->il_inpcnt)); - for (i = 0; i < grp->il_inpcnt; ++i) { - if (grp->il_inp[i] == inp) { - int last = grp->il_inpcnt - 1; - - if (i == last) - last = grp->il_inpcnt - 2; - return grp->il_inp[last]; - } - } - return NULL; -} - -static struct inpcb * -in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, - const struct in_addr *laddr, uint16_t lport, const struct in_addr *faddr, - uint16_t fport, int lookupflags) -{ - struct inpcb *local_wild = NULL; - const struct inpcblbgrouphead *hdr; - struct inpcblbgroup *grp; - struct inpcblbgroup *grp_local_wild; - - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; - - /* - * Order of socket selection: - * 1. non-wild. - * 2. wild (if lookupflags contains INPLOOKUP_WILDCARD). - * - * NOTE: - * - Load balanced group does not contain jailed sockets - * - Load balanced group does not contain IPv4 mapped INET6 wild sockets - */ - LIST_FOREACH(grp, hdr, il_list) { -#ifdef INET6 - if (!(grp->il_vflag & INP_IPV4)) - continue; -#endif - - if (grp->il_lport == lport) { - - uint32_t idx = 0; - int pkt_hash = INP_PCBLBGROUP_PKTHASH(faddr->s_addr, lport, fport); - - idx = pkt_hash % grp->il_inpcnt; - - if (grp->il_laddr.s_addr == laddr->s_addr) { - return grp->il_inp[idx]; - } else { - if (grp->il_laddr.s_addr == INADDR_ANY && - (lookupflags & INPLOOKUP_WILDCARD)) { - local_wild = grp->il_inp[idx]; - grp_local_wild = grp; - } - } - } - } - if (local_wild != NULL) { - return local_wild; - } - return NULL; -} - #ifdef PCBGROUP /* * Lookup PCB in hash list, using pcbgroup tables. @@ -2243,18 +1948,6 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, st return (tmpinp); /* - * Then look in lb group (for wildcard match) - */ - if (pcbinfo->ipi_lbgrouphashbase != NULL && - (lookupflags & INPLOOKUP_WILDCARD)) { - inp = in_pcblookup_lbgroup(pcbinfo, &laddr, lport, &faddr, fport, - lookupflags); - if (inp != NULL) { - return inp; - } - } - - /* * Then look for a wildcard match, if requested. */ if ((lookupflags & INPLOOKUP_WILDCARD) != 0) { @@ -2471,7 +2164,6 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; struct inpcbport *phd; u_int32_t hashkey_faddr; - int so_options; INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -2492,21 +2184,7 @@ in_pcbinshash_internal(struct inpcb *inp, int do_pcbgr pcbporthash = &pcbinfo->ipi_porthashbase[ INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_porthashmask)]; - /* - * Add entry in lb group - * Only do this if SO_REUSEPORT_LB is set - */ - so_options = inp_so_options(inp); - if(so_options & SO_REUSEPORT_LB) { - int ret = in_pcbinslbgrouphash(inp, pcbinfo); - if(ret) { - // pcb lb group malloc fail (ret=ENOBUFS) - return ret; - } - } - - /* * Go through port list and look for a head for this lport. */ LIST_FOREACH(phd, pcbporthash, phd_hash) { @@ -2632,10 +2310,6 @@ in_pcbremlists(struct inpcb *inp) struct inpcbport *phd = inp->inp_phd; INP_HASH_WLOCK(pcbinfo); - - // XXX Only do if SO_REUSEPORT_LB set? - in_pcbremlbgrouphash(inp, pcbinfo); - LIST_REMOVE(inp, inp_hash); LIST_REMOVE(inp, inp_portlist); if (LIST_FIRST(&phd->phd_pcblist) == NULL) { Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Tue Apr 24 19:51:05 2018 (r332966) +++ head/sys/netinet/in_pcb.h Tue Apr 24 19:55:12 2018 (r332967) @@ -78,11 +78,6 @@ struct in_addr_4in6 { struct in_addr ia46_addr4; }; -union in_dependaddr { - struct in_addr_4in6 id46_addr; - struct in6_addr id6_addr; -}; - /* * NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has * some extra padding to accomplish this. @@ -93,14 +88,22 @@ struct in_endpoints { u_int16_t ie_fport; /* foreign port */ u_int16_t ie_lport; /* local port */ /* protocol dependent part, local and foreign addr */ - union in_dependaddr ie_dependfaddr; /* foreign host table entry */ - union in_dependaddr ie_dependladdr; /* local host table entry */ -#define ie_faddr ie_dependfaddr.id46_addr.ia46_addr4 -#define ie_laddr ie_dependladdr.id46_addr.ia46_addr4 -#define ie6_faddr ie_dependfaddr.id6_addr -#define ie6_laddr ie_dependladdr.id6_addr + union { + /* foreign host table entry */ + struct in_addr_4in6 ie46_foreign; + struct in6_addr ie6_foreign; + } ie_dependfaddr; + union { + /* local host table entry */ + struct in_addr_4in6 ie46_local; + struct in6_addr ie6_local; + } ie_dependladdr; u_int32_t ie6_zoneid; /* scope zone id */ }; +#define ie_faddr ie_dependfaddr.ie46_foreign.ia46_addr4 +#define ie_laddr ie_dependladdr.ie46_local.ia46_addr4 +#define ie6_faddr ie_dependfaddr.ie6_foreign +#define ie6_laddr ie_dependladdr.ie6_local /* * XXX The defines for inc_* are hacks and should be changed to direct @@ -404,21 +407,6 @@ struct inpcbport { u_short phd_port; }; -struct inpcblbgroup { - LIST_ENTRY(inpcblbgroup) il_list; - uint16_t il_lport; - u_char il_vflag; - u_char il_pad; - uint32_t il_pad2; - union in_dependaddr il_dependladdr; -#define il_laddr il_dependladdr.id46_addr.ia46_addr4 -#define il6_laddr il_dependladdr.id6_addr - uint32_t il_inpsiz; /* size of il_inp[] */ - uint32_t il_inpcnt; /* # of elem in il_inp[] */ - struct inpcb *il_inp[]; -}; -LIST_HEAD(inpcblbgrouphead, inpcblbgroup); - /*- * Global data structure for each high-level protocol (UDP, TCP, ...) in both * IPv4 and IPv6. Holds inpcb lists and information for managing them. @@ -512,13 +500,6 @@ struct inpcbinfo { u_long ipi_wildmask; /* (p) */ /* - * Load balanced group used by the SO_REUSEPORT_LB option, - * hashed by local address and local port. - */ - struct inpcblbgrouphead *ipi_lbgrouphashbase; - u_long ipi_lbgrouphashmask; - - /* * Pointer to network stack instance */ struct vnet *ipi_vnet; /* (c) */ @@ -604,7 +585,7 @@ struct tcpcb * inp_inpcbtotcpcb(struct inpcb *inp); void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp); -int inp_so_options(const struct inpcb *inp); +short inp_so_options(const struct inpcb *inp); #endif /* _KERNEL */ @@ -667,10 +648,6 @@ int inp_so_options(const struct inpcb *inp); (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask)) #define INP_PCBPORTHASH(lport, mask) \ (ntohs((lport)) & (mask)) -#define INP_PCBLBGROUP_PORTHASH(lport, mask) \ - (ntohs((lport)) & (mask)) -#define INP_PCBLBGROUP_PKTHASH(faddr, lport, fport) \ - ((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) #define INP6_PCBHASHKEY(faddr) ((faddr)->s6_addr32[3]) /* @@ -739,7 +716,6 @@ int inp_so_options(const struct inpcb *inp); #define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ #define INP_ORIGDSTADDR 0x00000800 /* receive IP dst address/port */ #define INP_CANNOT_DO_ECN 0x00001000 /* The stack does not do ECN */ -#define INP_REUSEPORT_LB 0x00002000 /* SO_REUSEPORT_LB option is set */ /* * Flags passed to in_pcblookup*() functions. @@ -842,8 +818,6 @@ struct inpcb * struct inpcb * in_pcblookup(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *); -struct inpcb * - in_pcblookup_lbgroup_last(const struct inpcb *inp); struct inpcb * in_pcblookup_mbuf(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *, struct mbuf *); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Tue Apr 24 19:51:05 2018 (r332966) +++ head/sys/netinet/ip_output.c Tue Apr 24 19:55:12 2018 (r332967) @@ -986,15 +986,6 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) INP_WUNLOCK(inp); error = 0; break; - case SO_REUSEPORT_LB: - INP_WLOCK(inp); - if ((so->so_options & SO_REUSEPORT_LB) != 0) - inp->inp_flags2 |= INP_REUSEPORT_LB; - else - inp->inp_flags2 &= ~INP_REUSEPORT_LB; - INP_WUNLOCK(inp); - error = 0; - break; case SO_SETFIB: INP_WLOCK(inp); inp->inp_inc.inc_fibnum = so->so_fibnum; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Apr 24 19:51:05 2018 (r332966) +++ head/sys/netinet/tcp_subr.c Tue Apr 24 19:55:12 2018 (r332967) @@ -1956,28 +1956,10 @@ tcp_close(struct tcpcb *tp) { struct inpcb *inp = tp->t_inpcb; struct socket *so; - struct inpcb *inp_inh = NULL; - int listen = tp->t_state & TCPS_LISTEN; INP_INFO_LOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); - if (listen) { - /* - * Pending socket/syncache inheritance - * - * If this is a listen(2) socket, find another listen(2) - * socket in the same local group, which could inherit - * the syncache and sockets pending on the completion - * and incompletion queues. - * - * NOTE: - * Currently the inheritance could only happen on the - * listen(2) sockets with SO_REUSEPORT_LB set. - */ - inp_inh = in_pcblookup_lbgroup_last(inp); - } - #ifdef TCP_OFFLOAD if (tp->t_state == TCPS_LISTEN) tcp_offload_listen_stop(tp); @@ -1997,16 +1979,7 @@ tcp_close(struct tcpcb *tp) tcp_state_change(tp, TCPS_CLOSED); KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); so = inp->inp_socket; - soisdisconnected(so); - - if(listen) - { - if(inp_inh != NULL && inp_inh->inp_socket != NULL) { - soinherit(so, inp_inh->inp_socket); - } - } - if (inp->inp_flags & INP_SOCKREF) { KASSERT(so->so_state & SS_PROTOREF, ("tcp_close: !SS_PROTOREF")); Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Tue Apr 24 19:51:05 2018 (r332966) +++ head/sys/netinet/udp_usrreq.c Tue Apr 24 19:55:12 2018 (r332967) @@ -612,7 +612,7 @@ udp_input(struct mbuf **mp, int *offp, int proto) * will never clear these options after setting them. */ if ((last->inp_socket->so_options & - (SO_REUSEPORT|SO_REUSEPORT_LB|SO_REUSEADDR)) == 0) + (SO_REUSEPORT|SO_REUSEADDR)) == 0) break; } Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Tue Apr 24 19:51:05 2018 (r332966) +++ head/sys/netinet6/in6_pcb.c Tue Apr 24 19:55:12 2018 (r332967) @@ -125,12 +125,6 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, int error, lookupflags = 0; int reuseport = (so->so_options & SO_REUSEPORT); - /* - * XXX Maybe we could let SO_REUSEPORT_LB set SO_REUSEPORT bit here - * so that we don't have to add to the (already messy) code below - */ - int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); - INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); @@ -138,7 +132,7 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, return (EADDRNOTAVAIL); if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) return (EINVAL); - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0) lookupflags = INPLOOKUP_WILDCARD; if (nam == NULL) { if ((error = prison_local_ip6(cred, &inp->in6p_laddr, @@ -172,10 +166,6 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, */ if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0) reuseport = SO_REUSEADDR|SO_REUSEPORT; - // XXX: How to deal with SO_REUSEPORT_LB here? - // Added equivalent treatment as SO_REUSEPORT here for now - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT_LB)) != 0) - reuseport_lb = SO_REUSEADDR|SO_REUSEPORT_LB; } else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct ifaddr *ifa; @@ -224,8 +214,7 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, IN6_IS_ADDR_UNSPECIFIED(&t->in6p_faddr)) && (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) || !IN6_IS_ADDR_UNSPECIFIED(&t->in6p_laddr) || - (t->inp_flags2 & INP_REUSEPORT) || - (t->inp_flags2 & INP_REUSEPORT_LB) == 0) && + (t->inp_flags2 & INP_REUSEPORT) == 0) && (inp->inp_cred->cr_uid != t->inp_cred->cr_uid)) return (EADDRINUSE); @@ -275,39 +264,34 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, */ tw = intotw(t); if (tw == NULL || - ((reuseport & tw->tw_so_options) == 0 && - (reuseport_lb & tw->tw_so_options) == 0)) + (reuseport & tw->tw_so_options) == 0) return (EADDRINUSE); - } else if (t && (reuseport & inp_so_options(t)) == 0 && - (reuseport_lb & inp_so_options(t)) == 0) { + } else if (t && (reuseport & inp_so_options(t)) == 0) { return (EADDRINUSE); } #ifdef INET if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 && - IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { + IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { struct sockaddr_in sin; in6_sin6_2_sin(&sin, sin6); t = in_pcblookup_local(pcbinfo, sin.sin_addr, - lport, lookupflags, cred); + lport, lookupflags, cred); if (t && t->inp_flags & INP_TIMEWAIT) { tw = intotw(t); if (tw == NULL) return (EADDRINUSE); if ((reuseport & tw->tw_so_options) == 0 - && (reuseport_lb & tw->tw_so_options) == 0 - && (ntohl(t->inp_laddr.s_addr) != - INADDR_ANY || ((inp->inp_vflag & - INP_IPV6PROTO) == - (t->inp_vflag & INP_IPV6PROTO)))) + && (ntohl(t->inp_laddr.s_addr) != + INADDR_ANY || ((inp->inp_vflag & + INP_IPV6PROTO) == + (t->inp_vflag & INP_IPV6PROTO)))) return (EADDRINUSE); } else if (t && - (reuseport & inp_so_options(t)) == 0 && - (reuseport_lb & inp_so_options(t)) == 0 && - (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || - (t->inp_vflag & INP_IPV6PROTO) != 0)) { + (reuseport & inp_so_options(t)) == 0 && + (ntohl(t->inp_laddr.s_addr) != INADDR_ANY || + (t->inp_vflag & INP_IPV6PROTO) != 0)) return (EADDRINUSE); - } } #endif } @@ -872,54 +856,6 @@ in6_rtchange(struct inpcb *inp, int errno) return inp; } -static struct inpcb * -in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, - const struct in6_addr *laddr, uint16_t lport, const struct in6_addr *faddr, - uint16_t fport, int lookupflags) -{ - struct inpcb *local_wild = NULL; - const struct inpcblbgrouphead *hdr; - struct inpcblbgroup *grp; - struct inpcblbgroup *grp_local_wild; - - hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; - - /* - * Order of socket selection: - * 1. non-wild. - * 2. wild (if lookupflags contains INPLOOKUP_WILDCARD). - * - * NOTE: - * - Load balanced group does not contain jailed sockets - * - Load balanced does not contain IPv4 mapped INET6 wild sockets - */ - LIST_FOREACH(grp, hdr, il_list) { - - if (grp->il_lport == lport) { - uint32_t idx = 0; - int pkt_hash = INP_PCBLBGROUP_PKTHASH( - INP6_PCBHASHKEY(faddr), lport, fport); - - idx = pkt_hash % grp->il_inpcnt; - - if (IN6_ARE_ADDR_EQUAL(&grp->il6_laddr, laddr)) { - return grp->il_inp[idx]; - } else { - if (IN6_IS_ADDR_UNSPECIFIED(&grp->il6_laddr) && - (lookupflags & INPLOOKUP_WILDCARD)) { - local_wild = grp->il_inp[idx]; - grp_local_wild = grp; - } - } - } - } - if (local_wild != NULL) { - return local_wild; - } - return NULL; -} - #ifdef PCBGROUP /* * Lookup PCB in hash list, using pcbgroup tables. @@ -1121,8 +1057,6 @@ found: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Apr 24 19:59:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5C8BFB183A; Tue, 24 Apr 2018 19:59:04 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 40F7C82FD9; Tue, 24 Apr 2018 19:59:03 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id B45VfgV52XL8AB45Yf0q9r; Tue, 24 Apr 2018 13:58:57 -0600 X-Authority-Analysis: v=2.3 cv=MfVCRa3f c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=6I5d2MoRAAAA:8 a=LkQLV2c5AAAA:8 a=YxBL1-UpAAAA:8 a=y9IVfBcNMPb9XBaD4VgA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=B8rWm7P7DIhzdu2jYzZa:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id 6D25BB44; Tue, 24 Apr 2018 12:58:52 -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 w3OJwaU9056367; Tue, 24 Apr 2018 12:58:36 -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 w3OJwaJw056364; Tue, 24 Apr 2018 12:58:36 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804241958.w3OJwaJw056364@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Sean Bruno cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332967 - in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys In-Reply-To: Message from Sean Bruno of "Tue, 24 Apr 2018 19:55:12 -0000." <201804241955.w3OJtCls014127@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 24 Apr 2018 12:58:36 -0700 X-CMAE-Envelope: MS4wfM6PlW7jl82/KaKKFmCcHZoEFiJ+wDpLIdV9AcZPXvdRgZAJFi6/v1groCsQqRVzGlA/hVzWfiUeImiWsh6ng188xf6deKXc2vI1sbewrhSEGlUw1eQT V/E2VSSziENk02eRJvUBEik+XhDUicGJULBr8MMXLxbTl6DIyVfb3d+sGQUgYKZLrj8Ja2aJMhYWFJF3zJf0c7DqX5OydPRbHckAanSMDf+GE6XqIaEHHUe2 H9fwJhYzffeuPV+ux4vkhZjjBfZAufbC5cXIh0cHy1dk9B4GH81yF3v8Ugppb1Jc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 19:59:05 -0000 In message <201804241955.w3OJtCls014127@repo.freebsd.org>, Sean Bruno writes: > Author: sbruno > Date: Tue Apr 24 19:55:12 2018 > New Revision: 332967 > URL: https://svnweb.freebsd.org/changeset/base/332967 > > Log: > Revert r332894 at the request of the submitter. > > Submitted by: Johannes Lundberg > Sponsored by: Limelight Networks Hi Sean, Why? Not that I agree or disagree with this commit specifically, including the reason why in the log might assist someone browsing through the log. -- 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-head@freebsd.org Tue Apr 24 20:05:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E055BFB1B9A; Tue, 24 Apr 2018 20:05:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D6648434C; Tue, 24 Apr 2018 20:05:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FEC617C6C; Tue, 24 Apr 2018 20:05:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OK5kMx019255; Tue, 24 Apr 2018 20:05:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OK5kGx019253; Tue, 24 Apr 2018 20:05:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804242005.w3OK5kGx019253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 24 Apr 2018 20:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332968 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 332968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 20:05:47 -0000 Author: markj Date: Tue Apr 24 20:05:45 2018 New Revision: 332968 URL: https://svnweb.freebsd.org/changeset/base/332968 Log: Add a UMA zone flag to disable the use of buckets. This allows the creation of zones which don't do any caching in front of the keg. If the zone is a cache zone, this means that UMA will not attempt any memory allocations when allocating an item from the backend. This is intended for use after a panic by netdump, but likely has other applications. Reviewed by: kib MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15184 Modified: head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Apr 24 19:55:12 2018 (r332967) +++ head/sys/vm/uma.h Tue Apr 24 20:05:45 2018 (r332968) @@ -265,8 +265,8 @@ uma_zone_t uma_zcache_create(char *name, int size, uma * information in the vm_page. */ #define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */ -/* 0x0400 Unused */ -#define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets */ +#define UMA_ZONE_NOBUCKET 0x0400 /* Do not use buckets. */ +#define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets. */ #define UMA_ZONE_CACHESPREAD 0x1000 /* * Spread memory start locations across * all possible cache lines. May Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Apr 24 19:55:12 2018 (r332967) +++ head/sys/vm/uma_core.c Tue Apr 24 20:05:45 2018 (r332968) @@ -1681,10 +1681,15 @@ zone_ctor(void *mem, int size, void *udata, int flags) } out: - if ((arg->flags & UMA_ZONE_MAXBUCKET) == 0) - zone->uz_count = bucket_select(zone->uz_size); - else + 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) zone->uz_count = BUCKET_MAX; + else if ((arg->flags & UMA_ZONE_NOBUCKET) != 0) + zone->uz_count = 0; + else + zone->uz_count = bucket_select(zone->uz_size); zone->uz_count_min = zone->uz_count; return (0); From owner-svn-src-head@freebsd.org Tue Apr 24 20:22:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFE40FB229D; Tue, 24 Apr 2018 20:22:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E5E7697C6; Tue, 24 Apr 2018 20:22:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8943317F8C; Tue, 24 Apr 2018 20:22:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OKMUFx029063; Tue, 24 Apr 2018 20:22:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OKMUao029062; Tue, 24 Apr 2018 20:22:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804242022.w3OKMUao029062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Apr 2018 20:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332970 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 332970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 20:22:31 -0000 Author: kib Date: Tue Apr 24 20:22:30 2018 New Revision: 332970 URL: https://svnweb.freebsd.org/changeset/base/332970 Log: Use IS_BSP() macro. Noted and reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D15157 Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Tue Apr 24 20:21:59 2018 (r332969) +++ head/sys/x86/x86/mca.c Tue Apr 24 20:22:30 2018 (r332970) @@ -1103,7 +1103,7 @@ _mca_init(int boot) if (mcg_cap & MCG_CAP_CTL_P) /* Enable MCA features. */ wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); - if (PCPU_GET(cpuid) == 0 && boot) + if (IS_BSP() && boot) mca_setup(mcg_cap); /* From owner-svn-src-head@freebsd.org Tue Apr 24 20:29:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A13F9FB24B8; Tue, 24 Apr 2018 20:29: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FEB26CB95; Tue, 24 Apr 2018 20:29: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 42D6C17FA0; Tue, 24 Apr 2018 20:29:41 +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 w3OKTfNR029458; Tue, 24 Apr 2018 20:29:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OKTfLd029457; Tue, 24 Apr 2018 20:29:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804242029.w3OKTfLd029457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Apr 2018 20:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332971 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 332971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 20:29:41 -0000 Author: kib Date: Tue Apr 24 20:29:40 2018 New Revision: 332971 URL: https://svnweb.freebsd.org/changeset/base/332971 Log: Ensure that cmci_monitor() is not executed in parallel, since shared machine check banks must be only monitored by single CPU. Noted and reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15157 Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Tue Apr 24 20:22:30 2018 (r332970) +++ head/sys/x86/x86/mca.c Tue Apr 24 20:29:40 2018 (r332971) @@ -1119,6 +1119,14 @@ _mca_init(int boot) if ((mask & (1UL << 5)) == 0) wrmsr(MSR_MC0_CTL_MASK, mask | (1UL << 5)); } + + /* + * The cmci_monitor() must not be executed + * simultaneously by several CPUs. + */ + if (boot) + mtx_lock_spin(&mca_lock); + for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { /* By default enable logging of all errors. */ ctl = 0xffffffffffffffffUL; @@ -1158,6 +1166,8 @@ _mca_init(int boot) /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } + if (boot) + mtx_unlock_spin(&mca_lock); #ifdef DEV_APIC if (!amd_thresholding_supported() && From owner-svn-src-head@freebsd.org Tue Apr 24 20:33:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BCF2FB287A; Tue, 24 Apr 2018 20:33:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5E86D2E8; Tue, 24 Apr 2018 20:33:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0615A18129; Tue, 24 Apr 2018 20:33:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OKX8eo034426; Tue, 24 Apr 2018 20:33:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OKX8BF034425; Tue, 24 Apr 2018 20:33:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804242033.w3OKX8BF034425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Apr 2018 20:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332972 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 332972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 20:33:09 -0000 Author: kib Date: Tue Apr 24 20:33:08 2018 New Revision: 332972 URL: https://svnweb.freebsd.org/changeset/base/332972 Log: Extend ap_boot_mtx scope to also cover mca_init(). Otherwise, under bootverbose, the lapic_enable_cmc() banner 'lapicX: CMCI unmasked' is printed by several CPUs in parallel, causing garbled output for the LAPIC dumps. Reported by: royger Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15157 Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Tue Apr 24 20:29:40 2018 (r332971) +++ head/sys/x86/x86/mp_x86.c Tue Apr 24 20:33:08 2018 (r332972) @@ -1007,9 +1007,9 @@ init_secondary_tail(void) KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread")); PCPU_SET(curthread, PCPU_GET(idlethread)); - mca_init(); - mtx_lock_spin(&ap_boot_mtx); + + mca_init(); /* Init local apic for irq's */ lapic_setup(1); From owner-svn-src-head@freebsd.org Tue Apr 24 20:49:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 769A1FB2E36; Tue, 24 Apr 2018 20:49:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A95F72287; Tue, 24 Apr 2018 20:49:17 +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 25709182E1; Tue, 24 Apr 2018 20:49:17 +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 w3OKnHYc039931; Tue, 24 Apr 2018 20:49:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OKnHE7039930; Tue, 24 Apr 2018 20:49:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804242049.w3OKnHE7039930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 24 Apr 2018 20:49:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332973 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 332973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 20:49:17 -0000 Author: kib Date: Tue Apr 24 20:49:16 2018 New Revision: 332973 URL: https://svnweb.freebsd.org/changeset/base/332973 Log: Make the sysctl machdep.idle also a tunable. It is applied before it is possible for idle threads to execute on any CPU, allowing to work around against some bugs. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue Apr 24 20:33:08 2018 (r332972) +++ head/sys/x86/x86/cpu_machdep.c Tue Apr 24 20:49:16 2018 (r332973) @@ -636,13 +636,33 @@ idle_sysctl_available(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYPE_STRING | CTLFLAG_RD, 0, 0, idle_sysctl_available, "A", "list of available idle functions"); +static bool +idle_selector(const char *new_idle_name) +{ + int i; + + for (i = 0; idle_tbl[i].id_name != NULL; i++) { + if (strstr(idle_tbl[i].id_name, "mwait") && + (cpu_feature2 & CPUID2_MON) == 0) + continue; + if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && + cpu_idle_hook == NULL) + continue; + if (strcmp(idle_tbl[i].id_name, new_idle_name)) + continue; + cpu_idle_fn = idle_tbl[i].id_fn; + if (bootverbose) + printf("CPU idle set to %s\n", idle_tbl[i].id_name); + return (true); + } + return (false); +} + static int idle_sysctl(SYSCTL_HANDLER_ARGS) { - char buf[16]; - int error; - char *p; - int i; + char buf[16], *p; + int error, i; p = "unknown"; for (i = 0; idle_tbl[i].id_name != NULL; i++) { @@ -655,23 +675,21 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) return (error); - for (i = 0; idle_tbl[i].id_name != NULL; i++) { - if (strstr(idle_tbl[i].id_name, "mwait") && - (cpu_feature2 & CPUID2_MON) == 0) - continue; - if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && - cpu_idle_hook == NULL) - continue; - if (strcmp(idle_tbl[i].id_name, buf)) - continue; - cpu_idle_fn = idle_tbl[i].id_fn; - return (0); - } - return (EINVAL); + return (idle_selector(buf) ? 0 : EINVAL); } SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, idle_sysctl, "A", "currently selected idle function"); + +static void +idle_tun(void *unused __unused) +{ + char tunvar[16]; + + if (TUNABLE_STR_FETCH("machdep.idle", tunvar, sizeof(tunvar))) + idle_selector(tunvar); +} +SYSINIT(idle_tun, SI_SUB_CPU, SI_ORDER_MIDDLE, idle_tun, NULL); static int panic_on_nmi = 1; SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN, From owner-svn-src-head@freebsd.org Tue Apr 24 21:15:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E230FB36E0; Tue, 24 Apr 2018 21:15:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1D257AD4E; Tue, 24 Apr 2018 21:15:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACADE1D646; Tue, 24 Apr 2018 21:15:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OLFsfb054582; Tue, 24 Apr 2018 21:15:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OLFs7J054576; Tue, 24 Apr 2018 21:15:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804242115.w3OLFs7J054576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 24 Apr 2018 21:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332974 - in head/sys: amd64/include kern vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/include kern vm X-SVN-Commit-Revision: 332974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 21:15:55 -0000 Author: markj Date: Tue Apr 24 21:15:54 2018 New Revision: 332974 URL: https://svnweb.freebsd.org/changeset/base/332974 Log: Improve VM page queue scalability. Currently both the page lock and a page queue lock must be held in order to enqueue, dequeue or requeue a page in a given page queue. The queue locks are a scalability bottleneck in many workloads. This change reduces page queue lock contention by batching queue operations. To detangle the page and page queue locks, per-CPU batch queues are used to reference pages with pending queue operations. The requested operation is encoded in the page's aflags field with the page lock held, after which the page is enqueued for a deferred batch operation. Page queue scans are similarly optimized to minimize the amount of work performed with a page queue lock held. Reviewed by: kib, jeff (previous versions) Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14893 Modified: head/sys/amd64/include/vmparam.h head/sys/kern/subr_witness.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_pagequeue.h head/sys/vm/vm_phys.c head/sys/vm/vm_swapout.c Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Tue Apr 24 20:49:16 2018 (r332973) +++ head/sys/amd64/include/vmparam.h Tue Apr 24 21:15:54 2018 (r332974) @@ -227,4 +227,10 @@ #define ZERO_REGION_SIZE (2 * 1024 * 1024) /* 2MB */ +/* + * Use a fairly large batch size since we expect amd64 systems to have lots of + * memory. + */ +#define VM_BATCHQUEUE_SIZE 31 + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Apr 24 20:49:16 2018 (r332973) +++ head/sys/kern/subr_witness.c Tue Apr 24 21:15:54 2018 (r332974) @@ -603,7 +603,6 @@ static struct witness_order_list_entry order_lists[] = * CDEV */ { "vm map (system)", &lock_class_mtx_sleep }, - { "vm pagequeue", &lock_class_mtx_sleep }, { "vnode interlock", &lock_class_mtx_sleep }, { "cdev", &lock_class_mtx_sleep }, { NULL, NULL }, @@ -613,11 +612,11 @@ static struct witness_order_list_entry order_lists[] = { "vm map (user)", &lock_class_sx }, { "vm object", &lock_class_rw }, { "vm page", &lock_class_mtx_sleep }, - { "vm pagequeue", &lock_class_mtx_sleep }, { "pmap pv global", &lock_class_rw }, { "pmap", &lock_class_mtx_sleep }, { "pmap pv list", &lock_class_rw }, { "vm page free queue", &lock_class_mtx_sleep }, + { "vm pagequeue", &lock_class_mtx_sleep }, { NULL, NULL }, /* * kqueue/VFS interaction Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Apr 24 20:49:16 2018 (r332973) +++ head/sys/vm/vm_object.c Tue Apr 24 21:15:54 2018 (r332974) @@ -720,14 +720,11 @@ static void vm_object_terminate_pages(vm_object_t object) { vm_page_t p, p_next; - struct mtx *mtx, *mtx1; - struct vm_pagequeue *pq, *pq1; - int dequeued; + struct mtx *mtx; VM_OBJECT_ASSERT_WLOCKED(object); mtx = NULL; - pq = NULL; /* * Free any remaining pageable pages. This also removes them from the @@ -737,60 +734,21 @@ vm_object_terminate_pages(vm_object_t object) */ TAILQ_FOREACH_SAFE(p, &object->memq, listq, p_next) { vm_page_assert_unbusied(p); - if ((object->flags & OBJ_UNMANAGED) == 0) { + if ((object->flags & OBJ_UNMANAGED) == 0) /* * vm_page_free_prep() only needs the page * lock for managed pages. */ - mtx1 = vm_page_lockptr(p); - if (mtx1 != mtx) { - if (mtx != NULL) - mtx_unlock(mtx); - if (pq != NULL) { - vm_pagequeue_cnt_add(pq, dequeued); - vm_pagequeue_unlock(pq); - pq = NULL; - } - mtx = mtx1; - mtx_lock(mtx); - } - } + vm_page_change_lock(p, &mtx); p->object = NULL; if (p->wire_count != 0) - goto unlist; - VM_CNT_INC(v_pfree); - p->flags &= ~PG_ZERO; - if (p->queue != PQ_NONE) { - KASSERT(p->queue < PQ_COUNT, ("vm_object_terminate: " - "page %p is not queued", p)); - pq1 = vm_page_pagequeue(p); - if (pq != pq1) { - if (pq != NULL) { - vm_pagequeue_cnt_add(pq, dequeued); - vm_pagequeue_unlock(pq); - } - pq = pq1; - vm_pagequeue_lock(pq); - dequeued = 0; - } - p->queue = PQ_NONE; - TAILQ_REMOVE(&pq->pq_pl, p, plinks.q); - dequeued--; - } - if (vm_page_free_prep(p, true)) continue; -unlist: - TAILQ_REMOVE(&object->memq, p, listq); + VM_CNT_INC(v_pfree); + vm_page_free(p); } - if (pq != NULL) { - vm_pagequeue_cnt_add(pq, dequeued); - vm_pagequeue_unlock(pq); - } if (mtx != NULL) mtx_unlock(mtx); - vm_page_free_phys_pglist(&object->memq); - /* * If the object contained any pages, then reset it to an empty state. * None of the object's fields, including "resident_page_count", were @@ -1973,7 +1931,6 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t { vm_page_t p, next; struct mtx *mtx; - struct pglist pgl; VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_UNMANAGED) == 0 || @@ -1982,7 +1939,6 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t if (object->resident_page_count == 0) return; vm_object_pip_add(object, 1); - TAILQ_INIT(&pgl); again: p = vm_page_find_least(object, start); mtx = NULL; @@ -2036,13 +1992,10 @@ again: } if ((options & OBJPR_NOTMAPPED) == 0 && object->ref_count != 0) pmap_remove_all(p); - p->flags &= ~PG_ZERO; - if (vm_page_free_prep(p, false)) - TAILQ_INSERT_TAIL(&pgl, p, listq); + vm_page_free(p); } if (mtx != NULL) mtx_unlock(mtx); - vm_page_free_phys_pglist(&pgl); vm_object_pip_wakeup(object); } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Apr 24 20:49:16 2018 (r332973) +++ head/sys/vm/vm_page.c Tue Apr 24 21:15:54 2018 (r332974) @@ -102,6 +102,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -131,13 +132,10 @@ extern int uma_startup_count(int); extern void uma_startup(void *, int); extern int vmem_startup_count(void); -/* - * Associated with page of user-allocatable memory is a - * page structure. - */ - struct vm_domain vm_dom[MAXMEMDOM]; +static DPCPU_DEFINE(struct vm_batchqueue, pqbatch[MAXMEMDOM][PQ_COUNT]); + struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT]; struct mtx_padalign __exclusive_cache_line vm_domainset_lock; @@ -176,7 +174,8 @@ static uma_zone_t fakepg_zone; static void vm_page_alloc_check(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); -static void vm_page_enqueue(uint8_t queue, vm_page_t m); +static void vm_page_dequeue_complete(vm_page_t m); +static void vm_page_enqueue(vm_page_t m, uint8_t queue); static void vm_page_init(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); @@ -443,12 +442,13 @@ sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARGS) * Nonetheless, it write busies and initializes the hold count to one as * safety precautions. */ -void -vm_page_init_marker(vm_page_t marker, int queue) +static void +vm_page_init_marker(vm_page_t marker, int queue, uint8_t aflags) { bzero(marker, sizeof(*marker)); marker->flags = PG_MARKER; + marker->aflags = aflags; marker->busy_lock = VPB_SINGLE_EXCLUSIVER; marker->queue = queue; marker->hold_count = 1; @@ -481,14 +481,32 @@ vm_page_domain_init(int domain) TAILQ_INIT(&pq->pq_pl); mtx_init(&pq->pq_mutex, pq->pq_name, "vm pagequeue", MTX_DEF | MTX_DUPOK); - vm_page_init_marker(&vmd->vmd_markers[i], i); + vm_page_init_marker(&vmd->vmd_markers[i], i, 0); } mtx_init(&vmd->vmd_free_mtx, "vm page free queue", NULL, MTX_DEF); mtx_init(&vmd->vmd_pageout_mtx, "vm pageout lock", NULL, MTX_DEF); - vm_page_init_marker(&vmd->vmd_inacthead, PQ_INACTIVE); + snprintf(vmd->vmd_name, sizeof(vmd->vmd_name), "%d", domain); + + /* + * inacthead is used to provide FIFO ordering for LRU-bypassing + * insertions. + */ + vm_page_init_marker(&vmd->vmd_inacthead, PQ_INACTIVE, PGA_ENQUEUED); TAILQ_INSERT_HEAD(&vmd->vmd_pagequeues[PQ_INACTIVE].pq_pl, &vmd->vmd_inacthead, plinks.q); - snprintf(vmd->vmd_name, sizeof(vmd->vmd_name), "%d", domain); + + /* + * The clock pages are used to implement active queue scanning without + * requeues. Scans start at clock[0], which is advanced after the scan + * ends. When the two clock hands meet, they are reset and scanning + * resumes from the head of the queue. + */ + vm_page_init_marker(&vmd->vmd_clock[0], PQ_ACTIVE, PGA_ENQUEUED); + vm_page_init_marker(&vmd->vmd_clock[1], PQ_ACTIVE, PGA_ENQUEUED); + TAILQ_INSERT_HEAD(&vmd->vmd_pagequeues[PQ_ACTIVE].pq_pl, + &vmd->vmd_clock[0], plinks.q); + TAILQ_INSERT_TAIL(&vmd->vmd_pagequeues[PQ_ACTIVE].pq_pl, + &vmd->vmd_clock[1], plinks.q); } /* @@ -1847,6 +1865,7 @@ again: KASSERT(m != NULL, ("missing page")); found: + vm_page_dequeue(m); vm_page_alloc_check(m); /* @@ -2043,8 +2062,10 @@ again: #if VM_NRESERVLEVEL > 0 found: #endif - for (m = m_ret; m < &m_ret[npages]; m++) + for (m = m_ret; m < &m_ret[npages]; m++) { + vm_page_dequeue(m); vm_page_alloc_check(m); + } /* * Initialize the pages. Only the PG_ZERO flag is inherited. @@ -2188,6 +2209,7 @@ again: goto again; return (NULL); } + vm_page_dequeue(m); vm_page_alloc_check(m); /* @@ -2381,7 +2403,7 @@ retry: vm_reserv_size(level)) - pa); #endif } else if (object->memattr == VM_MEMATTR_DEFAULT && - m->queue != PQ_NONE && !vm_page_busied(m)) { + vm_page_enqueued(m) && !vm_page_busied(m)) { /* * The page is allocated but eligible for * relocation. Extend the current run by one @@ -2532,7 +2554,7 @@ retry: error = EINVAL; else if (object->memattr != VM_MEMATTR_DEFAULT) error = EINVAL; - else if (m->queue != PQ_NONE && !vm_page_busied(m)) { + else if (vm_page_enqueued(m) && !vm_page_busied(m)) { KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("page %p has an unexpected memattr", m)); @@ -2592,7 +2614,8 @@ retry: */ if (object->ref_count != 0) pmap_remove_all(m); - m_new->aflags = m->aflags; + m_new->aflags = m->aflags & + ~PGA_QUEUE_STATE_MASK; KASSERT(m_new->oflags == VPO_UNMANAGED, ("page %p is managed", m_new)); m_new->oflags = m->oflags & VPO_NOSYNC; @@ -2604,7 +2627,7 @@ retry: vm_page_remque(m); vm_page_replace_checked(m_new, object, m->pindex, m); - if (vm_page_free_prep(m, false)) + if (vm_page_free_prep(m)) SLIST_INSERT_HEAD(&free, m, plinks.s.ss); @@ -2618,7 +2641,7 @@ retry: m->flags &= ~PG_ZERO; vm_page_remque(m); vm_page_remove(m); - if (vm_page_free_prep(m, false)) + if (vm_page_free_prep(m)) SLIST_INSERT_HEAD(&free, m, plinks.s.ss); KASSERT(m->dirty == 0, @@ -3061,113 +3084,297 @@ vm_page_pagequeue(vm_page_t m) return (&vm_pagequeue_domain(m)->vmd_pagequeues[m->queue]); } +static struct mtx * +vm_page_pagequeue_lockptr(vm_page_t m) +{ + + if (m->queue == PQ_NONE) + return (NULL); + return (&vm_page_pagequeue(m)->pq_mutex); +} + +static inline void +vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_page_t m) +{ + struct vm_domain *vmd; + uint8_t aflags; + + vm_pagequeue_assert_locked(pq); + KASSERT(pq == vm_page_pagequeue(m), + ("page %p doesn't belong to %p", m, pq)); + + aflags = m->aflags; + if ((aflags & PGA_DEQUEUE) != 0) { + if (__predict_true((aflags & PGA_ENQUEUED) != 0)) { + TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); + vm_pagequeue_cnt_dec(pq); + } + vm_page_dequeue_complete(m); + } else if ((aflags & (PGA_REQUEUE | PGA_REQUEUE_HEAD)) != 0) { + if ((aflags & PGA_ENQUEUED) != 0) + TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); + else { + vm_pagequeue_cnt_inc(pq); + vm_page_aflag_set(m, PGA_ENQUEUED); + } + if ((aflags & PGA_REQUEUE_HEAD) != 0) { + KASSERT(m->queue == PQ_INACTIVE, + ("head enqueue not supported for page %p", m)); + vmd = vm_pagequeue_domain(m); + TAILQ_INSERT_BEFORE(&vmd->vmd_inacthead, m, plinks.q); + } else + TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); + + /* + * PGA_REQUEUE and PGA_REQUEUE_HEAD must be cleared after + * setting PGA_ENQUEUED in order to synchronize with the + * page daemon. + */ + vm_page_aflag_clear(m, PGA_REQUEUE | PGA_REQUEUE_HEAD); + } +} + +static void +vm_pqbatch_process(struct vm_pagequeue *pq, struct vm_batchqueue *bq, + uint8_t queue) +{ + vm_page_t m; + int i; + + for (i = 0; i < bq->bq_cnt; i++) { + m = bq->bq_pa[i]; + if (__predict_false(m->queue != queue)) + continue; + vm_pqbatch_process_page(pq, m); + } + vm_batchqueue_init(bq); +} + +static void +vm_pqbatch_submit_page(vm_page_t m, uint8_t queue) +{ + struct vm_batchqueue *bq; + struct vm_pagequeue *pq; + int domain; + + vm_page_assert_locked(m); + KASSERT(queue < PQ_COUNT, ("invalid queue %d", queue)); + + domain = vm_phys_domain(m); + pq = &vm_pagequeue_domain(m)->vmd_pagequeues[queue]; + + critical_enter(); + bq = DPCPU_PTR(pqbatch[domain][queue]); + if (vm_batchqueue_insert(bq, m)) { + critical_exit(); + return; + } + if (!vm_pagequeue_trylock(pq)) { + critical_exit(); + vm_pagequeue_lock(pq); + critical_enter(); + bq = DPCPU_PTR(pqbatch[domain][queue]); + } + vm_pqbatch_process(pq, bq, queue); + + /* + * The page may have been logically dequeued before we acquired the + * page queue lock. In this case, the page lock prevents the page + * from being logically enqueued elsewhere. + */ + if (__predict_true(m->queue == queue)) + vm_pqbatch_process_page(pq, m); + else { + KASSERT(m->queue == PQ_NONE, + ("invalid queue transition for page %p", m)); + KASSERT((m->aflags & PGA_ENQUEUED) == 0, + ("page %p is enqueued with invalid queue index", m)); + vm_page_aflag_clear(m, PGA_QUEUE_STATE_MASK); + } + vm_pagequeue_unlock(pq); + critical_exit(); +} + /* - * vm_page_dequeue: + * vm_page_drain_pqbatch: [ internal use only ] * - * Remove the given page from its current page queue. + * Force all per-CPU page queue batch queues to be drained. This is + * intended for use in severe memory shortages, to ensure that pages + * do not remain stuck in the batch queues. + */ +void +vm_page_drain_pqbatch(void) +{ + struct thread *td; + struct vm_domain *vmd; + struct vm_pagequeue *pq; + int cpu, domain, queue; + + td = curthread; + CPU_FOREACH(cpu) { + thread_lock(td); + sched_bind(td, cpu); + thread_unlock(td); + + for (domain = 0; domain < vm_ndomains; domain++) { + vmd = VM_DOMAIN(domain); + for (queue = 0; queue < PQ_COUNT; queue++) { + pq = &vmd->vmd_pagequeues[queue]; + vm_pagequeue_lock(pq); + critical_enter(); + vm_pqbatch_process(pq, + DPCPU_PTR(pqbatch[domain][queue]), queue); + critical_exit(); + vm_pagequeue_unlock(pq); + } + } + } + thread_lock(td); + sched_unbind(td); + thread_unlock(td); +} + +/* + * Complete the logical removal of a page from a page queue. We must be + * careful to synchronize with the page daemon, which may be concurrently + * examining the page with only the page lock held. The page must not be + * in a state where it appears to be logically enqueued. + */ +static void +vm_page_dequeue_complete(vm_page_t m) +{ + + m->queue = PQ_NONE; + atomic_thread_fence_rel(); + vm_page_aflag_clear(m, PGA_QUEUE_STATE_MASK); +} + +/* + * vm_page_dequeue_deferred: [ internal use only ] * + * Request removal of the given page from its current page + * queue. Physical removal from the queue may be deferred + * indefinitely. + * * The page must be locked. */ void -vm_page_dequeue(vm_page_t m) +vm_page_dequeue_deferred(vm_page_t m) { - struct vm_pagequeue *pq; + int queue; vm_page_assert_locked(m); - KASSERT(m->queue < PQ_COUNT, ("vm_page_dequeue: page %p is not queued", - m)); - pq = vm_page_pagequeue(m); - vm_pagequeue_lock(pq); - m->queue = PQ_NONE; - TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - vm_pagequeue_cnt_dec(pq); - vm_pagequeue_unlock(pq); + + queue = m->queue; + if (queue == PQ_NONE) { + KASSERT((m->aflags & PGA_QUEUE_STATE_MASK) == 0, + ("page %p has queue state", m)); + return; + } + if ((m->aflags & PGA_DEQUEUE) == 0) + vm_page_aflag_set(m, PGA_DEQUEUE); + vm_pqbatch_submit_page(m, queue); } /* * vm_page_dequeue_locked: * - * Remove the given page from its current page queue. + * Remove the page from its page queue, which must be locked. + * If the page lock is not held, there is no guarantee that the + * page will not be enqueued by another thread before this function + * returns. In this case, it is up to the caller to ensure that + * no other threads hold a reference to the page. * - * The page and page queue must be locked. + * The page queue lock must be held. If the page is not already + * logically dequeued, the page lock must be held as well. */ void vm_page_dequeue_locked(vm_page_t m) { struct vm_pagequeue *pq; - vm_page_lock_assert(m, MA_OWNED); pq = vm_page_pagequeue(m); + + KASSERT(m->queue != PQ_NONE, + ("%s: page %p queue field is PQ_NONE", __func__, m)); vm_pagequeue_assert_locked(pq); - m->queue = PQ_NONE; - TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - vm_pagequeue_cnt_dec(pq); + KASSERT((m->aflags & PGA_DEQUEUE) != 0 || + mtx_owned(vm_page_lockptr(m)), + ("%s: queued unlocked page %p", __func__, m)); + + if ((m->aflags & PGA_ENQUEUED) != 0) { + TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); + vm_pagequeue_cnt_dec(pq); + } + vm_page_dequeue_complete(m); } /* - * vm_page_enqueue: + * vm_page_dequeue: * - * Add the given page to the specified page queue. - * - * The page must be locked. + * Remove the page from whichever page queue it's in, if any. + * If the page lock is not held, there is no guarantee that the + * page will not be enqueued by another thread before this function + * returns. In this case, it is up to the caller to ensure that + * no other threads hold a reference to the page. */ -static void -vm_page_enqueue(uint8_t queue, vm_page_t m) +void +vm_page_dequeue(vm_page_t m) { - struct vm_pagequeue *pq; + struct mtx *lock, *lock1; - vm_page_lock_assert(m, MA_OWNED); - KASSERT(queue < PQ_COUNT, - ("vm_page_enqueue: invalid queue %u request for page %p", - queue, m)); - pq = &vm_pagequeue_domain(m)->vmd_pagequeues[queue]; - vm_pagequeue_lock(pq); - m->queue = queue; - TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - vm_pagequeue_cnt_inc(pq); - vm_pagequeue_unlock(pq); + lock = vm_page_pagequeue_lockptr(m); + for (;;) { + if (lock == NULL) + return; + mtx_lock(lock); + if ((lock1 = vm_page_pagequeue_lockptr(m)) == lock) + break; + mtx_unlock(lock); + lock = lock1; + } + KASSERT(lock == vm_page_pagequeue_lockptr(m), + ("%s: page %p migrated directly between queues", __func__, m)); + vm_page_dequeue_locked(m); + mtx_unlock(lock); } /* - * vm_page_requeue: - * - * Move the given page to the tail of its current page queue. - * - * The page must be locked. + * Schedule the given page for insertion into the specified page queue. + * Physical insertion of the page may be deferred indefinitely. */ -void -vm_page_requeue(vm_page_t m) +static void +vm_page_enqueue(vm_page_t m, uint8_t queue) { - struct vm_pagequeue *pq; - vm_page_lock_assert(m, MA_OWNED); - KASSERT(m->queue != PQ_NONE, - ("vm_page_requeue: page %p is not queued", m)); - pq = vm_page_pagequeue(m); - vm_pagequeue_lock(pq); - TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - vm_pagequeue_unlock(pq); + vm_page_assert_locked(m); + KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0, + ("%s: page %p is already enqueued", __func__, m)); + + m->queue = queue; + if ((m->aflags & PGA_REQUEUE) == 0) + vm_page_aflag_set(m, PGA_REQUEUE); + vm_pqbatch_submit_page(m, queue); } /* - * vm_page_requeue_locked: + * vm_page_requeue: [ internal use only ] * - * Move the given page to the tail of its current page queue. + * Schedule a requeue of the given page. * - * The page queue must be locked. + * The page must be locked. */ void -vm_page_requeue_locked(vm_page_t m) +vm_page_requeue(vm_page_t m) { - struct vm_pagequeue *pq; + vm_page_assert_locked(m); KASSERT(m->queue != PQ_NONE, - ("vm_page_requeue_locked: page %p is not queued", m)); - pq = vm_page_pagequeue(m); - vm_pagequeue_assert_locked(pq); - TAILQ_REMOVE(&pq->pq_pl, m, plinks.q); - TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); + ("%s: page %p is not logically enqueued", __func__, m)); + + if ((m->aflags & PGA_REQUEUE) == 0) + vm_page_aflag_set(m, PGA_REQUEUE); + vm_pqbatch_submit_page(m, m->queue); } /* @@ -3185,18 +3392,18 @@ vm_page_activate(vm_page_t m) int queue; vm_page_lock_assert(m, MA_OWNED); - if ((queue = m->queue) != PQ_ACTIVE) { - if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { - if (m->act_count < ACT_INIT) - m->act_count = ACT_INIT; - if (queue != PQ_NONE) - vm_page_dequeue(m); - vm_page_enqueue(PQ_ACTIVE, m); - } - } else { - if (m->act_count < ACT_INIT) + + if ((queue = m->queue) == PQ_ACTIVE || m->wire_count > 0 || + (m->oflags & VPO_UNMANAGED) != 0) { + if (queue == PQ_ACTIVE && m->act_count < ACT_INIT) m->act_count = ACT_INIT; + return; } + + vm_page_remque(m); + if (m->act_count < ACT_INIT) + m->act_count = ACT_INIT; + vm_page_enqueue(m, PQ_ACTIVE); } /* @@ -3207,11 +3414,10 @@ vm_page_activate(vm_page_t m) * the page to the free list only if this function returns true. * * The object must be locked. The page must be locked if it is - * managed. For a queued managed page, the pagequeue_locked - * argument specifies whether the page queue is already locked. + * managed. */ bool -vm_page_free_prep(vm_page_t m, bool pagequeue_locked) +vm_page_free_prep(vm_page_t m) { #if defined(DIAGNOSTIC) && defined(PHYS_TO_DMAP) @@ -3227,14 +3433,14 @@ vm_page_free_prep(vm_page_t m, bool pagequeue_locked) if ((m->oflags & VPO_UNMANAGED) == 0) { vm_page_lock_assert(m, MA_OWNED); KASSERT(!pmap_page_is_mapped(m), - ("vm_page_free_toq: freeing mapped page %p", m)); + ("vm_page_free_prep: freeing mapped page %p", m)); } else KASSERT(m->queue == PQ_NONE, - ("vm_page_free_toq: unmanaged page %p is queued", m)); + ("vm_page_free_prep: unmanaged page %p is queued", m)); VM_CNT_INC(v_tfree); if (vm_page_sbusied(m)) - panic("vm_page_free: freeing busy page %p", m); + panic("vm_page_free_prep: freeing busy page %p", m); vm_page_remove(m); @@ -3250,21 +3456,23 @@ vm_page_free_prep(vm_page_t m, bool pagequeue_locked) return (false); } - if (m->queue != PQ_NONE) { - if (pagequeue_locked) - vm_page_dequeue_locked(m); - else - vm_page_dequeue(m); - } + /* + * Pages need not be dequeued before they are returned to the physical + * memory allocator, but they must at least be marked for a deferred + * dequeue. + */ + if ((m->oflags & VPO_UNMANAGED) == 0) + vm_page_dequeue_deferred(m); + m->valid = 0; vm_page_undirty(m); if (m->wire_count != 0) - panic("vm_page_free: freeing wired page %p", m); + panic("vm_page_free_prep: freeing wired page %p", m); if (m->hold_count != 0) { m->flags &= ~PG_ZERO; KASSERT((m->flags & PG_UNHOLDFREE) == 0, - ("vm_page_free: freeing PG_UNHOLDFREE page %p", m)); + ("vm_page_free_prep: freeing PG_UNHOLDFREE page %p", m)); m->flags |= PG_UNHOLDFREE; return (false); } @@ -3283,36 +3491,6 @@ vm_page_free_prep(vm_page_t m, bool pagequeue_locked) return (true); } -void -vm_page_free_phys_pglist(struct pglist *tq) -{ - struct vm_domain *vmd; - vm_page_t m; - int cnt; - - if (TAILQ_EMPTY(tq)) - return; - vmd = NULL; - cnt = 0; - TAILQ_FOREACH(m, tq, listq) { - if (vmd != vm_pagequeue_domain(m)) { - if (vmd != NULL) { - vm_domain_free_unlock(vmd); - vm_domain_freecnt_inc(vmd, cnt); - cnt = 0; - } - vmd = vm_pagequeue_domain(m); - vm_domain_free_lock(vmd); - } - vm_phys_free_pages(m, 0); - cnt++; - } - if (vmd != NULL) { - vm_domain_free_unlock(vmd); - vm_domain_freecnt_inc(vmd, cnt); - } -} - /* * vm_page_free_toq: * @@ -3327,7 +3505,7 @@ vm_page_free_toq(vm_page_t m) { struct vm_domain *vmd; - if (!vm_page_free_prep(m, false)) + if (!vm_page_free_prep(m)) return; vmd = vm_pagequeue_domain(m); @@ -3425,22 +3603,25 @@ vm_page_unwire(vm_page_t m, uint8_t queue) KASSERT(queue < PQ_COUNT || queue == PQ_NONE, ("vm_page_unwire: invalid queue %u request for page %p", queue, m)); + if ((m->oflags & VPO_UNMANAGED) == 0) + vm_page_assert_locked(m); unwired = vm_page_unwire_noq(m); - if (unwired && (m->oflags & VPO_UNMANAGED) == 0 && m->object != NULL) { - if (m->queue == queue) { + if (!unwired || (m->oflags & VPO_UNMANAGED) != 0 || m->object == NULL) + return (unwired); + + if (m->queue == queue) { + if (queue == PQ_ACTIVE) + vm_page_reference(m); + else if (queue != PQ_NONE) + vm_page_requeue(m); + } else { + vm_page_dequeue(m); + if (queue != PQ_NONE) { + vm_page_enqueue(m, queue); if (queue == PQ_ACTIVE) - vm_page_reference(m); - else if (queue != PQ_NONE) - vm_page_requeue(m); - } else { - vm_page_remque(m); - if (queue != PQ_NONE) { - vm_page_enqueue(queue, m); - if (queue == PQ_ACTIVE) - /* Initialize act_count. */ - vm_page_activate(m); - } + /* Initialize act_count. */ + vm_page_activate(m); } } return (unwired); @@ -3476,65 +3657,32 @@ vm_page_unwire_noq(vm_page_t m) } /* - * Move the specified page to the inactive queue, or requeue the page if it is - * already in the inactive queue. + * Move the specified page to the tail of the inactive queue, or requeue + * the page if it is already in the inactive queue. * - * Normally, "noreuse" is FALSE, resulting in LRU ordering of the inactive - * queue. However, setting "noreuse" to TRUE will accelerate the specified - * page's reclamation, but it will not unmap the page from any address space. - * This is implemented by inserting the page near the head of the inactive - * queue, using a marker page to guide FIFO insertion ordering. - * * The page must be locked. */ -static inline void -_vm_page_deactivate(vm_page_t m, boolean_t noreuse) +void +vm_page_deactivate(vm_page_t m) { - struct vm_pagequeue *pq; - int queue; vm_page_assert_locked(m); - if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { - pq = &vm_pagequeue_domain(m)->vmd_pagequeues[PQ_INACTIVE]; - /* Avoid multiple acquisitions of the inactive queue lock. */ - queue = m->queue; - if (queue == PQ_INACTIVE) { - vm_pagequeue_lock(pq); - vm_page_dequeue_locked(m); - } else { - if (queue != PQ_NONE) - vm_page_dequeue(m); - vm_pagequeue_lock(pq); - } - m->queue = PQ_INACTIVE; - if (noreuse) - TAILQ_INSERT_BEFORE( - &vm_pagequeue_domain(m)->vmd_inacthead, m, - plinks.q); - else - TAILQ_INSERT_TAIL(&pq->pq_pl, m, plinks.q); - vm_pagequeue_cnt_inc(pq); - vm_pagequeue_unlock(pq); - } -} + if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) + return; -/* - * Move the specified page to the inactive queue, or requeue the page if it is - * already in the inactive queue. - * - * The page must be locked. - */ -void -vm_page_deactivate(vm_page_t m) -{ - - _vm_page_deactivate(m, FALSE); + if (!vm_page_inactive(m)) { + vm_page_remque(m); + vm_page_enqueue(m, PQ_INACTIVE); + } else + vm_page_requeue(m); } /* - * Move the specified page to the inactive queue with the expectation - * that it is unlikely to be reused. + * Move the specified page close to the head of the inactive queue, + * bypassing LRU. A marker page is used to maintain FIFO ordering. + * As with regular enqueues, we use a per-CPU batch queue to reduce + * contention on the page queue lock. * * The page must be locked. */ @@ -3542,7 +3690,17 @@ void vm_page_deactivate_noreuse(vm_page_t m) { - _vm_page_deactivate(m, TRUE); + vm_page_assert_locked(m); + + if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) + return; + + if (!vm_page_inactive(m)) + vm_page_remque(m); + m->queue = PQ_INACTIVE; + if ((m->aflags & PGA_REQUEUE_HEAD) == 0) + vm_page_aflag_set(m, PGA_REQUEUE_HEAD); + vm_pqbatch_submit_page(m, PQ_INACTIVE); } /* @@ -3555,13 +3713,14 @@ vm_page_launder(vm_page_t m) { vm_page_assert_locked(m); - if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) { - if (m->queue == PQ_LAUNDRY) - vm_page_requeue(m); - else { - vm_page_remque(m); - vm_page_enqueue(PQ_LAUNDRY, m); - } + if (m->wire_count > 0 || (m->oflags & VPO_UNMANAGED) != 0) + return; + + if (m->queue == PQ_LAUNDRY) + vm_page_requeue(m); + else { + vm_page_remque(m); + vm_page_enqueue(m, PQ_LAUNDRY); } } @@ -3577,9 +3736,9 @@ vm_page_unswappable(vm_page_t m) vm_page_assert_locked(m); KASSERT(m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0, ("page %p already unswappable", m)); - if (m->queue != PQ_NONE) - vm_page_dequeue(m); - vm_page_enqueue(PQ_UNSWAPPABLE, m); + + vm_page_remque(m); + vm_page_enqueue(m, PQ_UNSWAPPABLE); } /* Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Apr 24 20:49:16 2018 (r332973) +++ head/sys/vm/vm_page.h Tue Apr 24 21:15:54 2018 (r332974) @@ -93,8 +93,11 @@ * * In general, operations on this structure's mutable fields are * synchronized using either one of or a combination of the lock on the - * object that the page belongs to (O), the pool lock for the page (P), - * or the lock for either the free or paging queue (Q). If a field is + * object that the page belongs to (O), the page lock (P), + * the per-domain lock for the free queues (F), or the page's queue + * lock (Q). The physical address of a page is used to select its page + * lock from a pool. The queue lock for a page depends on the value of + * its queue field and described in detail below. If a field is * annotated below with two of these locks, then holding either lock is * sufficient for read access, but both locks are required for write * access. An annotation of (C) indicates that the field is immutable. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Apr 24 23:20:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95D0FB6728; Tue, 24 Apr 2018 23:20:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA1D75FF4; Tue, 24 Apr 2018 23:20:15 +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 55F6121330; Tue, 24 Apr 2018 23:20:15 +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 w3ONKFQs014781; Tue, 24 Apr 2018 23:20:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ONKFAZ014780; Tue, 24 Apr 2018 23:20:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804242320.w3ONKFAZ014780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 23:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332975 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 332975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 23:20:15 -0000 Author: jhb Date: Tue Apr 24 23:20:15 2018 New Revision: 332975 URL: https://svnweb.freebsd.org/changeset/base/332975 Log: Document the TRAP_CAP code for SIGTRAP. MFC after: 3 days Modified: head/share/man/man3/siginfo.3 Modified: head/share/man/man3/siginfo.3 ============================================================================== --- head/share/man/man3/siginfo.3 Tue Apr 24 21:15:54 2018 (r332974) +++ head/share/man/man3/siginfo.3 Tue Apr 24 23:20:15 2018 (r332975) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2016 +.Dd April 24, 2018 .Dt SIGINFO 3 .Os .Sh NAME @@ -156,6 +156,8 @@ process breakpoint process trace trap .It Ta Dv TRAP_DTRACE Ta DTrace induced trap +.It Ta Dv TRAP_CAP Ta +capabilities protective trap .It Dv SIGCHLD Ta Dv CLD_EXITED Ta child has exited .It Ta Dv CLD_KILLED Ta From owner-svn-src-head@freebsd.org Tue Apr 24 23:22:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 333D2FB6A33; Tue, 24 Apr 2018 23:22:35 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE8F477644; Tue, 24 Apr 2018 23:22:34 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x242.google.com with SMTP id o64so21122126qkl.7; Tue, 24 Apr 2018 16:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VUWSEcjsZ+5lQGnbzYwpTuma7cZVLlMWiJ41GZCkxZo=; b=M60KhuZLUeOEc6ZaKKEM78i0jmuZcEpThqzBs3AVtLg82MnOxN3YEMojfHGxfr1xDP 85visAYzLFXkHkUDSdLgKAJ8O+u+VZCxuaYiocQ00Wea0WV/u1soUmA4BvV7oFP1TJ98 VBexDdvMJdDkcvmii5keAMcbOgm15E3lg2RAbWsWzPDmnc5FV7hoy2nyWktM8EPVqys1 29VeODcMOGAan8g3BahOaoFVKJYjhpuhzRNeXoe2Y+KymH8BZd57yMVGp2Hm8Ax3guxw dTyIDuqWDezhKFk6di/9Er0B7uoo7x6G7iSBaH3bLr+6HwTBXEBJgGAkSS2SbYOciOXJ Femw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VUWSEcjsZ+5lQGnbzYwpTuma7cZVLlMWiJ41GZCkxZo=; b=Zy8mjBMwCtBNRYCIOGbpVXbYNVYfMfU0vUywEO5rfd4ebfk5+xWpxtEbLiHma/uKP8 aS0vUpzoFDKfbGFV9mSnawBRQXq8VkYkb/IlppMpmw9wSe1S2kG8dlcolNqSLJfzyAHf 5VuJeCXVJ3UlS0zMe9DahaukxpcW9noXiz6mTEZPh6YddE1WjF5vVlk+Zz3yXmNwV8K+ ypV9RhAP80guRK8aFPpCjLh12aKbqO5MkV/x0+8iTHZ2bOs9KimI2cj8WYyXHu9DOWws JIBTXbci1lUQi+XqMiUQAh2cv9tY8UZZSVsMOXsUtuozSterkXlokf91xQtnalsnBS+8 GnyQ== X-Gm-Message-State: ALQs6tBLJM2ngsv3GoSWa++0kTa31TdMOfFBtg77Z4ncZXEJqk75r2DN yocbnOrTTlSxbDy6D7eWG1YYR1GBBBKzYtj6YZ8= X-Google-Smtp-Source: AB8JxZrUwGKr6qDsnmhElA2EZVUYYGfHL4yc9XRriEMtw3vPlfX04YgL0MUjecSFob71cywjTXmo2wG3ESPrZQ+MNiI= X-Received: by 10.233.224.8 with SMTP id m8mr5349161qkk.73.1524612154203; Tue, 24 Apr 2018 16:22:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.28.74 with HTTP; Tue, 24 Apr 2018 16:22:33 -0700 (PDT) In-Reply-To: <201804241841.w3OIfE0U074131@repo.freebsd.org> References: <201804241841.w3OIfE0U074131@repo.freebsd.org> From: Mateusz Guzik Date: Wed, 25 Apr 2018 01:22:33 +0200 Message-ID: Subject: Re: svn commit: r332957 - head/sys/kern To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 23:22:35 -0000 On Tue, Apr 24, 2018 at 8:41 PM, Conrad Meyer wrote: > Author: cem > Date: Tue Apr 24 18:41:14 2018 > New Revision: 332957 > URL: https://svnweb.freebsd.org/changeset/base/332957 > > Log: > lockmgr: Add missed neutering during panic > > r313683 introduced new lockmgr APIs that missed the panic-time neutering > present in the rest of our locks. Correct that by adding the usual > check. > > Additionally, move the __lockmgr_args neutering above the assertions at > the > top of the function. Drop the interlock unlock because we shouldn't have > an unneutered interlock either. No point trying to unlock it. > > PR: 227749 > Reported by: jtl > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/kern/kern_lock.c > > Modified: head/sys/kern/kern_lock.c > ============================================================ > ================== > --- head/sys/kern/kern_lock.c Tue Apr 24 18:19:30 2018 (r332956) > +++ head/sys/kern/kern_lock.c Tue Apr 24 18:41:14 2018 (r332957) > @@ -918,6 +918,9 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, s > u_int op; > bool locked; > > + if (__predict_false(panicstr != NULL)) > + return (0); > + > > This only further pollutes the slowpath. I mean fastpath. All the fallback funcs check for panic, so there is no need to do it in regular kernels at this level. Instead, the firing assertion should also see if perhaps the kernel already has panicked. Alternatively, the checks added here can be conditional on INVARIANTS. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Apr 24 23:22:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A9D9FB6A64; Tue, 24 Apr 2018 23:22:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E0757783C; Tue, 24 Apr 2018 23:22:45 +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 ABD04214B6; Tue, 24 Apr 2018 23:22:45 +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 w3ONMjdJ019246; Tue, 24 Apr 2018 23:22:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ONMjVV019245; Tue, 24 Apr 2018 23:22:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804242322.w3ONMjVV019245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 24 Apr 2018 23:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332976 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 332976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 23:22:47 -0000 Author: jhb Date: Tue Apr 24 23:22:45 2018 New Revision: 332976 URL: https://svnweb.freebsd.org/changeset/base/332976 Log: Shorten some recently-added lines that are an extra indent over 80 columns. Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Tue Apr 24 23:20:15 2018 (r332975) +++ head/tests/sys/kern/ptrace_test.c Tue Apr 24 23:22:45 2018 (r332976) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); /* * Architectures with a user-visible breakpoint(). */ -#if defined(__amd64__) || defined(__i386__) || defined(__mips__) || \ +#if defined(__amd64__) || defined(__i386__) || defined(__mips__) || \ defined(__sparc64__) #define HAVE_BREAKPOINT #endif @@ -68,9 +68,9 @@ __FBSDID("$FreeBSD$"); #elif defined(__mips__) #define SKIP_BREAK(reg) ((reg)->r_regs[PC] += 4) #elif defined(__sparc64__) -#define SKIP_BREAK(reg) do { \ - (reg)->r_tpc = (reg)->r_tnpc + 4; \ - (reg)->r_tnpc += 8; \ +#define SKIP_BREAK(reg) do { \ + (reg)->r_tpc = (reg)->r_tnpc + 4; \ + (reg)->r_tnpc += 8; \ } while (0) #endif #endif From owner-svn-src-head@freebsd.org Tue Apr 24 23:22:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BA81FB6A9A; Tue, 24 Apr 2018 23:22:57 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 7871C77A32; Tue, 24 Apr 2018 23:22:56 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=50053 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fB0aT-000CzU-6F; Tue, 24 Apr 2018 16:14:37 +0000 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r332967 - in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys Date: Tue, 24 Apr 2018 16:22:48 -0700 In-Reply-To: <201804241958.w3OJwaJw056364@slippy.cwsent.com> Cc: Devin Teske , Sean Bruno , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Cy Schubert References: <201804241958.w3OJwaJw056364@slippy.cwsent.com> X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 23:22:57 -0000 > On Apr 24, 2018, at 12:58 PM, Cy Schubert = wrote: >=20 > In message <201804241955.w3OJtCls014127@repo.freebsd.org>, Sean Bruno=20= > writes: >> Author: sbruno >> Date: Tue Apr 24 19:55:12 2018 >> New Revision: 332967 >> URL: https://svnweb.freebsd.org/changeset/base/332967 >>=20 >> Log: >> Revert r332894 at the request of the submitter. >>=20 >> Submitted by: Johannes Lundberg >> Sponsored by: Limelight Networks >=20 > Hi Sean, >=20 > Why? Not that I agree or disagree with this commit specifically,=20 > including the reason why in the log might assist someone browsing=20 > through the log. >=20 Comments in phab review https://reviews.freebsd.org/D11003 = make it appear as though additional = changes are pending. --=20 Devin= From owner-svn-src-head@freebsd.org Tue Apr 24 23:26:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC317FB6D07; Tue, 24 Apr 2018 23:26:32 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 7E00A79102; Tue, 24 Apr 2018 23:26:32 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=50071 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1fB0e3-000D1t-OZ; Tue, 24 Apr 2018 16:18:19 +0000 From: Devin Teske Message-Id: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r332967 - in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys Date: Tue, 24 Apr 2018 16:26:30 -0700 In-Reply-To: Cc: Devin Teske , Sean Bruno , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Cy Schubert References: <201804241958.w3OJwaJw056364@slippy.cwsent.com> X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 23:26:33 -0000 > On Apr 24, 2018, at 4:22 PM, Devin Teske wrote: >=20 >>=20 >> On Apr 24, 2018, at 12:58 PM, Cy Schubert > wrote: >>=20 >> In message <201804241955.w3OJtCls014127@repo.freebsd.org = >, Sean Bruno=20 >> writes: >>> Author: sbruno >>> Date: Tue Apr 24 19:55:12 2018 >>> New Revision: 332967 >>> URL: https://svnweb.freebsd.org/changeset/base/332967 = >>>=20 >>> Log: >>> Revert r332894 at the request of the submitter. >>>=20 >>> Submitted by: Johannes Lundberg >>> Sponsored by: Limelight Networks >>=20 >> Hi Sean, >>=20 >> Why? Not that I agree or disagree with this commit specifically,=20 >> including the reason why in the log might assist someone browsing=20 >> through the log. >>=20 >=20 > Comments in phab review https://reviews.freebsd.org/D11003 = make it appear as though additional = changes are pending. Specifically, ... > On Apr 24, 2018, at 12:18 PM, Mark Johnston wrote: > A similar change is needed in udp.d. Without it, libdtrace fails to > compile its libraries when initializing a consumer, so dtrace(1) is > currently unusable on head without "-x nolibs". --=20 Devin= From owner-svn-src-head@freebsd.org Wed Apr 25 00:37:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EFA8FB8D29; Wed, 25 Apr 2018 00:37:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A1DE6BC64; Wed, 25 Apr 2018 00:37:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f171.google.com with SMTP id d6-v6so24915583iog.1; Tue, 24 Apr 2018 17:37:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Bys0zq9z/TU4jShK95oIeQ5q6dfC3fyi35cdL+hU958=; b=Cn2Q9/F2tTWByTfaCu/viMZ2StCdwtsQ9mIdsn3rshMt97oj/nD6c1nEvhMP7hbaJD cwnLfXCsB3vqoLNdsA0Xn0hNRMsbdGsXfaKDiNGxRtZGXQyYinqgqQA9/VlQDVNPeHrr p0pXU4SOrPDN4HxA+duw6ipTyTeL4VO47cjoX9Q6UHF8btWGle+DRz2j0Jbef6Ggb3yi Sc03gaFebHDh6CMcwfb2bGRxxG8wLsA7f0dirfiYqEv4q60BMY2tErts2kzNtzSrHtes R3C3AE7Dh1K8MfapGcPhZdL1wDR7JK/OHmN2Y1khYk+9xV5/TnpEnccwcKSAh65hqksi Q1sA== X-Gm-Message-State: ALQs6tCGu9hbBMB57lWFOz4kPaWn0PGqL1JD3lllWb3EbZvOzMV7O0c4 KChVhv3wMUquNqa44+HWMsDTfGrN X-Google-Smtp-Source: AB8JxZpI9n6QcnF0ClI+n10BtbJr/jiuEj20fREshmPp1ISXZj/r0JP0BdPJtmEF/mdijrGZV4G+5w== X-Received: by 2002:a6b:2f1e:: with SMTP id j30-v6mr27499255ioo.222.1524614744868; Tue, 24 Apr 2018 17:05:44 -0700 (PDT) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com. [209.85.223.170]) by smtp.gmail.com with ESMTPSA id n142-v6sm6047638itn.38.2018.04.24.17.05.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 17:05:44 -0700 (PDT) Received: by mail-io0-f170.google.com with SMTP id t23-v6so11876616ioc.10; Tue, 24 Apr 2018 17:05:44 -0700 (PDT) X-Received: by 2002:a6b:da04:: with SMTP id x4-v6mr19248152iob.19.1524614744313; Tue, 24 Apr 2018 17:05:44 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:224d:0:0:0:0:0 with HTTP; Tue, 24 Apr 2018 17:05:43 -0700 (PDT) In-Reply-To: References: <201804241841.w3OIfE0U074131@repo.freebsd.org> From: Conrad Meyer Date: Tue, 24 Apr 2018 17:05:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r332957 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 00:37:47 -0000 I am fine with any optimization to this path you like, so long as locks are neutered in panic and don't cause secondary panics. On Tue, Apr 24, 2018 at 4:22 PM, Mateusz Guzik wrote: > On Tue, Apr 24, 2018 at 8:41 PM, Conrad Meyer wrote: >> >> Author: cem >> Date: Tue Apr 24 18:41:14 2018 >> New Revision: 332957 >> URL: https://svnweb.freebsd.org/changeset/base/332957 >> >> Log: >> lockmgr: Add missed neutering during panic >> >> r313683 introduced new lockmgr APIs that missed the panic-time neutering >> present in the rest of our locks. Correct that by adding the usual >> check. >> >> Additionally, move the __lockmgr_args neutering above the assertions at >> the >> top of the function. Drop the interlock unlock because we shouldn't >> have >> an unneutered interlock either. No point trying to unlock it. >> >> PR: 227749 >> Reported by: jtl >> Sponsored by: Dell EMC Isilon >> >> Modified: >> head/sys/kern/kern_lock.c >> >> Modified: head/sys/kern/kern_lock.c >> >> ============================================================================== >> --- head/sys/kern/kern_lock.c Tue Apr 24 18:19:30 2018 (r332956) >> +++ head/sys/kern/kern_lock.c Tue Apr 24 18:41:14 2018 (r332957) >> @@ -918,6 +918,9 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, s >> u_int op; >> bool locked; >> >> + if (__predict_false(panicstr != NULL)) >> + return (0); >> + >> > > This only further pollutes the slowpath. I mean fastpath. All the fallback > funcs check for panic, so there is no need to do it in regular kernels at > this level. > > Instead, the firing assertion should also see if perhaps the kernel > already has panicked. > > Alternatively, the checks added here can be conditional on INVARIANTS. > > -- > Mateusz Guzik From owner-svn-src-head@freebsd.org Wed Apr 25 00:43:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFD0DFB90D3; Wed, 25 Apr 2018 00:43:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D2E26C0A8; Wed, 25 Apr 2018 00:43:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id B8WkfiHobXL8AB8Wlf1rhv; Tue, 24 Apr 2018 18:43:21 -0600 X-Authority-Analysis: v=2.3 cv=MfVCRa3f c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=Kd1tUaAdevIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=LkQLV2c5AAAA:8 a=pSzfVedxGQ2Z8OVss0gA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=B8rWm7P7DIhzdu2jYzZa:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 194CC1168; Tue, 24 Apr 2018 17:43:18 -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 w3P0hHbI004938; Tue, 24 Apr 2018 17:43:17 -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 w3P0hH9q004935; Tue, 24 Apr 2018 17:43:17 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201804250043.w3P0hH9q004935@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Devin Teske cc: Cy Schubert , Sean Bruno , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332967 - in head: cddl/lib/libdtrace sys/kern sys/netinet sys/netinet6 sys/sys In-Reply-To: Message from Devin Teske of "Tue, 24 Apr 2018 16:22:48 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 24 Apr 2018 17:43:17 -0700 X-CMAE-Envelope: MS4wfPH5/76Z/QkPn/3nxqhc7HYCDrM/GBsSeP391DI9kzIxNy37067X4QAZMErJ85b85dX+Zucc47k/tyOOPwq91aMrlw0vH/CEg8KS4lR6wkrS79zUznSb sjAo34g8PMLTaa9/0dkojdLqkC4BbPco1+gIU+RlnoWeW/ARPL8Mhqs6WqyyjVI6Bzx86Sg34xmHoTolMgvIVUdyRTZqfdrsO7aDRb0jPUnFHdcf/eB8eY5s v436SaR5fUJJeZXiWhX4nq9OQtYTWKNXBMn8UoRX7HTJHHciOrFETAZIYaUUrMBb5fwZY3O7FQ3prVTCfYLOY5drcaeAGJD1yEl7nwyMq6k= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 00:43:29 -0000 In message , Devin Teske writ es: > > > --Apple-Mail=_782CDA06-B0D5-4122-82C6-1541344DA2A3 > Content-Transfer-Encoding: quoted-printable > Content-Type: text/plain; > charset=us-ascii > > > > On Apr 24, 2018, at 12:58 PM, Cy Schubert = > wrote: > >=20 > > In message <201804241955.w3OJtCls014127@repo.freebsd.org>, Sean Bruno=20= > > > writes: > >> Author: sbruno > >> Date: Tue Apr 24 19:55:12 2018 > >> New Revision: 332967 > >> URL: https://svnweb.freebsd.org/changeset/base/332967 > >>=20 > >> Log: > >> Revert r332894 at the request of the submitter. > >>=20 > >> Submitted by: Johannes Lundberg > >> Sponsored by: Limelight Networks > >=20 > > Hi Sean, > >=20 > > Why? Not that I agree or disagree with this commit specifically,=20 > > including the reason why in the log might assist someone browsing=20 > > through the log. > >=20 > > Comments in phab review https://reviews.freebsd.org/D11003 = > make it appear as though additional = > changes are pending. Yes. Still would have been nice to have it documented. Oh well. -- 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-head@freebsd.org Wed Apr 25 02:42:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF9ABFBB25A; Wed, 25 Apr 2018 02:42:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BDC885A85; Wed, 25 Apr 2018 02:42:11 +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 66C4E23428; Wed, 25 Apr 2018 02:42:11 +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 w3P2gBLp018778; Wed, 25 Apr 2018 02:42:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P2gBCk018777; Wed, 25 Apr 2018 02:42:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201804250242.w3P2gBCk018777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 25 Apr 2018 02:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332984 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 332984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 02:42:11 -0000 Author: jhibbits Date: Wed Apr 25 02:42:11 2018 New Revision: 332984 URL: https://svnweb.freebsd.org/changeset/base/332984 Log: Increase the fdtmemreserv array limit to boot on POWER9 Discussing with others, this needs to be at least 20 to boot on some POWER9 nodes. Linux made a similar change for the same reason, so increase to 32 to give us some extra breathing room as well. The input and output arrays are sized at 256, so much greater than the increase in the property array size. Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Wed Apr 25 01:59:15 2018 (r332983) +++ head/sys/powerpc/ofw/ofw_machdep.c Wed Apr 25 02:42:11 2018 (r332984) @@ -230,7 +230,7 @@ excise_fdt_reserved(struct mem_region *avail, int asz) struct { uint64_t address; uint64_t size; - } fdtmap[16]; + } fdtmap[32]; ssize_t fdtmapsize; phandle_t chosen; int i, j, k; From owner-svn-src-head@freebsd.org Wed Apr 25 02:42:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33913FBB2DA; Wed, 25 Apr 2018 02:42:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D58EF85CE9; Wed, 25 Apr 2018 02:42:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D08FB23449; Wed, 25 Apr 2018 02:42:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3P2gvCe019724; Wed, 25 Apr 2018 02:42:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P2gvNL019723; Wed, 25 Apr 2018 02:42:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804250242.w3P2gvNL019723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Apr 2018 02:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332985 - head/stand/forth X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/forth X-SVN-Commit-Revision: 332985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 02:42:58 -0000 Author: kevans Date: Wed Apr 25 02:42:57 2018 New Revision: 332985 URL: https://svnweb.freebsd.org/changeset/base/332985 Log: forthloader: Remove "EFI boot environment message" Contrary to what the message says, this is not only executed in an EFI context- it provides functions for use in an EFI environment. I don't think there's much reason to broadcast this fact when we haven't in the past, so just remove it. Reported by: emaste (a while ago), cperciva Modified: head/stand/forth/efi.4th Modified: head/stand/forth/efi.4th ============================================================================== --- head/stand/forth/efi.4th Wed Apr 25 02:42:11 2018 (r332984) +++ head/stand/forth/efi.4th Wed Apr 25 02:42:57 2018 (r332985) @@ -37,5 +37,3 @@ only forth definitions s" efi-autoresizecons" evaluate then ; - -.( EFI boot environment) cr From owner-svn-src-head@freebsd.org Wed Apr 25 02:43:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93517FBB36D; Wed, 25 Apr 2018 02:43:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40D8C85E80; Wed, 25 Apr 2018 02:43:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B9052345B; Wed, 25 Apr 2018 02:43:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3P2hs46019802; Wed, 25 Apr 2018 02:43:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P2hs6m019801; Wed, 25 Apr 2018 02:43:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201804250243.w3P2hs6m019801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 25 Apr 2018 02:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332986 - head/usr.sbin/makefs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.sbin/makefs X-SVN-Commit-Revision: 332986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 02:43:54 -0000 Author: pfg Date: Wed Apr 25 02:43:53 2018 New Revision: 332986 URL: https://svnweb.freebsd.org/changeset/base/332986 Log: makefs: Use ENODATA instead of ENOMSG as a translation for missing ENOATTR. This is consistent with what some linux filesystems do and has been adopted in our linuxulator. MFC after: 3 days Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Wed Apr 25 02:42:57 2018 (r332985) +++ head/usr.sbin/makefs/mtree.c Wed Apr 25 02:43:53 2018 (r332986) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include "makefs.h" #ifndef ENOATTR -#define ENOATTR ENOMSG +#define ENOATTR ENODATA #endif #define IS_DOT(nm) ((nm)[0] == '.' && (nm)[1] == '\0') From owner-svn-src-head@freebsd.org Wed Apr 25 07:51:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D459FBF617; Wed, 25 Apr 2018 07:51:42 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E480F7E60D; Wed, 25 Apr 2018 07:51:41 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF89A2653B; Wed, 25 Apr 2018 07:51:41 +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 w3P7pfVe071376; Wed, 25 Apr 2018 07:51:41 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P7pf2Y071375; Wed, 25 Apr 2018 07:51:41 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201804250751.w3P7pf2Y071375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 25 Apr 2018 07:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332989 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 332989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 07:51:42 -0000 Author: lwhsu (ports committer) Date: Wed Apr 25 07:51:41 2018 New Revision: 332989 URL: https://svnweb.freebsd.org/changeset/base/332989 Log: Fix i386 build after r332970 by adding IS_BSP() definition. Approved by: kib Modified: head/sys/i386/include/pcpu.h Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Wed Apr 25 06:50:19 2018 (r332988) +++ head/sys/i386/include/pcpu.h Wed Apr 25 07:51:41 2018 (r332989) @@ -240,6 +240,8 @@ __curpcb(void) } #define curpcb (__curpcb()) +#define IS_BSP() (PCPU_GET(cpuid) == 0) + #else /* defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ #error "this file needs to be ported to your compiler" From owner-svn-src-head@freebsd.org Wed Apr 25 07:51:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B9F3FBF63B; Wed, 25 Apr 2018 07:51:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9856A7E65D; Wed, 25 Apr 2018 07:51:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 573BD2653F; Wed, 25 Apr 2018 07:51:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3P7pkQv071423; Wed, 25 Apr 2018 07:51:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P7pkYE071422; Wed, 25 Apr 2018 07:51:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201804250751.w3P7pkYE071422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 25 Apr 2018 07:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332990 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 332990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 07:51:50 -0000 Author: eadler Date: Wed Apr 25 07:51:45 2018 New Revision: 332990 URL: https://svnweb.freebsd.org/changeset/base/332990 Log: pci_vendors: update to 2018.04.06 Obtained from: https://pci-ids.ucw.cz/v2.2/pci.ids MFC After: 3 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Wed Apr 25 07:51:41 2018 (r332989) +++ head/share/misc/pci_vendors Wed Apr 25 07:51:45 2018 (r332990) @@ -2,8 +2,8 @@ # List of PCI ID's # -# Version: 2018.03.21 -# Date: 2018-03-21 03:15:01 +# Version: 2018.04.06 +# Date: 2018-04-06 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -421,6 +421,7 @@ 17aa 1052 ThinkServer RAID 720i 17aa 1053 ThinkServer RAID 720ix 1d49 0600 ThinkSystem RAID 730-8i 1GB Cache PCIe 12Gb Adapter + 1d49 0609 ThinkSystem RAID 730-8i 4GB Flash PCIe 12Gb Adapter 8086 351e RMS3CC080 RAID Controller 8086 351f RMS3CC040 RAID Controller 8086 9360 RS3DC080 RAID Controller @@ -858,7 +859,7 @@ 434d IXP AC'97 Modem 4353 SMBus 4354 215CT [Mach64 CT PCI] - 4358 210888CX [Mach64 CX] + 4358 Mach64 CX [Graphics Xpression] 4361 IXP SB300 AC'97 Audio Controller 4363 SMBus 436e 436E Serial ATA Controller @@ -1059,7 +1060,7 @@ 4437 RS250 [Mobility Radeon 7000 IGP] 4554 210888ET [Mach64 ET] 4654 Mach64 VT - 4742 3D Rage PRO AGP 2X + 4742 Rage 3 [3D Rage PRO AGP 2X] 1002 0040 Rage Pro Turbo AGP 2X 1002 0044 Rage Pro Turbo AGP 2X 1002 0061 Rage Pro AIW AGP 2X @@ -1075,7 +1076,7 @@ 1028 c082 Rage Pro Turbo AGP 2X 8086 4152 Xpert 98D AGP 2X 8086 464a Rage Pro Turbo AGP 2X - 4744 3D Rage PRO AGP 1X + 4744 Rage 3 [3D Rage PRO AGP 1X] 1002 4744 Rage Pro Turbo AGP 8086 4d55 Rage 3D Pro AGP 1X [Intel MU440EX] 4749 3D Rage PRO PCI @@ -1099,7 +1100,7 @@ 1002 0080 Rage Pro Turbo 1002 0084 Rage Pro Turbo 1002 4750 Rage Pro Turbo - 4752 Rage XL PCI + 4752 Rage 3 [Rage XL PCI] 0e11 001e Proliant Rage XL 1002 0008 Rage XL 1002 4752 Proliant Rage XL @@ -1121,19 +1122,19 @@ 8086 5744 S845WD1-E mainboard 4753 Rage XC 1002 4753 Rage XC - 4754 3D Rage II/II+ PCI [Mach64 GT] - 4755 Mach64 GTB [3D Rage II+ DVD] - 4756 3D Rage IIC PCI [Mach64 GT IIC] + 4754 Mach64 GT/GT-B [3D Rage I/II] + 4755 Mach64 GT-B [3D Rage II+ DVD] + 4756 Rage 2 [3D Rage IIC PCI] 1002 4756 Rage IIC - 4757 3D Rage IIC AGP + 4757 Rage 2 [3D Rage IIC AGP] 1002 4757 Rage IIC AGP 1028 0089 Rage 3D IIC 1028 008e PowerEdge 1300 onboard video 1028 4082 Rage 3D IIC 1028 8082 Rage 3D IIC 1028 c082 Rage 3D IIC - 4758 210888GX [Mach64 GX PCI] - 4759 3D Rage IIC PCI + 4758 Mach64 GX [WinTurbo] + 4759 Rage 3 [3D Rage IIC PCI] 475a 3D Rage IIC AGP 1002 0084 Rage 3D Pro AGP 2x XPERT 98 1002 0087 Rage 3D IIC @@ -1169,7 +1170,7 @@ 4b69 R481 [Radeon X850 XT AGP] (Secondary) 4b6b R481 [Radeon X850 PRO AGP] (Secondary) 4b6c R481 [Radeon X850 XT Platinum Edition AGP] (Secondary) - 4c42 3D Rage LT PRO AGP 2X + 4c42 Mach64 LT [3D Rage LT PRO AGP] 0e11 b0e7 Rage LT Pro (Compaq Presario 5240) 0e11 b0e8 Rage 3D LT Pro 0e11 b10e 3D Rage LT Pro (Compaq Armada 1750) @@ -1197,7 +1198,7 @@ 1028 00bb Latitude CPx 1179 ff00 Satellite 1715XCDS laptop 13bd 1019 PC-AR10 - 4c50 3D Rage LT PRO PCI + 4c50 Rage 3 LT [3D Rage LT PRO PCI] 1002 4c50 Rage LT Pro 4c52 Rage Mobility-M1 PCI 1033 8112 Versa Note VXi @@ -1267,7 +1268,7 @@ 5044 All-In-Wonder 128 PCI 1002 0028 Rage 128 AIW 1002 0029 Rage 128 AIW - 5046 Rage 128 PRO AGP 4x TMDS + 5046 Rage 4 [Rage 128 PRO AGP 4X TMDS] 1002 0004 Rage Fury Pro 1002 0008 Rage Fury Pro/Xpert 2000 Pro 1002 0014 Rage Fury Pro @@ -1367,7 +1368,7 @@ 1002 0028 Rage 128 AIW 1002 0029 Rage 128 AIW 1002 0068 Rage 128 AIW - 5246 Rage Fury/Xpert 128/Xpert 2000 AGP 2x + 5246 Rage 4 [Rage Fury/Xpert 128/Xpert 2000 AGP] 1002 0004 Magnum/Xpert 128/Xpert 99 1002 0008 Magnum/Xpert128/X99/Xpert2000 1002 0028 Rage 128 AIW AGP @@ -1425,10 +1426,10 @@ 5653 RV410/M26 [Mobility Radeon X700] 1025 0080 Aspire 5024WLMi 103c 0940 Compaq NW8240 Mobile Workstation - 5654 264VT [Mach64 VT] + 5654 Mach64 VT [Video Xpression] 1002 5654 Mach64VT Reference 5655 264VT3 [Mach64 VT3] - 5656 264VT4 [Mach64 VT4] + 5656 Mach64 VT4 [Video Xpression+] 5657 RV410 [Radeon X550 XTX / X700] 5830 RS300 Host Bridge 5831 RS300 Host Bridge @@ -1707,6 +1708,12 @@ 17aa 368f Radeon R5 A230 6667 Jet ULT [Radeon R5 M230] 666f Sun LE [Radeon HD 8550M / R5 M230] + 66a0 Vega 20 + 66a1 Vega 20 + 66a2 Vega 20 + 66a3 Vega 20 + 66a7 Vega 20 + 66af Vega 20 6704 Cayman PRO GL [FirePro V7900] 6707 Cayman LE GL [FirePro V5900] 6718 Cayman XT [Radeon HD 6970] @@ -3534,6 +3541,7 @@ 17aa 5113 Radeon R6 Graphics 17aa 5116 Radeon R6 Graphics 17aa 5118 Radeon R5 Graphics + 98e4 Radeon R2 Graphics 9900 Trinity [Radeon HD 7660G] 103c 1985 Pavilion 17-e163sg Notebook PC # AMD A10-5800K CPU @@ -4779,6 +4787,7 @@ 102b 0f83 Millennium G550 102b 0f84 Millennium G550 Dual Head DDR 32Mb 102b 1e41 Millennium G550 + 102b 22c0 G550 PCIe 102b 2300 Millennium G550 LP PCIE 2537 Millennium P650/P750 102b 1820 Millennium P750 64MB @@ -6390,7 +6399,7 @@ 1077 0007 QLogic 2x1GE+2x10GE QL41264HMCU CNA 1077 0009 QLogic 2x1GE+2x10GE QL41162HMRJ CNA 1077 000b 25GE 2P QL41262HxCU-DE Adapter - 1077 0011 FastLinQ QL41212H 25GbE Adapter + 1077 0011 FastLinQ QL41212HLCU 25GbE Adapter 1077 0012 FastLinQ QL41112H 10GbE Adapter 1077 0039 QLogic QL41262 PCIe 25Gb 2-Port SFP28 Ethernet Adapter 1590 021d 10/25GbE 2P QL41222HLCU-HP Adapter @@ -8608,7 +8617,7 @@ 0098 G70M [GeForce Go 7800] 0099 G70M [GeForce Go 7800 GTX] 009d G70GL [Quadro FX 4500] - 00a0 NV5 [Aladdin TNT2] + 00a0 NV0A [Aladdin TNT2 IGP] 14af 5810 Maxi Gamer Xentor 00c0 NV41 [GeForce 6800 GS] 00c1 NV41 [GeForce 6800] @@ -8704,7 +8713,7 @@ 00f5 G71 [GeForce 7800 GS] 00f6 NV43 [GeForce 6800 GS/XT] 1682 217e XFX GeForce 6800 XTreme 256MB DDR3 AGP - 00f8 NV40GL [Quadro FX 3400/4400] + 00f8 NV45GL [Quadro FX 3400/4400] 00f9 NV40 [GeForce 6800 GT/GTO/Ultra] 10de 00f9 NV40 [GeForce 6800 GT] 1682 2120 GEFORCE 6800 GT PCI-E @@ -11067,6 +11076,7 @@ 1b01 GP102 1b02 GP102 [TITAN Xp] 1b06 GP102 [GeForce GTX 1080 Ti] + 1b07 GP102 [P102-100] 1b30 GP102GL [Quadro P6000] 1b38 GP102GL [Tesla P40] 1b70 GP102GL @@ -11137,8 +11147,12 @@ 1d72 1701 Mi Notebook Pro [GeForce MX150] 1d33 GP108GL [Quadro P500] 1d81 GV100 [TITAN V] - 1db1 GV100GL [Tesla V100 SXM2] - 1db4 GV100GL [Tesla V100 PCIe] + 1db1 GV100GL [Tesla V100 SXM2 16GB] + 1db4 GV100GL [Tesla V100 PCIe 16GB] + 1db5 GV100GL [Tesla V100 SXM2 32GB] + 1db6 GV100GL [Tesla V100 PCIe 32GB] + 1db7 GV100GL [Tesla V100 DGXS 32GB] + 1dba GV100GL [Quadro GV100] 10df Emulex Corporation 0720 OneConnect NIC (Skyhawk) 103c 1934 FlexFabric 20Gb 2-port 650M Adapter @@ -14276,10 +14290,11 @@ 7384 PM7384 [FREEDM - 84P672 Frm Engine & Datalink Mgr] 8000 PM8000 [SPC - SAS Protocol Controller] 8009 PM8009 SPCve 8x6G - 8032 ATTO Celerity FC8xEN + 8032 PM8032 Tachyon QE8 117c 003a Celerity FC-81EN Fibre Channel Adapter 117c 003b Celerity FC-82EN Fibre Channel Adapter 117c 003c Celerity FC-84EN Fibre Channel Adapter + 117c 403b ThunderLink FC 1082 Fibre Channel Adapter 8053 PM8053 SXP 12G 24-port SAS/SATA expander 8054 PM8054 SXP 12G 36-port SAS/SATA expander 8055 PM8055 SXP 12G 48-port SAS/SATA expander @@ -14572,7 +14587,8 @@ 0d13 Desktop PCI L1/L3 Telephony 1232 GPT Limited 1233 Bus-Tech, Inc. -1235 Risq Modular Systems, Inc. +# nee Risq Modular Systems, Inc. +1235 SMART Modular Technologies 1236 Sigma Designs Corporation 0000 RealMagic64/GX 6401 REALmagic 64/GX (SD 6425) @@ -18737,10 +18753,8 @@ 020f MT28908A0 Family [ConnectX-6 Flash Recovery] 0210 MT28908A0 Family [ConnectX-6 Secure Flash Recovery] 0211 MT416842 Family [BlueField SoC Flash Recovery] -# reserved for RM#105916 024e MT53100 [Spectrum-2, Flash recovery mode] -# Actual value to be used - 024f MT53100 [Spectrum-2, Flash recovery mode] + 024f MT53100 [Spectrum-2, Secure Flash recovery mode] 0262 MT27710 [ConnectX-4 Lx Programmable] EN 0263 MT27710 [ConnectX-4 Lx Programmable Virtual Function] EN 0264 Innova-2 Flex Burn image @@ -20798,6 +20812,7 @@ 1a4a SLAC National Accelerator Lab TID-AIR 1000 MCOR Power Supply Controller 1010 AMC EVR - Stockholm Timing Board + 1020 Cluster On Board (COB) Ethernet Switch 2000 PGPCard - 4 Lane 2001 PGPCard - 8 Lane Plus EVR 2010 PCI-Express EVR @@ -24079,6 +24094,7 @@ 1059 0150 RD-01068 10GbE interface 15ab Ethernet Connection X552 10 GbE Backplane 15ac Ethernet Connection X552 10 GbE SFP+ + 1059 0160 RD-01167 10GbE interface 15ad Ethernet Connection X552/X557-AT 10GBASE-T 15ae Ethernet Connection X552 1000BASE-T 15b0 Ethernet Connection X552 Backplane @@ -28934,6 +28950,7 @@ 17aa 382a B51-80 Laptop 9d48 Sunrise Point-LP LPC Controller 1028 06f3 Latitude 3570 + 9d4e Intel(R) 100 Series Chipset Family LPC Controller/eSPI Controller - 9D4E 9d56 Sunrise Point-LP LPC Controller 9d58 Sunrise Point-LP LPC Controller 17aa 2247 ThinkPad T570 @@ -30032,6 +30049,14 @@ C 00 Unclassified device C 01 Mass storage controller 00 SCSI storage controller 01 IDE interface + 00 ISA Compatibility mode-only controller + 05 PCI native mode-only controller + 0a ISA Compatibility mode controller, supports both channels switched to PCI native mode + 0f PCI native mode controller, supports both channels switched to ISA compatibility mode + 80 ISA Compatibility mode-only controller, supports bus mastering + 85 PCI native mode-only controller, supports bus mastering + 8a ISA Compatibility mode controller, supports both channels switched to PCI native mode, supports bus mastering + 8f PCI native mode controller, supports both channels switched to ISA compatibility mode, supports bus mastering 02 Floppy disk controller 03 IPI bus controller 04 RAID bus controller @@ -30179,7 +30204,10 @@ C 0c Serial bus controller 04 Fibre Channel 05 SMBus 06 InfiniBand - 07 IPMI SMIC interface + 07 IPMI Interface + 00 SMIC + 01 KCS + 02 BT (Block Transfer) 08 SERCOS interface 09 CANBUS C 0d Wireless controller From owner-svn-src-head@freebsd.org Wed Apr 25 13:23:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97F87FA6029; Wed, 25 Apr 2018 13:23:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47BF584613; Wed, 25 Apr 2018 13:23:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4258B1AAC; Wed, 25 Apr 2018 13:23:59 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PDNxDt038588; Wed, 25 Apr 2018 13:23:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PDNwjw038582; Wed, 25 Apr 2018 13:23:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804251323.w3PDNwjw038582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 25 Apr 2018 13:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332993 - in head: gnu/usr.bin/grep tools/build/mk usr.bin/grep usr.bin/zstd X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: gnu/usr.bin/grep tools/build/mk usr.bin/grep usr.bin/zstd X-SVN-Commit-Revision: 332993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 13:23:59 -0000 Author: bapt Date: Wed Apr 25 13:23:58 2018 New Revision: 332993 URL: https://svnweb.freebsd.org/changeset/base/332993 Log: Use a script wrapper for grep Import the wrapper script from zstdgrep (written by wiz@netbsd.org) Modify it to support more than just zstd (adding support for gzip, lzma, xz and bzip2) Write a simple manpage dedicated for it. Only use that new wrapper both for gnu grep and bsd grep Next step will be removing code related to compression format from bsdgrep Reviewed by: kevans Approved by: kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15193 Added: head/usr.bin/grep/zgrep.1 (contents, props changed) head/usr.bin/grep/zgrep.sh (contents, props changed) Modified: head/gnu/usr.bin/grep/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/grep/Makefile head/usr.bin/zstd/Makefile Modified: head/gnu/usr.bin/grep/Makefile ============================================================================== --- head/gnu/usr.bin/grep/Makefile Wed Apr 25 12:23:35 2018 (r332992) +++ head/gnu/usr.bin/grep/Makefile Wed Apr 25 13:23:58 2018 (r332993) @@ -24,22 +24,9 @@ MLINKS= grep.1 egrep.1 grep.1 fgrep.1 LIBADD= gnuregex bz2 -.if ${MK_BSD_GREP} != "yes" -LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \ - ${BINDIR}/grep ${BINDIR}/bzegrep \ - ${BINDIR}/grep ${BINDIR}/bzfgrep -MLINKS+=grep.1 bzgrep.1 grep.1 bzegrep.1 grep.1 bzfgrep.1 -.endif - .if defined(GREP_LIBZ) && !empty(GREP_LIBZ) LIBADD+= z CFLAGS+=-DHAVE_LIBZ=1 -.if ${MK_BSD_GREP} != "yes" -LINKS+= ${BINDIR}/grep ${BINDIR}/zgrep \ - ${BINDIR}/grep ${BINDIR}/zegrep \ - ${BINDIR}/grep ${BINDIR}/zfgrep -MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1 -.endif .endif gnugrep.1: grep.1 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Apr 25 12:23:35 2018 (r332992) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Apr 25 13:23:58 2018 (r332993) @@ -657,21 +657,6 @@ OLD_FILES+=usr/share/man/man1/bsdcpio.1.gz OLD_FILES+=usr/share/man/man1/cpio.1.gz .endif -.if ${MK_BSD_GREP} == no -OLD_FILES+=usr/bin/lzegrep -OLD_FILES+=usr/bin/lzfgrep -OLD_FILES+=usr/bin/lzgrep -OLD_FILES+=usr/bin/xzegrep -OLD_FILES+=usr/bin/xzfgrep -OLD_FILES+=usr/bin/xzgrep -OLD_FILES+=usr/share/man/man1/lzegrep.1.gz -OLD_FILES+=usr/share/man/man1/lzfgrep.1.gz -OLD_FILES+=usr/share/man/man1/lzgrep.1.gz -OLD_FILES+=usr/share/man/man1/xzegrep.1.gz -OLD_FILES+=usr/share/man/man1/xzfgrep.1.gz -OLD_FILES+=usr/share/man/man1/xzgrep.1.gz -.endif - .if ${MK_BSDINSTALL} == no OLD_FILES+=usr/libexec/bsdinstall/adduser OLD_FILES+=usr/libexec/bsdinstall/auto Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Wed Apr 25 12:23:35 2018 (r332992) +++ head/usr.bin/grep/Makefile Wed Apr 25 13:23:58 2018 (r332993) @@ -6,9 +6,11 @@ .if ${MK_BSD_GREP} == "yes" PROG= grep +MAN1= grep.1 zgrep.1 .else PROG= bsdgrep CLEANFILES+= bsdgrep.1 +MAN1= grep.1 zgrep.1 bsdgrep.1: grep.1 ${CP} ${.ALLSRC} ${.TARGET} @@ -24,59 +26,59 @@ CFLAGS+=-I${.CURDIR}/regex CFLAGS+= -DWITHOUT_FASTMATCH .endif +SCRIPTS= zgrep.sh +LINKS= ${BINDIR}/zgrep ${BINDIR}/zfgrep \ + ${BINDIR}/zgrep ${BINDIR}/zegrep \ + ${BINDIR}/zgrep ${BINDIR}/bzgrep \ + ${BINDIR}/zgrep ${BINDIR}/bzegrep \ + ${BINDIR}/zgrep ${BINDIR}/bzfgrep \ + ${BINDIR}/zgrep ${BINDIR}/lzgrep \ + ${BINDIR}/zgrep ${BINDIR}/lzegrep \ + ${BINDIR}/zgrep ${BINDIR}/lzfgrep \ + ${BINDIR}/zgrep ${BINDIR}/xzgrep \ + ${BINDIR}/zgrep ${BINDIR}/xzegrep \ + ${BINDIR}/zgrep ${BINDIR}/xzfgrep \ + ${BINDIR}/zgrep ${BINDIR}/zstdgrep \ + ${BINDIR}/zgrep ${BINDIR}/zstdegrep \ + ${BINDIR}/zgrep ${BINDIR}/zstdegrep + +MLINKS= zgrep.1 zfgrep.1 \ + zgrep.1 zegrep.1 \ + zgrep.1 bzgrep.1 \ + zgrep.1 bzegrep.1 \ + zgrep.1 bzfgrep.1 \ + zgrep.1 lzgrep.1 \ + zgrep.1 lzegrep.1 \ + zgrep.1 lzfgrep.1 \ + zgrep.1 xzgrep.1 \ + zgrep.1 xzegrep.1 \ + zgrep.1 xzfgrep.1 \ + zgrep.1 zstdgrep.1 \ + zgrep.1 zstdegrep.1 \ + zgrep.1 zstdfgrep.1 + CFLAGS.gcc+= --param max-inline-insns-single=500 .if ${MK_BSD_GREP} == "yes" -LINKS= ${BINDIR}/grep ${BINDIR}/egrep \ +LINKS+= ${BINDIR}/grep ${BINDIR}/egrep \ ${BINDIR}/grep ${BINDIR}/fgrep \ ${BINDIR}/grep ${BINDIR}/rgrep \ - ${BINDIR}/grep ${BINDIR}/zgrep \ - ${BINDIR}/grep ${BINDIR}/zegrep \ - ${BINDIR}/grep ${BINDIR}/zfgrep -MLINKS= grep.1 egrep.1 \ +MLINKS+= grep.1 egrep.1 \ grep.1 fgrep.1 \ - grep.1 rgrep.1 \ - grep.1 zgrep.1 \ - grep.1 zegrep.1 \ - grep.1 zfgrep.1 + grep.1 rgrep.1 .endif LIBADD= z .if ${MK_LZMA_SUPPORT} != "no" LIBADD+= lzma - -.if ${MK_BSD_GREP} == "yes" -LINKS+= ${BINDIR}/${PROG} ${BINDIR}/xzgrep \ - ${BINDIR}/${PROG} ${BINDIR}/xzegrep \ - ${BINDIR}/${PROG} ${BINDIR}/xzfgrep \ - ${BINDIR}/${PROG} ${BINDIR}/lzgrep \ - ${BINDIR}/${PROG} ${BINDIR}/lzegrep \ - ${BINDIR}/${PROG} ${BINDIR}/lzfgrep - -MLINKS+= grep.1 xzgrep.1 \ - grep.1 xzegrep.1 \ - grep.1 xzfgrep.1 \ - grep.1 lzgrep.1 \ - grep.1 lzegrep.1 \ - grep.1 lzfgrep.1 -.endif .else CFLAGS+= -DWITHOUT_LZMA .endif .if ${MK_BZIP2_SUPPORT} != "no" LIBADD+= bz2 - -.if ${MK_BSD_GREP} == "yes" -LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \ - ${BINDIR}/grep ${BINDIR}/bzegrep \ - ${BINDIR}/grep ${BINDIR}/bzfgrep -MLINKS+= grep.1 bzgrep.1 \ - grep.1 bzegrep.1 \ - grep.1 bzfgrep.1 -.endif .else CFLAGS+= -DWITHOUT_BZIP2 .endif Added: head/usr.bin/grep/zgrep.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/grep/zgrep.1 Wed Apr 25 13:23:58 2018 (r332993) @@ -0,0 +1,90 @@ +.\" Copyright (c) 2018 Baptiste Daroussin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 25, 2018 +.Dt ZGREP 1 +.Os +.Sh NAME +.Nm zgrep , +.Nm zegrep , +.Nm zfgrep , +.Nm bzgrep , +.Nm bzegrep , +.Nm bzfgrep , +.Nm lzgrep , +.Nm lzegrep , +.Nm lzfgrep , +.Nm xzgrep , +.Nm xzegrep , +.Nm xzfgrep , +.Nm zstdgrep , +.Nm zstdegrep , +.Nm zstdfgrep +.Nd +.Xr grep 1 +compressed files +.Sh SYNOPSIS +.Nm +.Oo Ar flags Oc Ar files +.Nm zegrep +.Oo Ar flags Oc Ar files +.Nm zfgrep +.Oo Ar flags Oc Ar files +.Nm bzgrep +.Oo Ar flags Oc Ar files +.Nm bzegrep +.Oo Ar flags Oc Ar files +.Nm bzfgrep +.Oo Ar flags Oc Ar files +.Nm lzgrep +.Oo Ar flags Oc Ar files +.Nm lzegrep +.Oo Ar flags Oc Ar files +.Nm lzfgrep +.Oo Ar flags Oc Ar files +.Nm xzgrep +.Oo Ar flags Oc Ar files +.Nm xzegrep +.Oo Ar flags Oc Ar files +.Nm xzfgrep +.Oo Ar flags Oc Ar files +.Nm zstdgrep +.Oo Ar flags Oc Ar files +.Nm zstdegrep +.Oo Ar flags Oc Ar files +.Nm zstdfgrep +.Oo Ar flags Oc Ar files +.Sh DESCRIPTION +Allow +.Xr grep 1 +to read compressed files +.Sh SEE ALSO +.Xr grep 1 +.Sh AUTHORS +This version of the +.Nm +utility was written by +.An Thomas Klausner Aq Mt wiz@NetBSD.org . Added: head/usr.bin/grep/zgrep.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/grep/zgrep.sh Wed Apr 25 13:23:58 2018 (r332993) @@ -0,0 +1,151 @@ +#!/bin/sh +# +# Copyright (c) 2003 Thomas Klausner. +# +# 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$ + +set -eu +grep=grep +zcat=zstdcat + +endofopts=0 +pattern_found=0 +grep_args="" +hyphen=0 +silent=0 + +prg=$(basename $0) + +# handle being called 'zegrep' or 'zfgrep' +case ${prg} in +*egrep) + grep_args="-E";; +*fgrep) + grep_args="-F";; +esac + +catargs="-f" +case ${prg} in +zstd*) + cattool="/usr/bin/zstdcat" + catargs="-fq" + ;; +bz*) + cattool="/usr/bin/bzcat" + ;; +z*) + cattool="/usr/bin/zcat" + ;; +xz*) + cattool="/usr/bin/xzcat" + ;; +lz*) + cattool="/usr/bin/lzcat" + ;; +*) + echo "Invalid command: ${prg}" >&2 + exit 1 + ;; +esac + +# skip all options and pass them on to grep taking care of options +# with arguments, and if -e was supplied + +while [ $# -gt 0 -a ${endofopts} -eq 0 ] +do + case $1 in + # from GNU grep-2.5.1 -- keep in sync! + -[ABCDXdefm]) + if [ $# -lt 2 ] + then + echo "${prg}: missing argument for $1 flag" >&2 + exit 1 + fi + case $1 in + -e) + pattern="$2" + pattern_found=1 + shift 2 + break + ;; + *) + ;; + esac + grep_args="${grep_args} $1 $2" + shift 2 + ;; + --) + shift + endofopts=1 + ;; + -) + hyphen=1 + shift + ;; + -h) + silent=1 + shift + ;; + -*) + grep_args="${grep_args} $1" + shift + ;; + *) + # pattern to grep for + endofopts=1 + ;; + esac +done + +# if no -e option was found, take next argument as grep-pattern +if [ ${pattern_found} -lt 1 ] +then + if [ $# -ge 1 ]; then + pattern="$1" + shift + elif [ ${hyphen} -gt 0 ]; then + pattern="-" + else + echo "${prg}: missing pattern" >&2 + exit 1 + fi +fi + +# call grep ... +if [ $# -lt 1 ] +then + # ... on stdin + ${cattool} ${catargs} - | ${grep} ${grep_args} -- "${pattern}" - +else + # ... on all files given on the command line + if [ ${silent} -lt 1 -a $# -gt 1 ]; then + grep_args="-H ${grep_args}" + fi + while [ $# -gt 0 ] + do + ${cattool} ${catargs} -- "$1" | ${grep} --label="${1}" ${grep_args} -- "${pattern}" - + shift + done +fi + +exit 0 Modified: head/usr.bin/zstd/Makefile ============================================================================== --- head/usr.bin/zstd/Makefile Wed Apr 25 12:23:35 2018 (r332992) +++ head/usr.bin/zstd/Makefile Wed Apr 25 13:23:58 2018 (r332993) @@ -15,7 +15,6 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/programs \ -DXXH_NAMESPACE=ZSTD_ \ -DHAVE_THREAD=1 \ -DZSTD_MULTITHREAD=1 -SCRIPTS= zstdgrep LINKS= ${BINDIR}/zstd ${BINDIR}/unzstd \ ${BINDIR}/zstd ${BINDIR}/zstdcat \ ${BINDIR}/zstd ${BINDIR}/zstdmt From owner-svn-src-head@freebsd.org Wed Apr 25 14:21:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDB5CFA741C; Wed, 25 Apr 2018 14:21:13 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 720A9705C8; Wed, 25 Apr 2018 14:21:13 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D12D2405; Wed, 25 Apr 2018 14:21:13 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PELDcx066397; Wed, 25 Apr 2018 14:21:13 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PELDIn066396; Wed, 25 Apr 2018 14:21:13 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201804251421.w3PELDIn066396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Wed, 25 Apr 2018 14:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332994 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 332994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 14:21:13 -0000 Author: tychon Date: Wed Apr 25 14:21:13 2018 New Revision: 332994 URL: https://svnweb.freebsd.org/changeset/base/332994 Log: If a trap is encountered upon executing iretq from within doreti() the hardware will ensure the stack pointer is aligned to a 16-byte boundary before saving the fault state on the stack. In the PTI case, handle this potential alignment adjustment by copying both frames independently while unwinding the stack in between. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15183 Modified: head/sys/amd64/amd64/exception.S Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Wed Apr 25 13:23:58 2018 (r332993) +++ head/sys/amd64/amd64/exception.S Wed Apr 25 14:21:13 2018 (r332994) @@ -341,6 +341,9 @@ page_cr2: * On the stack, we have the hardware interrupt frame to return * to usermode (faulted) and another frame with error code, for * fault. For PTI, copy both frames to the main thread stack. + * Handle the potential 16-byte alignment adjustment incurred + * during the second fault by copying both frames independently + * while unwinding the stack in between. */ .macro PROTF_ENTRY name,trapno \name\()_pti_doreti: @@ -351,7 +354,11 @@ page_cr2: movq %rax,%cr3 movq PCPU(RSP0),%rax subq $2*PTI_SIZE-3*8,%rax /* no err, %rax, %rdx in faulted frame */ - MOVE_STACKS (PTI_SIZE / 4 - 3) + MOVE_STACKS (PTI_SIZE / 8) + addq $PTI_SIZE,%rax + movq PTI_RSP(%rsp),%rsp + MOVE_STACKS (PTI_SIZE / 8 - 3) + subq $PTI_SIZE,%rax movq %rax,%rsp popq %rdx popq %rax From owner-svn-src-head@freebsd.org Wed Apr 25 14:30:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54347FA7661 for ; Wed, 25 Apr 2018 14:30:24 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x22d.google.com (mail-yb0-x22d.google.com [IPv6:2607:f8b0:4002:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBDFC72CB2 for ; Wed, 25 Apr 2018 14:30:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x22d.google.com with SMTP id c10-v6so8323942ybn.7 for ; Wed, 25 Apr 2018 07:30:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0j6smAf1b+f/Scpt6Pw2auaPnW9uwBqJN1108oo+218=; b=Edxzu+DRFVuHqRg+i36fcvk0yhKnrKh/EuXdM83+KVO853S+GC4KXRXxgt/BTM1doO R5Krgirt1IiPaDDXiL2SYdhpCqnuAC7ywaTyXzoT+a16DWbEiwQGtaUNZEHbmXfR1/GQ d+8lx48MJB32OkgfycH8nkDpVkfvX45bTZiTc5u4Fp2qx674r+n3WBNqodHKPj6tHhyw 58TnbG7MwC/4ssZi0zUCF6HZf7ZlUlS6k/6HToKSXL4ACoRmJaVGjTKrtaBg6wc+B46c Ae46HoUHsMDely/pZH/OtoIUshYhijSsWTpN9lzoQKF/7v8WpcaB58PZxrdsb2xXeJRa 7tNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0j6smAf1b+f/Scpt6Pw2auaPnW9uwBqJN1108oo+218=; b=EFC4uzdz1mN/TSkTazVgARxfrvWsBhb7f4n0MSdkHmC6GuuWvOv0Nz6RqIOLNL8icn cboRSX5v2z3kHqSYdnUK4pTxpvKocDnC8FU+GHPMBY8kdxcqdpcG2SjW6sAARRGkF3JW 8Y5G1UB2nZM+AUXDI/OGfxCMtC7F/vGMcAGZK4ytXxC3H/jbLr9sE6MdSDmN8EZdM/Dz odu14MvJtAE26o5R3d7wWFL3IJlSZDMJqycHYFwbNvQOjD9MwcM9uOpeb+lBQ76jNfHQ iYo86tKGEDKx1ZJdleT+DXMaDjugtxrUDCNNA6+cdIpJ7aiBXp0TQBY8SaBZXJNlbrXE 0sUw== X-Gm-Message-State: ALQs6tAJVOmPaMwdqyMa3KlJ7P8xxIMRkexMqvugY1//xJ4nj9yb4Sw9 HOnW+9yZ2+fTv8AqIvDkmbTuZUOPAapubPO6zGMW8Q== X-Google-Smtp-Source: AB8JxZpyGvs637o0umTuB7FJiVJOPI9ZJrD9Fd4odRL8NtJTJDC741B2Hr1fECYbrB72hdqeB9dpsKNxNYn9jiwmKlE= X-Received: by 2002:a25:8709:: with SMTP id a9-v6mr2347811ybl.371.1524666623193; Wed, 25 Apr 2018 07:30:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ae64:0:0:0:0:0 with HTTP; Wed, 25 Apr 2018 07:30:22 -0700 (PDT) In-Reply-To: <201804251421.w3PELDIn066396@repo.freebsd.org> References: <201804251421.w3PELDIn066396@repo.freebsd.org> From: Oliver Pinter Date: Wed, 25 Apr 2018 16:30:22 +0200 Message-ID: Subject: Re: svn commit: r332994 - head/sys/amd64/amd64 To: Tycho Nightingale Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 14:30:24 -0000 On Wednesday, April 25, 2018, Tycho Nightingale wrote: > Author: tychon > Date: Wed Apr 25 14:21:13 2018 > New Revision: 332994 > URL: https://svnweb.freebsd.org/changeset/base/332994 > > Log: > If a trap is encountered upon executing iretq from within doreti() the > hardware will ensure the stack pointer is aligned to a 16-byte > boundary before saving the fault state on the stack. > > In the PTI case, handle this potential alignment adjustment by copying > both frames independently while unwinding the stack in between. > > Reviewed by: kib > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D15183 Is there any plan to MFC this commit? > > Modified: > head/sys/amd64/amd64/exception.S > > Modified: head/sys/amd64/amd64/exception.S > ============================================================ > ================== > --- head/sys/amd64/amd64/exception.S Wed Apr 25 13:23:58 2018 > (r332993) > +++ head/sys/amd64/amd64/exception.S Wed Apr 25 14:21:13 2018 > (r332994) > @@ -341,6 +341,9 @@ page_cr2: > * On the stack, we have the hardware interrupt frame to return > * to usermode (faulted) and another frame with error code, for > * fault. For PTI, copy both frames to the main thread stack. > + * Handle the potential 16-byte alignment adjustment incurred > + * during the second fault by copying both frames independently > + * while unwinding the stack in between. > */ > .macro PROTF_ENTRY name,trapno > \name\()_pti_doreti: > @@ -351,7 +354,11 @@ page_cr2: > movq %rax,%cr3 > movq PCPU(RSP0),%rax > subq $2*PTI_SIZE-3*8,%rax /* no err, %rax, %rdx in faulted > frame */ > - MOVE_STACKS (PTI_SIZE / 4 - 3) > + MOVE_STACKS (PTI_SIZE / 8) > + addq $PTI_SIZE,%rax > + movq PTI_RSP(%rsp),%rsp > + MOVE_STACKS (PTI_SIZE / 8 - 3) > + subq $PTI_SIZE,%rax > movq %rax,%rsp > popq %rdx > popq %rax > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Apr 25 14:39:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F06BFA79F9; Wed, 25 Apr 2018 14:39:53 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (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 4C13973E8E; Wed, 25 Apr 2018 14:39:53 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 3E435E8C9F; Wed, 25 Apr 2018 10:39:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from :message-id:content-type:mime-version:subject:date:in-reply-to :cc:to:references; s=sasl; bh=HDC3/B/FwLUn6R1B3YoIrO/u5QE=; b=sr uf2IAOICJdxzBbByMpT/0h8kRisikHFx86jv8mlha9nH16Ua7zA3krraYQyXFWH9 40ujTfegd78n1vZ7rZexzSW6crDHvu6wA6soLvcO6QfMsjO0vsq9oFUQJ3gNos8M ipq2YoAe5i35wUq3WnSSVVFM5ljDpNB8PZNqXc11E= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 36CC7E8C9E; Wed, 25 Apr 2018 10:39:47 -0400 (EDT) Received: from [10.0.1.71] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 97EAFE8C9D; Wed, 25 Apr 2018 10:39:46 -0400 (EDT) From: Tycho Nightingale Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r332994 - head/sys/amd64/amd64 Date: Wed, 25 Apr 2018 10:39:45 -0400 In-Reply-To: Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" To: Oliver Pinter References: <201804251421.w3PELDIn066396@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.6.18) X-Pobox-Relay-ID: 8026ADF6-4896-11E8-A2A9-44CE1968708C-09779102!pb-smtp1.pobox.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 14:39:54 -0000 > On Apr 25, 2018, at 10:30 AM, Oliver Pinter = wrote: >=20 > On Wednesday, April 25, 2018, Tycho Nightingale > wrote: > Author: tychon > Date: Wed Apr 25 14:21:13 2018 > New Revision: 332994 > URL: https://svnweb.freebsd.org/changeset/base/332994 = >=20 > Log: > If a trap is encountered upon executing iretq from within doreti() = the > hardware will ensure the stack pointer is aligned to a 16-byte > boundary before saving the fault state on the stack. >=20 > In the PTI case, handle this potential alignment adjustment by = copying > both frames independently while unwinding the stack in between. >=20 > Reviewed by: kib > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D15183 = >=20 > Is there any plan to MFC this commit?=20 Yes, it seems reasonable to do that after 2 weeks. Tycho= From owner-svn-src-head@freebsd.org Wed Apr 25 14:40:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A676FA7A48; Wed, 25 Apr 2018 14:40:17 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B002574080; Wed, 25 Apr 2018 14:40:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6DD92619; Wed, 25 Apr 2018 14:40:16 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PEeGA6073452; Wed, 25 Apr 2018 14:40:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PEeGKH073447; Wed, 25 Apr 2018 14:40:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804251440.w3PEeGKH073447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 25 Apr 2018 14:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332995 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 332995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 14:40:17 -0000 Author: bapt Date: Wed Apr 25 14:40:15 2018 New Revision: 332995 URL: https://svnweb.freebsd.org/changeset/base/332995 Log: Remove compression support from bsdgrep Compression support is now handled by an external script, remove it from the bsdgrep(1) utility. This removes the support for -Z -J -X and -M Note: that it matches the changes in newer GNU grep Reviewed by: kevans Approved by: kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15197 Modified: head/usr.bin/grep/Makefile head/usr.bin/grep/file.c head/usr.bin/grep/grep.1 head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Wed Apr 25 14:21:13 2018 (r332994) +++ head/usr.bin/grep/Makefile Wed Apr 25 14:40:15 2018 (r332995) @@ -69,20 +69,6 @@ MLINKS+= grep.1 egrep.1 \ grep.1 rgrep.1 .endif -LIBADD= z - -.if ${MK_LZMA_SUPPORT} != "no" -LIBADD+= lzma -.else -CFLAGS+= -DWITHOUT_LZMA -.endif - -.if ${MK_BZIP2_SUPPORT} != "no" -LIBADD+= bz2 -.else -CFLAGS+= -DWITHOUT_BZIP2 -.endif - .if ${MK_GNU_GREP_COMPAT} != "no" CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU LIBADD+= gnuregex Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Wed Apr 25 14:21:13 2018 (r332994) +++ head/usr.bin/grep/file.c Wed Apr 25 14:40:15 2018 (r332995) @@ -49,31 +49,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#ifndef WITHOUT_LZMA -#include -#endif - -#ifndef WITHOUT_BZIP2 -#include -#endif - #include "grep.h" #define MAXBUFSIZ (32 * 1024) #define LNBUFBUMP 80 -static gzFile gzbufdesc; -#ifndef WITHOUT_LZMA -static lzma_stream lstrm = LZMA_STREAM_INIT; -static lzma_action laction; -static uint8_t lin_buf[MAXBUFSIZ]; -#endif -#ifndef WITHOUT_BZIP2 -static BZFILE* bzbufdesc; -#endif - static unsigned char *buffer; static unsigned char *bufpos; static size_t bufrem; @@ -86,9 +67,6 @@ static inline int grep_refill(struct file *f) { ssize_t nr; -#ifndef WITHOUT_LZMA - lzma_ret lzmaret; -#endif if (filebehave == FILE_MMAP) return (0); @@ -96,84 +74,7 @@ grep_refill(struct file *f) bufpos = buffer; bufrem = 0; - switch (filebehave) { - case FILE_GZIP: - nr = gzread(gzbufdesc, buffer, MAXBUFSIZ); - break; -#ifndef WITHOUT_BZIP2 - case FILE_BZIP: - if (bzbufdesc != NULL) { - int bzerr; - - nr = BZ2_bzRead(&bzerr, bzbufdesc, buffer, MAXBUFSIZ); - switch (bzerr) { - case BZ_OK: - case BZ_STREAM_END: - /* No problem, nr will be okay */ - break; - case BZ_DATA_ERROR_MAGIC: - /* - * As opposed to gzread(), which simply returns the - * plain file data, if it is not in the correct - * compressed format, BZ2_bzRead() instead aborts. - * - * So, just restart at the beginning of the file again, - * and use plain reads from now on. - */ - BZ2_bzReadClose(&bzerr, bzbufdesc); - bzbufdesc = NULL; - if (lseek(f->fd, 0, SEEK_SET) == -1) - return (-1); - nr = read(f->fd, buffer, MAXBUFSIZ); - break; - default: - /* Make sure we exit with an error */ - nr = -1; - } - } else - /* - * Also an error case; we should never have a scenario - * where we have an open file but no bzip descriptor - * at this point. See: grep_open - */ - nr = -1; - break; -#endif -#ifndef WITHOUT_LZMA - case FILE_XZ: - case FILE_LZMA: - lstrm.next_out = buffer; - - do { - if (lstrm.avail_in == 0) { - lstrm.next_in = lin_buf; - nr = read(f->fd, lin_buf, MAXBUFSIZ); - - if (nr < 0) - return (-1); - else if (nr == 0) - laction = LZMA_FINISH; - - lstrm.avail_in = nr; - } - - lzmaret = lzma_code(&lstrm, laction); - - if (lzmaret != LZMA_OK && lzmaret != LZMA_STREAM_END) - return (-1); - - if (lstrm.avail_out == 0 || lzmaret == LZMA_STREAM_END) { - bufrem = MAXBUFSIZ - lstrm.avail_out; - lstrm.next_out = buffer; - lstrm.avail_out = MAXBUFSIZ; - } - } while (bufrem == 0 && lzmaret != LZMA_STREAM_END); - - return (0); -#endif /* WITHOUT_LZMA */ - default: - nr = read(f->fd, buffer, MAXBUFSIZ); - } + nr = read(f->fd, buffer, MAXBUFSIZ); if (nr < 0) return (-1); @@ -269,9 +170,6 @@ struct file * grep_open(const char *path) { struct file *f; -#ifndef WITHOUT_LZMA - lzma_ret lzmaret; -#endif f = grep_malloc(sizeof *f); memset(f, 0, sizeof *f); @@ -308,37 +206,6 @@ grep_open(const char *path) if ((buffer == NULL) || (buffer == MAP_FAILED)) buffer = grep_malloc(MAXBUFSIZ); - - switch (filebehave) { - case FILE_GZIP: - if ((gzbufdesc = gzdopen(f->fd, "r")) == NULL) - goto error2; - break; -#ifndef WITHOUT_BZIP2 - case FILE_BZIP: - if ((bzbufdesc = BZ2_bzdopen(f->fd, "r")) == NULL) - goto error2; - break; -#endif -#ifndef WITHOUT_LZMA - case FILE_XZ: - case FILE_LZMA: - - if (filebehave == FILE_XZ) - lzmaret = lzma_stream_decoder(&lstrm, UINT64_MAX, - LZMA_CONCATENATED); - else - lzmaret = lzma_alone_decoder(&lstrm, UINT64_MAX); - - if (lzmaret != LZMA_OK) - goto error2; - - lstrm.avail_in = 0; - lstrm.avail_out = MAXBUFSIZ; - laction = LZMA_RUN; - break; -#endif - } /* Fill read buffer, also catches errors early */ if (bufrem == 0 && grep_refill(f) != 0) Modified: head/usr.bin/grep/grep.1 ============================================================================== --- head/usr.bin/grep/grep.1 Wed Apr 25 14:21:13 2018 (r332994) +++ head/usr.bin/grep/grep.1 Wed Apr 25 14:40:15 2018 (r332995) @@ -30,17 +30,16 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd April 17, 2017 +.Dd April 25, 2018 .Dt GREP 1 .Os .Sh NAME .Nm grep , egrep , fgrep , rgrep , -.Nm zgrep , zegrep , zfgrep .Nd file pattern searcher .Sh SYNOPSIS .Nm grep .Bk -words -.Op Fl abcdDEFGHhIiJLlmnOopqRSsUVvwxZz +.Op Fl abcdDEFGHhIiLlmnOopqRSsUVvwxz .Op Fl A Ar num .Op Fl B Ar num .Op Fl C Ns Op Ar num @@ -88,21 +87,6 @@ but can only handle fixed patterns Patterns may consist of one or more lines, allowing any of the pattern lines to match a portion of the input. .Pp -.Nm zgrep , -.Nm zegrep , -and -.Nm zfgrep -act like -.Nm grep , -.Nm egrep , -and -.Nm fgrep , -respectively, but accept input files compressed with the -.Xr compress 1 -or -.Xr gzip 1 -compression utilities. -.Pp The following options are available: .Bl -tag -width indent .It Fl A Ar num , Fl Fl after-context Ns = Ns Ar num @@ -274,10 +258,6 @@ Note that patterns take priority over .Fl Fl include-dir patterns. -.It Fl J, Fl Fl bz2decompress -Decompress the -.Xr bzip2 1 -compressed file before looking for the text. .It Fl L , Fl Fl files-without-match Only the names of files not containing selected lines are written to standard output. @@ -381,11 +361,6 @@ Obsoleted. .It Fl z , Fl Fl null-data Treat input and output data as sequences of lines terminated by a zero-byte instead of a newline. -.It Fl Z , Fl Fl decompress -Force -.Nm grep -to behave as -.Nm zgrep . .It Fl Fl binary-files Ns = Ns Ar value Controls searching and printing of binary files. Options are @@ -465,7 +440,6 @@ looking for either 19, 20, or 25. .Sh SEE ALSO .Xr ed 1 , .Xr ex 1 , -.Xr gzip 1 , .Xr sed 1 , .Xr re_format 7 .Sh STANDARDS Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Wed Apr 25 14:21:13 2018 (r332994) +++ head/usr.bin/grep/grep.c Wed Apr 25 14:40:15 2018 (r332995) @@ -68,9 +68,8 @@ nl_catd catalog; const char *errstr[] = { "", /* 1*/ "(standard input)", -/* 2*/ "cannot read bzip2 compressed file", /* 3*/ "unknown %s option", -/* 4*/ "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A num] [-B num] [-C[num]]\n", +/* 4*/ "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]\n", /* 5*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n", /* 6*/ "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n", /* 7*/ "\t[--null] [pattern] [file ...]\n", @@ -136,7 +135,7 @@ char *label; /* --label */ const char *color; /* --color */ int grepbehave = GREP_BASIC; /* -EFGP: type of the regex */ int binbehave = BINFILE_BIN; /* -aIU: handling of binary files */ -int filebehave = FILE_STDIO; /* -JZ: normal, gzip or bzip2 file */ +int filebehave = FILE_STDIO; int devbehave = DEV_READ; /* -D: handling of devices */ int dirbehave = DIR_READ; /* -dRr: handling of directories */ int linkbehave = LINK_READ; /* -OpS: handling of symlinks */ @@ -169,14 +168,14 @@ bool file_err; /* file reading error */ static void usage(void) { - fprintf(stderr, getstr(4), getprogname()); + fprintf(stderr, getstr(3), getprogname()); + fprintf(stderr, "%s", getstr(4)); fprintf(stderr, "%s", getstr(5)); fprintf(stderr, "%s", getstr(6)); - fprintf(stderr, "%s", getstr(7)); exit(2); } -static const char *optstr = "0123456789A:B:C:D:EFGHIJMLOPSRUVZabcd:e:f:hilm:nopqrsuvwxXyz"; +static const char *optstr = "0123456789A:B:C:D:EFGHILOPSRUVabcd:e:f:hilm:nopqrsuvwxyz"; static const struct option long_options[] = { @@ -208,11 +207,9 @@ static const struct option long_options[] = {"no-filename", no_argument, NULL, 'h'}, {"with-filename", no_argument, NULL, 'H'}, {"ignore-case", no_argument, NULL, 'i'}, - {"bz2decompress", no_argument, NULL, 'J'}, {"files-with-matches", no_argument, NULL, 'l'}, {"files-without-match", no_argument, NULL, 'L'}, {"max-count", required_argument, NULL, 'm'}, - {"lzma", no_argument, NULL, 'M'}, {"line-number", no_argument, NULL, 'n'}, {"only-matching", no_argument, NULL, 'o'}, {"quiet", no_argument, NULL, 'q'}, @@ -225,9 +222,7 @@ static const struct option long_options[] = {"version", no_argument, NULL, 'V'}, {"word-regexp", no_argument, NULL, 'w'}, {"line-regexp", no_argument, NULL, 'x'}, - {"xz", no_argument, NULL, 'X'}, {"null-data", no_argument, NULL, 'z'}, - {"decompress", no_argument, NULL, 'Z'}, {NULL, no_argument, NULL, 0} }; @@ -367,21 +362,9 @@ main(int argc, char *argv[]) way we can have all the funcionalities in one binary without the need of scripting and using ugly hacks. */ pn = getprogname(); - if (pn[0] == 'b' && pn[1] == 'z') { - filebehave = FILE_BZIP; - pn += 2; - } else if (pn[0] == 'x' && pn[1] == 'z') { - filebehave = FILE_XZ; - pn += 2; - } else if (pn[0] == 'l' && pn[1] == 'z') { - filebehave = FILE_LZMA; - pn += 2; - } else if (pn[0] == 'r') { + if (pn[0] == 'r') { dirbehave = DIR_RECURSE; Hflag = true; - } else if (pn[0] == 'z') { - filebehave = FILE_GZIP; - pn += 1; } switch (pn[0]) { case 'e': @@ -490,7 +473,7 @@ main(int argc, char *argv[]) else if (strcasecmp(optarg, "read") == 0) devbehave = DEV_READ; else - errx(2, getstr(3), "--devices"); + errx(2, getstr(2), "--devices"); break; case 'd': if (strcasecmp("recurse", optarg) == 0) { @@ -501,7 +484,7 @@ main(int argc, char *argv[]) else if (strcasecmp("read", optarg) == 0) dirbehave = DIR_READ; else - errx(2, getstr(3), "--directories"); + errx(2, getstr(2), "--directories"); break; case 'E': grepbehave = GREP_EXTENDED; @@ -541,13 +524,6 @@ main(int argc, char *argv[]) iflag = true; cflags |= REG_ICASE; break; - case 'J': -#ifdef WITHOUT_BZIP2 - errno = EOPNOTSUPP; - err(2, "bzip2 support was disabled at compile-time"); -#endif - filebehave = FILE_BZIP; - break; case 'L': lflag = false; Lflag = true; @@ -568,9 +544,6 @@ main(int argc, char *argv[]) err(2, NULL); } break; - case 'M': - filebehave = FILE_LZMA; - break; case 'n': nflag = true; break; @@ -607,9 +580,9 @@ main(int argc, char *argv[]) break; case 'V': #ifdef WITH_GNU - printf(getstr(10), getprogname(), VERSION); -#else printf(getstr(9), getprogname(), VERSION); +#else + printf(getstr(8), getprogname(), VERSION); #endif exit(0); case 'v': @@ -623,15 +596,9 @@ main(int argc, char *argv[]) xflag = true; cflags &= ~REG_NOSUB; break; - case 'X': - filebehave = FILE_XZ; - break; case 'z': fileeol = '\0'; break; - case 'Z': - filebehave = FILE_GZIP; - break; case BIN_OPT: if (strcasecmp("binary", optarg) == 0) binbehave = BINFILE_BIN; @@ -640,7 +607,7 @@ main(int argc, char *argv[]) else if (strcasecmp("text", optarg) == 0) binbehave = BINFILE_TEXT; else - errx(2, getstr(3), "--binary-files"); + errx(2, getstr(2), "--binary-files"); break; case COLOR_OPT: color = NULL; @@ -660,7 +627,7 @@ main(int argc, char *argv[]) } else if (strcasecmp("never", optarg) != 0 && strcasecmp("none", optarg) != 0 && strcasecmp("no", optarg) != 0) - errx(2, getstr(3), "--color"); + errx(2, getstr(2), "--color"); cflags &= ~REG_NOSUB; break; case LABEL_OPT: Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Wed Apr 25 14:21:13 2018 (r332994) +++ head/usr.bin/grep/grep.h Wed Apr 25 14:40:15 2018 (r332995) @@ -69,10 +69,6 @@ extern const char *errstr[]; #define FILE_STDIO 0 #define FILE_MMAP 1 -#define FILE_GZIP 2 -#define FILE_BZIP 3 -#define FILE_XZ 4 -#define FILE_LZMA 5 #define DIR_READ 0 #define DIR_SKIP 1 From owner-svn-src-head@freebsd.org Wed Apr 25 15:28:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E799DFA8C79; Wed, 25 Apr 2018 15:28: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E1187DF84; Wed, 25 Apr 2018 15:28: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 817A92E17; Wed, 25 Apr 2018 15:28: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 w3PFSlME097874; Wed, 25 Apr 2018 15:28:47 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PFSlqo097870; Wed, 25 Apr 2018 15:28:47 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804251528.w3PFSlqo097870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 25 Apr 2018 15:28:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332996 - in head: share/man/man4 sys/dev/usb/serial X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/usb/serial X-SVN-Commit-Revision: 332996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 15:28:48 -0000 Author: trasz Date: Wed Apr 25 15:28:46 2018 New Revision: 332996 URL: https://svnweb.freebsd.org/changeset/base/332996 Log: Make it possible (controlled via sysctl, enabled by default) to mark device-side (and only device-side) "virtual USB serial adapters" - the ones you can get with an OTG-capable board - as consoles. It boils down to adding the device name to kern.console sysctl, although doing that requires jumping through some hoops. It doesn't change the actual operation of those virtual devices. The point is to make it possible for init(8) to recognize them as console devices and to launch getty(8) for them, when configured as "onifconsole" in ttys(5). The point of that, in turn, is to add such entries to the default ttys(5), so that init(8) will launch gettys for device-side "virtual serial adapters", but not for actual USB serial dongles. Reviewed by: hselasky@ No objections: imp@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/ucom.4 head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/usb_serial.h Modified: head/share/man/man4/ucom.4 ============================================================================== --- head/share/man/man4/ucom.4 Wed Apr 25 14:40:15 2018 (r332995) +++ head/share/man/man4/ucom.4 Wed Apr 25 15:28:46 2018 (r332996) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd April 25, 2018 .Dt UCOM 4 .Os .Sh NAME @@ -74,6 +74,11 @@ tunables: Debug output level, where 0 is debugging disabled and larger values increase debug message verbosity. Default is 0. +.It Va hw.usb.ucom.device_mode_console +When set to 1, the +.Nm +driver will mark terminals as console devices when operating in device mode. +Default is 1. .It Va hw.usb.ucom.pps_mode Enables and configure PPS capture mode as described below. .Sh Pulse Per Second (PPS) Timing Interface Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Wed Apr 25 14:40:15 2018 (r332995) +++ head/sys/dev/usb/serial/umodem.c Wed Apr 25 15:28:46 2018 (r332996) @@ -457,6 +457,8 @@ umodem_attach(device_t dev) mtx_unlock(&sc->sc_mtx); } + ucom_set_usb_mode(&sc->sc_super_ucom, uaa->usb_mode); + error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, &umodem_callback, &sc->sc_mtx); if (error) { Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Wed Apr 25 14:40:15 2018 (r332995) +++ head/sys/dev/usb/serial/usb_serial.c Wed Apr 25 15:28:46 2018 (r332996) @@ -105,6 +105,12 @@ SYSCTL_INT(_hw_usb_ucom, OID_AUTO, pps_mode, CTLFLAG_R &ucom_pps_mode, 0, "pulse capture mode: 0/1/2=disabled/CTS/DCD; add 0x10 to invert"); +static int ucom_device_mode_console = 1; + +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, device_mode_console, CTLFLAG_RW, + &ucom_device_mode_console, 0, + "set to 1 to mark terminals as consoles when in device mode"); + #ifdef USB_DEBUG static int ucom_debug = 0; @@ -288,7 +294,7 @@ ucom_attach(struct ucom_super_softc *ssc, struct ucom_ } ssc->sc_subunits = subunits; ssc->sc_flag = UCOM_FLAG_ATTACHED | - UCOM_FLAG_FREE_UNIT; + UCOM_FLAG_FREE_UNIT | (ssc->sc_flag & UCOM_FLAG_DEVICE_MODE); if (callback->ucom_free == NULL) ssc->sc_flag |= UCOM_FLAG_WAIT_REFS; @@ -388,6 +394,24 @@ ucom_drain_all(void *arg) mtx_unlock(&ucom_mtx); } +static cn_probe_t ucom_cnprobe; +static cn_init_t ucom_cninit; +static cn_term_t ucom_cnterm; +static cn_getc_t ucom_cngetc; +static cn_putc_t ucom_cnputc; +static cn_grab_t ucom_cngrab; +static cn_ungrab_t ucom_cnungrab; + +const struct consdev_ops ucom_cnops = { + .cn_probe = ucom_cnprobe, + .cn_init = ucom_cninit, + .cn_term = ucom_cnterm, + .cn_getc = ucom_cngetc, + .cn_putc = ucom_cnputc, + .cn_grab = ucom_cngrab, + .cn_ungrab = ucom_cnungrab, +}; + static int ucom_attach_tty(struct ucom_super_softc *ssc, struct ucom_softc *sc) { @@ -450,6 +474,24 @@ ucom_attach_tty(struct ucom_super_softc *ssc, struct u UCOM_MTX_UNLOCK(ucom_cons_softc); } + if ((ssc->sc_flag & UCOM_FLAG_DEVICE_MODE) != 0 && + ucom_device_mode_console > 0 && + ucom_cons_softc == NULL) { + struct consdev *cp; + + cp = malloc(sizeof(struct consdev), M_USBDEV, + M_WAITOK|M_ZERO); + cp->cn_ops = &ucom_cnops; + cp->cn_arg = NULL; + cp->cn_pri = CN_NORMAL; + strlcpy(cp->cn_name, "tty", sizeof(cp->cn_name)); + strlcat(cp->cn_name, buf, sizeof(cp->cn_name)); + + sc->sc_consdev = cp; + + cnadd(cp); + } + return (0); } @@ -460,6 +502,12 @@ ucom_detach_tty(struct ucom_super_softc *ssc, struct u DPRINTF("sc = %p, tp = %p\n", sc, sc->sc_tty); + if (sc->sc_consdev != NULL) { + cnremove(sc->sc_consdev); + free(sc->sc_consdev, M_USBDEV); + sc->sc_consdev = NULL; + } + if (sc->sc_flag & UCOM_FLAG_CONSOLE) { UCOM_MTX_LOCK(ucom_cons_softc); ucom_close(ucom_cons_softc->sc_tty); @@ -533,6 +581,20 @@ ucom_set_pnpinfo_usb(struct ucom_super_softc *ssc, dev } } +void +ucom_set_usb_mode(struct ucom_super_softc *ssc, enum usb_hc_mode usb_mode) +{ + + switch (usb_mode) { + case USB_MODE_DEVICE: + ssc->sc_flag |= UCOM_FLAG_DEVICE_MODE; + break; + default: + ssc->sc_flag &= ~UCOM_FLAG_DEVICE_MODE; + break; + } +} + static void ucom_queue_command(struct ucom_softc *sc, usb_proc_callback_t *fn, struct termios *pt, @@ -1532,14 +1594,6 @@ ucom_free(void *xsc) ucom_close_refs--; mtx_unlock(&ucom_mtx); } - -static cn_probe_t ucom_cnprobe; -static cn_init_t ucom_cninit; -static cn_term_t ucom_cnterm; -static cn_getc_t ucom_cngetc; -static cn_putc_t ucom_cnputc; -static cn_grab_t ucom_cngrab; -static cn_ungrab_t ucom_cnungrab; CONSOLE_DRIVER(ucom); Modified: head/sys/dev/usb/serial/usb_serial.h ============================================================================== --- head/sys/dev/usb/serial/usb_serial.h Wed Apr 25 14:40:15 2018 (r332995) +++ head/sys/dev/usb/serial/usb_serial.h Wed Apr 25 15:28:46 2018 (r332996) @@ -165,6 +165,7 @@ struct ucom_softc { const struct ucom_callback *sc_callback; struct ucom_super_softc *sc_super; struct tty *sc_tty; + struct consdev *sc_consdev; struct mtx *sc_mtx; void *sc_parent; int sc_subunit; @@ -183,6 +184,7 @@ struct ucom_softc { #define UCOM_FLAG_FREE_UNIT 0x0200 /* set if we must free the unit */ #define UCOM_FLAG_INWAKEUP 0x0400 /* set if we are in the tsw_inwakeup callback */ #define UCOM_FLAG_LSRTXIDLE 0x0800 /* set if sc_lsr bits ULSR_TSRE+TXRDY work */ +#define UCOM_FLAG_DEVICE_MODE 0x1000 /* set if we're an USB device, not a host */ uint8_t sc_lsr; uint8_t sc_msr; uint8_t sc_mcr; @@ -211,6 +213,7 @@ int ucom_attach(struct ucom_super_softc *, const struct ucom_callback *callback, struct mtx *); void ucom_detach(struct ucom_super_softc *, struct ucom_softc *); void ucom_set_pnpinfo_usb(struct ucom_super_softc *, device_t); +void ucom_set_usb_mode(struct ucom_super_softc *, enum usb_hc_mode); void ucom_status_change(struct ucom_softc *); uint8_t ucom_get_data(struct ucom_softc *, struct usb_page_cache *, uint32_t, uint32_t, uint32_t *); From owner-svn-src-head@freebsd.org Wed Apr 25 15:30:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40433FA8DF0; Wed, 25 Apr 2018 15:30:43 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6BC37EDC5; Wed, 25 Apr 2018 15:30:42 +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 E1AEA2E26; Wed, 25 Apr 2018 15:30:42 +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 w3PFUgwc098012; Wed, 25 Apr 2018 15:30:42 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PFUg8N098011; Wed, 25 Apr 2018 15:30:42 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201804251530.w3PFUg8N098011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 25 Apr 2018 15:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332997 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 332997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 15:30:43 -0000 Author: brooks Date: Wed Apr 25 15:30:42 2018 New Revision: 332997 URL: https://svnweb.freebsd.org/changeset/base/332997 Log: Translate 32-bit ifmedia requests into native ones. We use transformation rather than accessors as virtually ever driver implements SIOCGIFMEDIA and all would have to be touched. Keep the code readable by always performing copies and (possiably no-op) transforms. Reviewed by: jhb, kib Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14996 Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Apr 25 15:28:46 2018 (r332996) +++ head/sys/net/if.c Wed Apr 25 15:30:42 2018 (r332997) @@ -150,11 +150,24 @@ struct ifgroupreq32 { uint32_t ifgru_groups; } ifgr_ifgru; }; + +struct ifmediareq32 { + char ifm_name[IFNAMSIZ]; + int ifm_current; + int ifm_mask; + int ifm_status; + int ifm_active; + int ifm_count; + uint32_t ifm_ulist; /* (int *) */ +}; +#define SIOCGIFMEDIA32 _IOC_NEWTYPE(SIOCGIFMEDIA, struct ifmediareq32) +#define SIOCGIFXMEDIA32 _IOC_NEWTYPE(SIOCGIFXMEDIA, struct ifmediareq32) + #define _CASE_IOC_IFGROUPREQ_32(cmd) \ case _IOC_NEWTYPE((cmd), struct ifgroupreq32): -#else +#else /* !COMPAT_FREEBSD32 */ #define _CASE_IOC_IFGROUPREQ_32(cmd) -#endif /* COMPAT_FREEBSD32 */ +#endif /* !COMPAT_FREEBSD32 */ #define CASE_IOC_IFGROUPREQ(cmd) \ _CASE_IOC_IFGROUPREQ_32(cmd) \ @@ -2891,12 +2904,48 @@ struct ifconf32 { #define SIOCGIFCONF32 _IOWR('i', 36, struct ifconf32) #endif +#ifdef COMPAT_FREEBSD32 +static void +ifmr_init(struct ifmediareq *ifmr, caddr_t data) +{ + struct ifmediareq32 *ifmr32; + + ifmr32 = (struct ifmediareq32 *)data; + memcpy(ifmr->ifm_name, ifmr32->ifm_name, + sizeof(ifmr->ifm_name)); + ifmr->ifm_current = ifmr32->ifm_current; + ifmr->ifm_mask = ifmr32->ifm_mask; + ifmr->ifm_status = ifmr32->ifm_status; + ifmr->ifm_active = ifmr32->ifm_active; + ifmr->ifm_count = ifmr32->ifm_count; + ifmr->ifm_ulist = (int *)(uintptr_t)ifmr32->ifm_ulist; +} + +static void +ifmr_update(const struct ifmediareq *ifmr, caddr_t data) +{ + struct ifmediareq32 *ifmr32; + + ifmr32 = (struct ifmediareq32 *)data; + ifmr32->ifm_current = ifmr->ifm_current; + ifmr32->ifm_mask = ifmr->ifm_mask; + ifmr32->ifm_status = ifmr->ifm_status; + ifmr32->ifm_active = ifmr->ifm_active; + ifmr32->ifm_count = ifmr->ifm_count; +} +#endif + /* * Interface ioctls. */ int ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) { +#ifdef COMPAT_FREEBSD32 + caddr_t saved_data; + struct ifmediareq ifmr; +#endif + struct ifmediareq *ifmrp; struct ifnet *ifp; struct ifreq *ifr; int error; @@ -2941,17 +2990,29 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s } #endif } - ifr = (struct ifreq *)data; + ifmrp = NULL; +#ifdef COMPAT_FREEBSD32 switch (cmd) { + case SIOCGIFMEDIA32: + case SIOCGIFXMEDIA32: + ifmrp = &ifmr; + ifmr_init(ifmrp, data); + cmd = _IOC_NEWTYPE(cmd, struct ifmediareq); + saved_data = data; + data = (caddr_t)ifmrp; + } +#endif + + ifr = (struct ifreq *)data; + switch (cmd) { #ifdef VIMAGE case SIOCSIFRVNET: error = priv_check(td, PRIV_NET_SETIFVNET); if (error == 0) error = if_vmove_reclaim(td, ifr->ifr_name, ifr->ifr_jid); - CURVNET_RESTORE(); - return (error); + goto out_noref; #endif case SIOCIFCREATE: case SIOCIFCREATE2: @@ -2960,23 +3021,21 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = if_clone_create(ifr->ifr_name, sizeof(ifr->ifr_name), cmd == SIOCIFCREATE2 ? ifr_data_get_ptr(ifr) : NULL); - CURVNET_RESTORE(); - return (error); + goto out_noref; case SIOCIFDESTROY: error = priv_check(td, PRIV_NET_IFDESTROY); if (error == 0) error = if_clone_destroy(ifr->ifr_name); - CURVNET_RESTORE(); - return (error); + goto out_noref; case SIOCIFGCLONERS: error = if_clone_list((struct if_clonereq *)data); - CURVNET_RESTORE(); - return (error); + goto out_noref; + CASE_IOC_IFGROUPREQ(SIOCGIFGMEMB): error = if_getgroupmembers((struct ifgroupreq *)data); - CURVNET_RESTORE(); - return (error); + goto out_noref; + #if defined(INET) || defined(INET6) case SIOCSVH: case SIOCGVH: @@ -2984,29 +3043,24 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s error = EPROTONOSUPPORT; else error = (*carp_ioctl_p)(ifr, cmd, td); - CURVNET_RESTORE(); - return (error); + goto out_noref; #endif } ifp = ifunit_ref(ifr->ifr_name); if (ifp == NULL) { - CURVNET_RESTORE(); - return (ENXIO); + error = ENXIO; + goto out_noref; } error = ifhwioctl(cmd, ifp, data, td); - if (error != ENOIOCTL) { - if_rele(ifp); - CURVNET_RESTORE(); - return (error); - } + if (error != ENOIOCTL) + goto out_ref; oif_flags = ifp->if_flags; if (so->so_proto == NULL) { - if_rele(ifp); - CURVNET_RESTORE(); - return (EOPNOTSUPP); + error = EOPNOTSUPP; + goto out_ref; } /* @@ -3031,7 +3085,19 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s in6_if_up(ifp); #endif } + +out_ref: if_rele(ifp); +out_noref: +#ifdef COMPAT_FREEBSD32 + if (ifmrp != NULL) { + KASSERT((cmd == SIOCGIFMEDIA || cmd == SIOCGIFXMEDIA), + ("ifmrp non-NULL, but cmd is not an ifmedia req 0x%lx", + cmd)); + data = saved_data; + ifmr_update(ifmrp, data); + } +#endif CURVNET_RESTORE(); return (error); } From owner-svn-src-head@freebsd.org Wed Apr 25 15:32:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B48FA9046; Wed, 25 Apr 2018 15:32:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 314547F0D8; Wed, 25 Apr 2018 15:32:13 +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 29BCB2F8E; Wed, 25 Apr 2018 15:32:13 +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 w3PFWDpi001896; Wed, 25 Apr 2018 15:32:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PFWDh8001895; Wed, 25 Apr 2018 15:32:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804251532.w3PFWDh8001895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 25 Apr 2018 15:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332998 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 332998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 15:32:13 -0000 Author: trasz Date: Wed Apr 25 15:32:12 2018 New Revision: 332998 URL: https://svnweb.freebsd.org/changeset/base/332998 Log: Add some .Xrs to USB template descriptions. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/usb_template.4 Modified: head/share/man/man4/usb_template.4 ============================================================================== --- head/share/man/man4/usb_template.4 Wed Apr 25 15:30:42 2018 (r332997) +++ head/share/man/man4/usb_template.4 Wed Apr 25 15:32:12 2018 (r332998) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 30, 2018 +.Dd April 25, 2018 .Dt USB_TEMPLATE 4 .Os . @@ -74,10 +74,13 @@ may not be visible to the host until reenumeration is Available templates are: .Bl -column -offset 3n "Value" .It Em Value Ta Em Description -.It Dv 0 Ta USB Mass Storage -.It Dv 1 Ta CDC Ethernet +.It Dv 0 Ta USB Mass Storage, see +.Xr cfumass 4 +.It Dv 1 Ta CDC Ethernet, see +.Xr cdce 4 .It Dv 2 Ta Media Transfer Protocol (MTP) -.It Dv 3 Ta USB serial port +.It Dv 3 Ta USB serial port, see +.Xr umodem 4 .It Dv 4 Ta USB audio .It Dv 5 Ta USB keyboard .It Dv 6 Ta USB mouse From owner-svn-src-head@freebsd.org Wed Apr 25 15:39:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48868FA91EE; Wed, 25 Apr 2018 15:39:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E96EE7F3F9; Wed, 25 Apr 2018 15:39:36 +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 E00512FA9; Wed, 25 Apr 2018 15:39:36 +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 w3PFdasF003109; Wed, 25 Apr 2018 15:39:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PFda3P003108; Wed, 25 Apr 2018 15:39:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804251539.w3PFda3P003108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 25 Apr 2018 15:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332999 - head/usr.bin/man X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/man X-SVN-Commit-Revision: 332999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 15:39:37 -0000 Author: trasz Date: Wed Apr 25 15:39:36 2018 New Revision: 332999 URL: https://svnweb.freebsd.org/changeset/base/332999 Log: Clean up .Xrs in man(1). MFC after: 2 weeks Modified: head/usr.bin/man/man.1 Modified: head/usr.bin/man/man.1 ============================================================================== --- head/usr.bin/man/man.1 Wed Apr 25 15:32:12 2018 (r332998) +++ head/usr.bin/man/man.1 Wed Apr 25 15:39:36 2018 (r332999) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2017 +.Dd April 25, 2018 .Dt MAN 1 .Os .Sh NAME @@ -360,10 +360,8 @@ Local configuration files. .Sh SEE ALSO .Xr apropos 1 , .Xr intro 1 , -.Xr locale 1 , +.Xr mandoc 1 , .Xr manpath 1 , -.Xr nroff 1 , -.Xr troff 1 , .Xr whatis 1 , .Xr intro 2 , .Xr intro 3 , @@ -372,5 +370,6 @@ Local configuration files. .Xr man.conf 5 , .Xr intro 6 , .Xr intro 7 , +.Xr mdoc 7 , .Xr intro 8 , .Xr intro 9 From owner-svn-src-head@freebsd.org Wed Apr 25 15:41:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13830FA93D8; Wed, 25 Apr 2018 15:41:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6B79802A7; Wed, 25 Apr 2018 15:41:51 +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 AF141300B; Wed, 25 Apr 2018 15:41:51 +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 w3PFfpu3006818; Wed, 25 Apr 2018 15:41:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PFfoXG006806; Wed, 25 Apr 2018 15:41:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804251541.w3PFfoXG006806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Apr 2018 15:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333000 - in head/usr.bin/grep: . nls X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.bin/grep: . nls X-SVN-Commit-Revision: 333000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 15:41:52 -0000 Author: kevans Date: Wed Apr 25 15:41:50 2018 New Revision: 333000 URL: https://svnweb.freebsd.org/changeset/base/333000 Log: bsdgrep: Update NLS catalogs after r332995 Compression was removed so #2 goes away and everything else needs renumbered to match, and the usage string was also updated due to removed options. X-MFC-With: r332995 Modified: head/usr.bin/grep/grep.c head/usr.bin/grep/nls/C.msg head/usr.bin/grep/nls/es_ES.ISO8859-1.msg head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg head/usr.bin/grep/nls/ja_JP.SJIS.msg head/usr.bin/grep/nls/ja_JP.UTF-8.msg head/usr.bin/grep/nls/ja_JP.eucJP.msg head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg head/usr.bin/grep/nls/ru_RU.KOI8-R.msg head/usr.bin/grep/nls/uk_UA.UTF-8.msg head/usr.bin/grep/nls/zh_CN.UTF-8.msg Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/grep.c Wed Apr 25 15:41:50 2018 (r333000) @@ -68,14 +68,14 @@ nl_catd catalog; const char *errstr[] = { "", /* 1*/ "(standard input)", -/* 3*/ "unknown %s option", -/* 4*/ "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]\n", -/* 5*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n", -/* 6*/ "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n", -/* 7*/ "\t[--null] [pattern] [file ...]\n", -/* 8*/ "Binary file %s matches\n", -/* 9*/ "%s (BSD grep) %s\n", -/* 10*/ "%s (BSD grep, GNU compatible) %s\n", +/* 2*/ "unknown %s option", +/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]\n", +/* 4*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n", +/* 5*/ "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n", +/* 6*/ "\t[--null] [pattern] [file ...]\n", +/* 7*/ "Binary file %s matches\n", +/* 8*/ "%s (BSD grep) %s\n", +/* 9*/ "%s (BSD grep, GNU compatible) %s\n", }; /* Flags passed to regcomp() and regexec() */ Modified: head/usr.bin/grep/nls/C.msg ============================================================================== --- head/usr.bin/grep/nls/C.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/C.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(standard input)" -2 "cannot read bzip2 compressed file" -3 "unknown %s option" -4 "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A num] [-B num] [-C[num]]\n" -5 "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n" -6 "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n" -7 "\t[--null] [pattern] [file ...]\n" -8 "Binary file %s matches\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "unknown %s option" +3 "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]\n" +4 "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n" +5 "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n" +6 "\t[--null] [pattern] [file ...]\n" +7 "Binary file %s matches\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/es_ES.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/es_ES.ISO8859-1.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/es_ES.ISO8859-1.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(entrada estndar)" -2 "no se puede leer el fichero comprimido bzip2" -3 "opcin desconocida de %s" -4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A no] [-B no] [-C[no]]\n" -5 "\t[-e pauta] [-f fichero] [--binary-files=valor] [--color=cuando]\n" -6 "\t[--context[=no]] [--directories=accin] [--label] [--line-buffered]\n" -7 "\t[--null] [pauta] [fichero ...]\n" -8 "fichero binario %s se ajusta\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "opcin desconocida de %s" +3 "uso: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A no] [-B no] [-C[no]]\n" +4 "\t[-e pauta] [-f fichero] [--binary-files=valor] [--color=cuando]\n" +5 "\t[--context[=no]] [--directories=accin] [--label] [--line-buffered]\n" +6 "\t[--null] [pauta] [fichero ...]\n" +7 "fichero binario %s se ajusta\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(entrada estndar)" -2 "non se pode ler o ficheiro comprimido bzip2" -3 "opcin descoecida de %s" -4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A no] [-B no] [-C[no]]\n" -5 "\t[-e pauta] [-f ficheiro] [--binary-files=valor] [--color=cando]\n" -6 "\t[--context[=no]] [--directories=accin] [--label] [--line-buffered]\n" -7 "\t[--null] [pauta] [ficheiro ...]\n" -8 "ficheiro binario %s conforma\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "opcin descoecida de %s" +3 "uso: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A no] [-B no] [-C[no]]\n" +4 "\t[-e pauta] [-f ficheiro] [--binary-files=valor] [--color=cando]\n" +5 "\t[--context[=no]] [--directories=accin] [--label] [--line-buffered]\n" +6 "\t[--null] [pauta] [ficheiro ...]\n" +7 "ficheiro binario %s conforma\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg ============================================================================== --- head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(szabvnyos bemenet)" -2 "bzip2 tmrtett fjl nem olvashat" -3 "ismeretlen %s opci" -4 "hasznlat: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A szm] [-B szm] [-C[szm]]\n" -5 "\t[-e minta] [-f fjl] [--binary-files=rtk] [--color=mikor]\n" -6 "\t[--context[=szm]] [--directories=mvelet] [--label] [--line-buffered]\n" -7 "\t[--null] [minta] [fjl ...]\n" -8 "%s binris fjl illeszkedik\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "ismeretlen %s opci" +3 "hasznlat: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A szm] [-B szm] [-C[szm]]\n" +4 "\t[-e minta] [-f fjl] [--binary-files=rtk] [--color=mikor]\n" +5 "\t[--context[=szm]] [--directories=mvelet] [--label] [--line-buffered]\n" +6 "\t[--null] [minta] [fjl ...]\n" +7 "%s binris fjl illeszkedik\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/ja_JP.SJIS.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.SJIS.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/ja_JP.SJIS.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(W)" -2 "bzip2 kt@CǂݍނƂł܂" -3 "%s IvV̎wlɌ肪܂" -4 "g: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A ] [-B ] [-C[]]\n" -5 "\t[-e p^[] [-f t@C] [--binary-files=l] [--color=l]\n" -6 "\t[--context[=]] [--directories=] [--label] [--line-buffered]\n" -7 "\t[--null] [p^[] [t@C ...]\n" -8 "oCit@C %s Ƀ}b`܂\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "%s IvV̎wlɌ肪܂" +3 "g: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A ] [-B ] [-C[]]\n" +4 "\t[-e p^[] [-f t@C] [--binary-files=l] [--color=l]\n" +5 "\t[--context[=]] [--directories=] [--label] [--line-buffered]\n" +6 "\t[--null] [p^[] [t@C ...]\n" +7 "oCit@C %s Ƀ}b`܂\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/ja_JP.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.UTF-8.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/ja_JP.UTF-8.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(標準入力)" -2 "bzip2 圧縮ファイルを読み込むことができません" -3 "%s オプションの指定値に誤りがあります" -4 "使い方: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A 数字] [-B 数字] [-C[数字]]\n" -5 "\t[-e パターン] [-f ファイル名] [--binary-files=値] [--color=値]\n" -6 "\t[--context[=数字]] [--directories=動作] [--label] [--line-buffered]\n" -7 "\t[--null] [パターン] [ファイル名 ...]\n" -8 "バイナリファイル %s にマッチしました\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "%s オプションの指定値に誤りがあります" +3 "使い方: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A 数字] [-B 数字] [-C[数字]]\n" +4 "\t[-e パターン] [-f ファイル名] [--binary-files=値] [--color=値]\n" +5 "\t[--context[=数字]] [--directories=動作] [--label] [--line-buffered]\n" +6 "\t[--null] [パターン] [ファイル名 ...]\n" +7 "バイナリファイル %s にマッチしました\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/ja_JP.eucJP.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.eucJP.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/ja_JP.eucJP.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(ɸ)" -2 "bzip2 ̥եɤ߹ळȤǤޤ" -3 "%s ץλͤ˸꤬ޤ" -4 "Ȥ: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A ] [-B ] [-C[]]\n" -5 "\t[-e ѥ] [-f ե̾] [--binary-files=] [--color=]\n" -6 "\t[--context[=]] [--directories=ư] [--label] [--line-buffered]\n" -7 "\t[--null] [ѥ] [ե̾ ...]\n" -8 "Хʥե %s ˥ޥåޤ\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "%s ץλͤ˸꤬ޤ" +3 "Ȥ: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A ] [-B ] [-C[]]\n" +4 "\t[-e ѥ] [-f ե̾] [--binary-files=] [--color=]\n" +5 "\t[--context[=]] [--directories=ư] [--label] [--line-buffered]\n" +6 "\t[--null] [ѥ] [ե̾ ...]\n" +7 "Хʥե %s ˥ޥåޤ\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(entrada padro)" -2 "no se posso ler o fichero comprimido bzip2" -3 "opco no conhecida de %s" -4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A num] [-B num] [-C[num]]\n" -5 "\t[-e padro] [-f arquivo] [--binary-files=valor] [--color=quando]\n" -6 "\t[--context[=num]] [--directories=ao] [--label] [--line-buffered]\n" -7 "\t[--null] [padro] [arquivo ...]\n" -8 "arquivo binrio %s casa com o padro\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "opco no conhecida de %s" +3 "uso: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C[num]]\n" +4 "\t[-e padro] [-f arquivo] [--binary-files=valor] [--color=quando]\n" +5 "\t[--context[=num]] [--directories=ao] [--label] [--line-buffered]\n" +6 "\t[--null] [padro] [arquivo ...]\n" +7 "arquivo binrio %s casa com o padro\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/ru_RU.KOI8-R.msg ============================================================================== --- head/usr.bin/grep/nls/ru_RU.KOI8-R.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/ru_RU.KOI8-R.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "( )" -2 " bzip2 " -3 " %s" -4 ": %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A ] [-B ] [-C[]]\n" -5 "\t[-e ] [-f ] [--binary-files=] [--color=]\n" -6 "\t[--context[=]] [--directories=] [--label] [--line-buffered]\n" -7 "\t[--null] [] [ ...]\n" -8 " %s \n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 " %s" +3 ": %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A ] [-B ] [-C[]]\n" +4 "\t[-e ] [-f ] [--binary-files=] [--color=]\n" +5 "\t[--context[=]] [--directories=] [--label] [--line-buffered]\n" +6 "\t[--null] [] [ ...]\n" +7 " %s \n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/uk_UA.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/uk_UA.UTF-8.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/uk_UA.UTF-8.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -2,12 +2,11 @@ $ $FreeBSD$ $set 1 $quote " 1 "(стандартний ввід)" -2 "не можу прочитати стиснутий bzip2 файл" -3 "невiдома опція %s" -4 "використання: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A чис] [-B чис] [-C[чис]]\n" -5 "\t[-e шаблон] [-f файл] [--binary-files=значення] [--color=коли]\n" -6 "\t[--context[=чис] [--directories=дія] [--label] [--line-buffered]\n" -7 "\t[--null] [шаблон] [файл ...]\n" -8 "двійковий файл %s співпадає\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "невiдома опція %s" +3 "використання: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A чис] [-B чис] [-C[чис]]\n" +4 "\t[-e шаблон] [-f файл] [--binary-files=значення] [--color=коли]\n" +5 "\t[--context[=чис] [--directories=дія] [--label] [--line-buffered]\n" +6 "\t[--null] [шаблон] [файл ...]\n" +7 "двійковий файл %s співпадає\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/zh_CN.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/zh_CN.UTF-8.msg Wed Apr 25 15:39:36 2018 (r332999) +++ head/usr.bin/grep/nls/zh_CN.UTF-8.msg Wed Apr 25 15:41:50 2018 (r333000) @@ -3,12 +3,11 @@ $ $set 1 $quote " 1 "(标准输入)" -2 "读取 bzip2 压缩文件时出错" -3 "选项 %s 无法识别" -4 "用法: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A 行数] [-B 行数] [-C[行数]]\n" -5 "\t[-e 模式] [-f 文件] [--binary-files=值] [--color=何时]\n" -6 "\t[--context[=行数]] [--directories=动作] [--label] [--line-buffered]\n" -7 "\t[--null] [模式] [文件名 ...]\n" -8 "二进制文件 %s 包含模式\n" -9 "%s (BSD grep) %s\n" -10 "%s (BSD grep, GNU compatible) %s\n" +2 "选项 %s 无法识别" +3 "用法: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A 行数] [-B 行数] [-C[行数]]\n" +4 "\t[-e 模式] [-f 文件] [--binary-files=值] [--color=何时]\n" +5 "\t[--context[=行数]] [--directories=动作] [--label] [--line-buffered]\n" +6 "\t[--null] [模式] [文件名 ...]\n" +7 "二进制文件 %s 包含模式\n" +8 "%s (BSD grep) %s\n" +9 "%s (BSD grep, GNU compatible) %s\n" From owner-svn-src-head@freebsd.org Wed Apr 25 16:28:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B157BFA9F8E; Wed, 25 Apr 2018 16:28:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 621176BC8D; Wed, 25 Apr 2018 16:28:51 +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 58A683B8A; Wed, 25 Apr 2018 16:28:51 +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 w3PGSpkW027940; Wed, 25 Apr 2018 16:28:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PGSpYM027939; Wed, 25 Apr 2018 16:28:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804251628.w3PGSpYM027939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Apr 2018 16:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333001 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 333001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 16:28:51 -0000 Author: kevans Date: Wed Apr 25 16:28:51 2018 New Revision: 333001 URL: https://svnweb.freebsd.org/changeset/base/333001 Log: bsdgrep(1): Sneak in some man page updates - The --exclude{,-dir} and --include{,-dir} directives now match GNU behavior of being processed in order and latest matching directive wins - --label was previously not really documented, and -L and -l did not indicate that --label applied to them - The flags listed as being extensions to POSIX spec were not updated with the removal of compression-related flags MFC after: 1 week Modified: head/usr.bin/grep/grep.1 Modified: head/usr.bin/grep/grep.1 ============================================================================== --- head/usr.bin/grep/grep.1 Wed Apr 25 15:41:50 2018 (r333000) +++ head/usr.bin/grep/grep.1 Wed Apr 25 16:28:51 2018 (r333001) @@ -175,9 +175,11 @@ If specified, it excludes files matching the given filename pattern from the search. Note that .Fl Fl exclude -patterns take priority over +and .Fl Fl include -patterns, and if no +patterns are processed in the order given. +If a name patches multiple patterns, the latest matching rule wins. +If no .Fl Fl include pattern is specified, all files are searched that are not excluded. @@ -190,9 +192,11 @@ is specified, it excludes directories matching the given filename pattern from the search. Note that .Fl Fl exclude-dir -patterns take priority over +and .Fl Fl include-dir -patterns, and if no +patterns are processed in the order given. +If a name patches multiple patterns, the latest matching rule wins. +If no .Fl Fl include-dir pattern is specified, all directories are searched that are not excluded. @@ -242,10 +246,11 @@ is case sensitive. If specified, only files matching the given filename pattern are searched. Note that -.Fl Fl exclude -patterns take priority over .Fl Fl include -patterns. +and +.Fl Fl exclude +patterns are processed in the order given. +If a name patches multiple patterns, the latest matching rule wins. Patterns are matched to the full path specified, not only to the filename component. .It Fl Fl include-dir @@ -254,17 +259,20 @@ If is specified, only directories matching the given filename pattern are searched. Note that -.Fl Fl exclude-dir -patterns take priority over .Fl Fl include-dir -patterns. +and +.Fl Fl exclude-dir +patterns are processed in the order given. +If a name patches multiple patterns, the latest matching rule wins. .It Fl L , Fl Fl files-without-match Only the names of files not containing selected lines are written to standard output. Pathnames are listed once per file searched. If the standard input is searched, the string .Dq (standard input) -is written. +is written unless a +.Fl Fl label +is specified. .It Fl l , Fl Fl files-with-matches Only the names of files containing selected lines are written to standard output. @@ -274,7 +282,18 @@ making searches potentially less expensive. Pathnames are listed once per file searched. If the standard input is searched, the string .Dq (standard input) -is written. +is written unless a +.Fl Fl label +is specified. +.It Fl Fl label +Label to use in place of +.Dq (standard input) +for a file name where a file name would normally be printed. +This option applies to +.Fl H , +.Fl L , +and +.Fl l . .It Fl Fl mmap Use .Xr mmap 2 @@ -450,7 +469,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl AaBbCDdGHhIJLmoPRSUVwZ +.Op Fl AaBbCDdGHhILmoPRSUVw are extensions to that specification, and the behaviour of the .Fl f flag when used with an empty pattern file is left undefined. From owner-svn-src-head@freebsd.org Wed Apr 25 16:43:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39ED5FAA33C; Wed, 25 Apr 2018 16:43:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C98466ED9E; Wed, 25 Apr 2018 16:43:45 +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 BDD313EE8; Wed, 25 Apr 2018 16:43:45 +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 w3PGhjwB047840; Wed, 25 Apr 2018 16:43:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PGhjaw047839; Wed, 25 Apr 2018 16:43:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804251643.w3PGhjaw047839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 25 Apr 2018 16:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333002 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 333002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 16:43:46 -0000 Author: kib Date: Wed Apr 25 16:43:45 2018 New Revision: 333002 URL: https://svnweb.freebsd.org/changeset/base/333002 Log: Use CPUID leaf 0x15 to get TSC frequency when the calibration is disabled. Intel finally added this information, which allows us to not parse CPU identification string looking for the nominal frequency. The leaf is present e.g. on Appolo Lake Atom CPUs. It is only used if the TSC calibration is disabled by user. Also, report the TSC frequency in bootverbose mode always, regardless of the way it was obtained. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Wed Apr 25 16:28:51 2018 (r333001) +++ head/sys/x86/x86/tsc.c Wed Apr 25 16:43:45 2018 (r333002) @@ -129,6 +129,26 @@ tsc_freq_vmware(void) tsc_is_invariant = 1; } +/* + * Calculate TSC frequency using information from the CPUID leaf 0x15 + * 'Time Stamp Counter and Nominal Core Crystal Clock'. It should be + * an improvement over the parsing of the CPU model name in + * tsc_freq_intel(), when available. + */ +static bool +tsc_freq_cpuid(void) +{ + u_int regs[4]; + + if (cpu_high < 0x15) + return (false); + do_cpuid(0x15, regs); + if (regs[0] == 0 || regs[1] == 0 || regs[2] == 0) + return (false); + tsc_freq = (uint64_t)regs[2] * regs[1] / regs[0]; + return (true); +} + static void tsc_freq_intel(void) { @@ -253,17 +273,18 @@ probe_tsc_freq(void) } if (tsc_skip_calibration) { - if (cpu_vendor_id == CPU_VENDOR_INTEL) + if (tsc_freq_cpuid()) + ; + else if (cpu_vendor_id == CPU_VENDOR_INTEL) tsc_freq_intel(); - return; + } else { + if (bootverbose) + printf("Calibrating TSC clock ... "); + tsc1 = rdtsc(); + DELAY(1000000); + tsc2 = rdtsc(); + tsc_freq = tsc2 - tsc1; } - - if (bootverbose) - printf("Calibrating TSC clock ... "); - tsc1 = rdtsc(); - DELAY(1000000); - tsc2 = rdtsc(); - tsc_freq = tsc2 - tsc1; if (bootverbose) printf("TSC clock: %ju Hz\n", (intmax_t)tsc_freq); } From owner-svn-src-head@freebsd.org Wed Apr 25 17:51:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8DEBFAB5F5; Wed, 25 Apr 2018 17:51:18 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 829C97D27A; Wed, 25 Apr 2018 17:51:18 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D0DC49E0; Wed, 25 Apr 2018 17:51:18 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PHpIgQ078952; Wed, 25 Apr 2018 17:51:18 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PHpHMm078949; Wed, 25 Apr 2018 17:51:17 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201804251751.w3PHpHMm078949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 25 Apr 2018 17:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333003 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 333003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 17:51:19 -0000 Author: davidcs Date: Wed Apr 25 17:51:17 2018 New Revision: 333003 URL: https://svnweb.freebsd.org/changeset/base/333003 Log: Upgraded FW Related Files to version 5.4.67 MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_reset.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_boot.c ============================================================================== --- head/sys/dev/qlxgbe/ql_boot.c Wed Apr 25 16:43:45 2018 (r333002) +++ head/sys/dev/qlxgbe/ql_boot.c Wed Apr 25 17:51:17 2018 (r333003) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_bootloader_version_major = 5; unsigned int ql83xx_bootloader_version_minor = 4; -unsigned int ql83xx_bootloader_version_sub = 66; +unsigned int ql83xx_bootloader_version_sub = 67; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -10957,8 +10957,9 @@ unsigned char ql83xx_bootloader[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x93, 0x0e + 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x92, 0x0e }; unsigned int ql83xx_bootloader_len = 131072; + Modified: head/sys/dev/qlxgbe/ql_fw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_fw.c Wed Apr 25 16:43:45 2018 (r333002) +++ head/sys/dev/qlxgbe/ql_fw.c Wed Apr 25 17:51:17 2018 (r333003) @@ -35,32 +35,32 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 66; +unsigned int ql83xx_firmware_version_sub = 67; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe8, 0x46, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x64, 0x27, 0xbc, 0x1f, 0xfc, 0x30, 0xf6, 0x92, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa8, 0x49, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xba, 0x8f, 0x63, 0x84, 0x2f, 0x5a, 0x19, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0xf2, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xf3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x52, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x56, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xfc, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf7, 0x90, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x54, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xa1, 0x4e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xde, 0xfd, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa0, 0x91, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x58, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xa3, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xab, 0x8d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x74, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7e, 0x8f, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x76, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -69,118 +69,118 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1f, 0x98, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7c, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf4, 0x99, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x9b, 0xad, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x73, 0xaf, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xb2, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xdd, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x08, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0xb4, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xdf, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5a, 0xbd, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x03, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2a, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x33, 0xbf, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x2e, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5d, 0xdc, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x35, 0xde, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0xe8, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xbd, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xb0, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xea, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xbb, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xb4, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0xef, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x71, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x66, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x90, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xdd, 0xf0, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xb9, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa0, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x73, 0x12, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x96, 0x14, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x1d, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x81, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x50, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x1f, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa2, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x54, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfc, 0x39, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x42, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x26, 0x43, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6a, 0x45, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x4b, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x51, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xdc, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x4d, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xe0, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x8e, 0x4e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x26, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xcf, 0x50, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x26, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb4, 0x50, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc9, 0x0a, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf5, 0x52, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x0a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x5b, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xbb, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x5d, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xad, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1c, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x38, 0x7c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7c, 0xa1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6f, 0x7e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0e, 0xa2, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb4, 0x1d, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7d, 0x20, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x6e, 0x1e, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x48, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd1, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x37, 0x21, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -189,7 +189,7 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xb6, 0x43, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x72, 0x46, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x58, 0xe0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -232,9 +232,9 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x4d, 0x1a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xcc, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x92, 0x05, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0x4f, 0x1a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd3, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x92, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -249,143239 +249,143273 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xda, 0xec, 0x3d, - 0x0b, 0x70, 0x5c, 0xd5, 0x75, 0xf7, 0x7d, 0x76, 0xf7, 0x69, 0xb5, 0x2b, - 0xad, 0x1d, 0x41, 0x84, 0x2c, 0xd7, 0x4f, 0xb6, 0xb1, 0xc5, 0x77, 0x9e, - 0x8d, 0x6d, 0x8c, 0x31, 0xe1, 0x49, 0x96, 0x1d, 0xdb, 0x91, 0x88, 0x80, - 0x86, 0x5f, 0x80, 0x0a, 0xda, 0x52, 0x41, 0x08, 0x16, 0x33, 0x84, 0x8a, - 0xc0, 0xd8, 0x4f, 0xb6, 0x24, 0x1b, 0x90, 0x13, 0x19, 0x3b, 0x8e, 0x03, - 0x34, 0x5e, 0x09, 0x4c, 0x69, 0xcb, 0x74, 0x96, 0x49, 0x9a, 0x30, 0x6d, - 0x67, 0x58, 0xdb, 0x99, 0x60, 0x52, 0x9c, 0xba, 0x9d, 0xd0, 0x86, 0x74, - 0x68, 0xb6, 0x93, 0x32, 0xa3, 0x12, 0x20, 0xdb, 0x4e, 0x26, 0x91, 0x43, - 0x0d, 0xbd, 0xe7, 0x7e, 0xde, 0xe7, 0xee, 0x7b, 0x6f, 0xf7, 0xca, 0xb2, - 0x33, 0xe9, 0x58, 0x99, 0x09, 0x3a, 0xbe, 0xf7, 0x9c, 0x77, 0xee, 0xb9, - 0xe7, 0x9e, 0x73, 0xee, 0x39, 0xe7, 0x3d, 0x21, 0x05, 0xd1, 0x1f, 0x1d, - 0x69, 0x48, 0x45, 0x77, 0xa1, 0x73, 0xf0, 0xef, 0x26, 0x4c, 0x7f, 0xfa, - 0x18, 0x7c, 0xe2, 0xdd, 0xb7, 0xc9, 0xff, 0xbe, 0x58, 0x01, 0x07, 0x7f, - 0x0a, 0x02, 0x9c, 0x97, 0x84, 0x1d, 0x15, 0x99, 0xe4, 0x97, 0xbd, 0x29, - 0xf2, 0x9f, 0x81, 0x8a, 0xf9, 0x0a, 0x72, 0xec, 0x9c, 0x0f, 0x66, 0xbf, - 0x9b, 0xf9, 0x0c, 0xe5, 0x17, 0x15, 0x35, 0xce, 0x3a, 0x42, 0x75, 0x79, - 0x9d, 0x02, 0xbd, 0xb7, 0xd1, 0x9f, 0xfb, 0xa2, 0x9e, 0xb7, 0x11, 0x45, - 0x3c, 0x4f, 0x12, 0xe6, 0xf4, 0x8e, 0xcf, 0x32, 0xbd, 0xc5, 0xca, 0xec, - 0xd2, 0x5b, 0x3e, 0xcb, 0xf4, 0xb6, 0xa8, 0x33, 0xa3, 0xc7, 0xf1, 0x3f, - 0xaf, 0xcf, 0x08, 0x3f, 0x44, 0xdf, 0x2c, 0x07, 0x48, 0x5d, 0xb4, 0xfc, - 0xce, 0x4d, 0x73, 0xd0, 0xf0, 0xd7, 0x30, 0x49, 0x80, 0x4f, 0xb4, 0x0f, - 0xbf, 0xf9, 0x83, 0x6e, 0x25, 0xb7, 0x07, 0xa3, 0x00, 0x9c, 0xbf, 0x7f, - 0xfe, 0xda, 0x35, 0x88, 0x8c, 0x97, 0xf9, 0xf8, 0x7b, 0x0f, 0x28, 0x79, - 0x3c, 0x6e, 0x0d, 0x01, 0xfe, 0x7d, 0x37, 0xbe, 0x76, 0xf9, 0x22, 0x8a, - 0x3f, 0xc4, 0xc6, 0x1b, 0xf6, 0x28, 0xd6, 0x53, 0x18, 0x7f, 0x88, 0xd3, - 0xff, 0x27, 0x8a, 0x3f, 0x14, 0xa4, 0x6f, 0x6d, 0xc7, 0x70, 0xef, 0xa6, - 0xcb, 0x13, 0x17, 0x5d, 0x46, 0xf1, 0xb7, 0xb3, 0xf1, 0x1b, 0xde, 0x54, - 0x7a, 0xf7, 0x62, 0x7c, 0x80, 0xfb, 0xd6, 0xdc, 0xf6, 0xc2, 0xfd, 0x49, - 0x8a, 0xcf, 0xc7, 0x1f, 0xfa, 0xb5, 0xd2, 0x37, 0x8e, 0xf1, 0x77, 0xb8, - 0xf4, 0x15, 0x82, 0xbf, 0x43, 0xe0, 0x1f, 0xe0, 0xfc, 0xab, 0xff, 0xbd, - 0x78, 0x95, 0x41, 0xf1, 0xf9, 0xf8, 0x2b, 0x57, 0xa3, 0x5e, 0x78, 0xfe, - 0x30, 0x86, 0x07, 0x72, 0xaf, 0xd9, 0x4d, 0x74, 0x7d, 0x03, 0xc3, 0x6c, - 0xfc, 0x27, 0x77, 0x6c, 0x35, 0x30, 0xfd, 0x02, 0xc0, 0x7d, 0x99, 0x51, - 0x2b, 0xd7, 0x42, 0xf1, 0xf9, 0xf8, 0xda, 0xbb, 0xb7, 0xee, 0x82, 0xe7, - 0x8f, 0x00, 0xff, 0xc6, 0x7a, 0x33, 0xc3, 0xd6, 0x3f, 0xc2, 0xc6, 0x3b, - 0x87, 0xb7, 0x1a, 0xf0, 0x7c, 0x80, 0x6d, 0x5d, 0xcf, 0x19, 0x19, 0x8a, - 0xcf, 0xc7, 0xff, 0xe8, 0x85, 0xad, 0xbb, 0xe0, 0xf9, 0xa3, 0xba, 0xb7, - 0x1f, 0x98, 0xde, 0x80, 0x00, 0x17, 0x04, 0xb8, 0x2c, 0xc0, 0xd6, 0x4e, - 0x01, 0x5f, 0x80, 0x0b, 0x02, 0x5c, 0x16, 0x60, 0x6b, 0x17, 0xf0, 0xd7, - 0xb4, 0xe1, 0xae, 0x56, 0x33, 0xb7, 0xf2, 0x69, 0x8c, 0x0f, 0x70, 0xde, - 0xba, 0x5b, 0xbf, 0x64, 0xcb, 0x36, 0x58, 0x5f, 0x01, 0xe0, 0xde, 0xe6, - 0x9d, 0x0f, 0x36, 0x5d, 0x44, 0xc6, 0xcb, 0x7c, 0xbc, 0x67, 0xcf, 0x36, - 0x58, 0x9f, 0xf5, 0x38, 0xc8, 0xa7, 0xf5, 0x88, 0xa2, 0x2f, 0xa7, 0xf8, - 0x8f, 0xb3, 0xf1, 0x2d, 0xdf, 0xda, 0x06, 0xeb, 0x2b, 0x00, 0x3c, 0xd0, - 0xaa, 0xe4, 0x8c, 0xab, 0x29, 0x3e, 0x1f, 0xdf, 0xf3, 0xe6, 0x36, 0x03, - 0xeb, 0x87, 0xf5, 0x04, 0xe5, 0x67, 0x49, 0xab, 0x49, 0xf9, 0x27, 0x70, - 0x7d, 0x06, 0x19, 0x3d, 0x77, 0x11, 0xfe, 0xd9, 0xf8, 0x0a, 0x36, 0x5e, - 0x26, 0xf0, 0x93, 0x0a, 0x1f, 0xb7, 0x9e, 0x14, 0xd6, 0x2f, 0xc0, 0x05, - 0x01, 0x2e, 0x0b, 0xb0, 0x35, 0x26, 0xe0, 0x0b, 0x70, 0x41, 0x80, 0xcb, - 0x02, 0x6c, 0xed, 0x16, 0xf0, 0x05, 0xb8, 0x20, 0xc0, 0x65, 0x01, 0xb6, - 0xbe, 0x22, 0xe0, 0x0b, 0x70, 0x41, 0x80, 0xcb, 0x02, 0x6c, 0x7d, 0x55, - 0xc0, 0x17, 0xe0, 0x82, 0x00, 0x97, 0x05, 0xd8, 0xb2, 0x31, 0xec, 0xf4, - 0xbf, 0x97, 0xe4, 0xf8, 0x00, 0x97, 0x16, 0xfd, 0xe4, 0x61, 0x8e, 0x0f, - 0x70, 0xf1, 0x37, 0xc7, 0x46, 0x35, 0x86, 0x0f, 0x70, 0xfe, 0xe5, 0x8f, - 0x7e, 0xc5, 0x60, 0xab, 0x03, 0xc3, 0xb9, 0xdd, 0x2b, 0xeb, 0x6c, 0x86, - 0x0f, 0xf0, 0x40, 0xd7, 0xa2, 0x47, 0x18, 0x5c, 0x00, 0xb8, 0x77, 0xc1, - 0x9e, 0xdd, 0xeb, 0x18, 0x3e, 0xc0, 0xd6, 0xbf, 0xec, 0x3c, 0xc5, 0x60, - 0xab, 0x53, 0xe0, 0x5f, 0x80, 0x0b, 0x02, 0x5c, 0x16, 0x60, 0x6b, 0x9d, - 0x80, 0x2f, 0xc0, 0x05, 0x01, 0x2e, 0x0b, 0xb0, 0xd5, 0x25, 0xe0, 0x0b, - 0x70, 0x41, 0x80, 0xcb, 0x02, 0x6c, 0xad, 0x17, 0xf0, 0x05, 0xb8, 0x20, - 0xc0, 0x65, 0x01, 0xb6, 0x36, 0x08, 0xf8, 0x02, 0x5c, 0x10, 0xe0, 0xb2, - 0x00, 0x5b, 0x9f, 0x16, 0xf0, 0x05, 0xb8, 0x20, 0xc0, 0x65, 0x01, 0xb6, - 0x36, 0xc2, 0xfe, 0x7c, 0xee, 0x4d, 0xbe, 0x9f, 0x03, 0x00, 0x9f, 0xf8, - 0xd2, 0xdb, 0x1c, 0x2e, 0x90, 0xf1, 0xfd, 0xef, 0x70, 0xb8, 0x4c, 0xc6, - 0xbf, 0xf3, 0xbe, 0xbb, 0xff, 0x9b, 0xe0, 0xfc, 0x5f, 0xfd, 0x57, 0xa7, - 0x38, 0x3e, 0x81, 0x3f, 0xff, 0x6d, 0x0e, 0x17, 0x08, 0xfc, 0xe8, 0x08, - 0x87, 0xcb, 0x00, 0x97, 0x0f, 0x7e, 0x85, 0xc3, 0xd6, 0x66, 0x80, 0x5f, - 0x1d, 0x77, 0xf1, 0x09, 0xfc, 0xd3, 0x6f, 0xb8, 0xf8, 0x00, 0xa3, 0x39, - 0x0b, 0x4f, 0x72, 0x7c, 0x80, 0xc7, 0x57, 0x5e, 0xc2, 0x61, 0xeb, 0x33, - 0x18, 0x36, 0x3b, 0x75, 0x0e, 0x0f, 0x00, 0x5c, 0xb8, 0x27, 0xcb, 0xe1, - 0x02, 0xc0, 0xf6, 0xae, 0x9c, 0x8b, 0x0f, 0xf0, 0x89, 0x97, 0x2e, 0x70, - 0xf1, 0xbb, 0x81, 0x7e, 0xf1, 0x35, 0x77, 0xfd, 0xdd, 0x54, 0x3e, 0x65, - 0x8e, 0x2f, 0xc0, 0x65, 0x01, 0xb6, 0x7a, 0x82, 0xf0, 0x80, 0x00, 0x17, - 0x04, 0xb8, 0x2c, 0xc0, 0xd6, 0x75, 0x02, 0xbe, 0x00, 0x17, 0x04, 0xb8, - 0x2c, 0xc0, 0xd6, 0x67, 0x05, 0x7c, 0x01, 0x2e, 0x08, 0x70, 0x59, 0x80, - 0x83, 0xf1, 0x5d, 0x65, 0x7c, 0x30, 0xc7, 0x0f, 0x57, 0x8d, 0x37, 0x4c, - 0xfe, 0x9b, 0xc2, 0x82, 0x4a, 0xf6, 0xb0, 0x46, 0xc5, 0x0d, 0x32, 0xab, - 0xc4, 0x2b, 0x03, 0x8a, 0xed, 0xd3, 0x4f, 0x4a, 0x2f, 0x91, 0xc0, 0xf6, - 0x1f, 0x62, 0x6e, 0x3c, 0x7e, 0x5b, 0x82, 0x8d, 0x7d, 0xb4, 0x00, 0x99, - 0xbd, 0xd5, 0xe9, 0xc9, 0xf1, 0xcf, 0xce, 0x46, 0xe9, 0x63, 0xfa, 0xb3, - 0x45, 0x3e, 0x9e, 0x9a, 0x55, 0xb8, 0x50, 0x7d, 0x7f, 0xe4, 0x60, 0xb6, - 0xbe, 0x72, 0xc4, 0xfa, 0xaa, 0x3e, 0xaf, 0x0a, 0x7e, 0xd5, 0xfb, 0x8a, - 0xe4, 0xf3, 0x1c, 0xd7, 0x56, 0xd9, 0x5c, 0x7f, 0xb2, 0xec, 0xbe, 0xd2, - 0x8f, 0x47, 0x15, 0xf7, 0x3e, 0x83, 0x90, 0x41, 0xc6, 0x3d, 0xe3, 0x6c, - 0xa2, 0x03, 0x47, 0x95, 0x21, 0x94, 0x2b, 0x22, 0xa3, 0x99, 0xce, 0x37, - 0xb7, 0xe3, 0xf9, 0xe8, 0x52, 0x95, 0x91, 0xfe, 0x38, 0x5c, 0x7f, 0x32, - 0x41, 0xfa, 0xe8, 0x0d, 0x36, 0x34, 0xc5, 0xe0, 0xdf, 0xee, 0xfe, 0x55, - 0x93, 0xd7, 0x39, 0xf8, 0xf4, 0xce, 0xff, 0x99, 0x87, 0x67, 0x97, 0x1f, - 0x13, 0x09, 0xf9, 0x07, 0xfc, 0x0f, 0x9f, 0x6a, 0xf1, 0xcd, 0x67, 0xf6, - 0xd7, 0x1d, 0x47, 0xdf, 0x43, 0x41, 0xfd, 0xce, 0x65, 0x82, 0x30, 0x9c, - 0xa8, 0x24, 0xf2, 0xce, 0x15, 0x46, 0x4a, 0x5b, 0xc3, 0x9d, 0x1d, 0xed, - 0x54, 0xbe, 0x98, 0x7e, 0xba, 0x85, 0x9e, 0x2f, 0x53, 0xf5, 0xdb, 0x63, - 0xe7, 0xd4, 0x99, 0xb0, 0xc7, 0xd5, 0xe1, 0x46, 0x1f, 0x58, 0xcb, 0xf3, - 0xf9, 0x7c, 0xa7, 0x41, 0x6e, 0x3e, 0x9a, 0x2f, 0x49, 0xff, 0x12, 0x49, - 0xfa, 0x6b, 0x24, 0xe9, 0x6f, 0x94, 0xa4, 0x7f, 0xb3, 0x24, 0xfd, 0x3f, - 0x96, 0xa4, 0xff, 0x90, 0x24, 0xfd, 0xed, 0x92, 0xf4, 0xf7, 0x48, 0xd2, - 0x3f, 0x28, 0x49, 0xff, 0xaf, 0x25, 0xe9, 0xff, 0xbd, 0x24, 0xfd, 0x7f, - 0x90, 0xa4, 0xff, 0x96, 0x24, 0xfd, 0x29, 0x49, 0xfa, 0xbf, 0x92, 0xa4, - 0x9f, 0x50, 0xe4, 0xe8, 0x7f, 0x42, 0x6e, 0x3e, 0x5a, 0x28, 0x49, 0xdf, - 0x92, 0xa4, 0x7f, 0xad, 0x24, 0xfd, 0x1e, 0x49, 0xfa, 0xb7, 0x4b, 0xd2, - 0xbf, 0x4f, 0x92, 0xfe, 0x23, 0x92, 0xf4, 0x77, 0x4a, 0xd2, 0xdf, 0x2f, - 0x49, 0xff, 0x79, 0x49, 0xfa, 0xdf, 0x92, 0xa4, 0x7f, 0x58, 0x92, 0xfe, - 0x09, 0x49, 0xfa, 0xff, 0x2e, 0x49, 0xff, 0x7d, 0x49, 0xfa, 0x1f, 0x4a, - 0xd2, 0x4f, 0xab, 0x72, 0xf4, 0x9b, 0xe5, 0xe6, 0xa3, 0xa5, 0x92, 0xf4, - 0x57, 0x4a, 0xd2, 0xef, 0x92, 0xa4, 0x7f, 0x83, 0x24, 0xfd, 0xbb, 0x24, - 0xe9, 0x6f, 0x91, 0xa4, 0xbf, 0x55, 0x92, 0xfe, 0x98, 0x24, 0xfd, 0x67, - 0x24, 0xe9, 0xff, 0x85, 0x24, 0xfd, 0x57, 0x24, 0xe9, 0x7f, 0x5f, 0x92, - 0xfe, 0x9b, 0x92, 0xf4, 0x7f, 0x26, 0x49, 0xff, 0x7f, 0x24, 0xe9, 0x23, - 0x4d, 0x8e, 0x7e, 0xa3, 0xdc, 0x7c, 0x67, 0xbe, 0x24, 0xfd, 0x4b, 0x25, - 0xe9, 0xaf, 0x91, 0xa4, 0xbf, 0x49, 0x92, 0xfe, 0xcd, 0x92, 0xf4, 0xef, - 0x91, 0xa4, 0xff, 0x90, 0x24, 0xfd, 0x1d, 0x92, 0xf4, 0xf7, 0x48, 0xd2, - 0xcf, 0x6b, 0x67, 0xe3, 0xfe, 0xe1, 0xf4, 0xa0, 0xcb, 0x7f, 0x0f, 0x7e, - 0xfd, 0xf9, 0xb5, 0x88, 0xe4, 0x13, 0x8e, 0xb3, 0x0a, 0x70, 0x7f, 0x82, - 0xde, 0x9f, 0xb2, 0x2c, 0xbf, 0x30, 0xa5, 0x03, 0xcc, 0xeb, 0x75, 0xff, - 0x7a, 0x3d, 0x7f, 0xde, 0x6e, 0x9e, 0x5f, 0xd0, 0xd9, 0x7c, 0x7e, 0x1f, - 0x53, 0xd0, 0x90, 0x92, 0xa7, 0xd7, 0xae, 0xa7, 0xf1, 0xad, 0x6d, 0x09, - 0x2a, 0xe9, 0x5e, 0xbd, 0x36, 0x6f, 0x5f, 0x45, 0xae, 0x62, 0xf8, 0x9f, - 0x9a, 0xda, 0x35, 0xd4, 0x0a, 0xac, 0xe4, 0x8f, 0x2a, 0x43, 0x9c, 0xfe, - 0xdf, 0x3d, 0x47, 0xe9, 0x1b, 0x48, 0x41, 0x36, 0xa4, 0xf2, 0x6f, 0x19, - 0x44, 0x94, 0xbf, 0x20, 0xff, 0x7c, 0xfe, 0xd0, 0xc3, 0xe1, 0xeb, 0x37, - 0x0d, 0x84, 0xec, 0xb4, 0x59, 0x8f, 0xa6, 0xaf, 0x44, 0xa5, 0x14, 0x7a, - 0x0e, 0xa9, 0x2c, 0xdf, 0x73, 0x25, 0x49, 0xc0, 0xf4, 0xb9, 0x17, 0xec, - 0x76, 0x9b, 0xf1, 0x63, 0x9f, 0x87, 0xf9, 0x79, 0xf6, 0xfb, 0x8b, 0x9b, - 0x93, 0xcb, 0x9a, 0x46, 0x1d, 0x03, 0xed, 0x1e, 0xda, 0x4b, 0x4a, 0x09, - 0x53, 0x9a, 0x7f, 0xfd, 0x9c, 0x3f, 0xa4, 0xf4, 0x1c, 0xa5, 0xf5, 0xe8, - 0x7e, 0x95, 0xac, 0x9f, 0x25, 0xfb, 0xcc, 0x7a, 0x22, 0x87, 0x3e, 0xc8, - 0xe2, 0x10, 0xfe, 0x0d, 0x0b, 0xe1, 0x67, 0xf3, 0x7c, 0x13, 0xba, 0x89, - 0xd5, 0xab, 0x8d, 0x1d, 0x13, 0xf5, 0xa0, 0x1c, 0x6d, 0x4c, 0x49, 0x2a, - 0xe9, 0xd7, 0x1d, 0x61, 0xf4, 0x03, 0xf9, 0xa1, 0x36, 0x46, 0x1f, 0x96, - 0x63, 0xab, 0x95, 0xf4, 0x6f, 0x66, 0xf4, 0xd3, 0x43, 0x13, 0xc0, 0x82, - 0x73, 0x51, 0x24, 0x7d, 0x25, 0x48, 0xdf, 0xce, 0x1e, 0x69, 0x6b, 0x65, - 0xfb, 0x87, 0x61, 0xa3, 0x42, 0x3e, 0xf4, 0xe7, 0x16, 0x46, 0xbf, 0x82, - 0x9e, 0xab, 0x0f, 0x53, 0x0c, 0x7f, 0xb7, 0x46, 0xd6, 0xcf, 0xe8, 0xf1, - 0xf9, 0x8d, 0xcf, 0xd3, 0xf9, 0xba, 0x40, 0x1f, 0xa1, 0x31, 0x1e, 0xfe, - 0x13, 0x79, 0xdb, 0xe8, 0x0d, 0xc5, 0x86, 0x47, 0x35, 0xdf, 0xaf, 0x42, - 0xbe, 0x8b, 0xf1, 0xe3, 0xdc, 0xca, 0xeb, 0xfd, 0x64, 0x3f, 0x47, 0xeb, - 0x20, 0x9f, 0xea, 0x24, 0xb0, 0x12, 0x75, 0xf4, 0x1c, 0x51, 0x5a, 0xf1, - 0xae, 0x4f, 0x6f, 0xd1, 0x4a, 0x23, 0xca, 0xc4, 0xed, 0xd7, 0x39, 0x7a, - 0x09, 0xad, 0x56, 0x15, 0xf4, 0x62, 0xe2, 0x07, 0x08, 0xed, 0xc4, 0xfb, - 0x75, 0x24, 0x9b, 0xf3, 0xf8, 0xab, 0xe4, 0x9f, 0xeb, 0x3b, 0x5f, 0xff, - 0x71, 0x65, 0x6d, 0x08, 0xff, 0x7c, 0x3e, 0xe3, 0xdf, 0xb9, 0x83, 0xf3, - 0x03, 0xfa, 0x76, 0x3e, 0xf0, 0x4b, 0xf7, 0x03, 0xf8, 0x4d, 0x42, 0x2f, - 0xc3, 0x31, 0x0a, 0x23, 0xb4, 0x3a, 0xc5, 0x50, 0x92, 0xe1, 0xf7, 0x15, - 0xf7, 0xfc, 0x29, 0xf4, 0x3c, 0x75, 0xf3, 0xf3, 0x45, 0xe4, 0xc1, 0xe5, - 0xf5, 0x07, 0x11, 0xf2, 0x37, 0x50, 0x8f, 0x46, 0xf9, 0xa5, 0xeb, 0xe3, - 0xfc, 0xad, 0x8f, 0x9c, 0x1f, 0x94, 0xa7, 0xab, 0xaf, 0xc2, 0xf9, 0x9a, - 0x9b, 0x08, 0xac, 0xb7, 0x57, 0xa1, 0x89, 0x98, 0x3e, 0x2f, 0xbf, 0x38, - 0xa5, 0x86, 0xe5, 0x13, 0x41, 0xd4, 0x36, 0x10, 0x3d, 0xb0, 0x90, 0xad, - 0xbf, 0x9b, 0xb3, 0x94, 0xa8, 0xe5, 0xbe, 0x16, 0x21, 0x6f, 0xf4, 0x87, - 0x8c, 0xdf, 0x33, 0xbd, 0x3e, 0x03, 0xdb, 0x33, 0x22, 0xcf, 0xe9, 0x47, - 0xe2, 0xf6, 0x1f, 0xdd, 0xe3, 0xf6, 0x9f, 0x84, 0xf3, 0xff, 0x7e, 0x03, - 0x9d, 0x0f, 0xb3, 0xd6, 0xea, 0xa6, 0x06, 0xfa, 0x5a, 0x4a, 0xa0, 0x09, - 0x6a, 0x2f, 0x26, 0x1b, 0x5c, 0xfb, 0x88, 0x1a, 0x90, 0x7b, 0x54, 0x25, - 0xe4, 0xf3, 0x36, 0xf2, 0xf8, 0x81, 0x82, 0x26, 0x6a, 0xe7, 0xfa, 0xe6, - 0x9e, 0x27, 0xd5, 0xcf, 0xff, 0xab, 0xe9, 0xda, 0xfc, 0x05, 0x9f, 0x3f, - 0x59, 0x2f, 0x37, 0x5f, 0x3c, 0x1f, 0xfd, 0x55, 0xe4, 0x73, 0xdf, 0x69, - 0xd2, 0xbf, 0xd7, 0xa5, 0xdf, 0xcd, 0xd7, 0x9b, 0x08, 0xcf, 0x6f, 0x8f, - 0x09, 0xfe, 0xca, 0xd1, 0x71, 0x24, 0x05, 0x25, 0x35, 0xe5, 0x95, 0xa3, - 0x68, 0xa8, 0xc2, 0x9f, 0x62, 0x07, 0xd1, 0x40, 0xfc, 0xe3, 0x22, 0x26, - 0x4f, 0x91, 0x9e, 0xee, 0x2b, 0x3f, 0x56, 0xd4, 0x9f, 0x7c, 0xfe, 0xf5, - 0x24, 0xf1, 0xaf, 0x26, 0xde, 0x55, 0x7b, 0xee, 0xbe, 0x04, 0x32, 0x2d, - 0x54, 0x4c, 0xe1, 0xfd, 0x47, 0xb7, 0x32, 0x6d, 0x74, 0x9a, 0x60, 0xbf, - 0x1d, 0x74, 0xbc, 0xc3, 0x6e, 0xf0, 0x9d, 0x7f, 0xa6, 0xc0, 0xbf, 0xf8, - 0x73, 0xb6, 0x3e, 0xf2, 0xb4, 0x91, 0x34, 0xe8, 0x8f, 0xe9, 0xf3, 0xa7, - 0xe8, 0x00, 0x98, 0x6f, 0xca, 0x1f, 0x56, 0x5a, 0xbd, 0xf6, 0x7c, 0xf2, - 0x27, 0x62, 0xe3, 0x07, 0xf7, 0xbc, 0xfc, 0x78, 0x49, 0xe8, 0xfa, 0xf9, - 0x7e, 0x38, 0x7d, 0xc9, 0xc0, 0x79, 0x70, 0x90, 0xad, 0xf9, 0xfd, 0x85, - 0xea, 0x6c, 0xd0, 0xfc, 0xe7, 0x93, 0xcf, 0x67, 0xcb, 0x2b, 0x7c, 0x71, - 0x1e, 0x0a, 0xd5, 0x0f, 0xfe, 0xcb, 0xb3, 0x6a, 0x6d, 0xfc, 0x45, 0xf3, - 0xd3, 0xa1, 0x9d, 0x59, 0xfa, 0x9d, 0x67, 0x98, 0xfe, 0xba, 0x33, 0x4c, - 0xff, 0x33, 0x6c, 0x7f, 0x50, 0xb1, 0x43, 0x8d, 0x8b, 0x1f, 0xdf, 0x10, - 0xfc, 0x53, 0xd4, 0x79, 0x59, 0x16, 0x7e, 0x5e, 0xf8, 0x79, 0xb0, 0xdf, - 0x13, 0xe2, 0xcd, 0xa9, 0x14, 0xd0, 0xcb, 0x61, 0xff, 0x4b, 0xfc, 0x45, - 0xf3, 0x96, 0x54, 0x71, 0xbb, 0x67, 0xaf, 0x94, 0xcf, 0x71, 0xfb, 0xb9, - 0x5b, 0x6b, 0x48, 0x0e, 0x63, 0x5b, 0x76, 0x2a, 0x99, 0x1f, 0xc5, 0xf8, - 0x84, 0xd7, 0xc9, 0x3a, 0xcf, 0x7e, 0xd6, 0x29, 0x7e, 0xff, 0x02, 0xd8, - 0xcb, 0xd3, 0x81, 0xf3, 0xcf, 0xfd, 0x7b, 0x12, 0x95, 0xe8, 0xf9, 0x22, - 0xfe, 0x7a, 0xfa, 0x0a, 0xca, 0x2f, 0xb6, 0xc7, 0x4b, 0xe6, 0x03, 0x3a, - 0xe3, 0x9f, 0xf7, 0x43, 0x8e, 0x6b, 0x50, 0x03, 0xc6, 0xe7, 0xf5, 0x96, - 0x78, 0xfb, 0xcc, 0xe2, 0x3f, 0x7b, 0xdd, 0x55, 0x01, 0x7d, 0xfe, 0x8e, - 0xbb, 0x3f, 0x8f, 0xf3, 0x78, 0x3a, 0xeb, 0x8f, 0x17, 0xf9, 0x7c, 0x76, - 0x1e, 0x06, 0x52, 0x13, 0x8b, 0x19, 0xfe, 0xeb, 0x28, 0x30, 0x1f, 0x1d, - 0x53, 0xfc, 0x30, 0xb7, 0x7f, 0xce, 0x83, 0x5a, 0xc0, 0xff, 0x71, 0x79, - 0x19, 0xe8, 0x75, 0xa5, 0x01, 0xb6, 0xda, 0x39, 0x49, 0xe3, 0x67, 0x62, - 0x2f, 0x26, 0x33, 0x9e, 0xbc, 0x32, 0x01, 0x79, 0x01, 0x73, 0xab, 0x03, - 0xfb, 0xef, 0xc6, 0x1f, 0x54, 0x5e, 0xc4, 0x7e, 0x79, 0xf2, 0x02, 0xf6, - 0x17, 0x66, 0x7d, 0xf2, 0x82, 0x05, 0xe4, 0xaf, 0xab, 0xf7, 0xf0, 0xe7, - 0x49, 0xf9, 0x33, 0xfe, 0xcb, 0x31, 0x57, 0x5e, 0x9b, 0x78, 0x7c, 0xd1, - 0x40, 0xd6, 0xcf, 0xfa, 0x16, 0x53, 0x87, 0xb9, 0x7c, 0xea, 0x54, 0xff, - 0x38, 0x3c, 0x9e, 0xae, 0x77, 0x59, 0x40, 0xdf, 0xb9, 0x3c, 0x98, 0xbc, - 0x6c, 0x2e, 0x2f, 0x6a, 0x29, 0x27, 0xd3, 0x9e, 0x3c, 0xd2, 0x15, 0xfa, - 0xb3, 0x22, 0x1d, 0xaa, 0xff, 0x54, 0x1e, 0x58, 0x9e, 0x76, 0xb3, 0x27, - 0x0f, 0x10, 0x6f, 0x7b, 0x9d, 0x4f, 0x1e, 0x6c, 0x1d, 0x2f, 0xe8, 0x1c, - 0xff, 0xd6, 0x19, 0xc9, 0xe3, 0x2d, 0x57, 0x1e, 0xaf, 0xf3, 0xe7, 0x37, - 0xd0, 0xf8, 0x98, 0xc9, 0xe3, 0x65, 0x2e, 0x8f, 0xc7, 0x03, 0xe3, 0x35, - 0xca, 0x03, 0x0d, 0x73, 0x79, 0x18, 0xdc, 0xdb, 0x73, 0x79, 0xd4, 0x57, - 0xe8, 0xc7, 0xaa, 0x38, 0xfd, 0xc0, 0xb3, 0xc9, 0x7d, 0x82, 0x9f, 0x27, - 0x68, 0x66, 0x39, 0xcf, 0x27, 0x0f, 0xee, 0xaf, 0x5e, 0x84, 0x70, 0x04, - 0xce, 0x53, 0xeb, 0x8c, 0xe4, 0xf1, 0xf3, 0x0a, 0xfd, 0xe8, 0x6f, 0xa4, - 0xf6, 0x83, 0xc5, 0x9b, 0xcd, 0x78, 0x9d, 0x1a, 0x97, 0xff, 0x30, 0xde, - 0x11, 0x0b, 0xe2, 0x22, 0x8c, 0xbf, 0x49, 0xf5, 0xcf, 0xaf, 0x55, 0x5f, - 0x6a, 0x95, 0x0f, 0x60, 0xaf, 0x0a, 0xda, 0x9b, 0x80, 0xbe, 0xb8, 0xf6, - 0x98, 0xcb, 0x87, 0x8c, 0xee, 0x35, 0x80, 0x3f, 0x04, 0xf1, 0x20, 0x8e, - 0x4a, 0xf6, 0x34, 0xf9, 0xf1, 0x6f, 0x9b, 0x91, 0x7c, 0xfe, 0xd7, 0xb3, - 0x37, 0xfc, 0xf9, 0x39, 0xdf, 0xfd, 0xd1, 0xd4, 0x0c, 0xee, 0x6f, 0xeb, - 0x34, 0xff, 0x78, 0x8d, 0xf2, 0x70, 0x5c, 0x79, 0x90, 0xe1, 0xc9, 0xac, - 0x27, 0x8f, 0x6c, 0x85, 0xbe, 0xac, 0x09, 0xea, 0x4b, 0xac, 0xfd, 0x85, - 0x00, 0x65, 0x49, 0xa3, 0x60, 0x7f, 0xcd, 0xcf, 0x1a, 0x1e, 0x7e, 0xf3, - 0x8c, 0xe4, 0xc1, 0xba, 0x2c, 0x06, 0xbc, 0xfd, 0x9f, 0x6a, 0xf4, 0xdd, - 0x6f, 0x73, 0x9e, 0x3c, 0x5c, 0x7b, 0xdb, 0x18, 0x16, 0x3f, 0x72, 0x79, - 0x7c, 0x70, 0x53, 0x44, 0xbe, 0x81, 0x46, 0xcb, 0x09, 0x2e, 0x0f, 0x26, - 0xaf, 0xe2, 0x50, 0xa4, 0x7d, 0xde, 0x44, 0xed, 0x73, 0xf1, 0x11, 0x96, - 0xdf, 0xe0, 0xfa, 0x32, 0xe5, 0xbf, 0xef, 0x39, 0x91, 0xf8, 0x0a, 0xec, - 0xd7, 0xa8, 0x81, 0x8a, 0xcb, 0xa0, 0xcc, 0x3d, 0xe1, 0xbb, 0x8f, 0x11, - 0x7c, 0x98, 0x6e, 0xb7, 0x04, 0xed, 0xd3, 0xc5, 0x75, 0x9e, 0x7f, 0xde, - 0xcf, 0xc2, 0xe5, 0x24, 0x5a, 0xbd, 0x62, 0x9f, 0x86, 0x76, 0x0e, 0xd8, - 0x9a, 0xbb, 0x18, 0x5b, 0x55, 0x70, 0x3c, 0x8c, 0x5a, 0xcd, 0xec, 0x8e, - 0xa8, 0x78, 0x32, 0xbf, 0x1d, 0x7b, 0x12, 0x7b, 0x95, 0x99, 0xca, 0x65, - 0xa1, 0x82, 0x8e, 0x9e, 0x57, 0x0f, 0x4f, 0x6c, 0xc3, 0xff, 0xde, 0x74, - 0xf8, 0x41, 0x22, 0xd0, 0x91, 0x26, 0xf3, 0x45, 0xaa, 0x0c, 0xc6, 0xa5, - 0x14, 0xdf, 0xe4, 0xf1, 0x2a, 0x7e, 0x38, 0x89, 0x57, 0x79, 0xbe, 0x08, - 0x9f, 0xd6, 0xd0, 0xfd, 0x64, 0xe3, 0xf6, 0x60, 0xe0, 0x3e, 0xbb, 0x8e, - 0xf9, 0x4b, 0x2e, 0x8f, 0x5f, 0x0a, 0xf7, 0x3d, 0xd5, 0x77, 0xdf, 0xf3, - 0xeb, 0x33, 0xb7, 0x3f, 0x5d, 0xeb, 0xae, 0xf2, 0xdf, 0x1f, 0x6d, 0x2e, - 0x5f, 0xe4, 0x3a, 0xfc, 0x41, 0xe4, 0xbf, 0x2f, 0x71, 0x79, 0xe3, 0xf3, - 0xc2, 0x34, 0x66, 0x70, 0x8e, 0xe7, 0x8f, 0x26, 0x0d, 0x4f, 0xff, 0x8d, - 0x0a, 0x7b, 0x60, 0xc5, 0xd8, 0x03, 0xd7, 0x5e, 0x71, 0x7b, 0x40, 0xb4, - 0x73, 0x5f, 0x9d, 0xdf, 0x1e, 0xec, 0x9d, 0x05, 0x7b, 0xb0, 0x56, 0x13, - 0xed, 0xc1, 0x14, 0xe5, 0x9f, 0xaf, 0xe7, 0xc0, 0xc9, 0x39, 0x12, 0xe7, - 0xbf, 0xb8, 0xb3, 0xba, 0x3d, 0x4c, 0xd6, 0xe4, 0x2f, 0xaa, 0xf2, 0x3f, - 0x9f, 0xff, 0xae, 0x87, 0xad, 0xd7, 0x01, 0x7f, 0x53, 0x30, 0x53, 0x70, - 0x9f, 0xa2, 0xf1, 0xe6, 0x60, 0x72, 0x26, 0xf2, 0xb9, 0x4e, 0xab, 0xf0, - 0x27, 0x4a, 0x40, 0x3e, 0xb9, 0x41, 0x06, 0x1b, 0x42, 0xfc, 0x2b, 0xd0, - 0xa3, 0x6b, 0x75, 0x34, 0x9e, 0x9f, 0x20, 0xf1, 0x01, 0x8e, 0x57, 0x0d, - 0x0b, 0x99, 0x49, 0xf0, 0x87, 0x59, 0xc7, 0x00, 0x7f, 0x68, 0xbe, 0xcf, - 0xf4, 0xd9, 0x56, 0x20, 0xff, 0x39, 0x8a, 0xa6, 0xaf, 0xbd, 0x18, 0xdf, - 0x3f, 0x6d, 0xd4, 0xa3, 0xae, 0x26, 0x2a, 0xff, 0x80, 0x52, 0xc2, 0xf6, - 0x00, 0x5b, 0xbb, 0x03, 0xdd, 0x3a, 0x7a, 0xf6, 0x4b, 0x7b, 0x69, 0x7e, - 0x14, 0x30, 0xfb, 0x8c, 0xe7, 0x12, 0x40, 0xfa, 0x96, 0x90, 0x7c, 0x29, - 0x8e, 0xa7, 0xb9, 0x7d, 0x55, 0xfd, 0xe7, 0xe5, 0xc9, 0x48, 0xfb, 0x23, - 0x9c, 0x0f, 0x69, 0x7b, 0x9e, 0x89, 0xf5, 0xff, 0xf0, 0xab, 0x29, 0xc6, - 0x43, 0x4e, 0x77, 0x9d, 0x87, 0x7f, 0xc1, 0x8c, 0xf4, 0xf9, 0x5e, 0x77, - 0xbf, 0x5c, 0xff, 0xd5, 0x14, 0xd8, 0xaf, 0xc1, 0xc1, 0x26, 0x19, 0x7d, - 0x7e, 0xb2, 0x6a, 0x3c, 0x18, 0x65, 0x9f, 0x82, 0xe7, 0x39, 0x8a, 0xdf, - 0x87, 0x2a, 0xcf, 0x5f, 0x90, 0x5f, 0x34, 0x2d, 0xc3, 0x2f, 0x1a, 0xab, - 0x7a, 0xfe, 0xa2, 0xf8, 0xad, 0xed, 0xfc, 0x6d, 0xab, 0x3c, 0x0f, 0xe7, - 0x05, 0xf9, 0x1d, 0x3c, 0x2f, 0xce, 0x3f, 0x7a, 0xf5, 0x81, 0x08, 0x7b, - 0x8e, 0x3e, 0x20, 0xfa, 0x4f, 0x1d, 0xca, 0x64, 0x8a, 0xf3, 0xcf, 0xed, - 0x37, 0x3f, 0x3f, 0x2d, 0x54, 0xff, 0x5b, 0x15, 0x6c, 0x8f, 0x49, 0xfe, - 0x16, 0x8b, 0xa2, 0xaf, 0x21, 0x05, 0x2d, 0xfe, 0x89, 0xd5, 0xf4, 0x3c, - 0x9c, 0xa0, 0xfd, 0x5d, 0x86, 0x89, 0x92, 0x26, 0x0a, 0x39, 0x0f, 0x8a, - 0xff, 0x3c, 0x80, 0xfa, 0x35, 0xc0, 0xff, 0xe5, 0x97, 0xb9, 0xf1, 0x06, - 0x98, 0x60, 0x2e, 0xcf, 0x1c, 0xea, 0x41, 0x6b, 0x0d, 0x5f, 0xfe, 0x48, - 0xc9, 0x2a, 0x2c, 0x3f, 0x9e, 0x14, 0xfa, 0x27, 0x13, 0x61, 0xfe, 0x81, - 0xee, 0xcf, 0x41, 0xd5, 0xdb, 0x0f, 0x9f, 0xbc, 0x9d, 0xb8, 0xfb, 0x17, - 0xdf, 0x2f, 0xde, 0x0e, 0x3c, 0x7d, 0x3e, 0x7d, 0x9e, 0x1b, 0x0f, 0xd4, - 0x68, 0x2f, 0x47, 0xf8, 0xfc, 0xf3, 0x79, 0xfe, 0x28, 0x0d, 0xf1, 0x95, - 0x4d, 0xed, 0x63, 0x0e, 0x46, 0x73, 0xa6, 0x8e, 0x8c, 0x15, 0xd4, 0x1e, - 0xa1, 0x8d, 0x3c, 0x1f, 0x7d, 0x72, 0x01, 0xcd, 0x3f, 0x61, 0xde, 0x53, - 0x29, 0xb0, 0xa3, 0xf6, 0x30, 0xe8, 0x23, 0xcb, 0x7f, 0xda, 0xf7, 0x2b, - 0x66, 0xcc, 0x7e, 0xff, 0x52, 0xc8, 0x87, 0x1e, 0x75, 0xef, 0xbf, 0xbb, - 0x78, 0x3d, 0x08, 0x01, 0xff, 0x7c, 0xfe, 0xdd, 0x37, 0x07, 0xfd, 0xf5, - 0xbf, 0xb9, 0xf3, 0x79, 0xfe, 0xae, 0xdf, 0xa0, 0xeb, 0xf7, 0xe1, 0x53, - 0x79, 0x68, 0xae, 0x3c, 0x28, 0x3f, 0x29, 0x9a, 0xbf, 0x2b, 0xc5, 0xe7, - 0xef, 0xec, 0xc5, 0xd4, 0xfe, 0xf0, 0xfc, 0x43, 0xf1, 0x24, 0xcb, 0x3f, - 0x64, 0x03, 0xf6, 0xd2, 0xcb, 0xbf, 0x05, 0xf3, 0xa5, 0x3f, 0xbc, 0x3e, - 0xbc, 0xbe, 0x21, 0xfa, 0x7f, 0xbe, 0x9e, 0x74, 0x44, 0x3e, 0x9a, 0xcb, - 0xa7, 0x5e, 0xc8, 0x5f, 0x67, 0xaa, 0xe4, 0xaf, 0xb3, 0x6c, 0x3c, 0xc7, - 0x93, 0x85, 0x02, 0xfe, 0x79, 0xbe, 0x78, 0x07, 0x7e, 0x3e, 0x19, 0x59, - 0x9f, 0xc9, 0x2a, 0xc1, 0xfa, 0x46, 0x78, 0x3e, 0xfc, 0xc3, 0xeb, 0x83, - 0xf1, 0x7e, 0x5a, 0x3d, 0x5f, 0x8f, 0xcb, 0x9f, 0x0b, 0xf3, 0x8b, 0x92, - 0xf3, 0x51, 0x3d, 0x9b, 0xcf, 0x9f, 0x37, 0x97, 0xc1, 0xe2, 0x7c, 0xb6, - 0xbe, 0xd2, 0x97, 0x27, 0x3e, 0x48, 0xc4, 0xe5, 0x93, 0xc7, 0xee, 0x90, - 0xcb, 0x27, 0x5f, 0xf8, 0x50, 0xad, 0xf5, 0x53, 0x37, 0xbe, 0x93, 0xca, - 0xcf, 0x3f, 0xda, 0x26, 0x99, 0x6f, 0x57, 0xe5, 0xe6, 0xbf, 0x7f, 0x8d, - 0x2c, 0xff, 0xe1, 0xf1, 0x94, 0x5b, 0x3f, 0x10, 0xe8, 0xcf, 0xbb, 0x23, - 0x20, 0x7f, 0xe4, 0xb4, 0x65, 0x63, 0xf3, 0xb5, 0xef, 0x68, 0xe1, 0xfc, - 0xd4, 0x4a, 0xbf, 0xcf, 0xcc, 0xc6, 0xd6, 0x0b, 0x6e, 0xfc, 0x53, 0xe9, - 0xf5, 0xa6, 0x64, 0xf6, 0xcb, 0xba, 0x3d, 0xa8, 0x9f, 0xa5, 0x05, 0xf1, - 0xfc, 0x7c, 0xa8, 0xc8, 0xed, 0x57, 0xef, 0x33, 0x41, 0xfa, 0xd5, 0xe4, - 0x99, 0xd6, 0xe5, 0xe8, 0x6f, 0x8f, 0xac, 0xef, 0xd4, 0x0b, 0xf5, 0x0a, - 0xee, 0x8f, 0x69, 0x7d, 0x8b, 0xdf, 0x8f, 0x4a, 0x1f, 0x5d, 0x40, 0xfd, - 0xef, 0x5e, 0x93, 0x64, 0x73, 0x3f, 0xdd, 0xd6, 0xaf, 0x84, 0xdd, 0xff, - 0xc4, 0x7a, 0x6e, 0x86, 0x9f, 0x77, 0x7c, 0xb9, 0xb3, 0x25, 0xd6, 0x5f, - 0x6d, 0xbf, 0x1f, 0xbe, 0x41, 0x6e, 0xfd, 0x87, 0x0f, 0x54, 0xc9, 0x87, - 0xa3, 0x65, 0x71, 0xf9, 0x70, 0x7c, 0xad, 0xa0, 0xf5, 0x8b, 0xda, 0xe7, - 0x77, 0x04, 0xe7, 0x97, 0xad, 0xd8, 0xf9, 0x08, 0xb5, 0x49, 0xd9, 0x47, - 0x85, 0xd9, 0xc3, 0xa8, 0xf5, 0x5e, 0xba, 0x52, 0x4e, 0x3e, 0x0f, 0x36, - 0x06, 0xe9, 0xff, 0xe8, 0x4e, 0x25, 0x56, 0xfe, 0xff, 0xb8, 0xbc, 0xca, - 0x79, 0xce, 0x07, 0xd7, 0x7b, 0xb8, 0x3e, 0x78, 0x9e, 0x0f, 0x6f, 0x45, - 0xae, 0xbf, 0x22, 0xf3, 0xfb, 0x82, 0xf3, 0xff, 0x59, 0x98, 0xff, 0xce, - 0xeb, 0x5a, 0x2c, 0x3f, 0x4f, 0xac, 0x90, 0x5b, 0xef, 0x4d, 0x75, 0x72, - 0xf3, 0x57, 0x37, 0xc9, 0xcd, 0xdf, 0x71, 0x8d, 0xdc, 0xfc, 0x8f, 0x25, - 0xeb, 0x9d, 0xd7, 0x36, 0x48, 0xfa, 0x8f, 0x0d, 0x72, 0xf3, 0xb7, 0xf5, - 0xce, 0xac, 0x7f, 0x88, 0xe3, 0xe7, 0x7a, 0xe4, 0x9e, 0xd7, 0xf1, 0x43, - 0x4d, 0x6a, 0xfe, 0xd2, 0x1f, 0xc9, 0xcd, 0x3f, 0x78, 0x5c, 0x6e, 0xfe, - 0xdf, 0x5c, 0x2b, 0xc7, 0x7f, 0xdd, 0x84, 0x1c, 0xfd, 0xed, 0x92, 0xf6, - 0x7b, 0x32, 0x19, 0x3e, 0x5f, 0x45, 0x63, 0x47, 0x69, 0x7d, 0x8e, 0xc5, - 0x9f, 0x28, 0x13, 0x88, 0x5f, 0xbd, 0xfa, 0x04, 0xef, 0xc7, 0x88, 0x88, - 0x87, 0x8b, 0xcb, 0x82, 0xf1, 0xb0, 0xcd, 0xe3, 0xe1, 0x60, 0x3d, 0xdb, - 0x17, 0x0f, 0x2b, 0x71, 0xf7, 0xbd, 0x5f, 0x18, 0x8c, 0xbe, 0x0d, 0xf1, - 0xf1, 0x3e, 0x8c, 0x31, 0xa8, 0x14, 0x47, 0x94, 0x89, 0x48, 0x7f, 0x21, - 0x79, 0x1e, 0xff, 0x33, 0x29, 0xf4, 0x37, 0xc8, 0xce, 0x37, 0xac, 0xd8, - 0xfa, 0xf5, 0xe1, 0x9a, 0xbf, 0x3f, 0xd1, 0x30, 0xa3, 0xf8, 0xef, 0x2f, - 0x23, 0xe2, 0x21, 0xb7, 0x52, 0xcf, 0xe2, 0x75, 0xa8, 0xe7, 0x64, 0xc0, - 0x15, 0xb2, 0xfe, 0x21, 0xe2, 0x8f, 0xed, 0x64, 0xc6, 0x4f, 0x5f, 0xa6, - 0xbe, 0xaf, 0xa2, 0x2b, 0x62, 0xeb, 0xfb, 0x95, 0xf5, 0xde, 0x31, 0x21, - 0xff, 0xe5, 0xea, 0x53, 0x78, 0xbe, 0x4b, 0xd0, 0x2f, 0x9d, 0xe9, 0x57, - 0xae, 0xa3, 0x5a, 0xfd, 0x97, 0xe9, 0x5b, 0x8e, 0x17, 0xe4, 0xb8, 0xff, - 0xdf, 0x1d, 0x78, 0xbe, 0xd3, 0x79, 0x5c, 0xb1, 0x5b, 0x2f, 0x48, 0x8d, - 0xeb, 0xf4, 0xf9, 0x36, 0xb2, 0x69, 0x3f, 0xd8, 0xf4, 0x16, 0x54, 0x7a, - 0x8e, 0xd6, 0x23, 0xd5, 0xb9, 0xa4, 0xa4, 0xc1, 0xde, 0xdf, 0xba, 0x97, - 0x27, 0xb0, 0xe9, 0xfb, 0x90, 0xbd, 0x58, 0x23, 0x49, 0x89, 0x49, 0x71, - 0x9c, 0x39, 0xa6, 0x57, 0x6f, 0x80, 0x7d, 0x51, 0xd1, 0x04, 0xcf, 0x47, - 0xdb, 0x43, 0xbc, 0x9f, 0x2e, 0x67, 0x90, 0x7e, 0x3a, 0xa0, 0xbf, 0xa3, - 0x6d, 0x02, 0xe6, 0x27, 0xcf, 0xf7, 0xd3, 0x9f, 0x17, 0xa4, 0xdf, 0x87, - 0x9c, 0x31, 0xa0, 0x6f, 0x2b, 0x4e, 0x1e, 0xe8, 0x57, 0xeb, 0x07, 0x09, - 0xcd, 0x17, 0x76, 0x93, 0x7c, 0xaf, 0x49, 0xeb, 0xd7, 0x7c, 0x2b, 0xeb, - 0xc3, 0xf4, 0x8b, 0xd5, 0xfb, 0xca, 0x1f, 0xab, 0xbc, 0x5e, 0xf1, 0x05, - 0x1e, 0x52, 0x44, 0xe4, 0x7b, 0x40, 0xc2, 0xf0, 0x45, 0x03, 0x03, 0x91, - 0x67, 0x09, 0xeb, 0x51, 0x2b, 0xe8, 0xf1, 0xf5, 0x39, 0x1f, 0x85, 0xad, - 0x4f, 0xcc, 0x57, 0x43, 0x3f, 0xcb, 0x2a, 0xe8, 0x67, 0x01, 0xfe, 0x13, - 0xa4, 0x9f, 0x85, 0xf3, 0x63, 0x44, 0xf1, 0x4f, 0xf7, 0xef, 0x0a, 0xb7, - 0x3f, 0x0e, 0xa1, 0xfd, 0x9a, 0x87, 0x0f, 0x19, 0x78, 0x5b, 0x21, 0xfc, - 0x1a, 0x95, 0xfc, 0x22, 0x74, 0xb5, 0x28, 0x7f, 0xfa, 0xfe, 0xde, 0xb8, - 0xe6, 0x14, 0x35, 0x33, 0xd2, 0x5f, 0xbd, 0xac, 0x47, 0xc7, 0x2f, 0xf0, - 0xf3, 0xd3, 0xc9, 0xf8, 0xfb, 0xf7, 0xcf, 0x26, 0x67, 0xd6, 0x3f, 0x56, - 0xed, 0x7c, 0xe9, 0xf8, 0x7c, 0xad, 0xd5, 0xfd, 0xe7, 0x2b, 0x2a, 0x7f, - 0x11, 0x7e, 0x9e, 0xdc, 0xfd, 0x30, 0xda, 0x88, 0x3e, 0xc3, 0x03, 0xed, - 0xb4, 0x59, 0xd7, 0x59, 0xbf, 0x02, 0x95, 0x1a, 0xd1, 0x73, 0x66, 0x26, - 0xa3, 0xa9, 0xf5, 0x23, 0x5f, 0x50, 0x46, 0x06, 0x15, 0x73, 0x54, 0x99, - 0x68, 0x79, 0xda, 0x2c, 0xed, 0xf8, 0xdb, 0xc5, 0x4e, 0x27, 0xbe, 0x0d, - 0x1d, 0x98, 0x93, 0x70, 0xd2, 0x90, 0x67, 0x84, 0x75, 0x18, 0xed, 0x39, - 0x92, 0x87, 0x18, 0x69, 0x03, 0xfe, 0x9c, 0x6f, 0x53, 0x4b, 0xe2, 0xe8, - 0xdf, 0x30, 0x4b, 0x1a, 0xdc, 0xc7, 0x0d, 0x6e, 0x5f, 0x6e, 0x0c, 0xbc, - 0xcf, 0x5e, 0xb5, 0xff, 0xd8, 0xed, 0x7f, 0x7a, 0x97, 0x9c, 0x77, 0xef, - 0x35, 0xcc, 0xd5, 0x54, 0xdf, 0x58, 0xbe, 0x3c, 0xf1, 0x80, 0xdb, 0x2f, - 0xa1, 0x95, 0x48, 0x7e, 0x2f, 0x8f, 0x8a, 0x34, 0xbf, 0xa7, 0x16, 0x1b, - 0x53, 0xc3, 0x1a, 0xd5, 0xf0, 0x9d, 0x08, 0x6d, 0xe2, 0xe7, 0x23, 0x47, - 0xf4, 0x4b, 0x09, 0xe2, 0xc3, 0x6e, 0xd8, 0xe9, 0x60, 0x7f, 0x02, 0x42, - 0x5f, 0x4b, 0x42, 0xbf, 0x14, 0x16, 0xf6, 0x04, 0xb3, 0x9c, 0xa5, 0xa5, - 0x09, 0xbe, 0x1f, 0x69, 0x34, 0x13, 0x7b, 0x2e, 0xe6, 0x73, 0x1a, 0x0e, - 0x09, 0xfd, 0x9f, 0xbc, 0x1f, 0x57, 0x41, 0xc5, 0x36, 0x58, 0x74, 0x71, - 0x38, 0x6d, 0xe7, 0x40, 0x3f, 0xdb, 0x53, 0xfe, 0x7c, 0x3a, 0xbe, 0x24, - 0x39, 0x76, 0xab, 0xf4, 0xf3, 0x9c, 0xb9, 0x87, 0x02, 0xf9, 0x1f, 0x74, - 0xc1, 0xa1, 0x78, 0xfd, 0x9d, 0x77, 0x68, 0x86, 0xfd, 0x9d, 0x42, 0xfd, - 0xd0, 0x08, 0xd9, 0xbf, 0x34, 0xb4, 0x90, 0xbd, 0x18, 0x8c, 0xe7, 0xbf, - 0xab, 0x73, 0x7a, 0x3d, 0x2a, 0xf5, 0xd7, 0xdc, 0x9f, 0xec, 0x16, 0xfc, - 0x8b, 0xdb, 0x5f, 0x1e, 0xa8, 0xef, 0xcd, 0x8f, 0x5f, 0x8f, 0xfb, 0x7c, - 0xcf, 0xe1, 0xad, 0xe1, 0xe7, 0x2d, 0x00, 0x7b, 0xdf, 0x33, 0x63, 0xb0, - 0x57, 0x3f, 0xce, 0x31, 0xf9, 0x07, 0xc6, 0x2b, 0xec, 0x1b, 0x19, 0xa3, - 0xf6, 0x8d, 0xd5, 0xe3, 0xe0, 0xe7, 0xc4, 0x6c, 0xeb, 0xcf, 0x42, 0x71, - 0x7f, 0xb8, 0xfe, 0xd8, 0xa8, 0x78, 0x59, 0xeb, 0x0e, 0x95, 0x3d, 0x1f, - 0xd3, 0xbb, 0x3c, 0xa8, 0x3f, 0xe2, 0xf7, 0xd0, 0x6a, 0xd4, 0x9f, 0x25, - 0x67, 0x4b, 0x7f, 0x84, 0xfe, 0x18, 0x43, 0xdc, 0x1f, 0x8c, 0x6e, 0x40, - 0x8b, 0x90, 0x13, 0xa9, 0x3f, 0x1a, 0x8d, 0xdf, 0x06, 0x15, 0x21, 0x5f, - 0x2b, 0xe8, 0x53, 0x40, 0x7f, 0xd0, 0x65, 0x55, 0xf5, 0x67, 0x8d, 0x90, - 0x6f, 0x66, 0xf5, 0xf2, 0xca, 0xfa, 0x8e, 0x16, 0x8c, 0xaf, 0xf1, 0x3e, - 0x93, 0x7c, 0x73, 0x11, 0xc5, 0xf7, 0x8b, 0x2e, 0x8c, 0x8f, 0x7f, 0x9c, - 0x77, 0xa3, 0xe2, 0x6d, 0x85, 0xc4, 0xdb, 0xd3, 0x8f, 0xea, 0x30, 0x9e, - 0xfe, 0x7a, 0x1b, 0x58, 0x13, 0xe7, 0xa5, 0xa7, 0x8a, 0xa8, 0x4c, 0xec, - 0xa1, 0xdb, 0xdf, 0xa6, 0x90, 0x7e, 0xd1, 0x8e, 0xec, 0x76, 0xbb, 0x61, - 0xdf, 0xea, 0x5c, 0x6a, 0x5a, 0x83, 0x78, 0x9b, 0x9e, 0x07, 0xb0, 0xee, - 0x2b, 0x90, 0x9d, 0xf0, 0xd7, 0x5b, 0x06, 0x03, 0xfd, 0xcb, 0x07, 0x17, - 0xf9, 0xf2, 0x35, 0xd0, 0x8f, 0x3c, 0xbd, 0x14, 0xca, 0x28, 0xde, 0x7c, - 0xa3, 0xc6, 0xf9, 0x3a, 0xcc, 0x37, 0xf1, 0x21, 0x78, 0x4c, 0x41, 0xc3, - 0xe1, 0xf3, 0x75, 0xac, 0x1b, 0xe3, 0x8f, 0xb0, 0x78, 0xd6, 0xc8, 0x32, - 0xfb, 0x48, 0xf7, 0x33, 0x6c, 0x7e, 0xd2, 0x3f, 0x3f, 0x42, 0x9f, 0xff, - 0x23, 0x22, 0x3f, 0x5d, 0xd1, 0x3f, 0x9f, 0x03, 0xfd, 0x00, 0xe7, 0xfd, - 0x81, 0x52, 0x1a, 0xf6, 0xf4, 0x63, 0x79, 0xa4, 0x7e, 0x64, 0x35, 0x2b, - 0xe9, 0xbf, 0x3f, 0x75, 0xc7, 0xf6, 0xb7, 0x87, 0xd4, 0xb7, 0xb8, 0xc5, - 0xc9, 0x86, 0xd6, 0xab, 0xc9, 0x7f, 0x76, 0xa6, 0xe0, 0x3c, 0x3b, 0x5e, - 0x7f, 0x88, 0xcb, 0x3f, 0x3d, 0xca, 0xee, 0x27, 0x8d, 0xf2, 0xe1, 0xfd, - 0xb2, 0xcf, 0x6b, 0xbe, 0xfa, 0x92, 0x22, 0xc7, 0xdf, 0x9d, 0x9c, 0xbf, - 0x44, 0x54, 0xff, 0x62, 0x03, 0x89, 0xf7, 0xb8, 0xfe, 0xee, 0x52, 0xfc, - 0xf5, 0x17, 0x31, 0xbf, 0x1f, 0x9e, 0x9f, 0x7f, 0xc1, 0xc7, 0x5f, 0x38, - 0x3f, 0x3d, 0x89, 0xe8, 0xfc, 0x5c, 0x37, 0xb1, 0x70, 0x18, 0x5f, 0xad, - 0x5e, 0x5f, 0x90, 0xa5, 0x1f, 0x79, 0x5f, 0x44, 0x35, 0xe7, 0x93, 0x63, - 0xed, 0xbd, 0x68, 0xbf, 0x23, 0xf2, 0x7f, 0x45, 0xcd, 0xd7, 0x1f, 0x1d, - 0xbc, 0x9f, 0xb6, 0xcf, 0x12, 0xfd, 0x0e, 0xde, 0xcf, 0x4b, 0xdf, 0x0f, - 0xca, 0x71, 0xfa, 0xcd, 0xb3, 0x44, 0x9f, 0xf6, 0x3b, 0x83, 0x3e, 0x13, - 0x7b, 0xd5, 0xec, 0xf6, 0x5f, 0xcc, 0x12, 0x7d, 0xda, 0xef, 0xec, 0xfa, - 0x63, 0xb7, 0xbf, 0x63, 0xe3, 0x2c, 0xd1, 0xa7, 0xfd, 0xce, 0xdc, 0xff, - 0x17, 0xdd, 0xfa, 0xe3, 0x46, 0xee, 0x5f, 0xf4, 0x98, 0xf3, 0xe4, 0xac, - 0x5b, 0x62, 0x4c, 0xf7, 0xf6, 0xc1, 0x6d, 0xf7, 0xcb, 0xfc, 0x7b, 0x21, - 0x3a, 0x8f, 0x47, 0x6b, 0xf1, 0xc7, 0x53, 0xdf, 0xf5, 0xe5, 0x27, 0x12, - 0x9e, 0xbe, 0x13, 0x76, 0x32, 0x3e, 0x7d, 0x20, 0xa7, 0xef, 0x9b, 0xbe, - 0xfe, 0xa2, 0x41, 0xfe, 0xbd, 0x9f, 0x9a, 0xbe, 0x4f, 0x52, 0x5d, 0xbf, - 0x5d, 0xff, 0xa7, 0x57, 0xf1, 0x7f, 0xcc, 0x3f, 0xe2, 0x28, 0x9c, 0xf8, - 0x3f, 0x14, 0x5f, 0x6f, 0x75, 0xa8, 0xfd, 0xc8, 0x11, 0x7f, 0x87, 0x6f, - 0xb6, 0xc5, 0x53, 0xd7, 0xe2, 0xfb, 0x47, 0xde, 0x8d, 0xcf, 0x0d, 0x7a, - 0x9f, 0xb3, 0x75, 0xf0, 0xe7, 0xc3, 0x4f, 0x74, 0xac, 0x7b, 0x4c, 0x75, - 0xc6, 0x94, 0x09, 0x94, 0xc6, 0xf6, 0xda, 0xee, 0x7c, 0xf2, 0xc8, 0xa5, - 0xd3, 0x0a, 0x36, 0x3d, 0xf9, 0xcb, 0x37, 0x0c, 0xa9, 0x70, 0x1f, 0xf8, - 0x5e, 0xc7, 0x46, 0xf4, 0x63, 0x7a, 0x1f, 0x08, 0xcf, 0xf7, 0xa5, 0x3c, - 0x79, 0x5a, 0xfe, 0xfc, 0x10, 0xd9, 0x8b, 0xcd, 0x19, 0xef, 0x7b, 0x5b, - 0x6e, 0xbd, 0x3d, 0xe2, 0x7b, 0x5b, 0xbc, 0xbe, 0x1f, 0x7c, 0xdf, 0xeb, - 0x90, 0x47, 0xbf, 0xd8, 0x51, 0x43, 0xfe, 0x89, 0xcf, 0xa7, 0xf5, 0x90, - 0x94, 0x0a, 0xf5, 0x76, 0xea, 0x5f, 0xdd, 0xfa, 0x76, 0x95, 0x78, 0xc3, - 0xcd, 0xb7, 0xb0, 0x78, 0x23, 0x1f, 0x1f, 0x6f, 0xb0, 0x7c, 0x1e, 0xcb, - 0x46, 0x27, 0xb8, 0x7f, 0xb1, 0xa9, 0xfc, 0x93, 0x20, 0x7f, 0x7b, 0xd4, - 0xd7, 0x5f, 0x6f, 0xf4, 0x93, 0xf7, 0xe9, 0x1c, 0x15, 0xfc, 0xe5, 0x70, - 0xea, 0x68, 0xd7, 0x29, 0xd5, 0x1e, 0xc3, 0xb0, 0x8e, 0xe5, 0x6f, 0x76, - 0xfe, 0x66, 0x52, 0xe3, 0xf5, 0xed, 0xdd, 0xd0, 0x0f, 0x60, 0x40, 0xfc, - 0x60, 0x0e, 0x47, 0xe7, 0xff, 0x22, 0xe5, 0x4f, 0xcc, 0xe5, 0xe6, 0x7a, - 0x4f, 0xfe, 0xf5, 0xff, 0xaf, 0xe5, 0x2f, 0xf6, 0x17, 0xe8, 0xae, 0xb1, - 0x5a, 0xaf, 0x05, 0xe3, 0x13, 0xee, 0xaf, 0x83, 0xfd, 0x07, 0x95, 0xfe, - 0x9e, 0xbd, 0x3f, 0x99, 0x9b, 0x26, 0xf1, 0x92, 0x6b, 0xdf, 0x72, 0xf1, - 0xf6, 0x8d, 0x3f, 0x4f, 0x77, 0x9b, 0x4b, 0xd6, 0xc7, 0xbd, 0x7f, 0x63, - 0x92, 0xfb, 0x85, 0xdf, 0xde, 0x72, 0xfb, 0xe3, 0xca, 0x9a, 0x7e, 0x8f, - 0xcc, 0xc4, 0x06, 0xca, 0x6e, 0x1d, 0x4e, 0x80, 0xbd, 0x77, 0x52, 0x81, - 0x7e, 0xc4, 0x39, 0xc4, 0xfe, 0xa9, 0xc1, 0xf9, 0xae, 0xbb, 0xe4, 0x30, - 0xff, 0xd2, 0x6f, 0x54, 0x3d, 0x96, 0xdf, 0x17, 0xf8, 0xf3, 0xcd, 0x20, - 0x3e, 0x61, 0x0d, 0xf6, 0xb6, 0xc0, 0xfd, 0xc1, 0x35, 0xfc, 0xf9, 0x59, - 0x7e, 0x9f, 0x23, 0xf7, 0x69, 0xdf, 0xfb, 0xb0, 0x7e, 0xff, 0x4a, 0xd9, - 0xdb, 0xae, 0x80, 0x3e, 0xf6, 0x25, 0x02, 0xfd, 0x67, 0xf5, 0x01, 0xfc, - 0x9c, 0x15, 0xf1, 0xbe, 0x17, 0xfd, 0x79, 0x2b, 0x22, 0xbe, 0x70, 0xfd, - 0x61, 0xc0, 0x7e, 0x7b, 0xfc, 0x53, 0xd7, 0x00, 0x9f, 0xac, 0x65, 0xef, - 0xab, 0x7a, 0xfe, 0x2c, 0x15, 0x78, 0x3e, 0xf7, 0x77, 0xc2, 0x7a, 0xdc, - 0xfc, 0xf0, 0x09, 0xce, 0xdf, 0xbd, 0x48, 0xc8, 0x27, 0xd0, 0xf9, 0xed, - 0x02, 0x7e, 0x95, 0xfb, 0xe7, 0x4a, 0xe1, 0x3e, 0x78, 0x65, 0x95, 0xfb, - 0xe0, 0x55, 0x33, 0xbd, 0x0f, 0xb2, 0x7f, 0xb8, 0xe7, 0x51, 0x25, 0xd0, - 0xbf, 0x52, 0x45, 0x3f, 0xc9, 0xfb, 0x37, 0x7d, 0xbe, 0x7c, 0x5d, 0x63, - 0xfc, 0xfc, 0x3c, 0xda, 0x65, 0x04, 0xf9, 0x2b, 0x2e, 0x65, 0xf9, 0xce, - 0xf0, 0xf3, 0xa2, 0xf3, 0xf3, 0xc9, 0x08, 0xf4, 0x3d, 0x9a, 0x0d, 0xf0, - 0x97, 0x62, 0xe3, 0x30, 0xbc, 0x01, 0xf4, 0xaf, 0x3d, 0x18, 0x9f, 0x72, - 0x7a, 0x78, 0xbf, 0x8b, 0x7e, 0xff, 0x0f, 0xf3, 0xad, 0x10, 0xf9, 0x88, - 0xcf, 0xe7, 0xf4, 0x5d, 0xff, 0xd8, 0xbe, 0x10, 0x16, 0x57, 0x31, 0x9f, - 0xda, 0xb3, 0x11, 0x92, 0x0f, 0x80, 0xfb, 0x5d, 0x94, 0xfc, 0x05, 0xfa, - 0x58, 0x0b, 0xd6, 0x6b, 0x71, 0xfb, 0x55, 0x59, 0xcf, 0x0e, 0x9f, 0x1f, - 0x65, 0x6f, 0xc5, 0xf5, 0x70, 0x7c, 0x31, 0x1e, 0x22, 0xf4, 0x7c, 0xf1, - 0xbd, 0x57, 0x0f, 0x0f, 0xdf, 0x4f, 0xcc, 0x79, 0xd1, 0xaf, 0xbf, 0x80, - 0xbf, 0xb6, 0x3a, 0xff, 0x48, 0x15, 0xf9, 0x8f, 0x8f, 0x07, 0x6d, 0xcf, - 0x3e, 0x87, 0xaf, 0x6f, 0x7f, 0xd4, 0x7c, 0x13, 0x39, 0x76, 0x4b, 0xe8, - 0xfd, 0x2f, 0xd4, 0xbf, 0xb9, 0xf1, 0x38, 0xbe, 0x3f, 0xf7, 0x71, 0xfb, - 0x90, 0xf3, 0xc7, 0xff, 0xcd, 0x3c, 0xbf, 0xfd, 0xeb, 0x05, 0x11, 0xfd, - 0x39, 0x34, 0x7e, 0x8d, 0x3f, 0x2f, 0xa5, 0x57, 0xef, 0x0b, 0xae, 0xdf, - 0xa9, 0x4d, 0xff, 0x5d, 0xfb, 0xc5, 0xf2, 0x35, 0x7c, 0xbd, 0xc9, 0x2a, - 0xf2, 0x09, 0x3e, 0xff, 0xeb, 0x24, 0x9f, 0x8f, 0x74, 0x34, 0x51, 0xa3, - 0x3c, 0x71, 0xc8, 0xbb, 0x5e, 0xf3, 0xec, 0x23, 0x7c, 0x12, 0x99, 0xe6, - 0xbb, 0xc4, 0xf1, 0x1a, 0xee, 0xc3, 0xbf, 0x25, 0xff, 0xde, 0x35, 0x2b, - 0xfe, 0xdd, 0xf3, 0xd7, 0x5d, 0xe7, 0xfc, 0xf5, 0x2c, 0xfa, 0xeb, 0xdf, - 0x8f, 0xa8, 0xa7, 0xbb, 0xf6, 0x29, 0x42, 0x7e, 0x0e, 0x75, 0x36, 0xbe, - 0xef, 0x37, 0x7c, 0x59, 0xca, 0x5f, 0x03, 0xe9, 0x4c, 0x9d, 0xdf, 0x5f, - 0x6f, 0x9a, 0x0d, 0x7f, 0xed, 0xac, 0x91, 0xf4, 0xd7, 0x6b, 0x67, 0xe8, - 0xaf, 0xdd, 0x7a, 0xdd, 0xae, 0xc0, 0xf7, 0x45, 0x1c, 0xae, 0x9f, 0x54, - 0x4c, 0xa3, 0xf5, 0xfc, 0xbc, 0x46, 0xfa, 0xef, 0x03, 0xd4, 0x7f, 0xbb, - 0xcf, 0xb7, 0x17, 0x55, 0xb1, 0x47, 0x5d, 0x32, 0xfe, 0x0a, 0xfb, 0xcf, - 0xae, 0xa0, 0xff, 0xdc, 0x15, 0xfe, 0xbe, 0xb3, 0xdf, 0x7f, 0xf6, 0x49, - 0xf9, 0xcf, 0x2e, 0x49, 0xff, 0x29, 0xc7, 0x3f, 0x9f, 0x5f, 0xbb, 0xbf, - 0xec, 0x9a, 0x65, 0x7f, 0xd9, 0x25, 0xe9, 0x2f, 0xbb, 0x24, 0xfd, 0x65, - 0xd7, 0x69, 0xfb, 0x4b, 0xf3, 0xb4, 0xfc, 0x65, 0x57, 0xbc, 0xbf, 0x3c, - 0x28, 0xf8, 0x4b, 0x54, 0x9b, 0x7e, 0x8a, 0xef, 0xbb, 0x78, 0xfe, 0x32, - 0xfa, 0x79, 0x26, 0xd9, 0x4f, 0x5e, 0xcf, 0x3d, 0x4b, 0xfe, 0x8a, 0x7d, - 0x7f, 0x42, 0xfc, 0xbe, 0x44, 0xd4, 0x7e, 0x21, 0x37, 0xbf, 0x7b, 0x7a, - 0xdf, 0x03, 0xa0, 0xfd, 0x20, 0x9b, 0x31, 0x85, 0x95, 0xf0, 0xfd, 0x25, - 0x5f, 0xfd, 0x23, 0xbc, 0xdf, 0xc8, 0x05, 0xbc, 0xfc, 0xae, 0x02, 0xf5, - 0xdf, 0x7a, 0xc3, 0xc1, 0xeb, 0xf5, 0xde, 0x77, 0xe2, 0xfc, 0xa2, 0x8e, - 0xac, 0x6a, 0xb7, 0xee, 0xc3, 0x62, 0x9d, 0x0e, 0xed, 0x37, 0xc2, 0x86, - 0x55, 0x09, 0xd8, 0xeb, 0x1a, 0xf3, 0x65, 0x51, 0xf2, 0x30, 0x93, 0x58, - 0x7f, 0xe7, 0x6e, 0x4e, 0x8f, 0x5f, 0xbc, 0x02, 0x95, 0xb2, 0x28, 0x6f, - 0xe2, 0xbd, 0xdf, 0xd7, 0x9c, 0x48, 0x40, 0x7e, 0x81, 0x7c, 0x5f, 0x0a, - 0x91, 0x8f, 0x64, 0x3b, 0x0a, 0xed, 0x58, 0x30, 0x51, 0x3b, 0xb2, 0x3b, - 0xb0, 0xbe, 0x8f, 0x27, 0xbc, 0x7c, 0x08, 0x2b, 0xad, 0xa3, 0xbe, 0xa1, - 0x92, 0x52, 0xa1, 0xff, 0x5d, 0x08, 0x35, 0xc1, 0xfb, 0x61, 0x07, 0x86, - 0x10, 0xf4, 0x33, 0x80, 0xbe, 0x2c, 0xaf, 0xc1, 0xde, 0xf0, 0x7e, 0x52, - 0xaf, 0x3f, 0xac, 0x5f, 0xe8, 0x0f, 0x9b, 0x12, 0xfa, 0x0d, 0xfa, 0xe3, - 0xfb, 0xc3, 0x9c, 0x65, 0xb1, 0xfe, 0xb4, 0xb2, 0xbe, 0xcf, 0xbe, 0x6f, - 0x42, 0x37, 0x2f, 0x01, 0xf5, 0x2f, 0xf8, 0xb8, 0x57, 0x4e, 0x3f, 0xae, - 0xd8, 0x46, 0x4b, 0x9a, 0xbc, 0x3f, 0x47, 0xf6, 0x7b, 0xb3, 0xe6, 0x9a, - 0x1c, 0xa8, 0x5f, 0xa5, 0xc7, 0xb0, 0x3e, 0x8e, 0x5c, 0x3d, 0xae, 0x0f, - 0x6a, 0xf6, 0x08, 0xef, 0x07, 0x52, 0x33, 0xa8, 0x74, 0x21, 0xc1, 0x07, - 0x79, 0x19, 0x9f, 0x44, 0x6e, 0x7f, 0x69, 0x25, 0x3f, 0xc1, 0x7a, 0x18, - 0x88, 0x67, 0x14, 0xec, 0x8b, 0xe9, 0xbd, 0xcf, 0x46, 0xe0, 0x88, 0xef, - 0x51, 0x84, 0xf9, 0x87, 0x35, 0xba, 0x57, 0xbf, 0x98, 0xed, 0xef, 0x61, - 0x54, 0xc8, 0x67, 0x3b, 0xc9, 0xcf, 0x2d, 0x1e, 0xd7, 0x4f, 0x92, 0xfc, - 0xa8, 0xf7, 0xbe, 0x15, 0x95, 0x4f, 0x51, 0x87, 0xf3, 0x3a, 0xb2, 0x2a, - 0x97, 0x18, 0x54, 0x88, 0x7c, 0x88, 0xc1, 0x52, 0xeb, 0xb9, 0x7c, 0xc0, - 0x3f, 0x27, 0xb3, 0x71, 0xf2, 0x49, 0x07, 0xe5, 0x43, 0xe4, 0xbb, 0x21, - 0x03, 0xfe, 0xaf, 0x08, 0xf1, 0xb9, 0x0f, 0x76, 0x6a, 0x8c, 0xd7, 0x57, - 0xeb, 0x71, 0xfd, 0x63, 0xa7, 0x27, 0x9f, 0x4a, 0xfb, 0x10, 0xec, 0x0f, - 0xf0, 0xd9, 0xaf, 0x40, 0x3c, 0xed, 0xe6, 0x1f, 0x3b, 0x70, 0x3c, 0xdd, - 0x6a, 0xaa, 0x17, 0x66, 0x1e, 0x53, 0x8a, 0x5f, 0xf5, 0xf5, 0x9b, 0xe0, - 0x70, 0xcb, 0x71, 0xdf, 0xcf, 0x7e, 0x36, 0xe1, 0xed, 0x6f, 0x48, 0xbe, - 0x50, 0x47, 0xbd, 0x13, 0xff, 0xc5, 0xfd, 0x5f, 0xfc, 0x79, 0xf2, 0xad, - 0xaf, 0xb6, 0xf3, 0x74, 0x56, 0xd6, 0x87, 0xec, 0x97, 0x54, 0x7f, 0xbf, - 0xd8, 0x9f, 0x25, 0xab, 0xac, 0xb7, 0xef, 0xd0, 0x99, 0x5e, 0x2f, 0xeb, - 0xf7, 0x1b, 0x27, 0xeb, 0x6b, 0xd1, 0xc5, 0xef, 0xaf, 0xb9, 0xeb, 0xb3, - 0xf1, 0xfa, 0xf4, 0xee, 0x06, 0x34, 0xf5, 0x98, 0x82, 0xfc, 0xf5, 0x02, - 0xd3, 0xcb, 0x7f, 0xa1, 0xe2, 0x48, 0x32, 0xd8, 0x3f, 0xf7, 0xcd, 0xba, - 0xd8, 0xf5, 0x2d, 0xee, 0xd4, 0xd0, 0x94, 0x7b, 0x9f, 0x90, 0xec, 0x77, - 0xac, 0xd2, 0x8f, 0x45, 0xce, 0x6f, 0x4b, 0x1d, 0xb7, 0x7f, 0xbe, 0xfe, - 0x3d, 0x72, 0xde, 0xf2, 0x64, 0xbd, 0x66, 0x82, 0xf5, 0xc3, 0x7a, 0xeb, - 0x29, 0xc7, 0xd7, 0xb7, 0x7d, 0xf9, 0x74, 0xbb, 0xe3, 0x4c, 0x9e, 0x37, - 0x34, 0x9c, 0x0a, 0xf6, 0x2b, 0x8e, 0xa6, 0x64, 0xfa, 0x17, 0x93, 0x66, - 0xfe, 0x35, 0xf3, 0xde, 0x36, 0xb4, 0xbe, 0xdd, 0x98, 0xa6, 0x7e, 0x68, - 0x4d, 0x2a, 0x3e, 0xbf, 0x1f, 0xdf, 0x3f, 0x1a, 0xdd, 0x2f, 0x71, 0x52, - 0xfc, 0x3e, 0x25, 0xd5, 0x3f, 0x35, 0xbb, 0x9d, 0x7c, 0x8f, 0xc6, 0xdd, - 0xaf, 0x3a, 0xfe, 0x7c, 0x9d, 0xf6, 0x47, 0xc0, 0x79, 0x69, 0x69, 0x1e, - 0xd7, 0xfa, 0x63, 0xfb, 0x97, 0xe7, 0x45, 0xfc, 0xbd, 0x41, 0xb8, 0x3f, - 0x67, 0x5a, 0xf1, 0xfe, 0xb9, 0xf1, 0xe6, 0x9d, 0xc9, 0xf8, 0x78, 0xf5, - 0x0c, 0x9d, 0x9f, 0x88, 0xf7, 0x15, 0x2b, 0xf3, 0x0d, 0xc1, 0x7e, 0x98, - 0x8a, 0xf7, 0x17, 0x95, 0xdd, 0xec, 0x7e, 0xc1, 0xf8, 0x53, 0x21, 0x9e, - 0x09, 0xf3, 0xa7, 0x50, 0x88, 0xa6, 0xdf, 0x2f, 0xb0, 0xd3, 0xd5, 0xeb, - 0x33, 0xe2, 0xfd, 0xf4, 0x9a, 0x43, 0xf1, 0xdf, 0x7b, 0xdb, 0x1f, 0x11, - 0xbf, 0xb8, 0xf7, 0xcd, 0xc0, 0x7d, 0x7c, 0x34, 0x0d, 0xfe, 0xa9, 0x94, - 0x60, 0xf5, 0x24, 0x7b, 0xb3, 0xef, 0xfb, 0x42, 0xf5, 0xc1, 0xfb, 0xf4, - 0x0c, 0xfb, 0xaf, 0x3e, 0x25, 0x79, 0x9f, 0xb6, 0x0f, 0x9d, 0xee, 0xf7, - 0x12, 0x99, 0xfc, 0xa9, 0x81, 0xb6, 0x17, 0x1c, 0xd3, 0x02, 0xcf, 0xd7, - 0x51, 0x92, 0xc8, 0xa3, 0xa5, 0x3b, 0x4f, 0xde, 0xbb, 0xea, 0x6a, 0x23, - 0x13, 0x9c, 0x63, 0xa4, 0xac, 0x8f, 0x31, 0xff, 0x84, 0x9e, 0xb7, 0x6a, - 0xf7, 0x3f, 0xaf, 0xde, 0x1a, 0xfc, 0x3e, 0x28, 0xa7, 0x4f, 0xd7, 0x33, - 0x42, 0xf2, 0x75, 0xc5, 0xf0, 0xfb, 0x7b, 0x71, 0x2c, 0x19, 0x72, 0x1f, - 0x63, 0xf4, 0x68, 0x2c, 0x3b, 0x44, 0xfb, 0x59, 0x12, 0x35, 0xc7, 0xd3, - 0xee, 0xf3, 0xe9, 0xf2, 0x27, 0x5d, 0xff, 0xc4, 0xf2, 0x2f, 0x03, 0xbe, - 0xfe, 0x3a, 0xae, 0x8f, 0xf5, 0x32, 0xfb, 0x7b, 0xa1, 0xaf, 0x1e, 0x49, - 0xf2, 0x49, 0xbd, 0x96, 0x1b, 0x7f, 0x11, 0x79, 0xe4, 0x23, 0xee, 0x93, - 0x18, 0xb6, 0xe6, 0x78, 0xf7, 0x6d, 0x84, 0x6e, 0xe1, 0xfd, 0xd0, 0x27, - 0x17, 0xcc, 0x5c, 0xbf, 0x9c, 0x8e, 0xb3, 0xa6, 0x5f, 0xe1, 0xfc, 0xf5, - 0x45, 0xfd, 0x3d, 0x55, 0x51, 0x1f, 0xa3, 0xea, 0x59, 0x91, 0xf9, 0xb5, - 0xc7, 0x82, 0xfd, 0x44, 0xbc, 0x5f, 0x54, 0xcc, 0xaf, 0x49, 0xde, 0xb7, - 0x5c, 0xfd, 0x04, 0x05, 0x69, 0x35, 0x35, 0xb8, 0x5f, 0xf5, 0x25, 0x29, - 0xbd, 0xee, 0xc0, 0xfe, 0xb8, 0xdf, 0x53, 0xa5, 0xfd, 0x10, 0x84, 0x9c, - 0xf7, 0xfd, 0x0a, 0x57, 0x5f, 0x57, 0xfb, 0xe2, 0x07, 0x34, 0x94, 0xe4, - 0xfa, 0x8e, 0xa7, 0x3b, 0xcf, 0xa4, 0xc3, 0xfa, 0x21, 0x66, 0xe7, 0x3e, - 0x4e, 0xef, 0xbf, 0xf3, 0x55, 0xf7, 0x3e, 0x5e, 0x79, 0x7f, 0xa9, 0xf2, - 0xbe, 0x80, 0x40, 0x0f, 0xb2, 0xe3, 0xb0, 0xf7, 0xa5, 0xa5, 0xb3, 0x46, - 0xef, 0xa9, 0x98, 0xf7, 0x63, 0xaa, 0xc1, 0x20, 0xbf, 0xa0, 0x7f, 0x10, - 0xe7, 0x77, 0xca, 0xf5, 0x8b, 0x4b, 0xd3, 0xbf, 0xf1, 0xb4, 0xe8, 0xc3, - 0xcb, 0x06, 0xf1, 0xfa, 0xb9, 0x3c, 0x96, 0x1e, 0xa8, 0x96, 0xa5, 0xd6, - 0x2e, 0xaf, 0x19, 0xfe, 0xfd, 0x36, 0xf7, 0xef, 0x17, 0x1b, 0x02, 0x9c, - 0x13, 0x60, 0x53, 0x80, 0x6d, 0x01, 0x66, 0xf9, 0x7e, 0x0f, 0xd6, 0x05, - 0xd8, 0x10, 0xe0, 0x9c, 0x00, 0x9b, 0x02, 0x7c, 0x76, 0xff, 0x1e, 0x95, - 0x23, 0xc0, 0x55, 0xff, 0xde, 0xda, 0x2c, 0xf3, 0x77, 0xee, 0xe7, 0xdc, - 0xcf, 0xb9, 0x9f, 0x98, 0x9f, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xec, - 0x5d, 0x7b, 0x90, 0x1c, 0x47, 0x79, 0xef, 0xee, 0x79, 0xec, 0xec, 0xde, - 0xee, 0x6a, 0x74, 0x9c, 0xc4, 0x5a, 0x0f, 0x7b, 0x4e, 0x3e, 0x49, 0x47, - 0x95, 0xe2, 0x3a, 0x0b, 0xd9, 0x9c, 0x1d, 0xc5, 0xcc, 0x49, 0x67, 0xe7, - 0x64, 0x9f, 0x1c, 0xc5, 0x81, 0x8a, 0x4c, 0x80, 0xac, 0x70, 0x51, 0x91, - 0x0c, 0x91, 0x4d, 0xa0, 0x92, 0x73, 0xec, 0x94, 0x7b, 0xf7, 0xf6, 0x1e, - 0xc6, 0x3a, 0xe7, 0x2c, 0x8c, 0x91, 0x8d, 0x0d, 0x7b, 0x92, 0x8c, 0x15, - 0x4c, 0x05, 0x0a, 0x42, 0x70, 0xf8, 0x87, 0xd5, 0xcb, 0x91, 0x29, 0xab, - 0x4a, 0x40, 0x42, 0x41, 0x15, 0x95, 0x5a, 0x3b, 0x3c, 0x54, 0x01, 0x14, - 0x51, 0xd8, 0xce, 0x19, 0x0c, 0x97, 0x7e, 0xcf, 0xf4, 0xec, 0xcc, 0xec, - 0x9e, 0x2c, 0xbb, 0x48, 0x60, 0xff, 0x90, 0x34, 0xda, 0xd9, 0x9e, 0x9e, - 0xee, 0xaf, 0xbf, 0xf7, 0xf7, 0xfb, 0x06, 0x98, 0x7e, 0xc5, 0xf1, 0x65, - 0x68, 0xbe, 0x95, 0x83, 0xf2, 0x06, 0xb1, 0x2f, 0xce, 0xdc, 0x07, 0x77, - 0xc3, 0xc6, 0x38, 0x3c, 0xf4, 0x0e, 0xf0, 0x1c, 0xde, 0x6f, 0xd6, 0x36, - 0x41, 0x83, 0xfb, 0x6b, 0x73, 0xe0, 0x21, 0x7a, 0x66, 0x57, 0xd9, 0xbd, - 0x0e, 0xfc, 0xc2, 0xa0, 0x85, 0x39, 0xbf, 0xba, 0xc1, 0x66, 0xde, 0x53, - 0x22, 0xbf, 0xcb, 0x2e, 0xf0, 0xef, 0xcb, 0x8d, 0x6f, 0xe8, 0x32, 0xb8, - 0x7f, 0x2a, 0xff, 0xf0, 0x9c, 0x59, 0x46, 0x08, 0x2c, 0x5d, 0x0a, 0xec, - 0x72, 0x69, 0x52, 0xe9, 0xbf, 0xae, 0xa8, 0x3f, 0x1d, 0xa6, 0xf6, 0x72, - 0x6d, 0x8b, 0xf2, 0x0f, 0xac, 0x23, 0xfa, 0xab, 0x8f, 0x96, 0x5d, 0x7f, - 0x39, 0x94, 0xf9, 0x67, 0xb7, 0xa4, 0xf6, 0xe3, 0xcc, 0x61, 0xa6, 0x4e, - 0xd4, 0xb7, 0xbc, 0xb3, 0x9f, 0x7e, 0x85, 0x73, 0x38, 0xcb, 0xaf, 0x45, - 0xbf, 0x38, 0xf9, 0xbd, 0xd3, 0x60, 0x8c, 0x74, 0xfa, 0xb0, 0xa7, 0xf3, - 0x1b, 0xaf, 0x9f, 0xca, 0x2b, 0xaf, 0x6b, 0xb6, 0xb8, 0x89, 0x06, 0xad, - 0xa9, 0x3f, 0x2f, 0xe6, 0x79, 0xef, 0xb4, 0xe4, 0xfb, 0x01, 0x70, 0x53, - 0x44, 0x7e, 0x29, 0xbc, 0x2d, 0x66, 0x5f, 0x7a, 0x9e, 0xb8, 0x7f, 0x27, - 0xc2, 0x75, 0xcb, 0x7b, 0xad, 0xf2, 0xe4, 0x75, 0xff, 0xb8, 0xfa, 0xe5, - 0x2e, 0xf9, 0x8f, 0x3e, 0xb1, 0x3f, 0x1e, 0x6b, 0xce, 0xed, 0x59, 0x92, - 0x3e, 0x68, 0xae, 0xa0, 0xef, 0x78, 0x96, 0x6b, 0xf1, 0xf5, 0x0f, 0xd3, - 0x4b, 0x93, 0xd0, 0xcb, 0x30, 0xb5, 0x37, 0xbd, 0x1b, 0x37, 0x42, 0x91, - 0x8f, 0x28, 0xe5, 0x1b, 0x12, 0xf5, 0x8a, 0x54, 0x76, 0x3b, 0xd7, 0xdc, - 0x6c, 0x4b, 0x7c, 0xa3, 0x28, 0xbd, 0x98, 0xdd, 0x00, 0x4f, 0x9b, 0x93, - 0xf9, 0xd9, 0x3c, 0xb9, 0xce, 0x53, 0xff, 0xe6, 0xb6, 0xc8, 0x7a, 0x2b, - 0xff, 0x31, 0xab, 0x27, 0x64, 0xe2, 0x10, 0x6f, 0x91, 0x12, 0xbd, 0xce, - 0x50, 0x55, 0xc1, 0xb2, 0xeb, 0x7b, 0x3b, 0xa4, 0x9f, 0x50, 0x3d, 0x90, - 0xc0, 0x57, 0x61, 0xfd, 0x5f, 0xdd, 0xe0, 0x79, 0x4c, 0xe5, 0xf2, 0x42, - 0xf1, 0x0e, 0x3f, 0x2d, 0x9f, 0xd1, 0x43, 0x8c, 0x9e, 0xb2, 0xc1, 0xf8, - 0xe9, 0xf3, 0xbf, 0xc8, 0xfa, 0xc7, 0x6b, 0x38, 0xff, 0x03, 0x6f, 0xe8, - 0xf9, 0xff, 0xa3, 0x8b, 0x74, 0xfe, 0x5b, 0xf7, 0x2b, 0x7d, 0xbd, 0xfe, - 0xaf, 0xed, 0xcf, 0xff, 0x57, 0xfe, 0xbf, 0xd7, 0x09, 0xd9, 0xc3, 0xa1, - 0xf3, 0x2b, 0xf7, 0xbf, 0x77, 0x91, 0xfc, 0x5f, 0xf2, 0xf7, 0x16, 0x7d, - 0x52, 0xe2, 0x5f, 0x2b, 0x7b, 0xe9, 0xb7, 0x7b, 0xbf, 0x5b, 0x3f, 0xcf, - 0x45, 0xea, 0xf3, 0xf2, 0x9a, 0xbd, 0x1c, 0xb5, 0xe7, 0x72, 0xf8, 0xf7, - 0xd8, 0xdf, 0x2b, 0x44, 0x7d, 0xb1, 0xac, 0x47, 0xae, 0xfa, 0xba, 0xbc, - 0x3d, 0xa6, 0x5f, 0x4b, 0xfe, 0x89, 0xd7, 0x70, 0xff, 0x9f, 0x97, 0xa4, - 0xff, 0x07, 0xf1, 0x36, 0x59, 0x5f, 0x1f, 0x27, 0x8f, 0x0d, 0xf5, 0x7d, - 0x0e, 0xf7, 0xc7, 0x8d, 0x87, 0xdf, 0x71, 0x26, 0xd8, 0xff, 0xfd, 0xda, - 0xfe, 0x2b, 0x7f, 0xe9, 0xaf, 0x7e, 0x3b, 0xf7, 0x5b, 0xff, 0xb4, 0xda, - 0xeb, 0x7f, 0x12, 0xb3, 0xde, 0x28, 0x7a, 0xde, 0x2e, 0xda, 0x7e, 0xb6, - 0x5d, 0xff, 0xe4, 0xfd, 0xfb, 0xf5, 0xef, 0xf6, 0xef, 0x0d, 0x39, 0xff, - 0xc2, 0x7b, 0x29, 0xf7, 0x9f, 0x9f, 0xff, 0x63, 0xc3, 0xfd, 0xda, 0xf9, - 0xef, 0x56, 0xfc, 0x20, 0x13, 0xe1, 0x0f, 0x8b, 0xa6, 0x97, 0x08, 0x3d, - 0xb6, 0x9c, 0xff, 0x86, 0xce, 0x8f, 0x7e, 0x77, 0xfe, 0x5f, 0xe3, 0xf9, - 0xd7, 0xf6, 0x37, 0xe6, 0xfc, 0x47, 0xf8, 0xff, 0xe2, 0xf6, 0xf3, 0x37, - 0xef, 0xbc, 0x47, 0xf0, 0x5e, 0x54, 0xbc, 0xee, 0xbf, 0xa2, 0xfd, 0x4d, - 0x4c, 0x11, 0xaf, 0x44, 0x1c, 0xdf, 0x7b, 0xcc, 0xe4, 0xf9, 0x4a, 0xd9, - 0x48, 0x7c, 0x63, 0x46, 0xc3, 0x6f, 0x57, 0xef, 0x2a, 0xf0, 0x81, 0x82, - 0x05, 0xd1, 0xe3, 0x07, 0xf7, 0xeb, 0xf8, 0x7b, 0x77, 0x76, 0xbd, 0x45, - 0xe2, 0x07, 0xcd, 0x00, 0x5e, 0xff, 0xbc, 0xd7, 0xa0, 0xf5, 0xcf, 0x00, - 0x16, 0x0c, 0x3f, 0xd4, 0xff, 0x4c, 0xe6, 0xbf, 0x19, 0x32, 0xdf, 0x8a, - 0x3e, 0x90, 0x42, 0x6e, 0x7b, 0x2a, 0x7f, 0xb5, 0x91, 0x77, 0xda, 0xfb, - 0xef, 0x65, 0x7d, 0x2e, 0x07, 0x2a, 0x3a, 0x5c, 0xfd, 0x16, 0x5c, 0x07, - 0x9a, 0x79, 0x85, 0x87, 0xed, 0xcb, 0xf1, 0x3d, 0x19, 0x3f, 0x9c, 0x3e, - 0x0a, 0xeb, 0xa1, 0xf8, 0xa1, 0x5e, 0xdf, 0xfb, 0x84, 0xc2, 0xcf, 0xdd, - 0x42, 0xfb, 0x57, 0x21, 0xcf, 0x06, 0xce, 0x98, 0x41, 0xeb, 0xd7, 0x78, - 0x3d, 0xcd, 0x23, 0xa1, 0x7a, 0xc8, 0xdd, 0x32, 0x5f, 0xe6, 0x17, 0x1c, - 0xbf, 0x96, 0xcf, 0x6b, 0xdc, 0x68, 0xf1, 0xe7, 0xb7, 0xe9, 0x07, 0xa5, - 0xea, 0xff, 0x45, 0x3f, 0x28, 0x2f, 0xbd, 0xbe, 0xb1, 0xb1, 0x26, 0x21, - 0x9f, 0x23, 0x12, 0x9f, 0x06, 0x99, 0x48, 0x7e, 0x5b, 0x03, 0x63, 0x0b, - 0xae, 0x22, 0x2f, 0xb8, 0xe1, 0xdf, 0x01, 0x98, 0xca, 0x7d, 0xa2, 0x97, - 0xfd, 0x7a, 0xeb, 0x2e, 0xa6, 0x6a, 0xe2, 0x61, 0xb6, 0xff, 0x13, 0x9f, - 0x31, 0xe0, 0x3d, 0x10, 0x87, 0xea, 0xe9, 0x65, 0xbd, 0x3b, 0xf0, 0x59, - 0xfc, 0xd7, 0x37, 0x32, 0x61, 0xfc, 0x59, 0xd0, 0x50, 0xfb, 0xc7, 0xde, - 0x26, 0xe3, 0x7c, 0xc3, 0x24, 0xeb, 0xe3, 0xc4, 0xd5, 0xcb, 0x6f, 0x43, - 0xbc, 0x3e, 0x4f, 0xe0, 0xe9, 0x46, 0xf1, 0xa3, 0x4d, 0x7d, 0xbf, 0x5a, - 0x7f, 0xff, 0x2c, 0x02, 0x7e, 0x06, 0x05, 0xf5, 0xf5, 0xfc, 0x5c, 0xaa, - 0xe7, 0x7b, 0xa7, 0x44, 0xfc, 0x65, 0x2f, 0x60, 0xf4, 0x16, 0xf4, 0x6f, - 0xd1, 0xf0, 0xf4, 0x03, 0x7a, 0x79, 0x96, 0xa6, 0xe6, 0x55, 0xbf, 0x01, - 0xcf, 0xc1, 0xe6, 0x34, 0xcf, 0x7f, 0x1f, 0x30, 0x93, 0xe9, 0x4b, 0xe2, - 0xbf, 0x3e, 0xf5, 0xe3, 0xcf, 0xe7, 0x81, 0x8e, 0xdf, 0x80, 0xda, 0xd4, - 0xaf, 0x0a, 0x79, 0x84, 0x21, 0xdf, 0x5f, 0x9c, 0x9e, 0x3f, 0xa9, 0xf2, - 0xdf, 0x12, 0xce, 0xb7, 0xc0, 0xb3, 0x91, 0xe7, 0xb3, 0x71, 0x0b, 0xaf, - 0x17, 0x2a, 0x3e, 0xb4, 0xeb, 0x53, 0xcf, 0x17, 0x33, 0xb5, 0x63, 0xbb, - 0x58, 0xde, 0x21, 0xfe, 0x9e, 0x85, 0x28, 0x7e, 0x8d, 0x49, 0xa7, 0x5a, - 0x66, 0xcf, 0x53, 0xf9, 0x3e, 0x48, 0xef, 0x97, 0x39, 0xa6, 0xe2, 0x6f, - 0xbe, 0x53, 0x63, 0xf7, 0xbb, 0xe4, 0x7e, 0xf9, 0xfe, 0xbe, 0xb0, 0x6f, - 0x1c, 0x58, 0xc0, 0xbe, 0xeb, 0x19, 0x60, 0xf0, 0x55, 0x86, 0xb7, 0x90, - 0x74, 0x1e, 0xaf, 0x0a, 0xdb, 0x43, 0x21, 0x7f, 0x09, 0x00, 0xa7, 0x40, - 0x78, 0x3f, 0x82, 0x7a, 0x67, 0x41, 0x4f, 0xe6, 0x34, 0xf0, 0x29, 0xf6, - 0xe1, 0xfc, 0xdd, 0xac, 0x1f, 0xc5, 0x8a, 0xfd, 0x2c, 0xc5, 0x08, 0x5f, - 0xcf, 0xeb, 0xd2, 0x31, 0x72, 0x01, 0x5e, 0xf7, 0xf4, 0x4d, 0x30, 0x58, - 0xdf, 0x55, 0x12, 0x6f, 0x5f, 0xc4, 0xdf, 0x9f, 0xd5, 0xc6, 0x93, 0xf0, - 0x5e, 0xc1, 0xf9, 0xd7, 0xe3, 0xd1, 0x7c, 0xfd, 0x26, 0x6c, 0xd1, 0x0f, - 0xaf, 0x8e, 0xd1, 0x7d, 0xe4, 0x7a, 0xea, 0x47, 0x73, 0xe6, 0x3c, 0xf4, - 0x6b, 0x71, 0xf4, 0xb2, 0x0d, 0x6d, 0xc9, 0x10, 0x7a, 0x87, 0xe7, 0x40, - 0xb3, 0x9a, 0x8c, 0x77, 0x70, 0x53, 0x02, 0xbe, 0x1c, 0xe7, 0x0f, 0x1c, - 0x7f, 0x81, 0xf7, 0x83, 0x91, 0xeb, 0x41, 0xf8, 0x48, 0x53, 0xc5, 0xe3, - 0xb1, 0x91, 0x80, 0x6f, 0xc0, 0xd6, 0xb3, 0x91, 0x41, 0xc1, 0xf3, 0x2e, - 0x0c, 0x3f, 0x04, 0xda, 0x17, 0x0b, 0x3f, 0x64, 0x46, 0xab, 0xcf, 0x0e, - 0xea, 0x7b, 0xe7, 0x0d, 0xf6, 0xfd, 0x10, 0xc5, 0x4f, 0xab, 0xd1, 0xfa, - 0x5d, 0xd3, 0x9b, 0x90, 0x78, 0xeb, 0xf4, 0x23, 0xf0, 0x7b, 0x24, 0xfd, - 0x95, 0xe7, 0xa3, 0xf8, 0x3c, 0x7c, 0xbe, 0x1e, 0xe5, 0x67, 0x99, 0x82, - 0xa4, 0xd7, 0x1c, 0xf0, 0xb3, 0xb4, 0x5f, 0x01, 0x0d, 0xd8, 0xbf, 0x09, - 0xb2, 0x42, 0x46, 0xf6, 0x59, 0xa7, 0xfa, 0xef, 0x49, 0xfc, 0xf2, 0x31, - 0x41, 0x5f, 0xa0, 0x91, 0x8e, 0xcf, 0xbe, 0x5d, 0xcf, 0x57, 0x52, 0xf6, - 0xb5, 0x47, 0xe3, 0xb6, 0x6c, 0x3f, 0xf2, 0xe1, 0xfa, 0x47, 0xf2, 0x40, - 0xb4, 0x8c, 0xc8, 0x83, 0x91, 0x01, 0x2a, 0xe7, 0xc8, 0xf8, 0x7b, 0x33, - 0x2d, 0xfc, 0xdf, 0xcf, 0x64, 0x22, 0xf1, 0x33, 0xbc, 0x36, 0xb2, 0x9f, - 0x2d, 0xf5, 0x09, 0x62, 0x3d, 0x82, 0x78, 0xbb, 0xc7, 0xf0, 0xb4, 0x92, - 0xf2, 0xbf, 0xd7, 0xaa, 0xfc, 0xe4, 0xd7, 0xb7, 0x7e, 0xbe, 0x15, 0xaf, - 0x57, 0x1f, 0xdf, 0x8f, 0xcc, 0xbf, 0x87, 0xe3, 0xf5, 0xe2, 0x09, 0x6f, - 0xf0, 0x67, 0x7f, 0x7f, 0x1c, 0x56, 0x5c, 0x32, 0x1e, 0xa3, 0x97, 0x33, - 0xc0, 0xc5, 0xc8, 0xab, 0x63, 0x8f, 0xe2, 0xcb, 0xd4, 0x0a, 0xc0, 0x21, - 0xf2, 0x85, 0xc8, 0xd3, 0x6f, 0x5a, 0x20, 0x5b, 0xbf, 0xb3, 0x54, 0xdd, - 0x1b, 0xd2, 0xb7, 0xea, 0x5d, 0x89, 0xf8, 0x82, 0x75, 0xe4, 0xcf, 0x18, - 0x39, 0x54, 0x2b, 0x82, 0xf9, 0x7b, 0x01, 0xcd, 0x57, 0x2d, 0x6d, 0x9b, - 0x5b, 0xa0, 0x8b, 0x7d, 0xf0, 0x28, 0xbf, 0xbf, 0x58, 0x63, 0xf8, 0x61, - 0xe0, 0xe5, 0x8a, 0x27, 0xf0, 0xbb, 0xfc, 0x20, 0x5f, 0xa9, 0x0e, 0xeb, - 0xfd, 0x60, 0xdf, 0x51, 0x3f, 0x77, 0x90, 0xdc, 0xb3, 0xd7, 0xf6, 0xbe, - 0x4f, 0xf9, 0x3d, 0xc5, 0x2f, 0xa1, 0xf2, 0xfe, 0x9c, 0x59, 0x66, 0xfc, - 0xec, 0x1a, 0xe9, 0x3f, 0x61, 0xf5, 0x49, 0x3e, 0xcb, 0x97, 0xfa, 0x0c, - 0x59, 0xfc, 0xbd, 0x26, 0xaf, 0x3f, 0x97, 0x6f, 0x2c, 0xf1, 0xe0, 0xdb, - 0xeb, 0x7f, 0x00, 0xcc, 0x65, 0x69, 0xfd, 0x1b, 0x3f, 0xef, 0x6f, 0x91, - 0xe3, 0x17, 0x63, 0xf3, 0x49, 0xe4, 0xfd, 0x34, 0xbe, 0xce, 0xee, 0xdf, - 0x93, 0x8a, 0xe7, 0x12, 0xe0, 0x09, 0xc8, 0xf3, 0x2f, 0xdf, 0xf7, 0x6c, - 0x67, 0xf3, 0x23, 0xfa, 0xac, 0xf8, 0x77, 0x2e, 0x7e, 0x7c, 0x3f, 0x62, - 0x4f, 0xb5, 0x1b, 0xef, 0xae, 0x36, 0xf9, 0xee, 0x7e, 0x24, 0x1f, 0xad, - 0xdd, 0x78, 0xb7, 0xa6, 0xe3, 0xc5, 0x30, 0xdc, 0x41, 0x21, 0xcf, 0xea, - 0x29, 0xfd, 0x5f, 0xe7, 0x65, 0xbe, 0xc2, 0xcd, 0x92, 0xb4, 0xe2, 0xf1, - 0xb2, 0xc8, 0xd3, 0xf2, 0x5a, 0x7d, 0x07, 0xff, 0x7c, 0x45, 0xf1, 0x73, - 0x88, 0xb4, 0xe7, 0xc9, 0x03, 0x4c, 0xec, 0xb3, 0x32, 0x24, 0xf6, 0x04, - 0x75, 0xa8, 0xa3, 0x71, 0xc3, 0xfd, 0xd5, 0x5b, 0x69, 0x2b, 0xd5, 0x39, - 0xe9, 0xc9, 0x2d, 0x6f, 0x64, 0xe7, 0x4c, 0xe2, 0xe7, 0x9f, 0x5f, 0x58, - 0x58, 0x58, 0x42, 0xfe, 0xb8, 0xa3, 0x67, 0x7f, 0x39, 0x7f, 0x6a, 0x69, - 0x89, 0x65, 0x34, 0x95, 0x8f, 0xed, 0xae, 0xa0, 0xf1, 0xba, 0xe9, 0xcd, - 0x6c, 0x62, 0x07, 0x80, 0xe1, 0xcd, 0xdd, 0x42, 0x36, 0x86, 0xf0, 0x23, - 0xf7, 0x2f, 0xaa, 0x00, 0x77, 0x79, 0xf5, 0x03, 0xa3, 0x18, 0xe2, 0x81, - 0xc1, 0xea, 0x44, 0xef, 0x08, 0x3a, 0xdb, 0x6d, 0xe2, 0x55, 0x2e, 0x68, - 0x4c, 0xdb, 0x30, 0xbf, 0x76, 0xa8, 0xba, 0x30, 0x55, 0xf2, 0xe6, 0x28, - 0xdb, 0x66, 0x78, 0x68, 0x25, 0x68, 0xd4, 0x69, 0xfe, 0xbe, 0x6b, 0x41, - 0xe0, 0xdf, 0x64, 0x00, 0xdf, 0xe7, 0xfd, 0x39, 0xf3, 0x43, 0xe4, 0x0d, - 0xab, 0x5d, 0x5b, 0x7f, 0xf0, 0x0a, 0x04, 0x33, 0x70, 0x6e, 0x04, 0x1c, - 0x85, 0xfe, 0x07, 0xb7, 0x1a, 0x12, 0x0f, 0xc9, 0xf1, 0x46, 0x69, 0x33, - 0x40, 0xe3, 0xf8, 0x0d, 0xaf, 0x18, 0x14, 0xff, 0xe2, 0xb3, 0x5b, 0x55, - 0x01, 0x39, 0xe8, 0x67, 0xfd, 0x98, 0x86, 0x22, 0xf2, 0x5b, 0xf1, 0x1f, - 0xd8, 0x86, 0xff, 0x88, 0xfb, 0x31, 0x10, 0xfd, 0x4e, 0xdb, 0xc8, 0x9f, - 0x45, 0xe6, 0xff, 0x2b, 0xfc, 0xd8, 0x82, 0xce, 0xaf, 0xcc, 0x07, 0x51, - 0xe8, 0x9a, 0xa7, 0x1a, 0x16, 0xc1, 0xaa, 0x2d, 0x6b, 0xa7, 0x29, 0xdb, - 0xc0, 0xf9, 0xda, 0xf3, 0x27, 0x28, 0xbe, 0xc7, 0x13, 0x64, 0x26, 0x67, - 0x0c, 0x58, 0xc1, 0xb0, 0x80, 0xcc, 0xa5, 0x5e, 0x06, 0x8c, 0xf0, 0xfc, - 0xdf, 0xe5, 0x53, 0xbd, 0x59, 0x6c, 0x0c, 0xe0, 0x4b, 0x8f, 0x86, 0xf8, - 0x53, 0x2e, 0x99, 0x3f, 0x81, 0xe1, 0x19, 0xc3, 0x5c, 0x66, 0x15, 0x41, - 0xe9, 0x55, 0xd0, 0x9c, 0x82, 0x87, 0x56, 0xdc, 0x5c, 0xa7, 0xfc, 0x09, - 0x3f, 0xd5, 0x10, 0xf7, 0x43, 0x8a, 0xe7, 0x34, 0x45, 0xeb, 0x45, 0x6c, - 0xc6, 0x6f, 0x72, 0xcf, 0x1d, 0xe3, 0x78, 0x54, 0x7e, 0xc6, 0xab, 0xd0, - 0xf9, 0xef, 0xd2, 0xe6, 0x4b, 0xd4, 0x3f, 0xe3, 0x06, 0x5a, 0x8f, 0x01, - 0xae, 0x40, 0xe5, 0x83, 0x6c, 0xbd, 0xe5, 0x79, 0xcc, 0xf0, 0x7e, 0x6e, - 0x94, 0x3f, 0x09, 0x7e, 0xc6, 0xf8, 0xd3, 0x66, 0x79, 0xfe, 0x56, 0xf1, - 0xfa, 0xca, 0x3c, 0xda, 0xc2, 0x5a, 0xac, 0x9e, 0xb3, 0x3c, 0xb6, 0x3e, - 0x35, 0xb1, 0x1f, 0xfd, 0x1d, 0xf1, 0x07, 0xda, 0x3f, 0x68, 0xf4, 0x56, - 0x1a, 0x65, 0x58, 0xcf, 0xe5, 0x21, 0xd8, 0x20, 0xc7, 0xbf, 0x24, 0x16, - 0xbf, 0x9f, 0xde, 0x7f, 0x0d, 0xb9, 0x5f, 0xe5, 0x07, 0xc9, 0xfb, 0x29, - 0xf0, 0x4f, 0x6c, 0xff, 0x1a, 0xc9, 0x4f, 0x85, 0xfc, 0x32, 0xc5, 0xfc, - 0x8e, 0x74, 0xc8, 0xbf, 0xd4, 0xf8, 0xcb, 0xd2, 0xc7, 0x3f, 0x1b, 0x19, - 0xbf, 0x1f, 0x2e, 0x72, 0xfc, 0xee, 0x36, 0xf3, 0xb7, 0x22, 0xf3, 0x5f, - 0xec, 0xf8, 0x4b, 0xe2, 0xc7, 0x57, 0xf3, 0x8d, 0xb5, 0x2f, 0x5a, 0xf0, - 0x4e, 0x82, 0xfd, 0xc9, 0xa7, 0x8f, 0x77, 0xa4, 0x43, 0xbc, 0xae, 0x7b, - 0xda, 0xc8, 0x07, 0x35, 0x3f, 0x23, 0x69, 0x7e, 0xd7, 0xc6, 0xcf, 0x2f, - 0xd3, 0x66, 0x7e, 0x89, 0xe3, 0x5d, 0x1d, 0x3b, 0x5e, 0x92, 0x7c, 0xa8, - 0x05, 0xef, 0x5b, 0x8f, 0x1f, 0x8f, 0xe5, 0x67, 0x2a, 0xf9, 0x70, 0x45, - 0xaa, 0x7c, 0x60, 0xf5, 0xb4, 0x4e, 0xab, 0x7c, 0xf0, 0x54, 0xbf, 0x03, - 0x0b, 0x86, 0x9f, 0x17, 0x8c, 0xff, 0x56, 0xad, 0xff, 0x9b, 0x94, 0x07, - 0x5c, 0x3f, 0x5d, 0xa5, 0xf4, 0xd3, 0x52, 0x95, 0xa1, 0x75, 0xe2, 0x32, - 0xe1, 0xfb, 0x03, 0x2b, 0x1c, 0xcc, 0xb4, 0xbe, 0xc6, 0x50, 0x05, 0x65, - 0x07, 0x68, 0x49, 0xb0, 0xb4, 0x0f, 0x94, 0xfc, 0xf8, 0xce, 0x36, 0xe8, - 0x36, 0xae, 0xec, 0xaf, 0x56, 0x76, 0xed, 0x06, 0xde, 0x9b, 0x0a, 0x38, - 0xc0, 0x93, 0xe4, 0xfa, 0x58, 0x99, 0xd5, 0x47, 0x4f, 0x7e, 0xbb, 0x92, - 0xdb, 0x44, 0x3b, 0xa2, 0xd5, 0x9f, 0xb3, 0xa1, 0x51, 0xde, 0xd1, 0x8f, - 0x6c, 0x22, 0x3f, 0x4a, 0x4b, 0x4c, 0x6c, 0x12, 0x5b, 0xeb, 0xa1, 0x87, - 0xec, 0xfc, 0xda, 0x57, 0xd6, 0x83, 0x66, 0x17, 0xb5, 0xdf, 0x9e, 0x97, - 0xf5, 0x61, 0x0b, 0x97, 0x11, 0xf5, 0x0e, 0x51, 0x16, 0x0d, 0x1e, 0x84, - 0x54, 0x9f, 0xc6, 0x44, 0x7f, 0x1f, 0x00, 0x27, 0x91, 0xd9, 0x05, 0xdc, - 0x75, 0xd5, 0x7f, 0x61, 0xfa, 0xfd, 0x3b, 0xc0, 0xf5, 0x06, 0x2a, 0x78, - 0xb7, 0xac, 0x79, 0xe1, 0x0f, 0x0c, 0xca, 0x2f, 0xbb, 0xc1, 0x49, 0x2a, - 0x5f, 0x76, 0xad, 0x41, 0x4f, 0x23, 0x5c, 0x83, 0x73, 0xeb, 0x86, 0x89, - 0xe5, 0x67, 0x70, 0x1f, 0xc4, 0x01, 0xc0, 0xf0, 0x93, 0xac, 0x7a, 0xd1, - 0x88, 0xe1, 0x9f, 0x65, 0x70, 0xa4, 0x41, 0xbf, 0xc7, 0x66, 0x79, 0x49, - 0xdc, 0xf7, 0x3e, 0xf8, 0x0e, 0xfb, 0x1e, 0x98, 0x38, 0xf6, 0x7b, 0x0f, - 0x34, 0xd9, 0xf7, 0xca, 0xdf, 0x82, 0x22, 0xfd, 0x7a, 0x40, 0x04, 0xaf, - 0x3c, 0xb0, 0x77, 0x97, 0x80, 0xda, 0xbf, 0xc2, 0xd2, 0x55, 0xb1, 0xf2, - 0x88, 0xaa, 0xe0, 0xe1, 0x49, 0x44, 0xe9, 0xab, 0x65, 0x3f, 0x5b, 0xea, - 0x17, 0x1a, 0xac, 0x96, 0xdb, 0xe5, 0x85, 0xe3, 0xca, 0xfe, 0x3c, 0xd2, - 0x4b, 0xe5, 0xbb, 0xa2, 0x1f, 0xd1, 0xa3, 0xef, 0x4e, 0xa7, 0x9b, 0x0a, - 0xa9, 0x89, 0xd1, 0xfb, 0xe1, 0x26, 0x86, 0x9f, 0xd4, 0xf2, 0x3c, 0x6a, - 0x7f, 0xf4, 0x84, 0xe8, 0x8f, 0xcc, 0x6e, 0x98, 0xf1, 0x77, 0x91, 0x8f, - 0x4a, 0x61, 0x96, 0xdf, 0x0c, 0x5a, 0xeb, 0xe1, 0x77, 0xb2, 0x96, 0x18, - 0x8c, 0x1e, 0x73, 0xd4, 0x44, 0x1a, 0xe0, 0xdf, 0x8f, 0x58, 0x82, 0xd8, - 0x77, 0x31, 0x1c, 0x18, 0xfc, 0x4f, 0x02, 0xcf, 0x76, 0xc2, 0xe3, 0xd7, - 0x7f, 0x0b, 0xf9, 0xf2, 0x0d, 0xf5, 0x72, 0x7f, 0xc2, 0x34, 0xe2, 0x37, - 0x58, 0x7b, 0x54, 0xbd, 0x85, 0x8c, 0x75, 0xff, 0xf2, 0xb2, 0x84, 0xfa, - 0xfc, 0x8d, 0x25, 0x4d, 0x5f, 0x95, 0x5b, 0x67, 0x24, 0xd5, 0xf3, 0xb7, - 0x9e, 0x8f, 0xe5, 0xea, 0x7c, 0xc4, 0xf0, 0xab, 0x4b, 0x1a, 0xce, 0xfa, - 0xda, 0x7b, 0xa5, 0x7c, 0x05, 0x66, 0x83, 0x19, 0xdd, 0x89, 0xf7, 0x77, - 0x58, 0xef, 0xa1, 0xea, 0x1d, 0xa2, 0xfb, 0x19, 0xad, 0x7f, 0xc0, 0xb4, - 0x3e, 0xd4, 0xcc, 0x08, 0x7b, 0x94, 0x5c, 0x7f, 0x09, 0x17, 0x0e, 0x89, - 0x7c, 0x5c, 0x46, 0xaf, 0x4d, 0xaa, 0x70, 0x04, 0xf3, 0x91, 0xef, 0x2f, - 0xfa, 0xdf, 0x40, 0xb3, 0x09, 0xf8, 0x7c, 0xd7, 0xc4, 0xcd, 0x57, 0xf5, - 0x1f, 0xc8, 0x75, 0xe4, 0xaf, 0x57, 0xd7, 0x77, 0x74, 0x78, 0x7f, 0x52, - 0x3d, 0x84, 0x07, 0xde, 0xcc, 0xed, 0xcb, 0x48, 0x3f, 0x3a, 0x89, 0xd7, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Apr 25 18:06:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5D03FABCAD; Wed, 25 Apr 2018 18:06:23 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9918036B; Wed, 25 Apr 2018 18:06:23 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D3704BEC; Wed, 25 Apr 2018 18:06:23 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PI6NZO088614; Wed, 25 Apr 2018 18:06:23 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PI6MbX088613; Wed, 25 Apr 2018 18:06:22 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201804251806.w3PI6MbX088613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 25 Apr 2018 18:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333004 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 333004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 18:06:24 -0000 Author: davidcs Date: Wed Apr 25 18:06:22 2018 New Revision: 333004 URL: https://svnweb.freebsd.org/changeset/base/333004 Log: Fix Issue with adding MUltiCast Addresses. When multicast addresses are added/deleted, the delete the multicast addresses previously programmed in HW and reprogram the new set of multicast addresses. Submitted by:Vaishali.Kulkarni@cavium.com MFC after:5 days Modified: head/sys/dev/bxe/bxe.c Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Wed Apr 25 17:51:17 2018 (r333003) +++ head/sys/dev/bxe/bxe.c Wed Apr 25 18:06:22 2018 (r333004) @@ -29,7 +29,7 @@ #include __FBSDID("$FreeBSD$"); -#define BXE_DRIVER_VERSION "1.78.90" +#define BXE_DRIVER_VERSION "1.78.91" #include "bxe.h" #include "ecore_sp.h" @@ -11993,85 +11993,107 @@ bxe_initial_phy_init(struct bxe_softc *sc, } /* must be called under IF_ADDR_LOCK */ - static int -bxe_set_mc_list(struct bxe_softc *sc) +bxe_init_mcast_macs_list(struct bxe_softc *sc, + struct ecore_mcast_ramrod_params *p) { - struct ecore_mcast_ramrod_params rparam = { NULL }; - int rc = 0; - int mc_count = 0; - int mcnt, i; - struct ecore_mcast_list_elem *mc_mac, *mc_mac_start; - unsigned char *mta; if_t ifp = sc->ifp; + int mc_count = 0; + struct ifmultiaddr *ifma; + struct ecore_mcast_list_elem *mc_mac; - mc_count = if_multiaddr_count(ifp, -1);/* XXX they don't have a limit */ - if (!mc_count) - return (0); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) { + continue; + } - mta = malloc(sizeof(unsigned char) * ETHER_ADDR_LEN * - mc_count, M_DEVBUF, M_NOWAIT); + mc_count++; + } - if(mta == NULL) { - BLOGE(sc, "Failed to allocate temp mcast list\n"); - return (-1); + ECORE_LIST_INIT(&p->mcast_list); + p->mcast_list_len = 0; + + if (!mc_count) { + return (0); } - bzero(mta, (sizeof(unsigned char) * ETHER_ADDR_LEN * mc_count)); - - mc_mac = mallocarray(mc_count, sizeof(*mc_mac), M_DEVBUF, - (M_NOWAIT | M_ZERO)); - mc_mac_start = mc_mac; + mc_mac = malloc(sizeof(*mc_mac) * mc_count, M_DEVBUF, + (M_NOWAIT | M_ZERO)); if (!mc_mac) { - free(mta, M_DEVBUF); BLOGE(sc, "Failed to allocate temp mcast list\n"); return (-1); } bzero(mc_mac, (sizeof(*mc_mac) * mc_count)); - /* mta and mcnt not expected to be different */ - if_multiaddr_array(ifp, mta, &mcnt, mc_count); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) { + continue; + } + mc_mac->mac = (uint8_t *)LLADDR((struct sockaddr_dl *)ifma->ifma_addr); + ECORE_LIST_PUSH_TAIL(&mc_mac->link, &p->mcast_list); - rparam.mcast_obj = &sc->mcast_obj; - ECORE_LIST_INIT(&rparam.mcast_list); + BLOGD(sc, DBG_LOAD, + "Setting MCAST %02X:%02X:%02X:%02X:%02X:%02X and mc_count %d\n", + mc_mac->mac[0], mc_mac->mac[1], mc_mac->mac[2], + mc_mac->mac[3], mc_mac->mac[4], mc_mac->mac[5], mc_count); + mc_mac++; + } - for(i=0; i< mcnt; i++) { + p->mcast_list_len = mc_count; - mc_mac->mac = (uint8_t *)(mta + (i * ETHER_ADDR_LEN)); - ECORE_LIST_PUSH_TAIL(&mc_mac->link, &rparam.mcast_list); + return (0); +} - BLOGD(sc, DBG_LOAD, - "Setting MCAST %02X:%02X:%02X:%02X:%02X:%02X\n", - mc_mac->mac[0], mc_mac->mac[1], mc_mac->mac[2], - mc_mac->mac[3], mc_mac->mac[4], mc_mac->mac[5]); +static void +bxe_free_mcast_macs_list(struct ecore_mcast_ramrod_params *p) +{ + struct ecore_mcast_list_elem *mc_mac = + ECORE_LIST_FIRST_ENTRY(&p->mcast_list, + struct ecore_mcast_list_elem, + link); - mc_mac++; + if (mc_mac) { + /* only a single free as all mc_macs are in the same heap array */ + free(mc_mac, M_DEVBUF); } - rparam.mcast_list_len = mc_count; +} +static int +bxe_set_mc_list(struct bxe_softc *sc) +{ + struct ecore_mcast_ramrod_params rparam = { NULL }; + int rc = 0; + rparam.mcast_obj = &sc->mcast_obj; + BXE_MCAST_LOCK(sc); /* first, clear all configured multicast MACs */ rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_DEL); if (rc < 0) { BLOGE(sc, "Failed to clear multicast configuration: %d\n", rc); + /* Manual backport parts of FreeBSD upstream r284470. */ BXE_MCAST_UNLOCK(sc); - free(mc_mac_start, M_DEVBUF); - free(mta, M_DEVBUF); return (rc); } + /* configure a new MACs list */ + rc = bxe_init_mcast_macs_list(sc, &rparam); + if (rc) { + BLOGE(sc, "Failed to create mcast MACs list (%d)\n", rc); + BXE_MCAST_UNLOCK(sc); + return (rc); + } + /* Now add the new MACs */ rc = ecore_config_mcast(sc, &rparam, ECORE_MCAST_CMD_ADD); if (rc < 0) { BLOGE(sc, "Failed to set new mcast config (%d)\n", rc); } - BXE_MCAST_UNLOCK(sc); + bxe_free_mcast_macs_list(&rparam); - free(mc_mac_start, M_DEVBUF); - free(mta, M_DEVBUF); + BXE_MCAST_UNLOCK(sc); return (rc); } From owner-svn-src-head@freebsd.org Wed Apr 25 18:44:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9793BFAC882; Wed, 25 Apr 2018 18:44:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B647693C0; Wed, 25 Apr 2018 18:44:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3972B10AFD3; Wed, 25 Apr 2018 14:44:57 -0400 (EDT) From: John Baldwin To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r332959 - head/sys/kern Date: Wed, 25 Apr 2018 09:54:55 -0700 Message-ID: <5237617.Ai8m1U92WL@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201804241854.w3OIsKuQ083232@repo.freebsd.org> References: <201804241854.w3OIsKuQ083232@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 25 Apr 2018 14:44:57 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 18:44:58 -0000 On Tuesday, April 24, 2018 06:54:20 PM Conrad Meyer wrote: > Author: cem > Date: Tue Apr 24 18:54:20 2018 > New Revision: 332959 > URL: https://svnweb.freebsd.org/changeset/base/332959 > > Log: > panic: Optionally, trace secondary panics > > To diagnose and fix secondary panics, it is useful to have a stack trace. > When panic tracing is enabled, optionally trace secondary panics as well. > > The option is configured with the tunable/sysctl debug.trace_all_panics. > > (The original concern that inspired only tracing the primary panic was > likely that the secondary trace may scroll the original panic message or trace > off the screen. This is less of a concern for serial consoles with logging. > Not everything has a serial console, though, so the behavior is optional.) Note that KDB_TRACE is enabled by default, so you would need it to always default to false to preserve existing behavior by default. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 25 18:47:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39D10FAC976; Wed, 25 Apr 2018 18:47:53 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D503F69593; Wed, 25 Apr 2018 18:47:52 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB5205263; Wed, 25 Apr 2018 18:47:52 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PIlqHh009424; Wed, 25 Apr 2018 18:47:52 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PIlqlS009423; Wed, 25 Apr 2018 18:47:52 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804251847.w3PIlqlS009423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Wed, 25 Apr 2018 18:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333005 - head/release/amd64 X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/release/amd64 X-SVN-Commit-Revision: 333005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 18:47:53 -0000 Author: benno Date: Wed Apr 25 18:47:52 2018 New Revision: 333005 URL: https://svnweb.freebsd.org/changeset/base/333005 Log: Allow etdump, makefs and mkimg to be overridden. Recent changes to makefs and mkimg have led to situations where the disconnect between this script and the versions installed on the host cause failures. Provide a way to work around this that doesn't require the installation of new versions to the host system if that's not desired. With this change mkisoimages.sh will honour the $ETDUMP, $MAKEFS and $MKIMG environment variables but fall back to the previous behaviour of finding them within $PATH. Reviewed by: gjb Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D15181 Modified: head/release/amd64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Wed Apr 25 18:06:22 2018 (r333004) +++ head/release/amd64/mkisoimages.sh Wed Apr 25 18:47:52 2018 (r333005) @@ -23,6 +23,18 @@ # extra-bits-dir, if provided, contains additional files to be merged # into base-bits-dir as part of making the image. +if [ -z $ETDUMP ]; then + ETDUMP=etdump +fi + +if [ -z $MAKEFS ]; then + MAKEFS=makefs +fi + +if [ -z $MKIMG ]; then + MKIMG=mkimg +fi + if [ "$1" = "-b" ]; then # This is highly x86-centric and will be used directly below. bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" @@ -55,13 +67,13 @@ NAME="$1"; shift publisher="The FreeBSD Project. https://www.FreeBSD.org/" echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > "$1/etc/fstab" -makefs -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" +$MAKEFS -t cd9660 $bootable -o rockridge -o label="$LABEL" -o publisher="$publisher" "$NAME" "$@" rm -f "$1/etc/fstab" rm -f efiboot.img if [ "$bootable" != "" ]; then # Look for the EFI System Partition image we dropped in the ISO image. - for entry in `etdump --format shell $NAME`; do + for entry in `$ETDUMP --format shell $NAME`; do eval $entry if [ "$et_platform" = "efi" ]; then espstart=`expr $et_lba \* 2048` @@ -73,7 +85,7 @@ if [ "$bootable" != "" ]; then # Create a GPT image containing the partitions we need for hybrid boot. imgsize=`stat -f %z $NAME` - mkimg -s gpt \ + $MKIMG -s gpt \ --capacity $imgsize \ -b $4/boot/pmbr \ $espparam \ From owner-svn-src-head@freebsd.org Wed Apr 25 18:56:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26056FACC49; Wed, 25 Apr 2018 18:56:28 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA69B6C310; Wed, 25 Apr 2018 18:56:27 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C551B53F8; Wed, 25 Apr 2018 18:56:27 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PIuRDJ014429; Wed, 25 Apr 2018 18:56:27 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PIuRHY014428; Wed, 25 Apr 2018 18:56:27 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804251856.w3PIuRHY014428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Wed, 25 Apr 2018 18:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333007 - head/usr.bin/etdump X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head/usr.bin/etdump X-SVN-Commit-Revision: 333007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 18:56:28 -0000 Author: benno Date: Wed Apr 25 18:56:27 2018 New Revision: 333007 URL: https://svnweb.freebsd.org/changeset/base/333007 Log: Update release version of FreeBSD. Sponsored by: iXsystems, Inc. Modified: head/usr.bin/etdump/etdump.1 Modified: head/usr.bin/etdump/etdump.1 ============================================================================== --- head/usr.bin/etdump/etdump.1 Wed Apr 25 18:53:02 2018 (r333006) +++ head/usr.bin/etdump/etdump.1 Wed Apr 25 18:56:27 2018 (r333007) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2018 +.Dd April 25, 2018 .Dt ETDUMP 8 .Os .Sh NAME @@ -101,4 +101,4 @@ done The .Nm utility first appeared in -.Fx 12.0 . +.Fx 11.2 From owner-svn-src-head@freebsd.org Wed Apr 25 18:59:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AE1CFACD92; Wed, 25 Apr 2018 18:59:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D92CA6C633; Wed, 25 Apr 2018 18:59:29 +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 D406D53FF; Wed, 25 Apr 2018 18:59:29 +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 w3PIxTO7014648; Wed, 25 Apr 2018 18:59:29 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PIxTRD014647; Wed, 25 Apr 2018 18:59:29 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804251859.w3PIxTRD014647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 25 Apr 2018 18:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333009 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 333009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 18:59:30 -0000 Author: kevans Date: Wed Apr 25 18:59:29 2018 New Revision: 333009 URL: https://svnweb.freebsd.org/changeset/base/333009 Log: grep: Special case the -V flag In case we need version information of the ultimately chosen grep, allowing `zgrep -V` to operate would be most helpful. Modified: head/usr.bin/grep/zgrep.sh Modified: head/usr.bin/grep/zgrep.sh ============================================================================== --- head/usr.bin/grep/zgrep.sh Wed Apr 25 18:58:38 2018 (r333008) +++ head/usr.bin/grep/zgrep.sh Wed Apr 25 18:59:29 2018 (r333009) @@ -106,6 +106,10 @@ do silent=1 shift ;; + -V) + ${grep} -V + exit $? + ;; -*) grep_args="${grep_args} $1" shift From owner-svn-src-head@freebsd.org Wed Apr 25 19:46:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F0FAFAE0FD; Wed, 25 Apr 2018 19:46:40 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01D6E756AF; Wed, 25 Apr 2018 19:46:40 +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 EC4825BE5; Wed, 25 Apr 2018 19:46:39 +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 w3PJkdSZ040244; Wed, 25 Apr 2018 19:46:39 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PJkdkH040243; Wed, 25 Apr 2018 19:46:39 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201804251946.w3PJkdkH040243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 25 Apr 2018 19:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333010 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 333010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 19:46:40 -0000 Author: lwhsu (ports committer) Date: Wed Apr 25 19:46:39 2018 New Revision: 333010 URL: https://svnweb.freebsd.org/changeset/base/333010 Log: Fix mips32 build after r332951. Approved by: jhb Modified: head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Wed Apr 25 18:59:29 2018 (r333009) +++ head/sys/mips/mips/pm_machdep.c Wed Apr 25 19:46:39 2018 (r333010) @@ -264,7 +264,7 @@ ptrace_single_step(struct thread *td) va = locr0->pc + 4; } if (td->td_md.md_ss_addr) { - printf("SS %s (%d): breakpoint already set at %lx (va %lx)\n", + printf("SS %s (%d): breakpoint already set at %zx (va %zx)\n", p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ error = EFAULT; goto out; @@ -500,7 +500,7 @@ ptrace_clear_single_step(struct thread *td) if (error != 0) { log(LOG_ERR, - "SS %s %d: can't restore instruction at %lx: %x\n", + "SS %s %d: can't restore instruction at %zx: %x\n", p->p_comm, p->p_pid, td->td_md.md_ss_addr, td->td_md.md_ss_instr); } From owner-svn-src-head@freebsd.org Wed Apr 25 20:52:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F950FB00C3; Wed, 25 Apr 2018 20:52:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 501768693F; Wed, 25 Apr 2018 20:52:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A33066C6; Wed, 25 Apr 2018 20:52:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PKqIen073070; Wed, 25 Apr 2018 20:52:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PKqIDl073069; Wed, 25 Apr 2018 20:52:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804252052.w3PKqIDl073069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 25 Apr 2018 20:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333011 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 333011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 20:52:18 -0000 Author: bapt Date: Wed Apr 25 20:52:17 2018 New Revision: 333011 URL: https://svnweb.freebsd.org/changeset/base/333011 Log: zgrep: small improvements * Use slightly more efficient method to determine the name of the program called [1] * Use nicer form to loop over arguments [1] * add special support for --version along with -V previously added by kevans Reported by: jilles@ [1] Modified: head/usr.bin/grep/zgrep.sh Modified: head/usr.bin/grep/zgrep.sh ============================================================================== --- head/usr.bin/grep/zgrep.sh Wed Apr 25 19:46:39 2018 (r333010) +++ head/usr.bin/grep/zgrep.sh Wed Apr 25 20:52:17 2018 (r333011) @@ -34,7 +34,7 @@ grep_args="" hyphen=0 silent=0 -prg=$(basename $0) +prg=${0##*/} # handle being called 'zegrep' or 'zfgrep' case ${prg} in @@ -106,9 +106,8 @@ do silent=1 shift ;; - -V) - ${grep} -V - exit $? + -V|--version) + exec ${grep} -V ;; -*) grep_args="${grep_args} $1" @@ -145,9 +144,8 @@ else if [ ${silent} -lt 1 -a $# -gt 1 ]; then grep_args="-H ${grep_args}" fi - while [ $# -gt 0 ] - do - ${cattool} ${catargs} -- "$1" | ${grep} --label="${1}" ${grep_args} -- "${pattern}" - + for file do + ${cattool} ${catargs} -- "${file}" | ${grep} --label="${file}" ${grep_args} -- "${pattern}" - shift done fi From owner-svn-src-head@freebsd.org Wed Apr 25 20:55:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64462FB01A9; Wed, 25 Apr 2018 20:55:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0115F68334; Wed, 25 Apr 2018 20:55:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E54E566DE; Wed, 25 Apr 2018 20:55:18 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PKtITi076130; Wed, 25 Apr 2018 20:55:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PKtIaG076129; Wed, 25 Apr 2018 20:55:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804252055.w3PKtIaG076129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 25 Apr 2018 20:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333012 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 333012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 20:55:19 -0000 Author: bapt Date: Wed Apr 25 20:55:18 2018 New Revision: 333012 URL: https://svnweb.freebsd.org/changeset/base/333012 Log: zgrep.sh: remove now useless shift Modified: head/usr.bin/grep/zgrep.sh Modified: head/usr.bin/grep/zgrep.sh ============================================================================== --- head/usr.bin/grep/zgrep.sh Wed Apr 25 20:52:17 2018 (r333011) +++ head/usr.bin/grep/zgrep.sh Wed Apr 25 20:55:18 2018 (r333012) @@ -146,7 +146,6 @@ else fi for file do ${cattool} ${catargs} -- "${file}" | ${grep} --label="${file}" ${grep_args} -- "${pattern}" - - shift done fi From owner-svn-src-head@freebsd.org Wed Apr 25 21:01:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FE92FB02D0; Wed, 25 Apr 2018 21:01:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34DA3686A2; Wed, 25 Apr 2018 21:01:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FFFA6710; Wed, 25 Apr 2018 21:01:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PL12wW077912; Wed, 25 Apr 2018 21:01:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PL120S077911; Wed, 25 Apr 2018 21:01:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201804252101.w3PL120S077911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 25 Apr 2018 21:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333013 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 333013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 21:01:03 -0000 Author: bapt Date: Wed Apr 25 21:01:02 2018 New Revision: 333013 URL: https://svnweb.freebsd.org/changeset/base/333013 Log: zgrep.sh: Add forgotten ';' and remove set -e which prevents looping over files not matching Modified: head/usr.bin/grep/zgrep.sh Modified: head/usr.bin/grep/zgrep.sh ============================================================================== --- head/usr.bin/grep/zgrep.sh Wed Apr 25 20:55:18 2018 (r333012) +++ head/usr.bin/grep/zgrep.sh Wed Apr 25 21:01:02 2018 (r333013) @@ -24,7 +24,7 @@ # # $FreeBSD$ -set -eu +set -u grep=grep zcat=zstdcat @@ -144,7 +144,7 @@ else if [ ${silent} -lt 1 -a $# -gt 1 ]; then grep_args="-H ${grep_args}" fi - for file do + for file; do ${cattool} ${catargs} -- "${file}" | ${grep} --label="${file}" ${grep_args} -- "${pattern}" - done fi From owner-svn-src-head@freebsd.org Thu Apr 26 00:00:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AECEFFB35A9 for ; Thu, 26 Apr 2018 00:00:08 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36EEA6AE03 for ; Thu, 26 Apr 2018 00:00:07 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 87531b13-48e4-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 87531b13-48e4-11e8-b951-f99fef315fd9; Wed, 25 Apr 2018 23:58:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w3PNxxRx023211; Wed, 25 Apr 2018 17:59:59 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1524700799.57768.111.camel@freebsd.org> Subject: Re: svn commit: r333010 - head/sys/mips/mips From: Ian Lepore To: Li-Wen Hsu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 25 Apr 2018 17:59:59 -0600 In-Reply-To: <201804251946.w3PJkdkH040243@repo.freebsd.org> References: <201804251946.w3PJkdkH040243@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 00:00:08 -0000 On Wed, 2018-04-25 at 19:46 +0000, Li-Wen Hsu wrote: > Author: lwhsu (ports committer) > Date: Wed Apr 25 19:46:39 2018 > New Revision: 333010 > URL: https://svnweb.freebsd.org/changeset/base/333010 > > Log: > Fix mips32 build after r332951. > > Approved by: jhb > > Modified: > head/sys/mips/mips/pm_machdep.c > > Modified: head/sys/mips/mips/pm_machdep.c > ============================================================================== > --- head/sys/mips/mips/pm_machdep.c Wed Apr 25 18:59:29 2018 (r333009) > +++ head/sys/mips/mips/pm_machdep.c Wed Apr 25 19:46:39 2018 (r333010) > @@ -264,7 +264,7 @@ ptrace_single_step(struct thread *td) > va = locr0->pc + 4; > } > if (td->td_md.md_ss_addr) { > - printf("SS %s (%d): breakpoint already set at %lx (va %lx)\n", > + printf("SS %s (%d): breakpoint already set at %zx (va %zx)\n", > p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ > error = EFAULT; > goto out; > @@ -500,7 +500,7 @@ ptrace_clear_single_step(struct thread *td) > > if (error != 0) { > log(LOG_ERR, > - "SS %s %d: can't restore instruction at %lx: %x\n", > + "SS %s %d: can't restore instruction at %zx: %x\n", > p->p_comm, p->p_pid, td->td_md.md_ss_addr, > td->td_md.md_ss_instr); > } > This isn't right either. %z is for size_t values, both md_ss_addr and va are integers and a plain %x should be the right format. -- Ian From owner-svn-src-head@freebsd.org Thu Apr 26 08:58:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53DFFFA6B7A; Thu, 26 Apr 2018 08:58:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD9AD6AD65; Thu, 26 Apr 2018 08:58:27 +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 D88F71601E; Thu, 26 Apr 2018 08:58:27 +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 w3Q8wRG6039385; Thu, 26 Apr 2018 08:58:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3Q8wRuN039382; Thu, 26 Apr 2018 08:58:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804260858.w3Q8wRuN039382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 26 Apr 2018 08:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333015 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 08:58:28 -0000 Author: hselasky Date: Thu Apr 26 08:58:27 2018 New Revision: 333015 URL: https://svnweb.freebsd.org/changeset/base/333015 Log: Add network device event for priority code point, PCP, changes. When the PCP is changed for either a VLAN network interface or when prio tagging is enabled for a regular ethernet network interface, broadcast the IFNET_EVENT_PCP event so applications like ibcore can update its GID tables accordingly. MFC after: 3 days Reviewed by: ae, kib Differential Revision: https://reviews.freebsd.org/D15040 Sponsored by: Mellanox Technologies Modified: head/sys/net/if_ethersubr.c head/sys/net/if_var.h head/sys/net/if_vlan.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Thu Apr 26 05:21:00 2018 (r333014) +++ head/sys/net/if_ethersubr.c Thu Apr 26 08:58:27 2018 (r333015) @@ -1128,10 +1128,13 @@ ether_ioctl(struct ifnet *ifp, u_long command, caddr_t if (error != 0) break; if (ifr->ifr_lan_pcp > 7 && - ifr->ifr_lan_pcp != IFNET_PCP_NONE) + ifr->ifr_lan_pcp != IFNET_PCP_NONE) { error = EINVAL; - else + } else { ifp->if_pcp = ifr->ifr_lan_pcp; + /* broadcast event about PCP change */ + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_PCP); + } break; case SIOCGLANPCP: Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Apr 26 05:21:00 2018 (r333014) +++ head/sys/net/if_var.h Thu Apr 26 08:58:27 2018 (r333015) @@ -421,6 +421,8 @@ EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_even /* Interface up/down event */ #define IFNET_EVENT_UP 0 #define IFNET_EVENT_DOWN 1 +#define IFNET_EVENT_PCP 2 /* priority code point, PCP */ + typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event); EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn); #endif /* _SYS_EVENTHANDLER_H_ */ Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Apr 26 05:21:00 2018 (r333014) +++ head/sys/net/if_vlan.c Thu Apr 26 08:58:27 2018 (r333015) @@ -1947,6 +1947,8 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data } ifv->ifv_pcp = ifr->ifr_vlan_pcp; vlan_tag_recalculate(ifv); + /* broadcast event about PCP change */ + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_PCP); break; case SIOCSIFCAP: From owner-svn-src-head@freebsd.org Thu Apr 26 11:01:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59487FAA502; Thu, 26 Apr 2018 11:01:37 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D33A786FA5; Thu, 26 Apr 2018 11:01:36 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-wr0-x22b.google.com with SMTP id o15-v6so56323017wro.11; Thu, 26 Apr 2018 04:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=AY0YTwcyckRqLfnNWW2yvOwCT06wnfCDNH7Bh7prKJA=; b=HZJ8QiHYLNxu702fXZfdZ8s4p105QLcu4J770skxjHfJnswsGOztffQ6Sv6U4+4zVI Bgsov3jUagokNHtYB/cSGbs5bajb0IpbQsmgU3UaUps41ejbq0K+ADGyyOsGYZXAuR8v 8xU+Xa+qQSjffcMQvj3shH537U5vF7+A7kArN0AAFGTMYfEevN21rXQrHjS/7ZK0/tmx /rbK6xMgMIyiShB3GmxzbVRLMClIdaWBEe9w9mABeCjpHo0ykPgg9bE3Y1swA9cHW/Vv QyaP5IjoGOOETqnMd50K+Qx2Ol6WL+53G6pZudVCfNJEqC4nDPd7jwdXt3RmEjnSbTQS vuNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=AY0YTwcyckRqLfnNWW2yvOwCT06wnfCDNH7Bh7prKJA=; b=moKU8GdT5/+uNa4Fm2xJj4Q9Uu8Oea0rbSw9lsXWRchFgTt/+h7CvW0dSbVYv7gu5K LVkM79hjirk9AqsGfXesI5eSBdDBh++l8sMBYxGaLU686tB09SxV08kP1cztoLMVE9vZ xwQcxU0SXS3lmf7cbeTtHF89y6ozlsbxeD66xaVUyKm9KPt8w56hKQILpaNwbnNAgGcf XvWxywtN7cHXcLPk3fZBTAspy3NBNG5POJtWd/saRMhRvLTosHtdsFHorVExZgndMzOL NJrZdqrfbiPWkDkOV8BWp3SSyLxXyH4Jxk15lXe8aFbz/CPtDo+eB55S4znTsrj+mz6M S5Vg== X-Gm-Message-State: ALQs6tCIkXcaDpRiOK9x0KCxSDhhweDC5ajAXNyOrJPvvIc7d7YxeI0t A1ZnT6o4wIxc5zsrOvo/maAPVYvClr0ftUGTjANtCg== X-Google-Smtp-Source: AIpwx4/jRzKITudHQDrk/saJSkyDY2qglGQKxgzQ54Ff0lJubsiyOVGXBN8JZrZa/fuWHW75RKjbeGUZE8BI5aozeJM= X-Received: by 2002:adf:c792:: with SMTP id l18-v6mr27081780wrg.224.1524740495308; Thu, 26 Apr 2018 04:01:35 -0700 (PDT) MIME-Version: 1.0 Sender: lwhsu.freebsd@gmail.com Received: by 10.28.41.196 with HTTP; Thu, 26 Apr 2018 04:01:34 -0700 (PDT) In-Reply-To: <1524700799.57768.111.camel@freebsd.org> References: <201804251946.w3PJkdkH040243@repo.freebsd.org> <1524700799.57768.111.camel@freebsd.org> From: Li-Wen Hsu Date: Thu, 26 Apr 2018 19:01:34 +0800 X-Google-Sender-Auth: RxhT5dKkJvYbC_iC3eEB5Eu4QlY Message-ID: Subject: Re: svn commit: r333010 - head/sys/mips/mips To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 11:01:37 -0000 On Thu, Apr 26, 2018 at 7:59 AM, Ian Lepore wrote: > On Wed, 2018-04-25 at 19:46 +0000, Li-Wen Hsu wrote: >> Author: lwhsu (ports committer) >> Date: Wed Apr 25 19:46:39 2018 >> New Revision: 333010 >> URL: https://svnweb.freebsd.org/changeset/base/333010 >> >> Log: >> Fix mips32 build after r332951. >> >> Approved by: jhb >> >> Modified: >> head/sys/mips/mips/pm_machdep.c >> >> Modified: head/sys/mips/mips/pm_machdep.c >> ============================================================================== >> --- head/sys/mips/mips/pm_machdep.c Wed Apr 25 18:59:29 2018 (r333009) >> +++ head/sys/mips/mips/pm_machdep.c Wed Apr 25 19:46:39 2018 (r333010) >> @@ -264,7 +264,7 @@ ptrace_single_step(struct thread *td) >> va = locr0->pc + 4; >> } >> if (td->td_md.md_ss_addr) { >> - printf("SS %s (%d): breakpoint already set at %lx (va %lx)\n", >> + printf("SS %s (%d): breakpoint already set at %zx (va %zx)\n", >> p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ >> error = EFAULT; >> goto out; >> @@ -500,7 +500,7 @@ ptrace_clear_single_step(struct thread *td) >> >> if (error != 0) { >> log(LOG_ERR, >> - "SS %s %d: can't restore instruction at %lx: %x\n", >> + "SS %s %d: can't restore instruction at %zx: %x\n", >> p->p_comm, p->p_pid, td->td_md.md_ss_addr, >> td->td_md.md_ss_instr); >> } >> > > This isn't right either. %z is for size_t values, both md_ss_addr and > va are integers and a plain %x should be the right format. But it will break mips64: cc1: warnings being treated as errors /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function 'ptrace_single_step': /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' expects type 'unsigned int', but argument 4 has type 'uintptr_t' [-Wformat] /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' expects type 'unsigned int', but argument 5 has type 'uintptr_t' [-Wformat] /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function 'ptrace_clear_single_step': /home/lwhsu/src/sys/mips/mips/pm_machdep.c:505: warning: format '%x' expects type 'unsigned int', but argument 5 has type 'uintptr_t' [-Wformat] *** [pm_machdep.o] Error code 1 Another way is cast arguments to uintmax_t and use %jx. Will that be better? Li-Wen -- Li-Wen Hsu https://lwhsu.org From owner-svn-src-head@freebsd.org Thu Apr 26 12:23:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26A04FAC55A; Thu, 26 Apr 2018 12:23:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAE7B76E8E; Thu, 26 Apr 2018 12:23:31 +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 AC1221814A; Thu, 26 Apr 2018 12:23:31 +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 w3QCNVjC044102; Thu, 26 Apr 2018 12:23:31 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QCNV6G044101; Thu, 26 Apr 2018 12:23:31 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804261223.w3QCNV6G044101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 26 Apr 2018 12:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333016 - head/sys/netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netipsec X-SVN-Commit-Revision: 333016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 12:23:32 -0000 Author: ae Date: Thu Apr 26 12:23:31 2018 New Revision: 333016 URL: https://svnweb.freebsd.org/changeset/base/333016 Log: Merge r1.22-1.23 from NetBSD: Don't assume M_PKTHDR is set only on the first mbuf of the chain. The check is replaced by (m1 != m), which is equivalent to the previous code: we want to modify m->m_pkthdr.len only when 'm' was not passed in m_adj(). Fix a pretty bad mistake, that has always been there: m_adj(m1, -(m1->m_len - roff)); if (m1 != m) m->m_pkthdr.len -= (m1->m_len - roff); This is wrong: m_adj() will modify m1->m_len, so we're using a wrong value when manually adjusting m->m_pkthdr.len. Reported by: Maxime Villard Obtained from: NetBSD MFC after: 1 week Modified: head/sys/netipsec/ipsec_mbuf.c Modified: head/sys/netipsec/ipsec_mbuf.c ============================================================================== --- head/sys/netipsec/ipsec_mbuf.c Thu Apr 26 08:58:27 2018 (r333015) +++ head/sys/netipsec/ipsec_mbuf.c Thu Apr 26 12:23:31 2018 (r333016) @@ -255,10 +255,11 @@ m_striphdr(struct mbuf *m, int skip, int hlen) /* The header was at the beginning of the mbuf */ IPSECSTAT_INC(ips_input_front); m_adj(m1, hlen); - if ((m1->m_flags & M_PKTHDR) == 0) + if (m1 != m) m->m_pkthdr.len -= hlen; } else if (roff + hlen >= m1->m_len) { struct mbuf *mo; + int adjlen; /* * Part or all of the header is at the end of this mbuf, @@ -267,11 +268,13 @@ m_striphdr(struct mbuf *m, int skip, int hlen) */ IPSECSTAT_INC(ips_input_end); if (roff + hlen > m1->m_len) { + adjlen = roff + hlen - m1->m_len; + /* Adjust the next mbuf by the remainder */ - m_adj(m1->m_next, roff + hlen - m1->m_len); + m_adj(m1->m_next, adjlen); /* The second mbuf is guaranteed not to have a pkthdr... */ - m->m_pkthdr.len -= (roff + hlen - m1->m_len); + m->m_pkthdr.len -= adjlen; } /* Now, let's unlink the mbuf chain for a second...*/ @@ -279,9 +282,10 @@ m_striphdr(struct mbuf *m, int skip, int hlen) m1->m_next = NULL; /* ...and trim the end of the first part of the chain...sick */ - m_adj(m1, -(m1->m_len - roff)); - if ((m1->m_flags & M_PKTHDR) == 0) - m->m_pkthdr.len -= (m1->m_len - roff); + adjlen = m1->m_len - roff; + m_adj(m1, -adjlen); + if (m1 != m) + m->m_pkthdr.len -= adjlen; /* Finally, let's relink */ m1->m_next = mo; From owner-svn-src-head@freebsd.org Thu Apr 26 13:18:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96884FAD0A4; Thu, 26 Apr 2018 13:18:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 495A781091; Thu, 26 Apr 2018 13:18:25 +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 4263A18958; Thu, 26 Apr 2018 13:18:25 +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 w3QDIPIa069199; Thu, 26 Apr 2018 13:18:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QDIPNu069198; Thu, 26 Apr 2018 13:18:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804261318.w3QDIPNu069198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 26 Apr 2018 13:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333017 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 333017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 13:18:25 -0000 Author: emaste Date: Thu Apr 26 13:18:24 2018 New Revision: 333017 URL: https://svnweb.freebsd.org/changeset/base/333017 Log: Correct r307825 BOOTSTRAPPING test for unsupported upgrade __FreeBSD_version has five digits after the major number, but the min versions in the test had an extra 0 (so the test was always false). Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 26 12:23:31 2018 (r333016) +++ head/Makefile.inc1 Thu Apr 26 13:18:24 2018 (r333017) @@ -1851,9 +1851,9 @@ legacy: .PHONY # the version bump in r296219 (from July 29, 2015 -> Feb 29, 2016). .if ${BOOTSTRAPPING} != 0 && \ ${WANT_COMPILER_TYPE} == "clang" && ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30601 -.if ${BOOTSTRAPPING} > 10000000 && ${BOOTSTRAPPING} < 1002501 +.if ${BOOTSTRAPPING} > 1000000 && ${BOOTSTRAPPING} < 1002501 @echo "ERROR: Source upgrades from stable/10 prior to r286033 are not supported."; false -.elif ${BOOTSTRAPPING} > 9000000 && ${BOOTSTRAPPING} < 903509 +.elif ${BOOTSTRAPPING} > 900000 && ${BOOTSTRAPPING} < 903509 @echo "ERROR: Source upgrades from stable/9 prior to r286035 are not supported."; false .endif .endif From owner-svn-src-head@freebsd.org Thu Apr 26 13:47:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65A4BFAD834; Thu, 26 Apr 2018 13:47:30 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEE8587587; Thu, 26 Apr 2018 13:47:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x232.google.com with SMTP id c5-v6so479994itj.1; Thu, 26 Apr 2018 06:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=KwT9yBSutE3ElOjm39oSKcRiH+d8URvVgwIA/id7VmA=; b=DyR8S9koRVoIWChk5BIhmtxWC65r289n2x8gWvyJNWg3g9nm2WZvctk5vPQkTRIXfK 0+7BdgHH6eAoqPxE+Aa8SehkIBWodx7gEWwZfqL0JUEk4ZBNubtn3tuNN4j/8IewfBRa RCB4ctjYAIMAid4yUrDX1SDh69DuajHM1ykJK4I1gppmplqCKhPaKS/AXCLwGn049TbO SumE8cSl0GLoq7dP8XkzqkCB0sR/6xWp4R6hbCWF76g7jWxcAVK0hkcm0YM7AVm4yu8o DQwQm0NAjnWH+A9tlQpZHnXMP3mPFrs1rsBwndZLhgmfeKAPCKyC45uQYWtrBp6kATML P/7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=KwT9yBSutE3ElOjm39oSKcRiH+d8URvVgwIA/id7VmA=; b=moxg3bjQnLvQR7levasw+KM+YzhHNlALhiNMvbEe6FKE9m0lz8r31/bndSVadOhwXD EGkZQJ5LK679O17X05JQQJbvlPekxL7oOHyxVwGx79qLOGQAVT4DYnZVwvsTQ77IZdl5 8WwnCR9kPYPC7E6J6B222oNm1dCQ82rXb9A1a1NNkxKf04pjjY6ykx308NBpCsvx+K3s 41esYBCiI62hf5igXq+fFAn7A8OBp7xAhPl8zcM+An03017w1+RPvos0qtn1cQnNrcmQ XScTI1t7xzMIprNX5Ixa+630Y73GeK0u/gMpcVbR76SJSCXZTz/hfEbdkGmgXEEL2Rme NKHw== X-Gm-Message-State: ALQs6tDLmZPqs52yeV1cgKHVZfeaJMqY0z6P5j8XrHPErNZGswnmMWm1 MEN/2y+pOiq2EG9sfZT/2nLqPQAYjtkJcRvyNuHBDUhj X-Google-Smtp-Source: AB8JxZrQT6ZSdsZNqnvcluKxDcS+jQ6Xln1CowDFgM120RqJr7bQeMlQkRRW/k3F1Krp0hWKhCHjTEfhmbjBmQpcPYk= X-Received: by 2002:a24:2fce:: with SMTP id j197-v6mr10199573itj.52.1524750448873; Thu, 26 Apr 2018 06:47:28 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.167 with HTTP; Thu, 26 Apr 2018 06:47:08 -0700 (PDT) In-Reply-To: <201804261318.w3QDIPNu069198@repo.freebsd.org> References: <201804261318.w3QDIPNu069198@repo.freebsd.org> From: Ed Maste Date: Thu, 26 Apr 2018 09:47:08 -0400 X-Google-Sender-Auth: y_NbpbFTmhs83thi_Z1T-TeU208 Message-ID: Subject: Re: svn commit: r333017 - head To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Warner Losh Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 13:47:30 -0000 On 26 April 2018 at 09:18, Ed Maste wrote: > > Log: > Correct r307825 BOOTSTRAPPING test for unsupported upgrade > > __FreeBSD_version has five digits after the major number, but the min > versions in the test had an extra 0 (so the test was always false). With the test adjusted I believe we should now set the minimum supported rel to 10.3. No 9.x release contains r286035, so if reporting a minimum release (as opposed to SVN rev) then 10.3 is the first release with the fix (r286033). That said, is it time to just bump the minimum and remove the special cases? From owner-svn-src-head@freebsd.org Thu Apr 26 15:30:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF77FB0903 for ; Thu, 26 Apr 2018 15:30:46 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24CDC7EA74 for ; Thu, 26 Apr 2018 15:30:45 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a1342f1d-4966-11e8-91c6-33ffc249f3e8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id a1342f1d-4966-11e8-91c6-33ffc249f3e8; Thu, 26 Apr 2018 15:29:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w3QFTUe8024935; Thu, 26 Apr 2018 09:29:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1524756570.57768.115.camel@freebsd.org> Subject: Re: svn commit: r333010 - head/sys/mips/mips From: Ian Lepore To: Li-Wen Hsu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 26 Apr 2018 09:29:30 -0600 In-Reply-To: References: <201804251946.w3PJkdkH040243@repo.freebsd.org> <1524700799.57768.111.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 15:30:47 -0000 On Thu, 2018-04-26 at 19:01 +0800, Li-Wen Hsu wrote: > On Thu, Apr 26, 2018 at 7:59 AM, Ian Lepore wrote: > > > > On Wed, 2018-04-25 at 19:46 +0000, Li-Wen Hsu wrote: > > > > > > Author: lwhsu (ports committer) > > > Date: Wed Apr 25 19:46:39 2018 > > > New Revision: 333010 > > > URL: https://svnweb.freebsd.org/changeset/base/333010 > > > > > > Log: > > > Fix mips32 build after r332951. > > > > > > Approved by:jhb > > > > > > Modified: > > > head/sys/mips/mips/pm_machdep.c > > > > > > Modified: head/sys/mips/mips/pm_machdep.c > > > ============================================================================== > > > --- head/sys/mips/mips/pm_machdep.cWed Apr 25 18:59:29 2018(r333009) > > > +++ head/sys/mips/mips/pm_machdep.cWed Apr 25 19:46:39 2018(r333010) > > > @@ -264,7 +264,7 @@ ptrace_single_step(struct thread *td) > > > va = locr0->pc + 4; > > > } > > > if (td->td_md.md_ss_addr) { > > > -printf("SS %s (%d): breakpoint already set at %lx (va %lx)\n", > > > +printf("SS %s (%d): breakpoint already set at %zx (va %zx)\n", > > > p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ > > > error = EFAULT; > > > goto out; > > > @@ -500,7 +500,7 @@ ptrace_clear_single_step(struct thread *td) > > > > > > if (error != 0) { > > > log(LOG_ERR, > > > -"SS %s %d: can't restore instruction at %lx: %x\n", > > > +"SS %s %d: can't restore instruction at %zx: %x\n", > > > p->p_comm, p->p_pid, td->td_md.md_ss_addr, > > > td->td_md.md_ss_instr); > > > } > > > > > This isn't right either.%z is for size_t values, both md_ss_addr and > > va are integers and a plain %x should be the right format. > But it will break mips64: > > cc1: warnings being treated as errors > /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function 'ptrace_single_step': > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' > expects type 'unsigned int', but argument 4 has type 'uintptr_t' > [-Wformat] > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' > expects type 'unsigned int', but argument 5 has type 'uintptr_t' > [-Wformat] > /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function > 'ptrace_clear_single_step': > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:505: warning: format '%x' > expects type 'unsigned int', but argument 5 has type 'uintptr_t' > [-Wformat] > *** [pm_machdep.o] Error code 1 > > Another way is cast arguments to uintmax_t and use %jx.Will that be better? > > Li-Wen > Oh, my bad, my source was out of date. Now I see that the types are not plain integers anymore. In that case, I think the only options are to cast to uintmax_t and use %jx, or cast to void* and use %p. -- Ian From owner-svn-src-head@freebsd.org Thu Apr 26 16:00:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C234FB14CE for ; Thu, 26 Apr 2018 16:00:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 823278531B for ; Thu, 26 Apr 2018 16:00:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id e20-v6so1966753iof.4 for ; Thu, 26 Apr 2018 09:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=6GqAGJvjcyIrsBRltmkMt4nBWdawA6sA26smfVfzwWI=; b=Ppji0AU8ObsbT5L0KFdCSpe6h1RkniXlNUgdI9+YhDNWy9ahEhhaIUeoDi6c2kT+C9 VL2qdWpM8ayVOmEaWuAwqIZjc4+7I4rHrTeamZsogPbucYwD4OqjF4KJi//0U4QE9ODK T4a7T2B4uDRiWlHVpozqrQ9rMfXKu9gtmRunDNaboaYQ8Q2lFDrg2F9Fq6JRUpUwRfsq /lpgoh6excn1Kk+EcXzIt6+wCKCfHAcMSTYjeAVVPosJAVPzt7Z9J5i9lKBIvVXYhZMV oyp2rg398ciSxdvfStG2m2gXuHN8mGQFg8MawMDuurjD2cJu0M0u6wx1nEBd7Pugz8Qv IBzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=6GqAGJvjcyIrsBRltmkMt4nBWdawA6sA26smfVfzwWI=; b=Xl6eILDHRAeei6WDEJytLDWWVay/64osoKswqhooqEcK7XgKs2QMf5dydlJu5IOyrE iGJ5FEK8nXQ7iNOZnbBP0tqYXEar2zXCpYSfNNlq1x1ZPYZ/MaIVvNI7GhRzDOsNsy7n tcD0/NtPjn5HVnK39/LxiFQ2oQ00FnimIKDelykWXC8oDVTwdMDwc4HgOhoX0s78IDxg KvW1eRcbWoqscOH/P/RUI65U8OjPEYZjbdXf6qm2y4qrj5y5Bb7l62Nje7q9d4W7NgYl M0dW6FWwqMmc0vl2ZSqMS8oN0J6pvrfmUIKag+mFs5NbU/v4kATcbETWo6NMWw6Jqw1U W/YQ== X-Gm-Message-State: ALQs6tCvvhA21tzleyYsWD5o+LFAPqVTk8tlHkRSzd/mFJAVB0sqIxYK UziNswboVRm9HI18kSePz8+qLuqWBxdFwO6pI/Oo+w== X-Google-Smtp-Source: AIpwx4+4o0HV47zWdvTX0BytCYPd1XTrePHMAjri48m0ULz30cSOSo6cJGumIhzECMdjPEokSXLtJCihqy6pAUqkZJQ= X-Received: by 2002:a6b:12a3:: with SMTP id 35-v6mr35492413ios.168.1524758412797; Thu, 26 Apr 2018 09:00:12 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a65a:0:0:0:0:0 with HTTP; Thu, 26 Apr 2018 09:00:12 -0700 (PDT) X-Originating-IP: [192.55.54.60] In-Reply-To: References: <201804261318.w3QDIPNu069198@repo.freebsd.org> From: Warner Losh Date: Thu, 26 Apr 2018 10:00:12 -0600 X-Google-Sender-Auth: bzgmUULfK4W0R3UgGPIitr8OO98 Message-ID: Subject: Re: svn commit: r333017 - head To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 16:00:14 -0000 On Thu, Apr 26, 2018 at 7:47 AM, Ed Maste wrote: > On 26 April 2018 at 09:18, Ed Maste wrote: > > > > Log: > > Correct r307825 BOOTSTRAPPING test for unsupported upgrade > > > > __FreeBSD_version has five digits after the major number, but the min > > versions in the test had an extra 0 (so the test was always false). > > With the test adjusted I believe we should now set the minimum > supported rel to 10.3. No 9.x release contains r286035, so if > reporting a minimum release (as opposed to SVN rev) then 10.3 is the > first release with the fix (r286033). > > That said, is it time to just bump the minimum and remove the special > cases? > I added the original case so that up-to-date stable-9 systems that were at (Juniper?) could work. The bug was such that we don't know that it wasn't being used. It would never trigger on those systems, so people could be using it and we'll not know it. Basically, we should ask Juniper first before removing it since they specifically asked me to allow it. Warner From owner-svn-src-head@freebsd.org Thu Apr 26 16:59:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FAB1FB2CA1; Thu, 26 Apr 2018 16:59:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09FB57411A; Thu, 26 Apr 2018 16:59:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE2D01AC8C; Thu, 26 Apr 2018 16:59:06 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QGx6ib079760; Thu, 26 Apr 2018 16:59:06 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QGx6Md079753; Thu, 26 Apr 2018 16:59:06 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804261659.w3QGx6Md079753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 26 Apr 2018 16:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333019 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/smartpqi sys/modules sys/modules/smartpqi X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/smartpqi sys/modules sys/modules/smartpqi X-SVN-Commit-Revision: 333019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 16:59:07 -0000 Author: sbruno Date: Thu Apr 26 16:59:06 2018 New Revision: 333019 URL: https://svnweb.freebsd.org/changeset/base/333019 Log: martpqi(4): - Microsemi SCSI driver for PQI controllers. - Found on newer model HP servers. - Restrict to AMD64 only as per developer request. The driver provides support for the new generation of PQI controllers from Microsemi. This driver is the first SCSI driver to implement the PQI queuing model and it will replace the aacraid driver for Adaptec Series 9 controllers. HARDWARE Controllers supported by the driver include: HPE Gen10 Smart Array Controller Family OEM Controllers based on the Microsemi Chipset. Submitted by: deepak.ukey@microsemi.com Relnotes: yes Sponsored by: Microsemi Differential Revision: https://reviews.freebsd.org/D14514 > Description of fields to fill in above: 76 columns --| > PR: If and which Problem Report is related. > Submitted by: If someone else sent in the change. > Reported by: If someone else reported the issue. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Pull Request: https://github.com/freebsd/freebsd/pull/### (*full* GitHub URL needed). > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. M share/man/man4/Makefile AM share/man/man4/smartpqi.4 M sys/amd64/conf/GENERIC M sys/conf/NOTES M sys/conf/files.amd64 A sys/dev/smartpqi AM sys/dev/smartpqi/smartpqi_cam.c AM sys/dev/smartpqi/smartpqi_cmd.c AM sys/dev/smartpqi/smartpqi_defines.h AM sys/dev/smartpqi/smartpqi_discovery.c AM sys/dev/smartpqi/smartpqi_event.c AM sys/dev/smartpqi/smartpqi_helper.c AM sys/dev/smartpqi/smartpqi_includes.h AM sys/dev/smartpqi/smartpqi_init.c AM sys/dev/smartpqi/smartpqi_intr.c AM sys/dev/smartpqi/smartpqi_ioctl.c AM sys/dev/smartpqi/smartpqi_ioctl.h AM sys/dev/smartpqi/smartpqi_main.c AM sys/dev/smartpqi/smartpqi_mem.c AM sys/dev/smartpqi/smartpqi_misc.c AM sys/dev/smartpqi/smartpqi_prototypes.h AM sys/dev/smartpqi/smartpqi_queue.c AM sys/dev/smartpqi/smartpqi_request.c AM sys/dev/smartpqi/smartpqi_response.c AM sys/dev/smartpqi/smartpqi_sis.c AM sys/dev/smartpqi/smartpqi_structures.h AM sys/dev/smartpqi/smartpqi_tag.c M sys/modules/Makefile A sys/modules/smartpqi AM sys/modules/smartpqi/Makefile Added: head/share/man/man4/smartpqi.4 (contents, props changed) head/sys/dev/smartpqi/ head/sys/dev/smartpqi/smartpqi_cam.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_cmd.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_defines.h (contents, props changed) head/sys/dev/smartpqi/smartpqi_discovery.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_event.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_helper.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_includes.h (contents, props changed) head/sys/dev/smartpqi/smartpqi_init.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_intr.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_ioctl.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_ioctl.h (contents, props changed) head/sys/dev/smartpqi/smartpqi_main.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_mem.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_misc.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_prototypes.h (contents, props changed) head/sys/dev/smartpqi/smartpqi_queue.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_request.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_response.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_sis.c (contents, props changed) head/sys/dev/smartpqi/smartpqi_structures.h (contents, props changed) head/sys/dev/smartpqi/smartpqi_tag.c (contents, props changed) head/sys/modules/smartpqi/ head/sys/modules/smartpqi/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/files.amd64 head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Apr 26 16:40:59 2018 (r333018) +++ head/share/man/man4/Makefile Thu Apr 26 16:59:06 2018 (r333019) @@ -476,6 +476,7 @@ MAN= aac.4 \ sio.4 \ sis.4 \ sk.4 \ + smartpqi.4 \ smb.4 \ smbus.4 \ smp.4 \ Added: head/share/man/man4/smartpqi.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/smartpqi.4 Thu Apr 26 16:59:06 2018 (r333019) @@ -0,0 +1,102 @@ +.\" Copyright (c) 2018 Murthy Bhat +.\" 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$ stable/10/share/man/man4/smartpqi.4 195614 2017-01-11 08:10:18Z jkim $ +.Dd April 06, 2018 +.Dt SMARTPQI 4 +.Os +.Sh NAME +.Nm smartpqi +.Nd Microsemi smartpqi SCSI driver for PQI controllers +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd device pci +.Cd device scbus +.Cd device smartpqi +.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 +smartpqi_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +SCSI driver provides support for the new generation of PQI controllers from +Microsemi. +The +.Nm +driver is the first SCSI driver to implement the PQI queuing model. +.Pp +The +.Nm +driver will replace the aacraid driver for Adaptec Series 9 controllers. +.Pp +The +.Pa /dev/smartpqi? +device nodes provide access to the management interface of the controller. +One node exists per installed card. +.Sh HARDWARE +Controllers supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +HPE Gen10 Smart Array Controller Family +.It +OEM Controllers based on the Microsemi Chipset +.El +.Sh FILES +.Bl -tag -width /boot/kernel/aac.ko -compact +.It Pa /dev/smartpqi? +smartpqi management interface +.El +.Sh SEE ALSO +.Xr kld 4 , +.Xr linux 4 , +.Xr scsi 4 , +.Xr kldload 8 +.Xr pass 4 +.Xr xpt 4 +.Xr loader.conf 5 +.Xr camcontrol 8 +.Rs +.%T "Microsemi Website" +.%U http://www.microsemi.com/ +.Re +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 11.1 . +.Sh AUTHOR +.An Murthy Bhat +.Aq murthy.bhat@microsemi.com +.Sh BUGS +The controller is not actually paused on suspend/resume. Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Apr 26 16:40:59 2018 (r333018) +++ head/sys/amd64/conf/GENERIC Thu Apr 26 16:59:06 2018 (r333019) @@ -166,6 +166,7 @@ device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID device twa # 3ware 9000 series PATA/SATA RAID +device smartpqi # Microsemi smartpqi driver device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # RAID controllers Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Apr 26 16:40:59 2018 (r333018) +++ head/sys/conf/NOTES Thu Apr 26 16:59:06 2018 (r333019) @@ -1717,6 +1717,13 @@ options MFI_DEBUG device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s # +# Microsemi smartpqi controllers. +# These controllers have a SCSI-like interface, and require the +# CAM infrastructure. +# +device smartpqi + +# # 3ware ATA RAID # device twe # 3ware ATA RAID Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Apr 26 16:40:59 2018 (r333018) +++ head/sys/conf/files.amd64 Thu Apr 26 16:59:06 2018 (r333019) @@ -463,6 +463,22 @@ dev/sio/sio_isa.c optional sio isa dev/sio/sio_pccard.c optional sio pccard dev/sio/sio_pci.c optional sio pci dev/sio/sio_puc.c optional sio puc +dev/smartpqi/smartpqi_cam.c optional smartpqi +dev/smartpqi/smartpqi_cmd.c optional smartpqi +dev/smartpqi/smartpqi_discovery.c optional smartpqi +dev/smartpqi/smartpqi_event.c optional smartpqi +dev/smartpqi/smartpqi_helper.c optional smartpqi +dev/smartpqi/smartpqi_init.c optional smartpqi +dev/smartpqi/smartpqi_intr.c optional smartpqi +dev/smartpqi/smartpqi_ioctl.c optional smartpqi +dev/smartpqi/smartpqi_main.c optional smartpqi +dev/smartpqi/smartpqi_mem.c optional smartpqi +dev/smartpqi/smartpqi_misc.c optional smartpqi +dev/smartpqi/smartpqi_queue.c optional smartpqi +dev/smartpqi/smartpqi_request.c optional smartpqi +dev/smartpqi/smartpqi_response.c optional smartpqi +dev/smartpqi/smartpqi_sis.c optional smartpqi +dev/smartpqi/smartpqi_tag.c optional smartpqi dev/speaker/spkr.c optional speaker dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc Added: head/sys/dev/smartpqi/smartpqi_cam.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/smartpqi/smartpqi_cam.c Thu Apr 26 16:59:06 2018 (r333019) @@ -0,0 +1,1205 @@ +/*- + * Copyright (c) 2018 Microsemi Corporation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $FreeBSD$ */ +/* + * CAM interface for smartpqi driver + */ + +#include "smartpqi_includes.h" + +/* + * Set cam sim properties of the smartpqi adapter. + */ +static void update_sim_properties(struct cam_sim *sim, struct ccb_pathinq *cpi) +{ + + pqisrc_softstate_t *softs = (struct pqisrc_softstate *) + cam_sim_softc(sim); + DBG_FUNC("IN\n"); + + cpi->version_num = 1; + cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; + cpi->target_sprt = 0; + cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED; + cpi->hba_eng_cnt = 0; + cpi->max_lun = PQI_MAX_MULTILUN; + cpi->max_target = 1088; + cpi->maxio = (softs->pqi_cap.max_sg_elem - 1) * PAGE_SIZE; + cpi->initiator_id = 255; + strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strncpy(cpi->hba_vid, "Microsemi", HBA_IDLEN); + strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->unit_number = cam_sim_unit(sim); + cpi->bus_id = cam_sim_bus(sim); + cpi->base_transfer_speed = 1200000; /* Base bus speed in KB/sec */ + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_SPC4; + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->ccb_h.status = CAM_REQ_CMP; + + DBG_FUNC("OUT\n"); +} + +/* + * Get transport settings of the smartpqi adapter + */ +static void get_transport_settings(struct pqisrc_softstate *softs, + struct ccb_trans_settings *cts) +{ + struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; + struct ccb_trans_settings_sas *sas = &cts->xport_specific.sas; + struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; + + DBG_FUNC("IN\n"); + + cts->protocol = PROTO_SCSI; + cts->protocol_version = SCSI_REV_SPC4; + cts->transport = XPORT_SPI; + cts->transport_version = 2; + spi->valid = CTS_SPI_VALID_DISC; + spi->flags = CTS_SPI_FLAGS_DISC_ENB; + scsi->valid = CTS_SCSI_VALID_TQ; + scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; + sas->valid = CTS_SAS_VALID_SPEED; + cts->ccb_h.status = CAM_REQ_CMP; + + DBG_FUNC("OUT\n"); +} + +/* + * Add the target to CAM layer and rescan, when a new device is found + */ +void os_add_device(pqisrc_softstate_t *softs, pqi_scsi_dev_t *device) { + union ccb *ccb; + + DBG_FUNC("IN\n"); + + if(softs->os_specific.sim_registered) { + if ((ccb = xpt_alloc_ccb_nowait()) == NULL) { + DBG_ERR("rescan failed (can't allocate CCB)\n"); + return; + } + + if (xpt_create_path(&ccb->ccb_h.path, NULL, + cam_sim_path(softs->os_specific.sim), + device->target, device->lun) != CAM_REQ_CMP) { + DBG_ERR("rescan failed (can't create path)\n"); + xpt_free_ccb(ccb); + return; + } + xpt_rescan(ccb); + } + + DBG_FUNC("OUT\n"); +} + +/* + * Remove the device from CAM layer when deleted or hot removed + */ +void os_remove_device(pqisrc_softstate_t *softs, + pqi_scsi_dev_t *device) { + struct cam_path *tmppath; + + DBG_FUNC("IN\n"); + + if(softs->os_specific.sim_registered) { + if (xpt_create_path(&tmppath, NULL, + cam_sim_path(softs->os_specific.sim), + device->target, device->lun) != CAM_REQ_CMP) { + DBG_ERR("unable to create path for async event"); + return; + } + xpt_async(AC_LOST_DEVICE, tmppath, NULL); + xpt_free_path(tmppath); + pqisrc_free_device(softs, device); + OS_SLEEP(10000); + } + + DBG_FUNC("OUT\n"); + +} + +/* + * Function to release the frozen simq + */ +static void pqi_release_camq( rcb_t *rcb ) +{ + pqisrc_softstate_t *softs; + struct ccb_scsiio *csio; + + csio = (struct ccb_scsiio *)&rcb->cm_ccb->csio; + softs = rcb->softs; + + DBG_FUNC("IN\n"); + + if (softs->os_specific.pqi_flags & PQI_FLAG_BUSY) { + softs->os_specific.pqi_flags &= ~PQI_FLAG_BUSY; + if (csio->ccb_h.status & CAM_RELEASE_SIMQ) + xpt_release_simq(xpt_path_sim(csio->ccb_h.path), 0); + else + csio->ccb_h.status |= CAM_RELEASE_SIMQ; + } + + DBG_FUNC("OUT\n"); +} + +/* + * Function to dma-unmap the completed request + */ +static void pqi_unmap_request(void *arg) +{ + pqisrc_softstate_t *softs; + rcb_t *rcb; + + DBG_IO("IN rcb = %p\n", arg); + + rcb = (rcb_t *)arg; + softs = rcb->softs; + + if (!(rcb->cm_flags & PQI_CMD_MAPPED)) + return; + + if (rcb->bcount != 0 ) { + if (rcb->data_dir == SOP_DATA_DIR_FROM_DEVICE) + bus_dmamap_sync(softs->os_specific.pqi_buffer_dmat, + rcb->cm_datamap, + BUS_DMASYNC_POSTREAD); + if (rcb->data_dir == SOP_DATA_DIR_TO_DEVICE) + bus_dmamap_sync(softs->os_specific.pqi_buffer_dmat, + rcb->cm_datamap, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(softs->os_specific.pqi_buffer_dmat, + rcb->cm_datamap); + } + rcb->cm_flags &= ~PQI_CMD_MAPPED; + + if(rcb->sgt && rcb->nseg) + os_mem_free(rcb->softs, (void*)rcb->sgt, + rcb->nseg*sizeof(sgt_t)); + + pqisrc_put_tag(&softs->taglist, rcb->tag); + + DBG_IO("OUT\n"); +} + +/* + * Construct meaningful LD name for volume here. + */ +static void +smartpqi_fix_ld_inquiry(pqisrc_softstate_t *softs, struct ccb_scsiio *csio) +{ + struct scsi_inquiry_data *inq = NULL; + uint8_t *cdb = NULL; + pqi_scsi_dev_t *device = NULL; + + DBG_FUNC("IN\n"); + + cdb = (csio->ccb_h.flags & CAM_CDB_POINTER) ? + (uint8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes; + if(cdb[0] == INQUIRY && + (cdb[1] & SI_EVPD) == 0 && + (csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN && + csio->dxfer_len >= SHORT_INQUIRY_LENGTH) { + + inq = (struct scsi_inquiry_data *)csio->data_ptr; + + device = softs->device_list[csio->ccb_h.target_id][csio->ccb_h.target_lun]; + + /* Let the disks be probed and dealt with via CAM. Only for LD + let it fall through and inquiry be tweaked */ + if( !device || !pqisrc_is_logical_device(device) || + (device->devtype != DISK_DEVICE) || + pqisrc_is_external_raid_device(device)) { + return; + } + + strncpy(inq->vendor, "MSCC", + SID_VENDOR_SIZE); + strncpy(inq->product, + pqisrc_raidlevel_to_string(device->raid_level), + SID_PRODUCT_SIZE); + strncpy(inq->revision, device->volume_offline?"OFF":"OK", + SID_REVISION_SIZE); + } + + DBG_FUNC("OUT\n"); +} + +/* + * Handle completion of a command - pass results back through the CCB + */ +void +os_io_response_success(rcb_t *rcb) +{ + struct ccb_scsiio *csio; + + DBG_IO("IN rcb = %p\n", rcb); + + if (rcb == NULL) + panic("rcb is null"); + + csio = (struct ccb_scsiio *)&rcb->cm_ccb->csio; + + if (csio == NULL) + panic("csio is null"); + + rcb->status = REQUEST_SUCCESS; + csio->ccb_h.status = CAM_REQ_CMP; + + smartpqi_fix_ld_inquiry(rcb->softs, csio); + pqi_release_camq(rcb); + pqi_unmap_request(rcb); + xpt_done((union ccb *)csio); + + DBG_IO("OUT\n"); +} + +/* + * Error response handling for raid IO + */ +void os_raid_response_error(rcb_t *rcb, raid_path_error_info_elem_t *err_info) +{ + struct ccb_scsiio *csio; + pqisrc_softstate_t *softs; + + DBG_IO("IN\n"); + + csio = (struct ccb_scsiio *)&rcb->cm_ccb->csio; + + if (csio == NULL) + panic("csio is null"); + + softs = rcb->softs; + + ASSERT(err_info != NULL); + csio->scsi_status = err_info->status; + csio->ccb_h.status = CAM_REQ_CMP_ERR; + + if (csio->ccb_h.func_code == XPT_SCSI_IO) { + /* + * Handle specific SCSI status values. + */ + switch(csio->scsi_status) { + case PQI_RAID_STATUS_QUEUE_FULL: + csio->ccb_h.status = CAM_REQ_CMP; + DBG_ERR("Queue Full error"); + break; + /* check condition, sense data included */ + case PQI_RAID_STATUS_CHECK_CONDITION: + { + uint16_t sense_data_len = + LE_16(err_info->sense_data_len); + uint8_t *sense_data = NULL; + if (sense_data_len) + sense_data = err_info->data; + memset(&csio->sense_data, 0, csio->sense_len); + sense_data_len = (sense_data_len > + csio->sense_len) ? + csio->sense_len : + sense_data_len; + if (sense_data) + memcpy(&csio->sense_data, sense_data, + sense_data_len); + if (csio->sense_len > sense_data_len) + csio->sense_resid = csio->sense_len + - sense_data_len; + else + csio->sense_resid = 0; + csio->ccb_h.status = CAM_SCSI_STATUS_ERROR + | CAM_AUTOSNS_VALID + | CAM_REQ_CMP_ERR; + + } + break; + + case PQI_RAID_DATA_IN_OUT_UNDERFLOW: + { + uint32_t resid = 0; + resid = rcb->bcount-err_info->data_out_transferred; + csio->resid = resid; + csio->ccb_h.status = CAM_REQ_CMP; + break; + } + default: + csio->ccb_h.status = CAM_REQ_CMP; + break; + } + } + + if (softs->os_specific.pqi_flags & PQI_FLAG_BUSY) { + softs->os_specific.pqi_flags &= ~PQI_FLAG_BUSY; + if (csio->ccb_h.status & CAM_RELEASE_SIMQ) + xpt_release_simq(xpt_path_sim(csio->ccb_h.path), 0); + else + csio->ccb_h.status |= CAM_RELEASE_SIMQ; + } + + pqi_unmap_request(rcb); + xpt_done((union ccb *)csio); + + DBG_IO("OUT\n"); +} + + +/* + * Error response handling for aio. + */ +void os_aio_response_error(rcb_t *rcb, aio_path_error_info_elem_t *err_info) +{ + struct ccb_scsiio *csio; + pqisrc_softstate_t *softs; + + DBG_IO("IN\n"); + + if (rcb == NULL) + panic("rcb is null"); + + rcb->status = REQUEST_SUCCESS; + csio = (struct ccb_scsiio *)&rcb->cm_ccb->csio; + if (csio == NULL) + panic("csio is null"); + + softs = rcb->softs; + + switch (err_info->service_resp) { + case PQI_AIO_SERV_RESPONSE_COMPLETE: + csio->ccb_h.status = err_info->status; + break; + case PQI_AIO_SERV_RESPONSE_FAILURE: + switch(err_info->status) { + case PQI_AIO_STATUS_IO_ABORTED: + csio->ccb_h.status = CAM_REQ_ABORTED; + DBG_WARN_BTL(rcb->dvp, "IO aborted\n"); + break; + case PQI_AIO_STATUS_UNDERRUN: + csio->ccb_h.status = CAM_REQ_CMP; + csio->resid = + LE_32(err_info->resd_count); + break; + case PQI_AIO_STATUS_OVERRUN: + csio->ccb_h.status = CAM_REQ_CMP; + break; + case PQI_AIO_STATUS_AIO_PATH_DISABLED: + DBG_WARN_BTL(rcb->dvp,"AIO Path Disabled\n"); + rcb->dvp->offload_enabled = false; + csio->ccb_h.status |= CAM_REQUEUE_REQ; + break; + case PQI_AIO_STATUS_IO_ERROR: + case PQI_AIO_STATUS_IO_NO_DEVICE: + case PQI_AIO_STATUS_INVALID_DEVICE: + default: + DBG_WARN_BTL(rcb->dvp,"IO Error/Invalid/No device\n"); + csio->ccb_h.status |= + CAM_SCSI_STATUS_ERROR; + break; + } + break; + case PQI_AIO_SERV_RESPONSE_TMF_COMPLETE: + case PQI_AIO_SERV_RESPONSE_TMF_SUCCEEDED: + csio->ccb_h.status = CAM_REQ_CMP; + break; + case PQI_AIO_SERV_RESPONSE_TMF_REJECTED: + case PQI_AIO_SERV_RESPONSE_TMF_INCORRECT_LUN: + DBG_WARN_BTL(rcb->dvp,"TMF rejected/Incorrect Lun\n"); + csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR; + break; + default: + DBG_WARN_BTL(rcb->dvp,"Scsi Status Error\n"); + csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR; + break; + } + if(err_info->data_pres == DATA_PRESENT_SENSE_DATA ) { + csio->scsi_status = PQI_AIO_STATUS_CHECK_CONDITION; + uint8_t *sense_data = NULL; + unsigned sense_data_len = LE_16(err_info->data_len); + if (sense_data_len) + sense_data = err_info->data; + DBG_ERR_BTL(rcb->dvp, "SCSI_STATUS_CHECK_COND sense size %u\n", + sense_data_len); + memset(&csio->sense_data, 0, csio->sense_len); + if (sense_data) + memcpy(&csio->sense_data, sense_data, ((sense_data_len > + csio->sense_len) ? csio->sense_len : sense_data_len)); + if (csio->sense_len > sense_data_len) + csio->sense_resid = csio->sense_len - sense_data_len; + else + csio->sense_resid = 0; + csio->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; + } + + smartpqi_fix_ld_inquiry(softs, csio); + pqi_release_camq(rcb); + pqi_unmap_request(rcb); + xpt_done((union ccb *)csio); + DBG_IO("OUT\n"); +} + +/* + * Command-mapping helper function - populate this command's s/g table. + */ +static void +pqi_request_map_helper(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + pqisrc_softstate_t *softs; + rcb_t *rcb; + + rcb = (rcb_t *)arg; + softs = rcb->softs; + + if( error || nseg > softs->pqi_cap.max_sg_elem ) + { + xpt_freeze_simq(softs->os_specific.sim, 1); + rcb->cm_ccb->ccb_h.status |= (CAM_REQUEUE_REQ| + CAM_RELEASE_SIMQ); + DBG_ERR_BTL(rcb->dvp, "map failed err = %d or nseg(%d) > sgelem(%d)\n", + error, nseg, softs->pqi_cap.max_sg_elem); + pqi_unmap_request(rcb); + xpt_done((union ccb *)rcb->cm_ccb); + return; + } + + rcb->sgt = os_mem_alloc(softs, nseg * sizeof(rcb_t)); + rcb->nseg = nseg; + if (rcb->sgt != NULL) { + for (int i = 0; i < nseg; i++) { + rcb->sgt[i].addr = segs[i].ds_addr; + rcb->sgt[i].len = segs[i].ds_len; + rcb->sgt[i].flags = 0; + } + } + + if (rcb->data_dir == SOP_DATA_DIR_FROM_DEVICE) + bus_dmamap_sync(softs->os_specific.pqi_buffer_dmat, + rcb->cm_datamap, BUS_DMASYNC_PREREAD); + if (rcb->data_dir == SOP_DATA_DIR_TO_DEVICE) + bus_dmamap_sync(softs->os_specific.pqi_buffer_dmat, + rcb->cm_datamap, BUS_DMASYNC_PREWRITE); + + /* Call IO functions depending on pd or ld */ + rcb->status = REQUEST_PENDING; + + error = pqisrc_build_send_io(softs, rcb); + + if (error) { + rcb->req_pending = false; + xpt_freeze_simq(softs->os_specific.sim, 1); + rcb->cm_ccb->ccb_h.status |= (CAM_REQUEUE_REQ + |CAM_RELEASE_SIMQ); + DBG_ERR_BTL(rcb->dvp, "Build IO failed, error = %d\n", error); + pqi_unmap_request(rcb); + xpt_done((union ccb *)rcb->cm_ccb); + return; + } +} + +/* + * Function to dma-map the request buffer + */ +static int pqi_map_request( rcb_t *rcb ) +{ + pqisrc_softstate_t *softs = rcb->softs; + int error = PQI_STATUS_SUCCESS; + union ccb *ccb = rcb->cm_ccb; + + DBG_FUNC("IN\n"); + + /* check that mapping is necessary */ + if (rcb->cm_flags & PQI_CMD_MAPPED) + return(0); + rcb->cm_flags |= PQI_CMD_MAPPED; + + if (rcb->bcount) { + error = bus_dmamap_load_ccb(softs->os_specific.pqi_buffer_dmat, + rcb->cm_datamap, ccb, pqi_request_map_helper, rcb, 0); + if (error != 0){ + DBG_ERR_BTL(rcb->dvp, "bus_dmamap_load_ccb failed = %d count = %d\n", + error, rcb->bcount); + return error; + } + } else { + /* + * Set up the command to go to the controller. If there are no + * data buffers associated with the command then it can bypass + * busdma. + */ + /* Call IO functions depending on pd or ld */ + rcb->status = REQUEST_PENDING; + + error = pqisrc_build_send_io(softs, rcb); + + } + + DBG_FUNC("OUT error = %d\n", error); + + return error; +} + +/* + * Function to clear the request control block + */ +void os_reset_rcb( rcb_t *rcb ) +{ + rcb->error_info = NULL; + rcb->req = NULL; + rcb->status = -1; + rcb->tag = INVALID_ELEM; + rcb->dvp = NULL; + rcb->cdbp = NULL; + rcb->softs = NULL; + rcb->cm_flags = 0; + rcb->cm_data = NULL; + rcb->bcount = 0; + rcb->nseg = 0; + rcb->sgt = NULL; + rcb->cm_ccb = NULL; + rcb->encrypt_enable = false; + rcb->ioaccel_handle = 0; + rcb->resp_qid = 0; + rcb->req_pending = false; +} + +/* + * Callback function for the lun rescan + */ +static void smartpqi_lunrescan_cb(struct cam_periph *periph, union ccb *ccb) +{ + xpt_free_path(ccb->ccb_h.path); + xpt_free_ccb(ccb); +} + + +/* + * Function to rescan the lun + */ +static void smartpqi_lun_rescan(struct pqisrc_softstate *softs, int target, + int lun) +{ + union ccb *ccb = NULL; + cam_status status = 0; + struct cam_path *path = NULL; + + DBG_FUNC("IN\n"); + + ccb = xpt_alloc_ccb_nowait(); + status = xpt_create_path(&path, NULL, + cam_sim_path(softs->os_specific.sim), target, lun); + if (status != CAM_REQ_CMP) { + DBG_ERR("xpt_create_path status(%d) != CAM_REQ_CMP \n", + status); + xpt_free_ccb(ccb); + return; + } + + bzero(ccb, sizeof(union ccb)); + xpt_setup_ccb(&ccb->ccb_h, path, 5); + ccb->ccb_h.func_code = XPT_SCAN_LUN; + ccb->ccb_h.cbfcnp = smartpqi_lunrescan_cb; + ccb->crcn.flags = CAM_FLAG_NONE; + + xpt_action(ccb); + + DBG_FUNC("OUT\n"); +} + +/* + * Function to rescan the lun under each target + */ +void smartpqi_target_rescan(struct pqisrc_softstate *softs) +{ + int target = 0, lun = 0; + + DBG_FUNC("IN\n"); + + for(target = 0; target < PQI_MAX_DEVICES; target++){ + for(lun = 0; lun < PQI_MAX_MULTILUN; lun++){ + if(softs->device_list[target][lun]){ + smartpqi_lun_rescan(softs, target, lun); + } + } + } + + DBG_FUNC("OUT\n"); +} + +/* + * Set the mode of tagged command queueing for the current task. + */ +uint8_t os_get_task_attr(rcb_t *rcb) +{ + union ccb *ccb = rcb->cm_ccb; + uint8_t tag_action = SOP_TASK_ATTRIBUTE_SIMPLE; + + switch(ccb->csio.tag_action) { + case MSG_HEAD_OF_Q_TAG: + tag_action = SOP_TASK_ATTRIBUTE_HEAD_OF_QUEUE; + break; + case MSG_ORDERED_Q_TAG: + tag_action = SOP_TASK_ATTRIBUTE_ORDERED; + break; + case MSG_SIMPLE_Q_TAG: + default: + tag_action = SOP_TASK_ATTRIBUTE_SIMPLE; + break; + } + return tag_action; +} + +/* + * Complete all outstanding commands + */ +void os_complete_outstanding_cmds_nodevice(pqisrc_softstate_t *softs) +{ + int tag = 0; + + DBG_FUNC("IN\n"); + + for (tag = 1; tag < softs->max_outstanding_io; tag++) { + rcb_t *prcb = &softs->rcb[tag]; + if(prcb->req_pending && prcb->cm_ccb ) { + prcb->req_pending = false; + prcb->cm_ccb->ccb_h.status = CAM_REQ_ABORTED | CAM_REQ_CMP; + xpt_done((union ccb *)prcb->cm_ccb); + prcb->cm_ccb = NULL; + } + } + + DBG_FUNC("OUT\n"); +} + +/* + * IO handling functionality entry point + */ +static int pqisrc_io_start(struct cam_sim *sim, union ccb *ccb) +{ + rcb_t *rcb; + uint32_t tag, no_transfer = 0; + pqisrc_softstate_t *softs = (struct pqisrc_softstate *) + cam_sim_softc(sim); + int32_t error = PQI_STATUS_FAILURE; + pqi_scsi_dev_t *dvp; + + DBG_FUNC("IN\n"); + + if( softs->device_list[ccb->ccb_h.target_id][ccb->ccb_h.target_lun] == NULL ) { + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + DBG_INFO("Device = %d not there\n", ccb->ccb_h.target_id); + return PQI_STATUS_FAILURE; + } + + dvp = softs->device_list[ccb->ccb_h.target_id][ccb->ccb_h.target_lun]; + /* Check controller state */ + if (IN_PQI_RESET(softs)) { + ccb->ccb_h.status = CAM_SCSI_BUS_RESET + | CAM_BUSY | CAM_REQ_INPROG; + DBG_WARN("Device = %d BUSY/IN_RESET\n", ccb->ccb_h.target_id); + return error; + } + /* Check device state */ + if (pqisrc_ctrl_offline(softs) || DEV_GONE(dvp)) { + ccb->ccb_h.status = CAM_DEV_NOT_THERE | CAM_REQ_CMP; + DBG_WARN("Device = %d GONE/OFFLINE\n", ccb->ccb_h.target_id); + return error; + } + /* Check device reset */ + if (DEV_RESET(dvp)) { + ccb->ccb_h.status = CAM_SCSI_BUSY | CAM_REQ_INPROG | CAM_BUSY; + DBG_WARN("Device %d reset returned busy\n", ccb->ccb_h.target_id); + return error; + } + + if (dvp->expose_device == false) { + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + DBG_INFO("Device = %d not exposed\n", ccb->ccb_h.target_id); + return error; + } + + tag = pqisrc_get_tag(&softs->taglist); + if( tag == INVALID_ELEM ) { + DBG_ERR("Get Tag failed\n"); + xpt_freeze_simq(softs->os_specific.sim, 1); + softs->os_specific.pqi_flags |= PQI_FLAG_BUSY; + ccb->ccb_h.status |= (CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ); + return PQI_STATUS_FAILURE; + } + + DBG_IO("tag = %d &softs->taglist : %p\n", tag, &softs->taglist); + + rcb = &softs->rcb[tag]; + os_reset_rcb( rcb ); + rcb->tag = tag; + rcb->softs = softs; + rcb->cmdlen = ccb->csio.cdb_len; + ccb->ccb_h.sim_priv.entries[0].ptr = rcb; + + switch (ccb->ccb_h.flags & CAM_DIR_MASK) { + case CAM_DIR_IN: + rcb->data_dir = SOP_DATA_DIR_FROM_DEVICE; + break; + case CAM_DIR_OUT: + rcb->data_dir = SOP_DATA_DIR_TO_DEVICE; + break; + case CAM_DIR_NONE: + no_transfer = 1; + break; + default: + DBG_ERR("Unknown Dir\n"); + break; + } + rcb->cm_ccb = ccb; + rcb->dvp = softs->device_list[ccb->ccb_h.target_id][ccb->ccb_h.target_lun]; + + if (!no_transfer) { + rcb->cm_data = (void *)ccb->csio.data_ptr; + rcb->bcount = ccb->csio.dxfer_len; + } else { + rcb->cm_data = NULL; + rcb->bcount = 0; + } + /* + * Submit the request to the adapter. + * + * Note that this may fail if we're unable to map the request (and + * if we ever learn a transport layer other than simple, may fail + * if the adapter rejects the command). + */ + if ((error = pqi_map_request(rcb)) != 0) { + rcb->req_pending = false; + xpt_freeze_simq(softs->os_specific.sim, 1); + ccb->ccb_h.status |= CAM_RELEASE_SIMQ; + if (error == EINPROGRESS) { + DBG_WARN("In Progress on %d\n", ccb->ccb_h.target_id); + error = 0; + } else { + ccb->ccb_h.status |= CAM_REQUEUE_REQ; + DBG_WARN("Requeue req error = %d target = %d\n", error, + ccb->ccb_h.target_id); + pqi_unmap_request(rcb); + } + } + + DBG_FUNC("OUT error = %d\n", error); + return error; +} + +/* + * Abort a task, task management functionality + */ +static int +pqisrc_scsi_abort_task(pqisrc_softstate_t *softs, union ccb *ccb) +{ + rcb_t *rcb = ccb->ccb_h.sim_priv.entries[0].ptr; + uint32_t abort_tag = rcb->tag; + uint32_t tag = 0; + int rval = PQI_STATUS_SUCCESS; + uint16_t qid; + + DBG_FUNC("IN\n"); + + qid = (uint16_t)rcb->resp_qid; + + tag = pqisrc_get_tag(&softs->taglist); + rcb = &softs->rcb[tag]; + rcb->tag = tag; + rcb->resp_qid = qid; + + rval = pqisrc_send_tmf(softs, rcb->dvp, rcb, abort_tag, + SOP_TASK_MANAGEMENT_FUNCTION_ABORT_TASK); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Apr 26 17:13:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBF05FB3473; Thu, 26 Apr 2018 17:13:58 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94F32774C9; Thu, 26 Apr 2018 17:13:58 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F69A1AFBE; Thu, 26 Apr 2018 17:13:58 +0000 (UTC) (envelope-from seanc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QHDwCe089592; Thu, 26 Apr 2018 17:13:58 GMT (envelope-from seanc@FreeBSD.org) Received: (from seanc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QHDwbx089591; Thu, 26 Apr 2018 17:13:58 GMT (envelope-from seanc@FreeBSD.org) Message-Id: <201804261713.w3QHDwbx089591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: seanc set sender to seanc@FreeBSD.org using -f From: Sean Chittenden Date: Thu, 26 Apr 2018 17:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333020 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: seanc X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 333020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 17:13:59 -0000 Author: seanc (ports committer) Date: Thu Apr 26 17:13:58 2018 New Revision: 333020 URL: https://svnweb.freebsd.org/changeset/base/333020 Log: Add myself back to the ranks of being mentored Approved by: swills (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Apr 26 16:59:06 2018 (r333019) +++ head/share/misc/committers-ports.dot Thu Apr 26 17:13:58 2018 (r333020) @@ -517,6 +517,7 @@ mat -> dteske mat -> dvl mat -> gordon mat -> mmokhi +mat -> seanc mat -> tcberner mat -> thierry mat -> tobik @@ -650,6 +651,7 @@ swills -> pclin swills -> rezny swills -> robak swills -> rpaulo +swills -> seanc swills -> tz swills -> xmj From owner-svn-src-head@freebsd.org Thu Apr 26 17:32:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35015FB38B2; Thu, 26 Apr 2018 17:32:37 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 962D57CC42; Thu, 26 Apr 2018 17:32:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B4DB1B2FB; Thu, 26 Apr 2018 17:32:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QHWacE099700; Thu, 26 Apr 2018 17:32:36 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QHWa1m099699; Thu, 26 Apr 2018 17:32:36 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804261732.w3QHWa1m099699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 26 Apr 2018 17:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333021 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 17:32:37 -0000 Author: sbruno Date: Thu Apr 26 17:32:35 2018 New Revision: 333021 URL: https://svnweb.freebsd.org/changeset/base/333021 Log: Tigthen up kern_prefetch.h includes. The DMAP check was not committed in here with HPTS so these includes aren't necessary. Comments from rrs: Yeah I had those in there in our version so I could validate the range in amd64 with the DMAP_VM but for some reason those don't work in head anymore.. Forgot to purge the headers :) Submitted by: Kevin Bowling Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D15164 Modified: head/sys/sys/kern_prefetch.h Modified: head/sys/sys/kern_prefetch.h ============================================================================== --- head/sys/sys/kern_prefetch.h Thu Apr 26 17:13:58 2018 (r333020) +++ head/sys/sys/kern_prefetch.h Thu Apr 26 17:32:35 2018 (r333021) @@ -28,13 +28,6 @@ */ #define __kern_prefetch_h__ #ifdef _KERNEL -#if defined(__amd64__) -#include -#include -#include -#include -#include -#endif static __inline void kern_prefetch(const volatile void *addr, void* before) From owner-svn-src-head@freebsd.org Thu Apr 26 17:34:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F61CFB396B; Thu, 26 Apr 2018 17:34:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEBD97CE19; Thu, 26 Apr 2018 17:34:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B4651B304; Thu, 26 Apr 2018 17:34:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QHYrhe099848; Thu, 26 Apr 2018 17:34:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QHYrQh099845; Thu, 26 Apr 2018 17:34:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804261734.w3QHYrQh099845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 Apr 2018 17:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333022 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 333022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 17:34:54 -0000 Author: trasz Date: Thu Apr 26 17:34:53 2018 New Revision: 333022 URL: https://svnweb.freebsd.org/changeset/base/333022 Log: Clarify which USB specs are supported by cdce(4) and umodem(4). Discussed with: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/cdce.4 head/share/man/man4/umodem.4 Modified: head/share/man/man4/cdce.4 ============================================================================== --- head/share/man/man4/cdce.4 Thu Apr 26 17:32:35 2018 (r333021) +++ head/share/man/man4/cdce.4 Thu Apr 26 17:34:53 2018 (r333022) @@ -33,7 +33,7 @@ .Os .Sh NAME .Nm cdce -.Nd "USB Communication Device Class Ethernet driver" +.Nd "USB Communication Device Class Ethernet (CDC ECM/NCM) driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -58,7 +58,9 @@ The .Nm driver provides support for USB Host-to-Host (aka USB-to-USB) and USB-to-Ethernet bridges based on the USB Communication Device Class -(CDC) and Ethernet subclass. +Ethernet Control Model (CDC ECM) and Network Control Model (CDC NCM) +specifications. +It also provides device-level CDC ECM support. .Pp The USB bridge appears as a regular network interface on both sides, transporting Ethernet frames. Modified: head/share/man/man4/umodem.4 ============================================================================== --- head/share/man/man4/umodem.4 Thu Apr 26 17:32:35 2018 (r333021) +++ head/share/man/man4/umodem.4 Thu Apr 26 17:34:53 2018 (r333022) @@ -34,7 +34,7 @@ .Os .Sh NAME .Nm umodem -.Nd USB modem support +.Nd USB Communication Device Class serial (CDC ACM) driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -54,9 +54,10 @@ umodem_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for USB modems in the Communication -Device Class using the Abstract Control Model. -These modems are basically standard serial line modems, but they are +driver provides support for USB modems and serial devices that +implement the Communication Device Class Abstract Control Model (CDC ACM). +It also implement device-side CDC ACM support. +Supported modems are basically standard serial line modems, but they are accessed via USB instead. They support a regular AT command set. The commands can either be multiplexed with the data stream From owner-svn-src-head@freebsd.org Thu Apr 26 17:36:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C704FB3A13; Thu, 26 Apr 2018 17:36:32 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB5037CFA3; Thu, 26 Apr 2018 17:36:31 +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 E63781B308; Thu, 26 Apr 2018 17:36:31 +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 w3QHaVQb099966; Thu, 26 Apr 2018 17:36:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QHaVAN099965; Thu, 26 Apr 2018 17:36:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804261736.w3QHaVAN099965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 Apr 2018 17:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333023 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 333023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 17:36:32 -0000 Author: trasz Date: Thu Apr 26 17:36:31 2018 New Revision: 333023 URL: https://svnweb.freebsd.org/changeset/base/333023 Log: Bump .Dd. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/cdce.4 Modified: head/share/man/man4/cdce.4 ============================================================================== --- head/share/man/man4/cdce.4 Thu Apr 26 17:34:53 2018 (r333022) +++ head/share/man/man4/cdce.4 Thu Apr 26 17:36:31 2018 (r333023) @@ -28,7 +28,7 @@ .\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $ .\" $FreeBSD$ .\" -.Dd November 24, 2015 +.Dd April 26, 2018 .Dt CDCE 4 .Os .Sh NAME From owner-svn-src-head@freebsd.org Thu Apr 26 17:36:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD3FFB3A3E; Thu, 26 Apr 2018 17:36:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D8477D0C2; Thu, 26 Apr 2018 17:36:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 288151B309; Thu, 26 Apr 2018 17:36:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QHan2l000127; Thu, 26 Apr 2018 17:36:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QHanP6000126; Thu, 26 Apr 2018 17:36:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804261736.w3QHanP6000126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 26 Apr 2018 17:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333024 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 333024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 17:36:49 -0000 Author: trasz Date: Thu Apr 26 17:36:48 2018 New Revision: 333024 URL: https://svnweb.freebsd.org/changeset/base/333024 Log: Erm, fix typo. MFC after: 2 weeks Modified: head/share/man/man4/umodem.4 Modified: head/share/man/man4/umodem.4 ============================================================================== --- head/share/man/man4/umodem.4 Thu Apr 26 17:36:31 2018 (r333023) +++ head/share/man/man4/umodem.4 Thu Apr 26 17:36:48 2018 (r333024) @@ -56,7 +56,7 @@ The .Nm driver provides support for USB modems and serial devices that implement the Communication Device Class Abstract Control Model (CDC ACM). -It also implement device-side CDC ACM support. +It also provides device-side CDC ACM support. Supported modems are basically standard serial line modems, but they are accessed via USB instead. They support a regular AT command set. From owner-svn-src-head@freebsd.org Thu Apr 26 18:12:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474D3FB480F; Thu, 26 Apr 2018 18:12: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0A3585B05; Thu, 26 Apr 2018 18:12:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB8C81B94F; Thu, 26 Apr 2018 18:12: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 w3QICeWT019852; Thu, 26 Apr 2018 18:12:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QICeRh019851; Thu, 26 Apr 2018 18:12:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804261812.w3QICeRh019851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Apr 2018 18:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333025 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 333025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 18:12:41 -0000 Author: kib Date: Thu Apr 26 18:12:40 2018 New Revision: 333025 URL: https://svnweb.freebsd.org/changeset/base/333025 Log: Some style and minor code improvements for idle selection. Use designated initializers for the idlt_tlb elements. Remove strstr() use, add flag field to detect supported MWAIT. Use nitems() instead of the terminating NULL entry for idle_tlb. Move several functions into cpu_idle_* namespace. Based on the discussion with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Thu Apr 26 17:36:48 2018 (r333024) +++ head/sys/x86/x86/cpu_machdep.c Thu Apr 26 18:12:40 2018 (r333025) @@ -598,15 +598,16 @@ cpu_idle_wakeup(int cpu) /* * Ordered by speed/power consumption. */ -struct { +static struct { void *id_fn; char *id_name; + int id_cpuid2_flag; } idle_tbl[] = { - { cpu_idle_spin, "spin" }, - { cpu_idle_mwait, "mwait" }, - { cpu_idle_hlt, "hlt" }, - { cpu_idle_acpi, "acpi" }, - { NULL, NULL } + { .id_fn = cpu_idle_spin, .id_name = "spin" }, + { .id_fn = cpu_idle_mwait, .id_name = "mwait", + .id_cpuid2_flag = CPUID2_MON }, + { .id_fn = cpu_idle_hlt, .id_name = "hlt" }, + { .id_fn = cpu_idle_acpi, .id_name = "acpi" }, }; static int @@ -618,9 +619,9 @@ idle_sysctl_available(SYSCTL_HANDLER_ARGS) avail = malloc(256, M_TEMP, M_WAITOK); p = avail; - for (i = 0; idle_tbl[i].id_name != NULL; i++) { - if (strstr(idle_tbl[i].id_name, "mwait") && - (cpu_feature2 & CPUID2_MON) == 0) + for (i = 0; i < nitems(idle_tbl); i++) { + if (idle_tbl[i].id_cpuid2_flag != 0 && + (cpu_feature2 & idle_tbl[i].id_cpuid2_flag) == 0) continue; if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && cpu_idle_hook == NULL) @@ -637,13 +638,13 @@ SYSCTL_PROC(_machdep, OID_AUTO, idle_available, CTLTYP 0, 0, idle_sysctl_available, "A", "list of available idle functions"); static bool -idle_selector(const char *new_idle_name) +cpu_idle_selector(const char *new_idle_name) { int i; - for (i = 0; idle_tbl[i].id_name != NULL; i++) { - if (strstr(idle_tbl[i].id_name, "mwait") && - (cpu_feature2 & CPUID2_MON) == 0) + for (i = 0; i < nitems(idle_tbl); i++) { + if (idle_tbl[i].id_cpuid2_flag != 0 && + (cpu_feature2 & idle_tbl[i].id_cpuid2_flag) == 0) continue; if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && cpu_idle_hook == NULL) @@ -659,13 +660,13 @@ idle_selector(const char *new_idle_name) } static int -idle_sysctl(SYSCTL_HANDLER_ARGS) +cpu_idle_sysctl(SYSCTL_HANDLER_ARGS) { char buf[16], *p; int error, i; p = "unknown"; - for (i = 0; idle_tbl[i].id_name != NULL; i++) { + for (i = 0; i < nitems(idle_tbl); i++) { if (idle_tbl[i].id_fn == cpu_idle_fn) { p = idle_tbl[i].id_name; break; @@ -675,21 +676,21 @@ idle_sysctl(SYSCTL_HANDLER_ARGS) error = sysctl_handle_string(oidp, buf, sizeof(buf), req); if (error != 0 || req->newptr == NULL) return (error); - return (idle_selector(buf) ? 0 : EINVAL); + return (cpu_idle_selector(buf) ? 0 : EINVAL); } SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, - idle_sysctl, "A", "currently selected idle function"); + cpu_idle_sysctl, "A", "currently selected idle function"); static void -idle_tun(void *unused __unused) +cpu_idle_tun(void *unused __unused) { char tunvar[16]; if (TUNABLE_STR_FETCH("machdep.idle", tunvar, sizeof(tunvar))) - idle_selector(tunvar); + cpu_idle_selector(tunvar); } -SYSINIT(idle_tun, SI_SUB_CPU, SI_ORDER_MIDDLE, idle_tun, NULL); +SYSINIT(cpu_idle_tun, SI_SUB_CPU, SI_ORDER_MIDDLE, cpu_idle_tun, NULL); static int panic_on_nmi = 1; SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN, From owner-svn-src-head@freebsd.org Thu Apr 26 18:24:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 709A9FB4CAF; Thu, 26 Apr 2018 18:24:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC7F88466; Thu, 26 Apr 2018 18:24:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 141BD1BADF; Thu, 26 Apr 2018 18:24:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QIOVVI024975; Thu, 26 Apr 2018 18:24:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QIOVl8024974; Thu, 26 Apr 2018 18:24:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804261824.w3QIOVl8024974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Apr 2018 18:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333026 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 333026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 18:24:32 -0000 Author: kib Date: Thu Apr 26 18:24:31 2018 New Revision: 333026 URL: https://svnweb.freebsd.org/changeset/base/333026 Log: Handle Appolo Lake errata APL31. If the workaround is activated, always send IPI for wake up, not rely on the write to the monitor line. This fixes Appolo Lake machines early hang in sched_bind(), without requiring user to manually select idle method. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Thu Apr 26 18:12:40 2018 (r333025) +++ head/sys/x86/x86/cpu_machdep.c Thu Apr 26 18:24:31 2018 (r333026) @@ -575,6 +575,11 @@ out: busy, curcpu); } +static int cpu_idle_apl31_workaround; +SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, + &cpu_idle_apl31_workaround, 0, + "Appolo Lake APL31 MWAIT bug workaround"); + int cpu_idle_wakeup(int cpu) { @@ -586,7 +591,7 @@ cpu_idle_wakeup(int cpu) return (0); case STATE_MWAIT: atomic_store_int(state, STATE_RUNNING); - return (1); + return (cpu_idle_apl31_workaround ? 0 : 1); case STATE_RUNNING: return (1); default: @@ -689,6 +694,13 @@ cpu_idle_tun(void *unused __unused) if (TUNABLE_STR_FETCH("machdep.idle", tunvar, sizeof(tunvar))) cpu_idle_selector(tunvar); + if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_id == 0x506c9) { + /* + * Appolo Lake errata APL31. + */ + cpu_idle_apl31_workaround = 1; + } + TUNABLE_INT_FETCH("machdep.idle_apl31", &cpu_idle_apl31_workaround); } SYSINIT(cpu_idle_tun, SI_SUB_CPU, SI_ORDER_MIDDLE, cpu_idle_tun, NULL); From owner-svn-src-head@freebsd.org Thu Apr 26 18:39:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1B5CFB50EE; Thu, 26 Apr 2018 18:38:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8963F8A3B5; Thu, 26 Apr 2018 18:38:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 810981BC9F; Thu, 26 Apr 2018 18:38:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QIcx9Q030166; Thu, 26 Apr 2018 18:38:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QIcxLK030163; Thu, 26 Apr 2018 18:38:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804261838.w3QIcxLK030163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 26 Apr 2018 18:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333027 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 333027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 18:39:00 -0000 Author: emaste Date: Thu Apr 26 18:38:59 2018 New Revision: 333027 URL: https://svnweb.freebsd.org/changeset/base/333027 Log: Add arm64 Linux syscall table This is the first step (after the recent refactoring of some common code) to supporting the Linuxulator on arm64. Reviewed by: andrew Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D15187 Added: head/sys/arm64/linux/ head/sys/arm64/linux/Makefile (contents, props changed) head/sys/arm64/linux/syscalls.conf (contents, props changed) head/sys/arm64/linux/syscalls.master (contents, props changed) Added: head/sys/arm64/linux/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/Makefile Thu Apr 26 18:38:59 2018 (r333027) @@ -0,0 +1,15 @@ +# Makefile for syscall tables +# +# $FreeBSD$ + +# Don't use an OBJDIR +.OBJDIR: ${.CURDIR} + +all: + @echo "make sysent only" + +sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c + +linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ + ../../kern/makesyscalls.sh syscalls.master syscalls.conf + sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf Added: head/sys/arm64/linux/syscalls.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/syscalls.conf Thu Apr 26 18:38:59 2018 (r333027) @@ -0,0 +1,11 @@ +# $FreeBSD$ +sysnames="linux_syscalls.c" +sysproto="linux_proto.h" +sysproto_h=_LINUX_SYSPROTO_H_ +syshdr="linux_syscall.h" +syssw="linux_sysent.c" +sysmk="/dev/null" +syscallprefix="LINUX_SYS_" +switchname="linux_sysent" +namesname="linux_syscallnames" +systrace="linux_systrace_args.c" Added: head/sys/arm64/linux/syscalls.master ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/syscalls.master Thu Apr 26 18:38:59 2018 (r333027) @@ -0,0 +1,518 @@ + $FreeBSD$ + +; Linux ABI system call generic name/number map, based on Linux file +; include/uapi/asm-generic/unistd.h + +#include +#include +#include +#include +#include +#include + +; Isn't pretty, but there seems to be no other way to trap nosys +#define nosys linux_nosys + +0 AUE_NULL UNIMPL linux_io_setup +1 AUE_NULL UNIMPL linux_io_destroy +2 AUE_NULL UNIMPL linux_io_submit +3 AUE_NULL UNIMPL linux_io_cancel +4 AUE_NULL UNIMPL linux_io_getevents +5 AUE_NULL STD { int linux_setxattr(void); } +6 AUE_NULL STD { int linux_lsetxattr(void); } +7 AUE_NULL STD { int linux_fsetxattr(void); } +8 AUE_NULL STD { int linux_getxattr(void); } +9 AUE_NULL STD { int linux_lgetxattr(void); } +10 AUE_NULL STD { int linux_fgetxattr(void); } +11 AUE_NULL STD { int linux_listxattr(void); } +12 AUE_NULL STD { int linux_llistxattr(void); } +13 AUE_NULL STD { int linux_flistxattr(void); } +14 AUE_NULL STD { int linux_removexattr(void); } +15 AUE_NULL STD { int linux_lremovexattr(void); } +16 AUE_NULL STD { int linux_fremovexattr(void); } +17 AUE_GETCWD STD { int linux_getcwd(char *buf, \ + l_ulong bufsize); } +18 AUE_NULL STD { int linux_lookup_dcookie(void); } +19 AUE_NULL STD { int linux_eventfd2(l_uint initval, \ + l_int flags); } +20 AUE_NULL STD { int linux_epoll_create1(l_int flags); } +21 AUE_NULL STD { int linux_epoll_ctl(l_int epfd, l_int op, \ + l_int fd, struct epoll_event *event); } +22 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, \ + struct epoll_event *events, \ + l_int maxevents, l_int timeout, \ + l_sigset_t *mask, l_size_t sigsetsize); } +23 AUE_NULL UNIMPL linux_dup +24 AUE_NULL STD { int linux_dup3(l_int oldfd, l_int newfd, \ + l_int flags); } +25 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ + l_ulong arg); } +26 AUE_NULL STD { int linux_inotify_init1(l_int flags); } +27 AUE_NULL STD { int linux_inotify_add_watch(void); } +28 AUE_NULL STD { int linux_inotify_rm_watch(void); } +29 AUE_IOCTL STD { int linux_ioctl(l_uint fd, l_uint cmd, \ + uintptr_t arg); } +30 AUE_NULL STD { int linux_ioprio_set(void); } +31 AUE_NULL STD { int linux_ioprio_get(void); } +32 AUE_FLOCK NOPROTO { int flock(int fd, int how); } +33 AUE_MKNODAT STD { int linux_mknodat(l_int dfd, \ + const char *filename, l_int mode, \ + l_uint dev); } +34 AUE_MKDIRAT STD { int linux_mkdirat(l_int dfd, \ + const char *pathname, l_int mode); } +35 AUE_UNLINKAT STD { int linux_unlinkat(l_int dfd, \ + const char *pathname, l_int flag); } +36 AUE_SYMLINKAT STD { int linux_symlinkat(const char *oldname, \ + l_int newdfd, const char *newname); } +37 AUE_LINKAT STD { int linux_linkat(l_int olddfd, \ + const char *oldname, l_int newdfd, \ + const char *newname, l_int flag); } +38 AUE_RENAMEAT STD { int linux_renameat(l_int olddfd, \ + const char *oldname, l_int newdfd, \ + const char *newname); } +39 AUE_NULL UNIMPL linux_umount2 +40 AUE_MOUNT STD { int linux_mount(char *specialfile, \ + char *dir, char *filesystemtype, \ + l_ulong rwflag, void *data); } +41 AUE_PIVOT_ROOT STD { int linux_pivot_root(void); } +42 AUE_NULL UNIMPL nfsservctl +43 AUE_STATFS STD { int linux_statfs(char *path, \ + struct l_statfs_buf *buf); } +44 AUE_FSTATFS STD { int linux_fstatfs(l_uint fd, \ + struct l_statfs_buf *buf); } +45 AUE_TRUNCATE STD { int linux_truncate(char *path, \ + l_ulong length); } +46 AUE_FTRUNCATE STD { int linux_ftruncate(l_int fd, \ + l_long length); } +47 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ + l_loff_t offset, l_loff_t len); } +48 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, \ + const char *filename, l_int amode); } +49 AUE_CHDIR STD { int linux_chdir(char *path); } +50 AUE_FCHDIR NOPROTO { int fchdir(int fd); } +51 AUE_CHROOT NOPROTO { int chroot(char *path); } +52 AUE_FCHMOD NOPROTO { int fchmod(int fd, int mode); } +53 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, \ + const char *filename, l_mode_t mode); } +54 AUE_FCHOWNAT STD { int linux_fchownat(l_int dfd, \ + const char *filename, l_uid_t uid, \ + l_gid_t gid, l_int flag); } +55 AUE_FCHOWN NOPROTO { int fchown(int fd, int uid, int gid); } +56 AUE_OPEN_RWTC STD { int linux_openat(l_int dfd, \ + const char *filename, l_int flags, \ + l_int mode); } +57 AUE_CLOSE NOPROTO { int close(int fd); } +58 AUE_NULL STD { int linux_vhangup(void); } +59 AUE_NULL STD { int linux_pipe2(l_int *pipefds, \ + l_int flags); } +60 AUE_NULL UNIMPL linux_quotactl +61 AUE_GETDIRENTRIES STD { int linux_getdents64(l_uint fd, \ + void *dirent, l_uint count); } +62 AUE_LSEEK STD { int linux_lseek(l_uint fdes, l_off_t off, \ + l_int whence); } +63 AUE_NULL NOPROTO { int read(int fd, char *buf, \ + u_int nbyte); } +64 AUE_NULL NOPROTO { int write(int fd, char *buf, \ + u_int nbyte); } +65 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ + u_int iovcnt); } +66 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \ + u_int iovcnt); } +67 AUE_PREAD STD { int linux_pread(l_uint fd, char *buf, \ + l_size_t nbyte, l_loff_t offset); } +68 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ + l_size_t nbyte, l_loff_t offset); } +69 AUE_NULL STD { int linux_preadv(l_ulong fd, \ + struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h); } +70 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ + struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h); } +71 AUE_SENDFILE STD { int linux_sendfile(l_int out, l_int in, \ + l_long *offset, l_size_t count); } +72 AUE_SELECT STD { int linux_pselect6(l_int nfds, \ + l_fd_set *readfds, l_fd_set *writefds, \ + l_fd_set *exceptfds, \ + struct l_timespec *tsp, l_uintptr_t *sig); } +73 AUE_POLL STD { int linux_ppoll(struct pollfd *fds, \ + uint32_t nfds, struct l_timespec *tsp, \ + l_sigset_t *sset, l_size_t ssize); } +74 AUE_NULL STD { int linux_signalfd4(void); } +75 AUE_NULL STD { int linux_vmsplice(void); } +76 AUE_NULL STD { int linux_splice(void); } +77 AUE_NULL STD { int linux_tee(void); } +78 AUE_READLINKAT STD { int linux_readlinkat(l_int dfd, \ + const char *path, char *buf, \ + l_int bufsiz); } +79 AUE_FSTATAT STD { int linux_newfstatat(l_int dfd, \ + char *pathname, struct l_stat64 *statbuf, \ + l_int flag); } +80 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ + struct l_newstat *buf); } +81 AUE_NULL UNIMPL linux_sync +82 AUE_FSYNC NOPROTO { int fsync(int fd); } +83 AUE_NULL STD { int linux_fdatasync(l_uint fd); } +84 AUE_NULL STD { int linux_sync_file_range(void); } +85 AUE_NULL STD { int linux_timerfd_create(l_int clockid, \ + l_int flags); } +86 AUE_NULL STD { int linux_timerfd_settime(l_int fd, \ + l_int flags, \ + const struct l_itimerspec *new_value, \ + struct l_itimerspec *old_value); } +87 AUE_NULL STD { int linux_timerfd_gettime(l_int fd, \ + struct l_itimerspec *old_value); } +88 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, \ + const char *pathname, \ + const struct l_timespec *times, \ + l_int flags); } +89 AUE_ACCT NOPROTO { int acct(char *path); } +90 AUE_CAPGET STD { int linux_capget( \ + struct l_user_cap_header *hdrp, \ + struct l_user_cap_data *datap); } +91 AUE_CAPSET STD { int linux_capset( \ + struct l_user_cap_header *hdrp, \ + struct l_user_cap_data *datap); } +92 AUE_PERSONALITY STD { int linux_personality(l_uint per); } +93 AUE_EXIT STD { int linux_exit(int rval); } +94 AUE_EXIT STD { int linux_exit_group(int error_code); } +95 AUE_WAIT6 STD { int linux_waitid(l_int idtype, l_pid_t id, \ + l_siginfo_t *info, l_int options, \ + struct rusage *rusage); } +96 AUE_NULL STD { int linux_set_tid_address(int *tidptr); } +97 AUE_NULL STD { int linux_unshare(void); } +98 AUE_NULL STD { int linux_sys_futex(void *uaddr, int op, \ + int val, struct l_timespec *timeout, \ + void *uaddr2, int val3); } +99 AUE_NULL STD { int linux_set_robust_list( \ + struct linux_robust_list_head *head, \ + l_size_t len); } +100 AUE_NULL STD { int linux_get_robust_list(l_int pid, \ + struct linux_robust_list_head **head, \ + l_size_t *len); } +101 AUE_NULL STD { int linux_nanosleep( \ + const struct l_timespec *rqtp, \ + struct l_timespec *rmtp); } +102 AUE_GETITIMER STD { int linux_getitimer(l_int which, \ + struct l_itimerval *itv); } +103 AUE_SETITIMER STD { int linux_setitimer(l_int which, \ + struct l_itimerval *itv, \ + struct l_itimerval *oitv); } +104 AUE_NULL STD { int linux_kexec_load(void); } +105 AUE_NULL STD { int linux_init_module(void); } +106 AUE_NULL STD { int linux_delete_module(void); } +107 AUE_NULL STD { int linux_timer_create(clockid_t clock_id, \ + struct sigevent *evp, l_timer_t *timerid); } +108 AUE_NULL STD { int linux_timer_gettime(l_timer_t timerid, \ + struct itimerspec *setting); } +109 AUE_NULL STD { int linux_timer_getoverrun( \ + l_timer_t timerid); } +110 AUE_NULL STD { int linux_timer_settime(l_timer_t timerid, \ + l_int flags, const struct itimerspec *new, \ + struct itimerspec *old); } +111 AUE_NULL STD { int linux_timer_delete(l_timer_t timerid); } +112 AUE_CLOCK_SETTIME STD { int linux_clock_settime( \ + clockid_t which, struct l_timespec *tp); } +113 AUE_NULL STD { int linux_clock_gettime(clockid_t which, \ + struct l_timespec *tp); } +114 AUE_NULL STD { int linux_clock_getres(clockid_t which, \ + struct l_timespec *tp); } +115 AUE_NULL STD { int linux_clock_nanosleep(clockid_t which, \ + int flags, struct l_timespec *rqtp, \ + struct l_timespec *rmtp); } +116 AUE_NULL STD { int linux_syslog(l_int type, char *buf, \ + l_int len); } +117 AUE_PTRACE STD { int linux_ptrace(l_long req, l_long pid, \ + l_ulong addr, l_ulong data); } +118 AUE_SCHED_SETPARAM STD { int linux_sched_setparam( \ + l_pid_t pid, struct sched_param *param); } +119 AUE_SCHED_SETSCHEDULER STD { int linux_sched_setscheduler( \ + l_pid_t pid, l_int policy, \ + struct sched_param *param); } +120 AUE_SCHED_GETSCHEDULER STD { int linux_sched_getscheduler( \ + l_pid_t pid); } +121 AUE_SCHED_GETPARAM STD { int linux_sched_getparam( \ + l_pid_t pid, struct sched_param *param); } +122 AUE_NULL STD { int linux_sched_setaffinity(l_pid_t pid, \ + l_uint len, l_ulong *user_mask_ptr); } +123 AUE_NULL STD { int linux_sched_getaffinity(l_pid_t pid, \ + l_uint len, l_ulong *user_mask_ptr); } +124 AUE_NULL NOPROTO { int sched_yield(void); } +125 AUE_SCHED_GET_PRIORITY_MAX STD { int linux_sched_get_priority_max(\ + l_int policy); } +126 AUE_SCHED_GET_PRIORITY_MIN STD { int linux_sched_get_priority_min(\ + l_int policy); } +127 AUE_SCHED_RR_GET_INTERVAL STD { int linux_sched_rr_get_interval( \ + l_pid_t pid, struct l_timespec *interval); } +128 AUE_NULL UNIMPL restart_syscall +129 AUE_KILL STD { int linux_kill(l_int pid, l_int signum); } +130 AUE_NULL STD { int linux_tkill(l_int tid, l_int sig); } +131 AUE_NULL STD { int linux_tgkill(l_int tgid, l_int pid, \ + l_int sig); } +132 AUE_NULL STD { int linux_sigaltstack(l_stack_t *uss, \ + l_stack_t *uoss); } +133 AUE_NULL STD { int linux_rt_sigsuspend( \ + l_sigset_t *newset, \ + l_size_t sigsetsize); } +134 AUE_NULL STD { int linux_rt_sigaction(l_int sig, \ + l_sigaction_t *act, l_sigaction_t *oact, \ + l_size_t sigsetsize); } +135 AUE_NULL STD { int linux_rt_sigprocmask(l_int how, \ + l_sigset_t *mask, l_sigset_t *omask, \ + l_size_t sigsetsize); } +136 AUE_NULL STD { int linux_rt_sigpending(l_sigset_t *set, \ + l_size_t sigsetsize); } +137 AUE_NULL STD { int linux_rt_sigtimedwait(l_sigset_t *mask, \ + l_siginfo_t *ptr, \ + struct l_timeval *timeout, \ + l_size_t sigsetsize); } +138 AUE_NULL STD { int linux_rt_sigqueueinfo(l_pid_t pid, \ + l_int sig, l_siginfo_t *info); } +139 AUE_NULL STD { int linux_rt_sigreturn( \ + struct l_ucontext *ucp); } +140 AUE_SETPRIORITY NOPROTO { int setpriority(int which, int who, \ + int prio); } +141 AUE_GETPRIORITY STD { int linux_getpriority(l_int which, \ + l_int who); } +142 AUE_REBOOT STD { int linux_reboot(l_int magic1, \ + l_int magic2, l_uint cmd, void *arg); } +143 AUE_SETREGID NOPROTO { int setregid(gid_t rgid, gid_t egid); } +144 AUE_SETGID NOPROTO { int setgid(gid_t gid); } +145 AUE_SETREUID NOPROTO { int setreuid(uid_t ruid, uid_t euid); } +146 AUE_SETUID NOPROTO { int setuid(uid_t uid); } +147 AUE_SETRESUID NOPROTO { int setresuid(uid_t ruid, uid_t euid, \ + uid_t suid); } +148 AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \ + uid_t *suid); } +149 AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \ + gid_t sgid); } +150 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ + gid_t *sgid); } +151 AUE_SETFSUID STD { int linux_setfsuid(l_uid_t uid); } +152 AUE_SETFSGID STD { int linux_setfsgid(l_gid_t gid); } +153 AUE_NULL STD { int linux_times(struct l_times_argv *buf); } +154 AUE_SETPGRP NOPROTO { int setpgid(int pid, int pgid); } +155 AUE_GETPGID NOPROTO { int getpgid(int pid); } +156 AUE_GETSID STD { int linux_getsid(l_pid_t pid); } +157 AUE_SETSID NOPROTO { int setsid(void); } +158 AUE_GETGROUPS STD { int linux_getgroups(l_int gidsetsize, \ + l_gid_t *grouplist); } +159 AUE_SETGROUPS STD { int linux_setgroups(l_int gidsetsize, \ + l_gid_t *grouplist); } +160 AUE_NULL STD { int linux_newuname( \ + struct l_new_utsname *buf); } +161 AUE_SYSCTL STD { int linux_sethostname(char *hostname, \ + l_uint len); } +162 AUE_SYSCTL STD { int linux_setdomainname(char *name, \ + l_int len); } +163 AUE_GETRLIMIT STD { int linux_getrlimit(l_uint resource, \ + struct l_rlimit *rlim); } +164 AUE_SETRLIMIT STD { int linux_setrlimit(l_uint resource, \ + struct l_rlimit *rlim); } +165 AUE_GETRUSAGE NOPROTO { int getrusage(int who, \ + struct rusage *rusage); } +166 AUE_UMASK NOPROTO { int umask(int newmask); } +167 AUE_PRCTL STD { int linux_prctl(l_int option, \ + l_uintptr_t arg2, l_uintptr_t arg3, \ + l_uintptr_t arg4, l_uintptr_t arg5); } +168 AUE_NULL STD { int linux_getcpu(l_uint *cpu, l_uint *node, \ + void *cache); } +169 AUE_NULL NOPROTO { int gettimeofday(struct l_timeval *tp, \ + struct timezone *tzp); } +170 AUE_SETTIMEOFDAY NOPROTO { int settimeofday( \ + struct l_timeval *tv, \ + struct timezone *tzp); } +171 AUE_ADJTIME STD { int linux_adjtimex(void); } +172 AUE_GETPID STD { int linux_getpid(void); } +173 AUE_GETPPID STD { int linux_getppid(void); } +174 AUE_GETUID STD { int linux_getuid(void); } +175 AUE_GETEUID NOPROTO { int geteuid(void); } +176 AUE_GETGID STD { int linux_getgid(void); } +177 AUE_GETEGID NOPROTO { int getegid(void); } +178 AUE_NULL STD { int linux_gettid(void); } +179 AUE_NULL STD { int linux_sysinfo(struct l_sysinfo *info); } +180 AUE_NULL STD { int linux_mq_open(void); } +181 AUE_NULL STD { int linux_mq_unlink(void); } +182 AUE_NULL STD { int linux_mq_timedsend(void); } +183 AUE_NULL STD { int linux_mq_timedreceive(void); } +184 AUE_NULL STD { int linux_mq_notify(void); } +185 AUE_NULL STD { int linux_mq_getsetattr(void); } +186 AUE_NULL STD { int linux_msgget(l_key_t key, l_int msgflg); } +187 AUE_NULL STD { int linux_msgctl(l_int msqid, l_int cmd, \ + struct l_msqid_ds *buf); } +188 AUE_NULL STD { int linux_msgrcv(l_int msqid, \ + struct l_msgbuf *msgp, l_size_t msgsz, \ + l_long msgtyp, l_int msgflg); } +189 AUE_NULL STD { int linux_msgsnd(l_int msqid, \ + struct l_msgbuf *msgp, l_size_t msgsz, \ + l_int msgflg); } +190 AUE_NULL STD { int linux_semget(l_key_t key, \ + l_int nsems, l_int semflg); } +191 AUE_NULL STD { int linux_semctl(l_int semid, \ + l_int semnum, l_int cmd, \ + union l_semun arg); } +192 AUE_NULL STD { int linux_semtimedop(void); } +193 AUE_NULL STD { int linux_semop(l_int semid, \ + struct l_sembuf *tsops, l_uint nsops); } +194 AUE_NULL STD { int linux_shmget(l_key_t key, l_size_t size, \ + l_int shmflg); } +195 AUE_NULL STD { int linux_shmctl(l_int shmid, l_int cmd, \ + struct l_shmid_ds *buf); } +196 AUE_NULL STD { int linux_shmat(l_int shmid, char *shmaddr, \ + l_int shmflg); } +197 AUE_NULL STD { int linux_shmdt(char *shmaddr); } +198 AUE_SOCKET STD { int linux_socket(l_int domain, l_int type, \ + l_int protocol); } +199 AUE_SOCKETPAIR STD { int linux_socketpair(l_int domain, \ + l_int type, l_int protocol, \ + l_uintptr_t rsv); } +200 AUE_BIND STD { int linux_bind(l_int s, l_uintptr_t name, \ + l_int namelen); } +201 AUE_LISTEN STD { int linux_listen(l_int s, l_int backlog); } +202 AUE_ACCEPT STD { int linux_accept(l_int s, l_uintptr_t addr, \ + l_uintptr_t namelen); } +203 AUE_CONNECT STD { int linux_connect(l_int s, l_uintptr_t name, \ + l_int namelen); } +204 AUE_GETSOCKNAME STD { int linux_getsockname(l_int s, \ + l_uintptr_t addr, l_uintptr_t namelen); } +205 AUE_GETPEERNAME STD { int linux_getpeername(l_int s, \ + l_uintptr_t addr, l_uintptr_t namelen); } +206 AUE_SENDTO STD { int linux_sendto(l_int s, l_uintptr_t msg, \ + l_int len, l_int flags, l_uintptr_t to, \ + l_int tolen); } +207 AUE_RECVFROM STD { int linux_recvfrom(l_int s, l_uintptr_t buf, \ + l_size_t len, l_int flags, \ + l_uintptr_t from, l_uintptr_t fromlen); } +208 AUE_SETSOCKOPT STD { int linux_setsockopt(l_int s, l_int level, \ + l_int optname, l_uintptr_t optval, \ + l_int optlen); } +209 AUE_GETSOCKOPT STD { int linux_getsockopt(l_int s, l_int level, \ + l_int optname, l_uintptr_t optval, \ + l_uintptr_t optlen); } +210 AUE_NULL STD { int linux_shutdown(l_int s, l_int how); } +211 AUE_SENDMSG STD { int linux_sendmsg(l_int s, l_uintptr_t msg, \ + l_int flags); } +212 AUE_RECVMSG STD { int linux_recvmsg(l_int s, l_uintptr_t msg, \ + l_int flags); } +213 AUE_NULL UNIMPL linux_readahead +214 AUE_NULL STD { int linux_brk(l_ulong dsend); } +215 AUE_MUNMAP NOPROTO { int munmap(caddr_t addr, int len); } +216 AUE_NULL STD { int linux_mremap(l_ulong addr, \ + l_ulong old_len, l_ulong new_len, \ + l_ulong flags, l_ulong new_addr); } +217 AUE_NULL STD { int linux_add_key(void); } +218 AUE_NULL STD { int linux_request_key(void); } +219 AUE_NULL STD { int linux_keyctl(void); } +220 AUE_RFORK STD { int linux_clone(l_int flags, void *stack, \ + void *parent_tidptr, void *child_tidptr, \ + void *tls); } +221 AUE_EXECVE STD { int linux_execve(char *path, char **argp, \ + char **envp); } +222 AUE_MMAP STD { int linux_mmap2(l_ulong addr, l_ulong len, \ + l_ulong prot, l_ulong flags, l_ulong fd, \ + l_ulong pgoff); } +223 AUE_NULL STD { int linux_fadvise64(l_int fd, \ + l_loff_t offset, l_size_t len, \ + l_int advice); } +224 AUE_SWAPON NOPROTO { int swapon(char *name); } +225 AUE_SWAPOFF STD { int linux_swapoff(void); } +226 AUE_MPROTECT STD { int linux_mprotect(caddr_t addr, l_int len, \ + l_int prot); } +227 AUE_MSYNC STD { int linux_msync(l_ulong addr, \ + l_size_t len, l_int fl); } +228 AUE_MLOCK NOPROTO { int mlock(const void *addr, size_t len); } +229 AUE_MUNLOCK NOPROTO { int munlock(const void *addr, size_t len); } +230 AUE_MLOCKALL NOPROTO { int mlockall(int how); } +231 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } +232 AUE_MINCORE STD { int linux_mincore(l_ulong start, \ + l_size_t len, u_char *vec); } +233 AUE_MADVISE NOPROTO { int madvise(void *addr, size_t len, \ + int behav); } +234 AUE_NULL STD { int linux_remap_file_pages(void); } +235 AUE_NULL STD { int linux_mbind(void); } +236 AUE_NULL STD { int linux_get_mempolicy(void); } +237 AUE_NULL STD { int linux_set_mempolicy(void); } +238 AUE_NULL STD { int linux_migrate_pages(void); } +239 AUE_NULL STD { int linux_move_pages(void); } +240 AUE_NULL STD { int linux_rt_tgsigqueueinfo(l_pid_t tgid, \ + l_pid_t tid, l_int sig, \ + l_siginfo_t *uinfo); } +241 AUE_NULL STD { int linux_perf_event_open(void); } +242 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ + l_uintptr_t namelen, int flags); } +243 AUE_NULL STD { int linux_recvmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags, struct l_timespec *timeout); } +244-259 AUE_NULL UNIMPL unimpl_md_syscall +260 AUE_WAIT4 STD { int linux_wait4(l_pid_t pid, \ + l_int *status, l_int options, \ + struct rusage *rusage); } +261 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, \ + l_uint resource, struct rlimit *new, \ + struct rlimit *old); } +262 AUE_NULL STD { int linux_fanotify_init(void); } +263 AUE_NULL STD { int linux_fanotify_mark(void); } +264 AUE_NULL STD { int linux_name_to_handle_at(void); } +265 AUE_NULL STD { int linux_open_by_handle_at(void); } +266 AUE_NULL STD { int linux_clock_adjtime(void); } +267 AUE_SYNC STD { int linux_syncfs(l_int fd); } +268 AUE_NULL STD { int linux_setns(l_int fd, l_int nstype); } +269 AUE_NULL STD { int linux_sendmmsg(l_int s, \ + struct l_mmsghdr *msg, l_uint vlen, \ + l_uint flags); } +270 AUE_NULL STD { int linux_process_vm_readv(l_pid_t pid, \ + const struct iovec *lvec, l_ulong liovcnt, \ + const struct iovec *rvec, l_ulong riovcnt, \ + l_ulong flags); } +271 AUE_NULL STD { int linux_process_vm_writev(l_pid_t pid, \ + const struct iovec *lvec, l_ulong liovcnt, \ + const struct iovec *rvec, l_ulong riovcnt, \ + l_ulong flags); } +272 AUE_NULL STD { int linux_kcmp(l_pid_t pid1, l_pid_t pid2, \ + l_int type, l_ulong idx1, l_ulong idx); } +273 AUE_NULL STD { int linux_finit_module(l_int fd, \ + const char *uargs, l_int flags); } +274 AUE_NULL STD { int linux_sched_setattr(l_pid_t pid, \ + void *attr, l_uint flags); } +275 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \ + void *attr, l_uint size, l_uint flags); } +276 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ + const char *oldname, l_int newfd, \ + const char *newname, unsigned int flags); } +277 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ + const char *uargs); } +278 AUE_NULL STD { int linux_getrandom(char *buf, \ + l_size_t count, l_uint flags); } +279 AUE_NULL STD { int linux_memfd_create( \ + const char *uname_ptr, l_uint flags); } +280 AUE_NULL STD { int linux_bpf(l_int cmd, void *attr, \ + l_uint size); } +281 AUE_NULL STD { int linux_execveat(l_int dfd, \ + const char *filename, const char **argv, \ + const char **envp, l_int flags); } +282 AUE_NULL STD { int linux_userfaultfd(l_int flags); } +283 AUE_NULL STD { int linux_membarrier(l_int cmd, \ + l_int flags); } +284 AUE_NULL STD { int linux_mlock2(l_ulong start, \ + l_size_t len, l_int flags); } +285 AUE_NULL STD { int linux_copy_file_range(l_int fd_in, \ + l_loff_t *off_in, l_int fd_out, \ + l_loff_t *off_out, l_size_t len, \ + l_uint flags); } +286 AUE_NULL STD { int linux_preadv2(l_ulong fd, \ + const struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h, \ + l_int flags); } +287 AUE_NULL STD { int linux_pwritev2(l_ulong fd, \ + const struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h, \ + l_int flags); } +288 AUE_NULL STD { int linux_pkey_mprotect(l_ulong start, \ + l_size_t len, l_ulong prot, l_int pkey); } +289 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \ + l_ulong init_val); } +290 AUE_NULL STD { int linux_pkey_free(l_int pkey); } + +; please, keep this line at the end. +291 AUE_NULL UNIMPL nosys + +; vim: syntax=off From owner-svn-src-head@freebsd.org Thu Apr 26 18:46:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB900FB5355; Thu, 26 Apr 2018 18:46:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6854F8D0DE; Thu, 26 Apr 2018 18:46:39 +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 491191BE2F; Thu, 26 Apr 2018 18:46:39 +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 w3QIkd28035088; Thu, 26 Apr 2018 18:46:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QIkdw7035086; Thu, 26 Apr 2018 18:46:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804261846.w3QIkdw7035086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 26 Apr 2018 18:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333028 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 333028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 18:46:40 -0000 Author: emaste Date: Thu Apr 26 18:46:38 2018 New Revision: 333028 URL: https://svnweb.freebsd.org/changeset/base/333028 Log: arm64 linuxulator: add generated sysent files From syscalls.master in r333027 Sponsored by: Turing Robotic Industries Inc. Added: head/sys/arm64/linux/linux_proto.h (contents, props changed) head/sys/arm64/linux/linux_syscall.h (contents, props changed) head/sys/arm64/linux/linux_syscalls.c (contents, props changed) head/sys/arm64/linux/linux_sysent.c (contents, props changed) head/sys/arm64/linux/linux_systrace_args.c (contents, props changed) Added: head/sys/arm64/linux/linux_proto.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/linux_proto.h Thu Apr 26 18:46:38 2018 (r333028) @@ -0,0 +1,1553 @@ +/* + * System call prototypes. + * + * DO NOT EDIT-- this file is automatically generated. + * $FreeBSD$ + */ + +#ifndef _LINUX_SYSPROTO_H_ +#define _LINUX_SYSPROTO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct proc; + +struct thread; + +#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ + 0 : sizeof(register_t) - sizeof(t)) + +#if BYTE_ORDER == LITTLE_ENDIAN +#define PADL_(t) 0 +#define PADR_(t) PAD_(t) +#else +#define PADL_(t) PAD_(t) +#define PADR_(t) 0 +#endif + +#define nosys linux_nosys +struct linux_setxattr_args { + register_t dummy; +}; +struct linux_lsetxattr_args { + register_t dummy; +}; +struct linux_fsetxattr_args { + register_t dummy; +}; +struct linux_getxattr_args { + register_t dummy; +}; +struct linux_lgetxattr_args { + register_t dummy; +}; +struct linux_fgetxattr_args { + register_t dummy; +}; +struct linux_listxattr_args { + register_t dummy; +}; +struct linux_llistxattr_args { + register_t dummy; +}; +struct linux_flistxattr_args { + register_t dummy; +}; +struct linux_removexattr_args { + register_t dummy; +}; +struct linux_lremovexattr_args { + register_t dummy; +}; +struct linux_fremovexattr_args { + register_t dummy; +}; +struct linux_getcwd_args { + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)]; +}; +struct linux_lookup_dcookie_args { + register_t dummy; +}; +struct linux_eventfd2_args { + char initval_l_[PADL_(l_uint)]; l_uint initval; char initval_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_epoll_create1_args { + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_epoll_ctl_args { + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)]; +}; +struct linux_epoll_pwait_args { + char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; + char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; + char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; + char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_dup3_args { + char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_fcntl_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)]; +}; +struct linux_inotify_init1_args { + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_inotify_add_watch_args { + register_t dummy; +}; +struct linux_inotify_rm_watch_args { + register_t dummy; +}; +struct linux_ioctl_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(uintptr_t)]; uintptr_t arg; char arg_r_[PADR_(uintptr_t)]; +}; +struct linux_ioprio_set_args { + register_t dummy; +}; +struct linux_ioprio_get_args { + register_t dummy; +}; +struct linux_mknodat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char dev_l_[PADL_(l_uint)]; l_uint dev; char dev_r_[PADR_(l_uint)]; +}; +struct linux_mkdirat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_unlinkat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_symlinkat_args { + char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; + char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; +}; +struct linux_linkat_args { + char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)]; + char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; + char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_renameat_args { + char olddfd_l_[PADL_(l_int)]; l_int olddfd; char olddfd_r_[PADR_(l_int)]; + char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; + char newdfd_l_[PADL_(l_int)]; l_int newdfd; char newdfd_r_[PADR_(l_int)]; + char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; +}; +struct linux_mount_args { + char specialfile_l_[PADL_(char *)]; char * specialfile; char specialfile_r_[PADR_(char *)]; + char dir_l_[PADL_(char *)]; char * dir; char dir_r_[PADR_(char *)]; + char filesystemtype_l_[PADL_(char *)]; char * filesystemtype; char filesystemtype_r_[PADR_(char *)]; + char rwflag_l_[PADL_(l_ulong)]; l_ulong rwflag; char rwflag_r_[PADR_(l_ulong)]; + char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; +}; +struct linux_pivot_root_args { + register_t dummy; +}; +struct linux_statfs_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)]; +}; +struct linux_fstatfs_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)]; +}; +struct linux_truncate_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char length_l_[PADL_(l_ulong)]; l_ulong length; char length_r_[PADR_(l_ulong)]; +}; +struct linux_ftruncate_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char length_l_[PADL_(l_long)]; l_long length; char length_r_[PADR_(l_long)]; +}; +struct linux_fallocate_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; +}; +struct linux_faccessat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; +}; +struct linux_chdir_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; +}; +struct linux_fchmodat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)]; +}; +struct linux_fchownat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_openat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; +}; +struct linux_vhangup_args { + register_t dummy; +}; +struct linux_pipe2_args { + char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_getdents64_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char dirent_l_[PADL_(void *)]; void * dirent; char dirent_r_[PADR_(void *)]; + char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)]; +}; +struct linux_lseek_args { + char fdes_l_[PADL_(l_uint)]; l_uint fdes; char fdes_r_[PADR_(l_uint)]; + char off_l_[PADL_(l_off_t)]; l_off_t off; char off_r_[PADR_(l_off_t)]; + char whence_l_[PADL_(l_int)]; l_int whence; char whence_r_[PADR_(l_int)]; +}; +struct linux_pread_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; +}; +struct linux_pwrite_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; +}; +struct linux_preadv_args { + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char vec_l_[PADL_(struct iovec *)]; struct iovec * vec; char vec_r_[PADR_(struct iovec *)]; + char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)]; + char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)]; + char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)]; +}; +struct linux_pwritev_args { + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char vec_l_[PADL_(struct iovec *)]; struct iovec * vec; char vec_r_[PADR_(struct iovec *)]; + char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)]; + char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)]; + char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)]; +}; +struct linux_sendfile_args { + char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; + char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_long *)]; l_long * offset; char offset_r_[PADR_(l_long *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; +}; +struct linux_pselect6_args { + char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; + char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; + char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; + char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; +}; +struct linux_ppoll_args { + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; +}; +struct linux_signalfd4_args { + register_t dummy; +}; +struct linux_vmsplice_args { + register_t dummy; +}; +struct linux_splice_args { + register_t dummy; +}; +struct linux_tee_args { + register_t dummy; +}; +struct linux_readlinkat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char bufsiz_l_[PADL_(l_int)]; l_int bufsiz; char bufsiz_r_[PADR_(l_int)]; +}; +struct linux_newfstatat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(char *)]; char * pathname; char pathname_r_[PADR_(char *)]; + char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)]; + char flag_l_[PADL_(l_int)]; l_int flag; char flag_r_[PADR_(l_int)]; +}; +struct linux_newfstat_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; + char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; +}; +struct linux_fdatasync_args { + char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; +}; +struct linux_sync_file_range_args { + register_t dummy; +}; +struct linux_timerfd_create_args { + char clockid_l_[PADL_(l_int)]; l_int clockid; char clockid_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_timerfd_settime_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_value_l_[PADL_(const struct l_itimerspec *)]; const struct l_itimerspec * new_value; char new_value_r_[PADR_(const struct l_itimerspec *)]; + char old_value_l_[PADL_(struct l_itimerspec *)]; struct l_itimerspec * old_value; char old_value_r_[PADR_(struct l_itimerspec *)]; +}; +struct linux_timerfd_gettime_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char old_value_l_[PADL_(struct l_itimerspec *)]; struct l_itimerspec * old_value; char old_value_r_[PADR_(struct l_itimerspec *)]; +}; +struct linux_utimensat_args { + char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)]; + char pathname_l_[PADL_(const char *)]; const char * pathname; char pathname_r_[PADR_(const char *)]; + char times_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * times; char times_r_[PADR_(const struct l_timespec *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_capget_args { + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; +}; +struct linux_capset_args { + char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; + char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; +}; +struct linux_personality_args { + char per_l_[PADL_(l_uint)]; l_uint per; char per_r_[PADR_(l_uint)]; +}; +struct linux_exit_args { + char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)]; +}; +struct linux_exit_group_args { + char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; +}; +struct linux_waitid_args { + char idtype_l_[PADL_(l_int)]; l_int idtype; char idtype_r_[PADR_(l_int)]; + char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; + char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)]; + char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)]; +}; +struct linux_set_tid_address_args { + char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)]; +}; +struct linux_unshare_args { + register_t dummy; +}; +struct linux_sys_futex_args { + char uaddr_l_[PADL_(void *)]; void * uaddr; char uaddr_r_[PADR_(void *)]; + char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char val_l_[PADL_(int)]; int val; char val_r_[PADR_(int)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; + char uaddr2_l_[PADL_(void *)]; void * uaddr2; char uaddr2_r_[PADR_(void *)]; + char val3_l_[PADL_(int)]; int val3; char val3_r_[PADR_(int)]; +}; +struct linux_set_robust_list_args { + char head_l_[PADL_(struct linux_robust_list_head *)]; struct linux_robust_list_head * head; char head_r_[PADR_(struct linux_robust_list_head *)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; +}; +struct linux_get_robust_list_args { + char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; + char head_l_[PADL_(struct linux_robust_list_head **)]; struct linux_robust_list_head ** head; char head_r_[PADR_(struct linux_robust_list_head **)]; + char len_l_[PADL_(l_size_t *)]; l_size_t * len; char len_r_[PADR_(l_size_t *)]; +}; +struct linux_nanosleep_args { + char rqtp_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * rqtp; char rqtp_r_[PADR_(const struct l_timespec *)]; + char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_getitimer_args { + char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; + char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)]; +}; +struct linux_setitimer_args { + char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; + char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)]; + char oitv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * oitv; char oitv_r_[PADR_(struct l_itimerval *)]; +}; +struct linux_kexec_load_args { + register_t dummy; +}; +struct linux_init_module_args { + register_t dummy; +}; +struct linux_delete_module_args { + register_t dummy; +}; +struct linux_timer_create_args { + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char evp_l_[PADL_(struct sigevent *)]; struct sigevent * evp; char evp_r_[PADR_(struct sigevent *)]; + char timerid_l_[PADL_(l_timer_t *)]; l_timer_t * timerid; char timerid_r_[PADR_(l_timer_t *)]; +}; +struct linux_timer_gettime_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char setting_l_[PADL_(struct itimerspec *)]; struct itimerspec * setting; char setting_r_[PADR_(struct itimerspec *)]; +}; +struct linux_timer_getoverrun_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; +}; +struct linux_timer_settime_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; + char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; +}; +struct linux_timer_delete_args { + char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; +}; +struct linux_clock_settime_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_gettime_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_getres_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_clock_nanosleep_args { + char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char rqtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rqtp; char rqtp_r_[PADR_(struct l_timespec *)]; + char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; +}; +struct linux_syslog_args { + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; +}; +struct linux_ptrace_args { + char req_l_[PADL_(l_long)]; l_long req; char req_r_[PADR_(l_long)]; + char pid_l_[PADL_(l_long)]; l_long pid; char pid_r_[PADR_(l_long)]; + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char data_l_[PADL_(l_ulong)]; l_ulong data; char data_r_[PADR_(l_ulong)]; +}; +struct linux_sched_setparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; +}; +struct linux_sched_setscheduler_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; +}; +struct linux_sched_getscheduler_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; +}; +struct linux_sched_getparam_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; +}; +struct linux_sched_setaffinity_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; + char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; +}; +struct linux_sched_getaffinity_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; + char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; +}; +struct linux_sched_get_priority_max_args { + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; +}; +struct linux_sched_get_priority_min_args { + char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; +}; +struct linux_sched_rr_get_interval_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char interval_l_[PADL_(struct l_timespec *)]; struct l_timespec * interval; char interval_r_[PADR_(struct l_timespec *)]; +}; +struct linux_kill_args { + char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; + char signum_l_[PADL_(l_int)]; l_int signum; char signum_r_[PADR_(l_int)]; +}; +struct linux_tkill_args { + char tid_l_[PADL_(l_int)]; l_int tid; char tid_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; +}; +struct linux_tgkill_args { + char tgid_l_[PADL_(l_int)]; l_int tgid; char tgid_r_[PADR_(l_int)]; + char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; +}; +struct linux_sigaltstack_args { + char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)]; + char uoss_l_[PADL_(l_stack_t *)]; l_stack_t * uoss; char uoss_r_[PADR_(l_stack_t *)]; +}; +struct linux_rt_sigsuspend_args { + char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigaction_args { + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char act_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * act; char act_r_[PADR_(l_sigaction_t *)]; + char oact_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * oact; char oact_r_[PADR_(l_sigaction_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigprocmask_args { + char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char omask_l_[PADL_(l_sigset_t *)]; l_sigset_t * omask; char omask_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigpending_args { + char set_l_[PADL_(l_sigset_t *)]; l_sigset_t * set; char set_r_[PADR_(l_sigset_t *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigtimedwait_args { + char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; + char ptr_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * ptr; char ptr_r_[PADR_(l_siginfo_t *)]; + char timeout_l_[PADL_(struct l_timeval *)]; struct l_timeval * timeout; char timeout_r_[PADR_(struct l_timeval *)]; + char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; +}; +struct linux_rt_sigqueueinfo_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; +}; +struct linux_rt_sigreturn_args { + char ucp_l_[PADL_(struct l_ucontext *)]; struct l_ucontext * ucp; char ucp_r_[PADR_(struct l_ucontext *)]; +}; +struct linux_getpriority_args { + char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; + char who_l_[PADL_(l_int)]; l_int who; char who_r_[PADR_(l_int)]; +}; +struct linux_reboot_args { + char magic1_l_[PADL_(l_int)]; l_int magic1; char magic1_r_[PADR_(l_int)]; + char magic2_l_[PADL_(l_int)]; l_int magic2; char magic2_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; + char arg_l_[PADL_(void *)]; void * arg; char arg_r_[PADR_(void *)]; +}; +struct linux_setfsuid_args { + char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; +}; +struct linux_setfsgid_args { + char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; +}; +struct linux_times_args { + char buf_l_[PADL_(struct l_times_argv *)]; struct l_times_argv * buf; char buf_r_[PADR_(struct l_times_argv *)]; +}; +struct linux_getsid_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; +}; +struct linux_getgroups_args { + char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)]; + char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)]; +}; +struct linux_setgroups_args { + char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)]; + char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)]; +}; +struct linux_newuname_args { + char buf_l_[PADL_(struct l_new_utsname *)]; struct l_new_utsname * buf; char buf_r_[PADR_(struct l_new_utsname *)]; +}; +struct linux_sethostname_args { + char hostname_l_[PADL_(char *)]; char * hostname; char hostname_r_[PADR_(char *)]; + char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; +}; +struct linux_setdomainname_args { + char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; +}; +struct linux_getrlimit_args { + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)]; +}; +struct linux_setrlimit_args { + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)]; +}; +struct linux_prctl_args { + char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; + char arg2_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg2; char arg2_r_[PADR_(l_uintptr_t)]; + char arg3_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg3; char arg3_r_[PADR_(l_uintptr_t)]; + char arg4_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg4; char arg4_r_[PADR_(l_uintptr_t)]; + char arg5_l_[PADL_(l_uintptr_t)]; l_uintptr_t arg5; char arg5_r_[PADR_(l_uintptr_t)]; +}; +struct linux_getcpu_args { + char cpu_l_[PADL_(l_uint *)]; l_uint * cpu; char cpu_r_[PADR_(l_uint *)]; + char node_l_[PADL_(l_uint *)]; l_uint * node; char node_r_[PADR_(l_uint *)]; + char cache_l_[PADL_(void *)]; void * cache; char cache_r_[PADR_(void *)]; +}; +struct linux_adjtimex_args { + register_t dummy; +}; +struct linux_getpid_args { + register_t dummy; +}; +struct linux_getppid_args { + register_t dummy; +}; +struct linux_getuid_args { + register_t dummy; +}; +struct linux_getgid_args { + register_t dummy; +}; +struct linux_gettid_args { + register_t dummy; +}; +struct linux_sysinfo_args { + char info_l_[PADL_(struct l_sysinfo *)]; struct l_sysinfo * info; char info_r_[PADR_(struct l_sysinfo *)]; +}; +struct linux_mq_open_args { + register_t dummy; +}; +struct linux_mq_unlink_args { + register_t dummy; +}; +struct linux_mq_timedsend_args { + register_t dummy; +}; +struct linux_mq_timedreceive_args { + register_t dummy; +}; +struct linux_mq_notify_args { + register_t dummy; +}; +struct linux_mq_getsetattr_args { + register_t dummy; +}; +struct linux_msgget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgctl_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_msqid_ds *)]; struct l_msqid_ds * buf; char buf_r_[PADR_(struct l_msqid_ds *)]; +}; +struct linux_msgrcv_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgtyp_l_[PADL_(l_long)]; l_long msgtyp; char msgtyp_r_[PADR_(l_long)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_msgsnd_args { + char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; + char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; + char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; + char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; +}; +struct linux_semget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char nsems_l_[PADL_(l_int)]; l_int nsems; char nsems_r_[PADR_(l_int)]; + char semflg_l_[PADL_(l_int)]; l_int semflg; char semflg_r_[PADR_(l_int)]; +}; +struct linux_semctl_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char semnum_l_[PADL_(l_int)]; l_int semnum; char semnum_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char arg_l_[PADL_(union l_semun)]; union l_semun arg; char arg_r_[PADR_(union l_semun)]; +}; +struct linux_semtimedop_args { + register_t dummy; +}; +struct linux_semop_args { + char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; + char tsops_l_[PADL_(struct l_sembuf *)]; struct l_sembuf * tsops; char tsops_r_[PADR_(struct l_sembuf *)]; + char nsops_l_[PADL_(l_uint)]; l_uint nsops; char nsops_r_[PADR_(l_uint)]; +}; +struct linux_shmget_args { + char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; + char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmctl_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char buf_l_[PADL_(struct l_shmid_ds *)]; struct l_shmid_ds * buf; char buf_r_[PADR_(struct l_shmid_ds *)]; +}; +struct linux_shmat_args { + char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; + char shmflg_l_[PADL_(l_int)]; l_int shmflg; char shmflg_r_[PADR_(l_int)]; +}; +struct linux_shmdt_args { + char shmaddr_l_[PADL_(char *)]; char * shmaddr; char shmaddr_r_[PADR_(char *)]; +}; +struct linux_socket_args { + char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)]; + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)]; +}; +struct linux_socketpair_args { + char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)]; + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)]; + char rsv_l_[PADL_(l_uintptr_t)]; l_uintptr_t rsv; char rsv_r_[PADR_(l_uintptr_t)]; +}; +struct linux_bind_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)]; +}; +struct linux_listen_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char backlog_l_[PADL_(l_int)]; l_int backlog; char backlog_r_[PADR_(l_int)]; +}; +struct linux_accept_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_connect_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)]; +}; +struct linux_getsockname_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_getpeername_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_sendto_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char to_l_[PADL_(l_uintptr_t)]; l_uintptr_t to; char to_r_[PADR_(l_uintptr_t)]; + char tolen_l_[PADL_(l_int)]; l_int tolen; char tolen_r_[PADR_(l_int)]; +}; +struct linux_recvfrom_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char buf_l_[PADL_(l_uintptr_t)]; l_uintptr_t buf; char buf_r_[PADR_(l_uintptr_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char from_l_[PADL_(l_uintptr_t)]; l_uintptr_t from; char from_r_[PADR_(l_uintptr_t)]; + char fromlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t fromlen; char fromlen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_setsockopt_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)]; + char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)]; + char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)]; + char optlen_l_[PADL_(l_int)]; l_int optlen; char optlen_r_[PADR_(l_int)]; +}; +struct linux_getsockopt_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)]; + char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)]; + char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)]; + char optlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t optlen; char optlen_r_[PADR_(l_uintptr_t)]; +}; +struct linux_shutdown_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; +}; +struct linux_sendmsg_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_recvmsg_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_brk_args { + char dsend_l_[PADL_(l_ulong)]; l_ulong dsend; char dsend_r_[PADR_(l_ulong)]; +}; +struct linux_mremap_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char old_len_l_[PADL_(l_ulong)]; l_ulong old_len; char old_len_r_[PADR_(l_ulong)]; + char new_len_l_[PADL_(l_ulong)]; l_ulong new_len; char new_len_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; + char new_addr_l_[PADL_(l_ulong)]; l_ulong new_addr; char new_addr_r_[PADR_(l_ulong)]; +}; +struct linux_add_key_args { + register_t dummy; +}; +struct linux_request_key_args { + register_t dummy; +}; +struct linux_keyctl_args { + register_t dummy; +}; +struct linux_clone_args { + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; + char stack_l_[PADL_(void *)]; void * stack; char stack_r_[PADR_(void *)]; + char parent_tidptr_l_[PADL_(void *)]; void * parent_tidptr; char parent_tidptr_r_[PADR_(void *)]; + char child_tidptr_l_[PADL_(void *)]; void * child_tidptr; char child_tidptr_r_[PADR_(void *)]; + char tls_l_[PADL_(void *)]; void * tls; char tls_r_[PADR_(void *)]; +}; +struct linux_execve_args { + char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; + char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)]; + char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)]; +}; +struct linux_mmap2_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_ulong)]; l_ulong len; char len_r_[PADR_(l_ulong)]; + char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; + char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; + char pgoff_l_[PADL_(l_ulong)]; l_ulong pgoff; char pgoff_r_[PADR_(l_ulong)]; +}; +struct linux_fadvise64_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char advice_l_[PADL_(l_int)]; l_int advice; char advice_r_[PADR_(l_int)]; +}; +struct linux_swapoff_args { + register_t dummy; +}; +struct linux_mprotect_args { + char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; + char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; + char prot_l_[PADL_(l_int)]; l_int prot; char prot_r_[PADR_(l_int)]; +}; +struct linux_msync_args { + char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char fl_l_[PADL_(l_int)]; l_int fl; char fl_r_[PADR_(l_int)]; +}; +struct linux_mincore_args { + char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)]; + char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; + char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; +}; +struct linux_remap_file_pages_args { + register_t dummy; +}; +struct linux_mbind_args { + register_t dummy; +}; +struct linux_get_mempolicy_args { + register_t dummy; +}; +struct linux_set_mempolicy_args { + register_t dummy; +}; +struct linux_migrate_pages_args { + register_t dummy; +}; +struct linux_move_pages_args { + register_t dummy; +}; +struct linux_rt_tgsigqueueinfo_args { + char tgid_l_[PADL_(l_pid_t)]; l_pid_t tgid; char tgid_r_[PADR_(l_pid_t)]; + char tid_l_[PADL_(l_pid_t)]; l_pid_t tid; char tid_r_[PADR_(l_pid_t)]; + char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; + char uinfo_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * uinfo; char uinfo_r_[PADR_(l_siginfo_t *)]; +}; +struct linux_perf_event_open_args { + register_t dummy; +}; +struct linux_accept4_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; + char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; +struct linux_recvmmsg_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)]; + char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; +}; +struct linux_wait4_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char status_l_[PADL_(l_int *)]; l_int * status; char status_r_[PADR_(l_int *)]; + char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)]; + char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)]; +}; +struct linux_prlimit64_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; + char new_l_[PADL_(struct rlimit *)]; struct rlimit * new; char new_r_[PADR_(struct rlimit *)]; + char old_l_[PADL_(struct rlimit *)]; struct rlimit * old; char old_r_[PADR_(struct rlimit *)]; +}; +struct linux_fanotify_init_args { + register_t dummy; +}; +struct linux_fanotify_mark_args { + register_t dummy; +}; +struct linux_name_to_handle_at_args { + register_t dummy; +}; +struct linux_open_by_handle_at_args { + register_t dummy; +}; +struct linux_clock_adjtime_args { + register_t dummy; +}; +struct linux_syncfs_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; +}; +struct linux_setns_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char nstype_l_[PADL_(l_int)]; l_int nstype; char nstype_r_[PADR_(l_int)]; +}; +struct linux_sendmmsg_args { + char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; + char msg_l_[PADL_(struct l_mmsghdr *)]; struct l_mmsghdr * msg; char msg_r_[PADR_(struct l_mmsghdr *)]; + char vlen_l_[PADL_(l_uint)]; l_uint vlen; char vlen_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_process_vm_readv_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char lvec_l_[PADL_(const struct iovec *)]; const struct iovec * lvec; char lvec_r_[PADR_(const struct iovec *)]; + char liovcnt_l_[PADL_(l_ulong)]; l_ulong liovcnt; char liovcnt_r_[PADR_(l_ulong)]; + char rvec_l_[PADL_(const struct iovec *)]; const struct iovec * rvec; char rvec_r_[PADR_(const struct iovec *)]; + char riovcnt_l_[PADL_(l_ulong)]; l_ulong riovcnt; char riovcnt_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; +}; +struct linux_process_vm_writev_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char lvec_l_[PADL_(const struct iovec *)]; const struct iovec * lvec; char lvec_r_[PADR_(const struct iovec *)]; + char liovcnt_l_[PADL_(l_ulong)]; l_ulong liovcnt; char liovcnt_r_[PADR_(l_ulong)]; + char rvec_l_[PADL_(const struct iovec *)]; const struct iovec * rvec; char rvec_r_[PADR_(const struct iovec *)]; + char riovcnt_l_[PADL_(l_ulong)]; l_ulong riovcnt; char riovcnt_r_[PADR_(l_ulong)]; + char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; +}; +struct linux_kcmp_args { + char pid1_l_[PADL_(l_pid_t)]; l_pid_t pid1; char pid1_r_[PADR_(l_pid_t)]; + char pid2_l_[PADL_(l_pid_t)]; l_pid_t pid2; char pid2_r_[PADR_(l_pid_t)]; + char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; + char idx1_l_[PADL_(l_ulong)]; l_ulong idx1; char idx1_r_[PADR_(l_ulong)]; + char idx_l_[PADL_(l_ulong)]; l_ulong idx; char idx_r_[PADR_(l_ulong)]; +}; +struct linux_finit_module_args { + char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; + char uargs_l_[PADL_(const char *)]; const char * uargs; char uargs_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; +}; +struct linux_sched_setattr_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_sched_getattr_args { + char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; + char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)]; + char size_l_[PADL_(l_uint)]; l_uint size; char size_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_renameat2_args { + char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)]; + char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)]; + char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)]; + char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)]; + char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)]; +}; +struct linux_seccomp_args { + char op_l_[PADL_(l_uint)]; l_uint op; char op_r_[PADR_(l_uint)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; + char uargs_l_[PADL_(const char *)]; const char * uargs; char uargs_r_[PADR_(const char *)]; +}; +struct linux_getrandom_args { + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_memfd_create_args { + char uname_ptr_l_[PADL_(const char *)]; const char * uname_ptr; char uname_ptr_r_[PADR_(const char *)]; + char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)]; +}; +struct linux_bpf_args { + char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; + char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)]; + char size_l_[PADL_(l_uint)]; l_uint size; char size_r_[PADR_(l_uint)]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Apr 26 18:54:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA7EFFB58C4; Thu, 26 Apr 2018 18:54:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 689ED8F7D8; Thu, 26 Apr 2018 18:54:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 637DF1BFCF; Thu, 26 Apr 2018 18:54:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QIs1vm042412; Thu, 26 Apr 2018 18:54:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QIs13N042409; Thu, 26 Apr 2018 18:54:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804261854.w3QIs13N042409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 26 Apr 2018 18:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333029 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 333029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 18:54:02 -0000 Author: emaste Date: Thu Apr 26 18:54:00 2018 New Revision: 333029 URL: https://svnweb.freebsd.org/changeset/base/333029 Log: libsysdecode: support errno and syscalls for arm64 Linux Sponsored by: Turing Robotic Industries Inc. Modified: head/lib/libsysdecode/errno.c head/lib/libsysdecode/syscallnames.c head/lib/libsysdecode/sysdecode.3 Modified: head/lib/libsysdecode/errno.c ============================================================================== --- head/lib/libsysdecode/errno.c Thu Apr 26 18:46:38 2018 (r333028) +++ head/lib/libsysdecode/errno.c Thu Apr 26 18:54:00 2018 (r333029) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__i386__) || defined(__amd64__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) static #include #endif @@ -130,7 +130,7 @@ sysdecode_abi_to_freebsd_errno(enum sysdecode_abi abi, case SYSDECODE_ABI_FREEBSD: case SYSDECODE_ABI_FREEBSD32: return (error); -#if defined(__i386__) || defined(__amd64__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) case SYSDECODE_ABI_LINUX: case SYSDECODE_ABI_LINUX32: { unsigned int i; @@ -166,7 +166,7 @@ sysdecode_freebsd_to_abi_errno(enum sysdecode_abi abi, case SYSDECODE_ABI_FREEBSD: case SYSDECODE_ABI_FREEBSD32: return (error); -#if defined(__i386__) || defined(__amd64__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) case SYSDECODE_ABI_LINUX: case SYSDECODE_ABI_LINUX32: if (error >= 0 && error <= ELAST) Modified: head/lib/libsysdecode/syscallnames.c ============================================================================== --- head/lib/libsysdecode/syscallnames.c Thu Apr 26 18:46:38 2018 (r333028) +++ head/lib/libsysdecode/syscallnames.c Thu Apr 26 18:54:00 2018 (r333029) @@ -49,9 +49,11 @@ static #include #endif -#if defined(__amd64__) || defined(__i386__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) static -#ifdef __amd64__ +#ifdef __aarch64__ +#include +#elif __amd64__ #include #else #include @@ -83,7 +85,7 @@ sysdecode_syscallname(enum sysdecode_abi abi, unsigned return (freebsd32_syscallnames[code]); break; #endif -#if defined(__amd64__) || defined(__i386__) +#if defined(__aarch64__) || defined(__amd64__) || defined(__i386__) case SYSDECODE_ABI_LINUX: if (code < nitems(linux_syscallnames)) return (linux_syscallnames[code]); Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Thu Apr 26 18:46:38 2018 (r333028) +++ head/lib/libsysdecode/sysdecode.3 Thu Apr 26 18:54:00 2018 (r333029) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2018 +.Dd April 26, 2018 .Dt SYSDECODE 3 .Os .Sh NAME @@ -57,7 +57,7 @@ Supported on all platforms. Supported on amd64 and powerpc64. .It Li SYSDECODE_ABI_LINUX Linux binaries of the same platform. -Supported on amd64 and i386. +Supported on amd64, i386, and arm64. .It Li SYSDECODE_ABI_LINUX32 32-bit Linux binaries. Supported on amd64. From owner-svn-src-head@freebsd.org Thu Apr 26 19:00:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C292FB5D5E; Thu, 26 Apr 2018 19:00:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F57D8FC6F; Thu, 26 Apr 2018 19:00:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 082CA1BFDA; Thu, 26 Apr 2018 19:00:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QJ0ZC6042846; Thu, 26 Apr 2018 19:00:35 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QJ0Z9i042842; Thu, 26 Apr 2018 19:00:35 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804261900.w3QJ0Z9i042842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 26 Apr 2018 19:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333030 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 333030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 19:00:36 -0000 Author: np Date: Thu Apr 26 19:00:35 2018 New Revision: 333030 URL: https://svnweb.freebsd.org/changeset/base/333030 Log: cxgbe(4): Break up alloc_tid_tabs and move the atid routines to the base NIC driver. The atid services will be used by new features (hashfilters and inline TLS) that do not involve TOE. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Apr 26 18:54:00 2018 (r333029) +++ head/sys/dev/cxgbe/adapter.h Thu Apr 26 19:00:35 2018 (r333030) @@ -1164,6 +1164,11 @@ int vi_full_uninit(struct vi_info *); void vi_sysctls(struct vi_info *); void vi_tick(void *); int rw_via_memwin(struct adapter *, int, uint32_t, uint32_t *, int, int); +int alloc_atid_tab(struct tid_info *, int); +void free_atid_tab(struct tid_info *); +int alloc_atid(struct adapter *, void *); +void *lookup_atid(struct adapter *, int); +void free_atid(struct adapter *, int); #ifdef DEV_NETMAP /* t4_netmap.c */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Apr 26 18:54:00 2018 (r333029) +++ head/sys/dev/cxgbe/t4_main.c Thu Apr 26 19:00:35 2018 (r333030) @@ -2460,6 +2460,81 @@ rw_via_memwin(struct adapter *sc, int idx, uint32_t ad return (0); } +int +alloc_atid_tab(struct tid_info *t, int flags) +{ + int i; + + MPASS(t->natids > 0); + MPASS(t->atid_tab == NULL); + + t->atid_tab = malloc(t->natids * sizeof(*t->atid_tab), M_CXGBE, + M_ZERO | flags); + if (t->atid_tab == NULL) + return (ENOMEM); + mtx_init(&t->atid_lock, "atid lock", NULL, MTX_DEF); + t->afree = t->atid_tab; + t->atids_in_use = 0; + for (i = 1; i < t->natids; i++) + t->atid_tab[i - 1].next = &t->atid_tab[i]; + t->atid_tab[t->natids - 1].next = NULL; + + return (0); +} + +void +free_atid_tab(struct tid_info *t) +{ + + KASSERT(t->atids_in_use == 0, + ("%s: %d atids still in use.", __func__, t->atids_in_use)); + + if (mtx_initialized(&t->atid_lock)) + mtx_destroy(&t->atid_lock); + free(t->atid_tab, M_CXGBE); + t->atid_tab = NULL; +} + +int +alloc_atid(struct adapter *sc, void *ctx) +{ + struct tid_info *t = &sc->tids; + int atid = -1; + + mtx_lock(&t->atid_lock); + if (t->afree) { + union aopen_entry *p = t->afree; + + atid = p - t->atid_tab; + t->afree = p->next; + p->data = ctx; + t->atids_in_use++; + } + mtx_unlock(&t->atid_lock); + return (atid); +} + +void * +lookup_atid(struct adapter *sc, int atid) +{ + struct tid_info *t = &sc->tids; + + return (t->atid_tab[atid].data); +} + +void +free_atid(struct adapter *sc, int atid) +{ + struct tid_info *t = &sc->tids; + union aopen_entry *p = &t->atid_tab[atid]; + + mtx_lock(&t->atid_lock); + p->next = t->afree; + t->afree = p; + t->atids_in_use--; + mtx_unlock(&t->atid_lock); +} + static int t4_range_cmp(const void *a, const void *b) { Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Apr 26 18:54:00 2018 (r333029) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Apr 26 19:00:35 2018 (r333030) @@ -65,51 +65,6 @@ __FBSDID("$FreeBSD$"); #include "tom/t4_tom_l2t.h" #include "tom/t4_tom.h" -/* atid services */ -static int alloc_atid(struct adapter *, void *); -static void *lookup_atid(struct adapter *, int); -static void free_atid(struct adapter *, int); - -static int -alloc_atid(struct adapter *sc, void *ctx) -{ - struct tid_info *t = &sc->tids; - int atid = -1; - - mtx_lock(&t->atid_lock); - if (t->afree) { - union aopen_entry *p = t->afree; - - atid = p - t->atid_tab; - t->afree = p->next; - p->data = ctx; - t->atids_in_use++; - } - mtx_unlock(&t->atid_lock); - return (atid); -} - -static void * -lookup_atid(struct adapter *sc, int atid) -{ - struct tid_info *t = &sc->tids; - - return (t->atid_tab[atid].data); -} - -static void -free_atid(struct adapter *sc, int atid) -{ - struct tid_info *t = &sc->tids; - union aopen_entry *p = &t->atid_tab[atid]; - - mtx_lock(&t->atid_lock); - p->next = t->afree; - t->afree = p; - t->atids_in_use--; - mtx_unlock(&t->atid_lock); -} - /* * Active open succeeded. */ Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 26 18:54:00 2018 (r333029) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 26 19:00:35 2018 (r333030) @@ -754,55 +754,94 @@ negative_advice(int status) } static int -alloc_tid_tabs(struct tid_info *t) +alloc_tid_tab(struct tid_info *t, int flags) { - size_t size; - unsigned int i; - size = t->ntids * sizeof(*t->tid_tab) + - t->natids * sizeof(*t->atid_tab) + - t->nstids * sizeof(*t->stid_tab); + MPASS(t->ntids > 0); + MPASS(t->tid_tab == NULL); - t->tid_tab = malloc(size, M_CXGBE, M_ZERO | M_NOWAIT); + t->tid_tab = malloc(t->ntids * sizeof(*t->tid_tab), M_CXGBE, + M_ZERO | flags); if (t->tid_tab == NULL) return (ENOMEM); + atomic_store_rel_int(&t->tids_in_use, 0); - mtx_init(&t->atid_lock, "atid lock", NULL, MTX_DEF); - t->atid_tab = (union aopen_entry *)&t->tid_tab[t->ntids]; - t->afree = t->atid_tab; - t->atids_in_use = 0; - for (i = 1; i < t->natids; i++) - t->atid_tab[i - 1].next = &t->atid_tab[i]; - t->atid_tab[t->natids - 1].next = NULL; + return (0); +} +static void +free_tid_tab(struct tid_info *t) +{ + + KASSERT(t->tids_in_use == 0, + ("%s: %d tids still in use.", __func__, t->tids_in_use)); + + free(t->tid_tab, M_CXGBE); + t->tid_tab = NULL; +} + +static int +alloc_stid_tab(struct tid_info *t, int flags) +{ + + MPASS(t->nstids > 0); + MPASS(t->stid_tab == NULL); + + t->stid_tab = malloc(t->nstids * sizeof(*t->stid_tab), M_CXGBE, + M_ZERO | flags); + if (t->stid_tab == NULL) + return (ENOMEM); mtx_init(&t->stid_lock, "stid lock", NULL, MTX_DEF); - t->stid_tab = (struct listen_ctx **)&t->atid_tab[t->natids]; t->stids_in_use = 0; TAILQ_INIT(&t->stids); t->nstids_free_head = t->nstids; - atomic_store_rel_int(&t->tids_in_use, 0); - return (0); } static void -free_tid_tabs(struct tid_info *t) +free_stid_tab(struct tid_info *t) { - KASSERT(t->tids_in_use == 0, - ("%s: %d tids still in use.", __func__, t->tids_in_use)); - KASSERT(t->atids_in_use == 0, - ("%s: %d atids still in use.", __func__, t->atids_in_use)); + KASSERT(t->stids_in_use == 0, ("%s: %d tids still in use.", __func__, t->stids_in_use)); - free(t->tid_tab, M_CXGBE); - t->tid_tab = NULL; - - if (mtx_initialized(&t->atid_lock)) - mtx_destroy(&t->atid_lock); if (mtx_initialized(&t->stid_lock)) mtx_destroy(&t->stid_lock); + free(t->stid_tab, M_CXGBE); + t->stid_tab = NULL; +} + +static void +free_tid_tabs(struct tid_info *t) +{ + + free_tid_tab(t); + free_atid_tab(t); + free_stid_tab(t); +} + +static int +alloc_tid_tabs(struct tid_info *t) +{ + int rc; + + rc = alloc_tid_tab(t, M_NOWAIT); + if (rc != 0) + goto failed; + + rc = alloc_atid_tab(t, M_NOWAIT); + if (rc != 0) + goto failed; + + rc = alloc_stid_tab(t, M_NOWAIT); + if (rc != 0) + goto failed; + + return (0); +failed: + free_tid_tabs(t); + return (rc); } static int From owner-svn-src-head@freebsd.org Thu Apr 26 19:00:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1814FB5D82; Thu, 26 Apr 2018 19:00: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7EC8FEF9; Thu, 26 Apr 2018 19:00: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 882561BFEC; Thu, 26 Apr 2018 19:00: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 w3QJ0nQU042906; Thu, 26 Apr 2018 19:00:49 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QJ0mpv042898; Thu, 26 Apr 2018 19:00:48 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804261900.w3QJ0mpv042898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 26 Apr 2018 19:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333031 - in head/sys: arm/mv dts dts/arm X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: arm/mv dts dts/arm X-SVN-Commit-Revision: 333031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 19:00:50 -0000 Author: mw Date: Thu Apr 26 19:00:48 2018 New Revision: 333031 URL: https://svnweb.freebsd.org/changeset/base/333031 Log: Update mv_gpio driver to new FreeBSD API This patch implements and exports functions described in gpio_if.m file. It also uses new gpiobus_attach_bus function instead of adding gpioc and gpiobus as children. It removes ulgy reading SoC ID and related if..else, so it depends only on data read from FDT. Submitted by: Patryk Duda Reviewed by: manu Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14756 Modified: head/sys/arm/mv/gpio.c head/sys/dts/arm/db78100.dts head/sys/dts/arm/db88f5182.dts head/sys/dts/arm/db88f5281.dts head/sys/dts/arm/db88f6281.dts head/sys/dts/arm/dockstar.dts head/sys/dts/arm/sheevaplug.dts head/sys/dts/bindings-gpio.txt Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Thu Apr 26 19:00:35 2018 (r333030) +++ head/sys/arm/mv/gpio.c Thu Apr 26 19:00:48 2018 (r333031) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -58,8 +59,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include "gpio_if.h" + #define GPIO_MAX_INTR_COUNT 8 #define GPIO_PINS_PER_REG 32 +#define GPIO_GENERIC_CAP (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | \ + GPIO_PIN_OPENDRAIN | GPIO_PIN_PUSHPULL | \ + GPIO_PIN_TRISTATE | GPIO_PIN_PULLUP | \ + GPIO_PIN_PULLDOWN | GPIO_PIN_INVIN | \ + GPIO_PIN_INVOUT) #define DEBOUNCE_CHECK_MS 1 #define DEBOUNCE_LO_HI_MS 2 @@ -67,6 +75,7 @@ __FBSDID("$FreeBSD$"); #define DEBOUNCE_CHECK_TICKS ((hz / 1000) * DEBOUNCE_CHECK_MS) struct mv_gpio_softc { + device_t sc_busdev; struct resource * mem_res; int mem_rid; struct resource * irq_res[GPIO_MAX_INTR_COUNT]; @@ -134,6 +143,19 @@ int mv_gpio_configure(device_t, uint32_t, uint32_t, ui void mv_gpio_out(device_t, uint32_t, uint8_t, uint8_t); uint8_t mv_gpio_in(device_t, uint32_t); +/* + * GPIO interface + */ +static device_t mv_gpio_get_bus(device_t); +static int mv_gpio_pin_max(device_t, int *); +static int mv_gpio_pin_getcaps(device_t, uint32_t, uint32_t *); +static int mv_gpio_pin_getflags(device_t, uint32_t, uint32_t *); +static int mv_gpio_pin_getname(device_t, uint32_t, char *); +static int mv_gpio_pin_setflags(device_t, uint32_t, uint32_t); +static int mv_gpio_pin_set(device_t, uint32_t, unsigned int); +static int mv_gpio_pin_get(device_t, uint32_t, unsigned int *); +static int mv_gpio_pin_toggle(device_t, uint32_t); + #define MV_GPIO_LOCK() mtx_lock_spin(&sc->mutex) #define MV_GPIO_UNLOCK() mtx_unlock_spin(&sc->mutex) #define MV_GPIO_ASSERT_LOCKED() mtx_assert(&sc->mutex, MA_OWNED) @@ -141,7 +163,19 @@ uint8_t mv_gpio_in(device_t, uint32_t); static device_method_t mv_gpio_methods[] = { DEVMETHOD(device_probe, mv_gpio_probe), DEVMETHOD(device_attach, mv_gpio_attach), - { 0, 0 } + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, mv_gpio_get_bus), + DEVMETHOD(gpio_pin_max, mv_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, mv_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, mv_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, mv_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, mv_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, mv_gpio_pin_get), + DEVMETHOD(gpio_pin_set, mv_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, mv_gpio_pin_toggle), + + DEVMETHOD_END }; static driver_t mv_gpio_driver = { @@ -152,31 +186,23 @@ static driver_t mv_gpio_driver = { static devclass_t mv_gpio_devclass; -DRIVER_MODULE(gpio, simplebus, mv_gpio_driver, mv_gpio_devclass, 0, 0); +DRIVER_MODULE(mv_gpio, simplebus, mv_gpio_driver, mv_gpio_devclass, 0, 0); -typedef int (*gpios_phandler_t)(device_t, phandle_t, pcell_t *, int); - -struct gpio_ctrl_entry { - const char *compat; - gpios_phandler_t handler; -}; - static int mv_handle_gpios_prop(device_t, phandle_t, pcell_t *, int); -int gpio_get_config_from_dt(void); -struct gpio_ctrl_entry gpio_controllers[] = { - { "mrvl,gpio", &mv_handle_gpios_prop }, - { NULL, NULL } +struct ofw_compat_data gpio_controllers[] = { + { "mrvl,gpio", (uintptr_t)&mv_handle_gpios_prop }, + { "marvell,orion-gpio", (uintptr_t)&mv_handle_gpios_prop }, + { NULL, 0 } }; static int mv_gpio_probe(device_t dev) { - if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "mrvl,gpio")) + if (ofw_bus_search_compatible(dev, gpio_controllers)->ocd_data == 0) return (ENXIO); device_set_desc(dev, "Marvell Integrated GPIO Controller"); @@ -188,7 +214,6 @@ mv_gpio_attach(device_t dev) { int error, i, size; struct mv_gpio_softc *sc; - uint32_t dev_id, rev_id; pcell_t pincnt = 0; pcell_t irq_cells = 0; phandle_t iparent; @@ -197,34 +222,22 @@ mv_gpio_attach(device_t dev) if (sc == NULL) return (ENXIO); - /* Get chip id and revision */ - soc_id(&dev_id, &rev_id); - - if (dev_id == MV_DEV_88F5182 || - dev_id == MV_DEV_88F5281 || - dev_id == MV_DEV_MV78100 || - dev_id == MV_DEV_MV78100_Z0 ) { - sc->pin_num = 32; - sc->irq_num = 4; - - } else if (dev_id == MV_DEV_88F6281 || - dev_id == MV_DEV_88F6282) { - sc->pin_num = 50; - sc->irq_num = 7; - - } else { - 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 = pincnt; + 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 entry found!\n"); - return (ENXIO); - } + } 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)); if (iparent == 0) { @@ -315,8 +328,13 @@ mv_gpio_attach(device_t dev) /* Clear interrupt status. */ bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_CAUSE, 0); - device_add_child(dev, "gpioc", device_get_unit(dev)); - device_add_child(dev, "gpiobus", device_get_unit(dev)); + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) { + mtx_destroy(&sc->mutex); + bus_release_resource(dev, SYS_RES_IRQ, + sc->irq_rid[i], sc->irq_res[i]); + return (ENXIO); + } return (0); } @@ -535,6 +553,16 @@ mv_gpio_configure(device_t dev, uint32_t pin, uint32_t MV_GPIO_LOCK(); + if ((mask & flags) & GPIO_PIN_INPUT) + mv_gpio_out_en(dev, pin, 0); + if ((mask & flags) & GPIO_PIN_OUTPUT) { + if ((flags & mask) & GPIO_PIN_OPENDRAIN) + mv_gpio_value_set(dev, pin, 0); + else + mv_gpio_value_set(dev, pin, 1); + mv_gpio_out_en(dev, pin, 1); + } + if (mask & MV_GPIO_OUT_BLINK) mv_gpio_blink(dev, pin, flags & MV_GPIO_OUT_BLINK); if (mask & MV_GPIO_IN_POL_LOW) @@ -799,7 +827,7 @@ mv_gpio_in(device_t dev, uint32_t pin) struct mv_gpio_softc *sc; sc = (struct mv_gpio_softc *)device_get_softc(dev); - MV_GPIO_LOCK(); + MV_GPIO_ASSERT_LOCKED(); if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_DEBOUNCE) { if (sc->gpio_setup[pin].gp_flags & MV_GPIO_IN_POL_LOW) @@ -814,7 +842,6 @@ mv_gpio_in(device_t dev, uint32_t pin) } else state = (mv_gpio_value_get(dev, pin, 0) ? 1 : 0); - return (state); } @@ -997,6 +1024,8 @@ mv_gpio_value_set(device_t dev, uint32_t pin, uint8_t struct mv_gpio_softc *sc; sc = (struct mv_gpio_softc *)device_get_softc(dev); + MV_GPIO_ASSERT_LOCKED(); + if (pin >= sc->pin_num) return; @@ -1013,9 +1042,8 @@ mv_handle_gpios_prop(device_t dev, phandle_t ctrl, pce { pcell_t gpio_cells, pincnt; int inc, t, tuples, tuple_size; - int dir, flags, pin; + int flags, pin; u_long gpio_ctrl, size; - struct mv_gpio_softc sc; pincnt = 0; if (!OF_hasprop(ctrl, "gpio-controller")) @@ -1024,7 +1052,7 @@ mv_handle_gpios_prop(device_t dev, phandle_t ctrl, pce if (OF_getencprop(ctrl, "#gpio-cells", &gpio_cells, sizeof(pcell_t)) < 0) return (ENXIO); - if (gpio_cells != 3) + if (gpio_cells != 2) return (ENXIO); tuple_size = gpio_cells * sizeof(pcell_t) + sizeof(phandle_t); @@ -1033,10 +1061,6 @@ mv_handle_gpios_prop(device_t dev, phandle_t ctrl, pce if (fdt_regsize(ctrl, &gpio_ctrl, &size)) return (ENXIO); - if (OF_getencprop(ctrl, "pin-count", &pincnt, sizeof(pcell_t)) < 0) - return (ENXIO); - sc.pin_num = pincnt; - /* * Skip controller reference, since controller's phandle is given * explicitly (in a function argument). @@ -1046,22 +1070,9 @@ mv_handle_gpios_prop(device_t dev, phandle_t ctrl, pce for (t = 0; t < tuples; t++) { pin = gpios[0]; - dir = gpios[1]; - flags = gpios[2]; + flags = gpios[1]; mv_gpio_configure(dev, pin, flags, ~0); - - if (dir == 1) - /* Input. */ - mv_gpio_out_en(dev, pin, 0); - else { - /* Output. */ - if (flags & MV_GPIO_OUT_OPEN_DRAIN) - mv_gpio_out(dev, pin, 0, 1); - - if (flags & MV_GPIO_OUT_OPEN_SRC) - mv_gpio_out(dev, pin, 1, 1); - } gpios += gpio_cells + inc; } @@ -1075,12 +1086,13 @@ mv_gpio_init(device_t dev) { phandle_t child, parent, root, ctrl; pcell_t gpios[MAX_PINS_PER_NODE * GPIOS_PROP_CELLS]; - struct gpio_ctrl_entry *e; + struct ofw_compat_data *e; int len, rv; root = OF_finddevice("/"); len = 0; parent = root; + rv = 0; /* Traverse through entire tree to find nodes with 'gpios' prop */ for (child = OF_child(parent); child != 0; child = OF_peer(child)) { @@ -1098,30 +1110,175 @@ mv_gpio_init(device_t dev) /* Get 'gpios' property. */ OF_getencprop(child, "gpios", gpios, len); - e = (struct gpio_ctrl_entry *)&gpio_controllers; + /* + * First cell of 'gpios' property should + * contain a ref. to a node defining GPIO + * controller. + */ + ctrl = OF_node_from_xref(gpios[0]); + if(ctrl != ofw_bus_get_node(dev)) { + /* Not this gpio controller */ + device_printf(dev, "Not this gpio controller ctrl: %x, dev: %x\n", + ctrl, ofw_bus_get_node(dev)); + continue; + } + + e = gpio_controllers; + /* Find and call a handler. */ - for (; e->compat; e++) { - /* - * First cell of 'gpios' property should - * contain a ref. to a node defining GPIO - * controller. - */ - ctrl = OF_node_from_xref(gpios[0]); + for (; e->ocd_str; e++) { - if (ofw_bus_node_is_compatible(ctrl, e->compat)) + if (ofw_bus_node_is_compatible(ctrl,e->ocd_str)) { /* Call a handler. */ - if ((rv = e->handler(dev, ctrl, - (pcell_t *)&gpios, len))) - return (rv); + rv |= mv_handle_gpios_prop(dev, ctrl, + (pcell_t *)&gpios, len); + } } } - if (OF_peer(child) == 0) { + while (OF_peer(child) == 0 && parent != root) { /* No more siblings. */ child = parent; parent = OF_parent(child); } } + return (rv); +} + +static int +mv_gpio_pin_max(device_t dev, int *maxpin) +{ + struct mv_gpio_softc *sc; + if (maxpin == NULL) + return (EINVAL); + + sc = device_get_softc(dev); + *maxpin = sc->pin_num; + return (0); +} + +static int +mv_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct mv_gpio_softc *sc = device_get_softc(dev); + if (caps == NULL) + return (EINVAL); + + if (pin >= sc->pin_num) + return (EINVAL); + + MV_GPIO_LOCK(); + *caps = sc->gpio_setup[pin].gp_caps; + MV_GPIO_UNLOCK(); + + return (0); +} + +static int +mv_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct mv_gpio_softc *sc = device_get_softc(dev); + if (flags == NULL) + return (EINVAL); + + if (pin >= sc->pin_num) + return (EINVAL); + + MV_GPIO_LOCK(); + *flags = sc->gpio_setup[pin].gp_flags; + MV_GPIO_UNLOCK(); + + return (0); +} + +static int +mv_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct mv_gpio_softc *sc = device_get_softc(dev); + if (name == NULL) + return (EINVAL); + + if (pin >= sc->pin_num) + return (EINVAL); + + MV_GPIO_LOCK(); + memcpy(name, sc->gpio_setup[pin].gp_name, GPIOMAXNAME); + MV_GPIO_UNLOCK(); + + return (0); +} + +static int +mv_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + int ret; + struct mv_gpio_softc *sc = device_get_softc(dev); + if (pin >= sc->pin_num) + return (EINVAL); + + /* Check for unwanted flags. */ + if ((flags & sc->gpio_setup[pin].gp_caps) != flags) + return (EINVAL); + + ret = mv_gpio_configure(dev, pin, flags, ~0); + + return (ret); +} + +static int +mv_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct mv_gpio_softc *sc = device_get_softc(dev); + if (pin >= sc->pin_num) + return (EINVAL); + + MV_GPIO_LOCK(); + mv_gpio_value_set(dev, pin, value); + MV_GPIO_UNLOCK(); + + return (0); +} + +static int +mv_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *value) +{ + struct mv_gpio_softc *sc = device_get_softc(dev); + if (value == NULL) + return (EINVAL); + + if (pin >= sc->pin_num) + return (EINVAL); + + MV_GPIO_LOCK(); + *value = mv_gpio_in(dev, pin); + MV_GPIO_UNLOCK(); + + return (0); +} + +static int +mv_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct mv_gpio_softc *sc = device_get_softc(dev); + uint32_t value; + if (pin >= sc->pin_num) + return (EINVAL); + + MV_GPIO_LOCK(); + value = mv_gpio_in(dev, pin); + value = (~value) & 1; + mv_gpio_value_set(dev, pin, value); + MV_GPIO_UNLOCK(); + + return (0); +} + +static device_t +mv_gpio_get_bus(device_t dev) +{ + struct mv_gpio_softc *sc = device_get_softc(dev); + + return (sc->sc_busdev); } Modified: head/sys/dts/arm/db78100.dts ============================================================================== --- head/sys/dts/arm/db78100.dts Thu Apr 26 19:00:35 2018 (r333030) +++ head/sys/dts/arm/db78100.dts Thu Apr 26 19:00:48 2018 (r333031) @@ -165,7 +165,7 @@ }; GPIO: gpio@10100 { - #gpio-cells = <3>; + #gpio-cells = <2>; compatible = "mrvl,gpio"; reg = <0x10100 0x20>; gpio-controller; Modified: head/sys/dts/arm/db88f5182.dts ============================================================================== --- head/sys/dts/arm/db88f5182.dts Thu Apr 26 19:00:35 2018 (r333030) +++ head/sys/dts/arm/db88f5182.dts Thu Apr 26 19:00:48 2018 (r333031) @@ -152,7 +152,7 @@ }; GPIO: gpio@10100 { - #gpio-cells = <3>; + #gpio-cells = <2>; compatible = "mrvl,gpio"; reg = <0x10100 0x20>; gpio-controller; Modified: head/sys/dts/arm/db88f5281.dts ============================================================================== --- head/sys/dts/arm/db88f5281.dts Thu Apr 26 19:00:35 2018 (r333030) +++ head/sys/dts/arm/db88f5281.dts Thu Apr 26 19:00:48 2018 (r333031) @@ -152,7 +152,7 @@ }; GPIO: gpio@10100 { - #gpio-cells = <3>; + #gpio-cells = <2>; compatible = "mrvl,gpio"; reg = <0x10100 0x20>; gpio-controller; Modified: head/sys/dts/arm/db88f6281.dts ============================================================================== --- head/sys/dts/arm/db88f6281.dts Thu Apr 26 19:00:35 2018 (r333030) +++ head/sys/dts/arm/db88f6281.dts Thu Apr 26 19:00:48 2018 (r333031) @@ -156,7 +156,7 @@ }; GPIO: gpio@10100 { - #gpio-cells = <3>; + #gpio-cells = <2>; compatible = "mrvl,gpio"; reg = <0x10100 0x20>; gpio-controller; Modified: head/sys/dts/arm/dockstar.dts ============================================================================== --- head/sys/dts/arm/dockstar.dts Thu Apr 26 19:00:35 2018 (r333030) +++ head/sys/dts/arm/dockstar.dts Thu Apr 26 19:00:48 2018 (r333031) @@ -141,7 +141,7 @@ }; GPIO: gpio@10100 { - #gpio-cells = <3>; + #gpio-cells = <2>; compatible = "mrvl,gpio"; reg = <0x10100 0x20>; gpio-controller; Modified: head/sys/dts/arm/sheevaplug.dts ============================================================================== --- head/sys/dts/arm/sheevaplug.dts Thu Apr 26 19:00:35 2018 (r333030) +++ head/sys/dts/arm/sheevaplug.dts Thu Apr 26 19:00:48 2018 (r333031) @@ -153,7 +153,7 @@ }; GPIO: gpio@10100 { - #gpio-cells = <3>; + #gpio-cells = <2>; compatible = "mrvl,gpio"; reg = <0x10100 0x20>; gpio-controller; Modified: head/sys/dts/bindings-gpio.txt ============================================================================== --- head/sys/dts/bindings-gpio.txt Thu Apr 26 19:00:35 2018 (r333030) +++ head/sys/dts/bindings-gpio.txt Thu Apr 26 19:00:48 2018 (r333031) @@ -65,37 +65,42 @@ Description: The gpios property of a device node defin information like pin number, direction and various flags. Example: - gpios = <&GPIO 0 1 0 /* GPIO[0]: IN, NONE */ - &GPIO 1 2 0>; /* GPIO[1]: OUT, NONE */ + gpios = <&GPIO 0 1 /* GPIO[0]: FLAGS */ + &GPIO 1 2>; /* GPIO[1]: FLAGS */ -3. "mrvl,gpio" controller GPIO specifier +3. GPIO controller specifier pin: 0-MAX GPIO pin number. -dir: - 1 IN Input direction. - 2 OUT Output direction. - flags: - 0x0000---- IN_NONE - 0x0001---- IN_POL_LOW Polarity low (active-low). - 0x0002---- IN_IRQ_EDGE Interrupt, edge triggered. - 0x0004---- IN_IRQ_LEVEL Interrupt, level triggered. - - 0x----0000 OUT_NONE - 0x----0001 OUT_BLINK Blink on the pin. - 0x----0002 OUT_OPEN_DRAIN Open drain output line. - 0x----0004 OUT_OPEN_SRC Open source output line. + Available flags are listed in sys/conf.h. Following combination + can be supported by the controller. For details please refer + to controller's GPIO reference manual. + GPIO_PIN_INPUT 0x0001 Input direction + GPIO_PIN_OUTPUT 0x0002 Output direction + GPIO_PIN_OPENDRAIN 0x0004 Open-drain output + GPIO_PIN_OPENSOURCE 0x0008 Open-source output + GPIO_PIN_PUSHPULL 0x0010 Push-pull output + GPIO_PIN_TRISTATE 0x0020 Output disabled + GPIO_PIN_PULLUP 0x0040 Internal pull-up enabled + GPIO_PIN_PULLDOWN 0x0080 Internal pull-down enabled + GPIO_PIN_INVIN 0x0100 Invert input + GPIO_PIN_INVOUT 0x0200 Invert output + GPIO_PIN_PULSATE 0x0400 Pulsate in hardware + GPIO_PIN_IRQ_POL_EDG 0x0800 IRQ active single edge + GPIO_PIN_IRQ_POL_DBL 0x1000 IRQ active double edge + GPIO_PIN_IRQ_POL_LVL 0x2000 IRQ active level + GPIO_PIN_IRQ_DEBOUNCE 0x4000 Debounce on IRQ pin Example: - gpios = <&GPIO 0 1 0x00000000 /* GPIO[0]: IN */ - &GPIO 1 2 0x00000000 /* GPIO[1]: OUT */ - &GPIO 2 1 0x00020000 /* GPIO[2]: IN, IRQ (edge) */ - &GPIO 3 1 0x00040000 /* GPIO[3]: IN, IRQ (level) */ + gpios = <&GPIO 0 0x00000001 /* GPIO[0]: IN */ + &GPIO 1 0x00000002 /* GPIO[1]: OUT */ + &GPIO 2 0x00000801 /* GPIO[2]: IN, IRQ (edge) */ + &GPIO 3 0x00004001 /* GPIO[3]: IN, IRQ (level) */ ... - &GPIO 10 2 0x00000001>; /* GPIO[10]: OUT, blink */ + &GPIO 10 0x00000401>; /* GPIO[10]: OUT, blink */ From owner-svn-src-head@freebsd.org Thu Apr 26 19:10:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8925FB5FCD; Thu, 26 Apr 2018 19:10:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 563CE6A9F4; Thu, 26 Apr 2018 19:10:18 +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 510901C16B; Thu, 26 Apr 2018 19:10:18 +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 w3QJAISf047944; Thu, 26 Apr 2018 19:10:18 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QJAIEa047943; Thu, 26 Apr 2018 19:10:18 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804261910.w3QJAIEa047943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 26 Apr 2018 19:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333032 - head/sys/arm/mv X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/mv X-SVN-Commit-Revision: 333032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 19:10:18 -0000 Author: mw Date: Thu Apr 26 19:10:18 2018 New Revision: 333032 URL: https://svnweb.freebsd.org/changeset/base/333032 Log: Replace FDT tree parsing with gpio_map_gpios implementation in mv_gpio driver This patch replaces in-driver FDT parsing, which was needed for setting initial values on GPIO pins. Now FDT is parsed by generic kernel code, pins are set by invoking gpio_map_gpios method. Submitted by: Patryk Duda Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14757 Modified: head/sys/arm/mv/gpio.c Modified: head/sys/arm/mv/gpio.c ============================================================================== --- head/sys/arm/mv/gpio.c Thu Apr 26 19:00:48 2018 (r333031) +++ head/sys/arm/mv/gpio.c Thu Apr 26 19:10:18 2018 (r333032) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -104,7 +103,6 @@ struct mv_gpio_pindev { static int mv_gpio_probe(device_t); static int mv_gpio_attach(device_t); static int mv_gpio_intr(device_t, void *); -static int mv_gpio_init(device_t); static void mv_gpio_double_edge_init(device_t, int); @@ -155,6 +153,8 @@ static int mv_gpio_pin_setflags(device_t, uint32_t, ui static int mv_gpio_pin_set(device_t, uint32_t, unsigned int); static int mv_gpio_pin_get(device_t, uint32_t, unsigned int *); static int mv_gpio_pin_toggle(device_t, uint32_t); +static int mv_gpio_map_gpios(device_t, phandle_t, phandle_t, + int, pcell_t *, uint32_t *, uint32_t *); #define MV_GPIO_LOCK() mtx_lock_spin(&sc->mutex) #define MV_GPIO_UNLOCK() mtx_unlock_spin(&sc->mutex) @@ -174,6 +174,7 @@ static device_method_t mv_gpio_methods[] = { DEVMETHOD(gpio_pin_get, mv_gpio_pin_get), DEVMETHOD(gpio_pin_set, mv_gpio_pin_set), DEVMETHOD(gpio_pin_toggle, mv_gpio_pin_toggle), + DEVMETHOD(gpio_map_gpios, mv_gpio_map_gpios), DEVMETHOD_END }; @@ -188,11 +189,9 @@ static devclass_t mv_gpio_devclass; DRIVER_MODULE(mv_gpio, simplebus, mv_gpio_driver, mv_gpio_devclass, 0, 0); -static int mv_handle_gpios_prop(device_t, phandle_t, pcell_t *, int); - struct ofw_compat_data gpio_controllers[] = { - { "mrvl,gpio", (uintptr_t)&mv_handle_gpios_prop }, - { "marvell,orion-gpio", (uintptr_t)&mv_handle_gpios_prop }, + { "mrvl,gpio", (uintptr_t)true }, + { "marvell,orion-gpio", (uintptr_t)true }, { NULL, 0 } }; @@ -212,7 +211,7 @@ mv_gpio_probe(device_t dev) static int mv_gpio_attach(device_t dev) { - int error, i, size; + int i, size; struct mv_gpio_softc *sc; pcell_t pincnt = 0; pcell_t irq_cells = 0; @@ -319,12 +318,6 @@ mv_gpio_attach(device_t dev) } } - error = mv_gpio_init(dev); - if (error) { - device_printf(dev, "WARNING: failed to initialize GPIO pins, " - "error = %d\n", error); - } - /* Clear interrupt status. */ bus_space_write_4(sc->bst, sc->bsh, GPIO_INT_CAUSE, 0); @@ -1037,116 +1030,11 @@ mv_gpio_value_set(device_t dev, uint32_t pin, uint8_t mv_gpio_reg_clear(dev, reg, pin); } -static int -mv_handle_gpios_prop(device_t dev, phandle_t ctrl, pcell_t *gpios, int len) -{ - pcell_t gpio_cells, pincnt; - int inc, t, tuples, tuple_size; - int flags, pin; - u_long gpio_ctrl, size; +/* + * GPIO interface methods + */ - pincnt = 0; - if (!OF_hasprop(ctrl, "gpio-controller")) - /* Node is not a GPIO controller. */ - return (ENXIO); - - if (OF_getencprop(ctrl, "#gpio-cells", &gpio_cells, sizeof(pcell_t)) < 0) - return (ENXIO); - if (gpio_cells != 2) - return (ENXIO); - - tuple_size = gpio_cells * sizeof(pcell_t) + sizeof(phandle_t); - tuples = len / tuple_size; - - if (fdt_regsize(ctrl, &gpio_ctrl, &size)) - return (ENXIO); - - /* - * Skip controller reference, since controller's phandle is given - * explicitly (in a function argument). - */ - inc = sizeof(ihandle_t) / sizeof(pcell_t); - gpios += inc; - - for (t = 0; t < tuples; t++) { - pin = gpios[0]; - flags = gpios[1]; - - mv_gpio_configure(dev, pin, flags, ~0); - gpios += gpio_cells + inc; - } - - return (0); -} - -#define MAX_PINS_PER_NODE 5 -#define GPIOS_PROP_CELLS 4 static int -mv_gpio_init(device_t dev) -{ - phandle_t child, parent, root, ctrl; - pcell_t gpios[MAX_PINS_PER_NODE * GPIOS_PROP_CELLS]; - struct ofw_compat_data *e; - int len, rv; - - root = OF_finddevice("/"); - len = 0; - parent = root; - rv = 0; - - /* Traverse through entire tree to find nodes with 'gpios' prop */ - for (child = OF_child(parent); child != 0; child = OF_peer(child)) { - - /* Find a 'leaf'. Start the search from this node. */ - while (OF_child(child)) { - parent = child; - child = OF_child(child); - } - if ((len = OF_getproplen(child, "gpios")) > 0) { - - if (len > sizeof(gpios)) - return (ENXIO); - - /* Get 'gpios' property. */ - OF_getencprop(child, "gpios", gpios, len); - - /* - * First cell of 'gpios' property should - * contain a ref. to a node defining GPIO - * controller. - */ - ctrl = OF_node_from_xref(gpios[0]); - - if(ctrl != ofw_bus_get_node(dev)) { - /* Not this gpio controller */ - device_printf(dev, "Not this gpio controller ctrl: %x, dev: %x\n", - ctrl, ofw_bus_get_node(dev)); - continue; - } - - e = gpio_controllers; - - /* Find and call a handler. */ - for (; e->ocd_str; e++) { - - if (ofw_bus_node_is_compatible(ctrl,e->ocd_str)) { - /* Call a handler. */ - rv |= mv_handle_gpios_prop(dev, ctrl, - (pcell_t *)&gpios, len); - } - } - } - - while (OF_peer(child) == 0 && parent != root) { - /* No more siblings. */ - child = parent; - parent = OF_parent(child); - } - } - return (rv); -} - -static int mv_gpio_pin_max(device_t dev, int *maxpin) { struct mv_gpio_softc *sc; @@ -1281,4 +1169,20 @@ mv_gpio_get_bus(device_t dev) struct mv_gpio_softc *sc = device_get_softc(dev); return (sc->sc_busdev); +} + +static int +mv_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, + pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + struct mv_gpio_softc *sc = device_get_softc(bus); + + if (gpios[0] >= sc->pin_num) + return (EINVAL); + + *pin = gpios[0]; + *flags = gpios[1]; + mv_gpio_configure(bus, *pin, *flags, ~0); + + return (0); } From owner-svn-src-head@freebsd.org Thu Apr 26 19:15:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E8AFB637D; Thu, 26 Apr 2018 19:15:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A74366D6FD; Thu, 26 Apr 2018 19:15:39 +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 A1D911C314; Thu, 26 Apr 2018 19:15:39 +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 w3QJFdYW052756; Thu, 26 Apr 2018 19:15:39 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QJFd44052755; Thu, 26 Apr 2018 19:15:39 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804261915.w3QJFd44052755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 26 Apr 2018 19:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333033 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 333033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 19:15:40 -0000 Author: mw Date: Thu Apr 26 19:15:39 2018 New Revision: 333033 URL: https://svnweb.freebsd.org/changeset/base/333033 Log: Add support for gpioled on ARMADA38X based boards This patch adds support for gpio and gpioled into ARMADA38X kernel config. Reviewed by: andrew Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14758 Modified: head/sys/arm/conf/ARMADA38X Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Thu Apr 26 19:10:18 2018 (r333032) +++ head/sys/arm/conf/ARMADA38X Thu Apr 26 19:15:39 2018 (r333033) @@ -97,3 +97,7 @@ options PLATFORM # FDT options FDT + +# GPIO +device gpio +device gpioled From owner-svn-src-head@freebsd.org Thu Apr 26 19:23:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DADBFB6814; Thu, 26 Apr 2018 19:23:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DEFA6EE83; Thu, 26 Apr 2018 19:23: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 05EA61C4A9; Thu, 26 Apr 2018 19:23: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 w3QJNJFY057475; Thu, 26 Apr 2018 19:23:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QJNJ6M057474; Thu, 26 Apr 2018 19:23:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804261923.w3QJNJ6M057474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Apr 2018 19:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333034 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 333034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 19:23:20 -0000 Author: kib Date: Thu Apr 26 19:23:19 2018 New Revision: 333034 URL: https://svnweb.freebsd.org/changeset/base/333034 Log: Fix spelling: Appolo -> Apollo [1]. The APL31 NDA errata is APL30 public errata. Add the reference and provide the description [2]. Noted by: emaste [2], rpokala [1] Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Thu Apr 26 19:15:39 2018 (r333033) +++ head/sys/x86/x86/cpu_machdep.c Thu Apr 26 19:23:19 2018 (r333034) @@ -578,7 +578,7 @@ out: static int cpu_idle_apl31_workaround; SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, &cpu_idle_apl31_workaround, 0, - "Appolo Lake APL31 MWAIT bug workaround"); + "Apollo Lake APL31 MWAIT bug workaround"); int cpu_idle_wakeup(int cpu) @@ -696,7 +696,11 @@ cpu_idle_tun(void *unused __unused) cpu_idle_selector(tunvar); if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_id == 0x506c9) { /* - * Appolo Lake errata APL31. + * Apollo Lake errata APL31 (public errata APL30). + * Stores to the armed address range may not trigger + * MWAIT to resume execution. OS needs to use + * interrupts to wake processors from MWAIT-induced + * sleep states. */ cpu_idle_apl31_workaround = 1; } From owner-svn-src-head@freebsd.org Thu Apr 26 19:23:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B589FB6851; Thu, 26 Apr 2018 19:23:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B1506F1C0; Thu, 26 Apr 2018 19:23:38 +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 431011C4AA; Thu, 26 Apr 2018 19:23:38 +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 w3QJNc42057530; Thu, 26 Apr 2018 19:23:38 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QJNchI057529; Thu, 26 Apr 2018 19:23:38 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804261923.w3QJNchI057529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 26 Apr 2018 19:23:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333035 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 333035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 19:23:39 -0000 Author: mw Date: Thu Apr 26 19:23:37 2018 New Revision: 333035 URL: https://svnweb.freebsd.org/changeset/base/333035 Log: Add Marvell ArmadaXP and Armada38X to GENERIC config Include source files and drivers for Marvell ArmadaXP and Armada38X in GENERIC kernel config. Submitted by: Michal Mazur Rafal Kozik Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D14747 Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Thu Apr 26 19:23:19 2018 (r333034) +++ head/sys/arm/conf/GENERIC Thu Apr 26 19:23:37 2018 (r333035) @@ -21,6 +21,7 @@ ident GENERIC cpu CPU_CORTEXA +cpu CPU_MV_PJ4B options SMP_ON_UP machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" @@ -38,6 +39,7 @@ files "../allwinner/h3/files.h3" files "../broadcom/bcm2835/files.bcm2836" files "../broadcom/bcm2835/files.bcm283x" files "../freescale/imx/files.imx6" +files "../mv/files.arm7" files "../nvidia/tegra124/files.tegra124" files "../qemu/files.qemu" files "../ti/files.ti" @@ -57,6 +59,8 @@ options SOC_ALLWINNER_H3 options SOC_BCM2836 options SOC_TI_AM335X options SOC_OMAP4 +options SOC_MV_ARMADA38X +options SOC_MV_ARMADAXP options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores @@ -185,9 +189,10 @@ device pass # Passthrough device (direct ATA/SCSI a # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb -#device uhci +device uhci device ohci device ehci +device xhci device dwcotg # DWC OTG controller device musb @@ -196,6 +201,8 @@ device umass # Disks/Mass storage - Requires scbus device uhid # "Human Interface Devices" device ukbd # Allow keyboard like HIDs to control console +device firmware + # Device mode support device usb_template # Control of the gadget @@ -204,6 +211,11 @@ device loop device ether device vlan # 802.1Q VLAN support device bpf +device mii +device mdio +device etherswitch +device e6000sw +device neta # Marvell Network controller # Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! @@ -243,6 +255,11 @@ device ti_sdma # Extensible Firmware Interface options EFI + +# Marvell Cryptographic Engine and Security Accelerator +device cesa +device crypto +device cryptodev # Flattened Device Tree options FDT # Configure using FDT/DTB data From owner-svn-src-head@freebsd.org Thu Apr 26 21:07:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2B77FB8470; Thu, 26 Apr 2018 21:07:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45BF98509B; Thu, 26 Apr 2018 21:07:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B2671D50E; Thu, 26 Apr 2018 21:07:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QL7jl3009989; Thu, 26 Apr 2018 21:07:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QL7jkJ009988; Thu, 26 Apr 2018 21:07:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804262107.w3QL7jkJ009988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 26 Apr 2018 21:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333036 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 333036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 21:07:46 -0000 Author: kib Date: Thu Apr 26 21:07:45 2018 New Revision: 333036 URL: https://svnweb.freebsd.org/changeset/base/333036 Log: Fix move of the frame to the normal stack for interrupts occuring from the vm86 mode. Submitted by: jhb Modified: head/sys/i386/include/asmacros.h Modified: head/sys/i386/include/asmacros.h ============================================================================== --- head/sys/i386/include/asmacros.h Thu Apr 26 19:23:37 2018 (r333035) +++ head/sys/i386/include/asmacros.h Thu Apr 26 21:07:45 2018 (r333036) @@ -208,7 +208,7 @@ .macro KENTER testl $PSL_VM, TF_EFLAGS(%esp) - jnz 2f + jnz 1f testb $SEL_RPL_MASK, TF_CS(%esp) jz 2f 1: MOVE_STACKS From owner-svn-src-head@freebsd.org Thu Apr 26 21:35:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E6DFB8AFD; Thu, 26 Apr 2018 21:35:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77D996D4E8; Thu, 26 Apr 2018 21:35:05 +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 703A61D9DC; Thu, 26 Apr 2018 21:35:05 +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 w3QLZ5DF024625; Thu, 26 Apr 2018 21:35:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QLZ4FV024621; Thu, 26 Apr 2018 21:35:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804262135.w3QLZ4FV024621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Apr 2018 21:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333037 - in head: share/man/man4 sys/arm64/rockchip sys/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: share/man/man4 sys/arm64/rockchip sys/conf X-SVN-Commit-Revision: 333037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 21:35:06 -0000 Author: manu Date: Thu Apr 26 21:35:04 2018 New Revision: 333037 URL: https://svnweb.freebsd.org/changeset/base/333037 Log: arm64: rockchip: Add GRF driver RockChip GRF (General Register Files) is present on almost all RockChip SoC and is used to control some area of the system like iomuxing, gpio or usb phy. We need it to be probed and attached early in the boot process so subclass syscon_generic and set the pass to BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE. Added: head/share/man/man4/rk_grf.4 (contents, props changed) head/sys/arm64/rockchip/rk_grf.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files.arm64 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Apr 26 21:07:45 2018 (r333036) +++ head/share/man/man4/Makefile Thu Apr 26 21:35:04 2018 (r333037) @@ -444,6 +444,7 @@ MAN= aac.4 \ re.4 \ rgephy.4 \ rights.4 \ + ${_rk_grf.4} \ rl.4 \ rndtest.4 \ route.4 \ @@ -765,6 +766,7 @@ MLINKS+=xl.4 if_xl.4 .if ${MACHINE_CPUARCH} == "aarch64" _armv8crypto.4= armv8crypto.4 +_rk_grf.4= rk_grf.4 .endif .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64" Added: head/share/man/man4/rk_grf.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rk_grf.4 Thu Apr 26 21:35:04 2018 (r333037) @@ -0,0 +1,60 @@ +.\"- +.\" 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$ +.\" +.Dd Apr 26, 2018 +.Dt RK_GRF 4 +.Os +.Sh NAME +.Nm rk_grf +.Nd driver for the General Register Files controller on RockChip SoCs +.Sh SYNOPSIS +.Cd "options SOC_ROCKCHIP_rk3328" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the RockChip General Register Files +system controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the GRF controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +rockchip,rk3328-grf +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver and manpage was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Added: head/sys/arm64/rockchip/rk_grf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_grf.c Thu Apr 26 21:35:04 2018 (r333037) @@ -0,0 +1,81 @@ +/*- + * 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 "opt_soc.h" + +static struct ofw_compat_data compat_data[] = { +#ifdef SOC_ROCKCHIP_RK3328 + {"rockchip,rk3328-grf", 1}, +#endif + {NULL, 0} +}; + +static int +rk_grf_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 General Register Files"); + return (BUS_PROBE_DEFAULT); +} + +static device_method_t rk_grf_methods[] = { + DEVMETHOD(device_probe, rk_grf_probe), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(rk_grf, rk_grf_driver, rk_grf_methods, + sizeof(struct syscon_generic_softc), syscon_generic_driver); + +static devclass_t rk_grf_devclass; +EARLY_DRIVER_MODULE(rk_grf, simplebus, rk_grf_driver, rk_grf_devclass, + 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(rk_grf, 1); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Apr 26 21:07:45 2018 (r333036) +++ head/sys/conf/files.arm64 Thu Apr 26 21:35:04 2018 (r333037) @@ -242,6 +242,7 @@ cddl/dev/dtrace/aarch64/dtrace_asm.S optional dtrace cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" +arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_cru.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_clk_composite.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_clk_gate.c optional fdt soc_rockchip_rk3328 From owner-svn-src-head@freebsd.org Thu Apr 26 21:37:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F236FB8C0E; Thu, 26 Apr 2018 21:37: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7FB96D752; Thu, 26 Apr 2018 21:37: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 CE5F41D9DD; Thu, 26 Apr 2018 21:37: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 w3QLbcgV024750; Thu, 26 Apr 2018 21:37:38 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QLbcTq024746; Thu, 26 Apr 2018 21:37:38 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804262137.w3QLbcTq024746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Apr 2018 21:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333038 - in head: share/man/man4 sys/arm64/rockchip sys/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: share/man/man4 sys/arm64/rockchip sys/conf X-SVN-Commit-Revision: 333038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 21:37:39 -0000 Author: manu Date: Thu Apr 26 21:37:38 2018 New Revision: 333038 URL: https://svnweb.freebsd.org/changeset/base/333038 Log: arm64: rockchip: Add pinctrl driver Add pinctrl driver for RockChip SoCs. This device manage which function to set on which pin and some other properties like pull up/down, drive strength etc ... For now the driver only support RK3328 but it is versatile enough to add support for other RockChip SoC in the future. Added: head/share/man/man4/rk_pinctrl.4 (contents, props changed) head/sys/arm64/rockchip/rk_pinctrl.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files.arm64 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Apr 26 21:35:04 2018 (r333037) +++ head/share/man/man4/Makefile Thu Apr 26 21:37:38 2018 (r333038) @@ -445,6 +445,7 @@ MAN= aac.4 \ rgephy.4 \ rights.4 \ ${_rk_grf.4} \ + ${_rk_pinctrl.4} \ rl.4 \ rndtest.4 \ route.4 \ @@ -767,6 +768,7 @@ MLINKS+=xl.4 if_xl.4 .if ${MACHINE_CPUARCH} == "aarch64" _armv8crypto.4= armv8crypto.4 _rk_grf.4= rk_grf.4 +_rk_pinctrl.4= rk_pinctrl.4 .endif .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64" Added: head/share/man/man4/rk_pinctrl.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rk_pinctrl.4 Thu Apr 26 21:37:38 2018 (r333038) @@ -0,0 +1,62 @@ +.\"- +.\" 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$ +.\" +.Dd Apr 26, 2018 +.Dt RK_PINCTRL 4 +.Os +.Sh NAME +.Nm rk_pinctrl +.Nd driver for the pin multiplexing on RockChip SoCs +.Sh SYNOPSIS +.Cd "options SOC_ROCKCHIP_RK3328" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the pin multiplexing device present +on RockChip SoC. +.Sh HARDWARE +The current version of the +.Nm +driver supports the pin controller with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +rockchip,rk3328-pinctrl +.El +.Sh SEE ALSO +.Xr fdt_pinctrl 4 , +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver and manpage was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Added: head/sys/arm64/rockchip/rk_pinctrl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_pinctrl.c Thu Apr 26 21:37:38 2018 (r333038) @@ -0,0 +1,475 @@ +/*- + * 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 + +#include + +#include + +#include "syscon_if.h" + +#include "opt_soc.h" + +struct rk_pinctrl_pin_drive { + uint32_t value; + uint32_t ma; +}; + +struct rk_pinctrl_bank { + uint32_t bank_num; + uint32_t subbank_num; + uint32_t offset; + uint32_t nbits; +}; + +struct rk_pinctrl_pin_fixup { + uint32_t bank; + uint32_t subbank; + uint32_t pin; + uint32_t reg; + uint32_t bit; + uint32_t mask; +}; + +struct rk_pinctrl_conf { + struct rk_pinctrl_bank *iomux_conf; + uint32_t iomux_nbanks; + struct rk_pinctrl_pin_fixup *pin_fixup; + uint32_t npin_fixup; + struct rk_pinctrl_pin_drive *pin_drive; + uint32_t npin_drive; + uint32_t pd_offset; + uint32_t drive_offset; +}; + +struct rk_pinctrl_softc { + struct simplebus_softc simplebus_sc; + device_t dev; + struct syscon *grf; + struct rk_pinctrl_conf *conf; +}; + +static struct rk_pinctrl_bank rk3328_iomux_bank[] = { + { + .bank_num = 0, + .subbank_num = 0, + .offset = 0x00, + .nbits = 2, + }, + { + .bank_num = 0, + .subbank_num = 1, + .offset = 0x04, + .nbits = 2, + }, + { + .bank_num = 0, + .subbank_num = 2, + .offset = 0x08, + .nbits = 2, + }, + { + .bank_num = 0, + .subbank_num = 3, + .offset = 0xc, + .nbits = 2, + }, + { + .bank_num = 1, + .subbank_num = 0, + .offset = 0x10, + .nbits = 2, + }, + { + .bank_num = 1, + .subbank_num = 1, + .offset = 0x14, + .nbits = 2, + }, + { + .bank_num = 1, + .subbank_num = 2, + .offset = 0x18, + .nbits = 2, + }, + { + .bank_num = 1, + .subbank_num = 3, + .offset = 0x1C, + .nbits = 2, + }, + { + .bank_num = 2, + .subbank_num = 0, + .offset = 0x20, + .nbits = 2, + }, + { + .bank_num = 2, + .subbank_num = 1, + .offset = 0x24, + .nbits = 3, + }, + { + .bank_num = 2, + .subbank_num = 2, + .offset = 0x2c, + .nbits = 3, + }, + { + .bank_num = 2, + .subbank_num = 3, + .offset = 0x34, + .nbits = 2, + }, + { + .bank_num = 3, + .subbank_num = 0, + .offset = 0x38, + .nbits = 3, + }, + { + .bank_num = 3, + .subbank_num = 1, + .offset = 0x40, + .nbits = 3, + }, + { + .bank_num = 3, + .subbank_num = 2, + .offset = 0x48, + .nbits = 3, + }, + { + .bank_num = 3, + .subbank_num = 3, + .offset = 0x4c, + .nbits = 3, + }, +}; + +static struct rk_pinctrl_pin_fixup rk3328_pin_fixup[] = { + { + .bank = 2, + .pin = 12, + .reg = 0x24, + .bit = 8, + .mask = 0x300, + }, + { + .bank = 2, + .pin = 15, + .reg = 0x28, + .bit = 0, + .mask = 0x7, + }, + { + .bank = 2, + .pin = 23, + .reg = 0x30, + .bit = 14, + .mask = 0x6000, + }, +}; + +static struct rk_pinctrl_pin_drive rk3328_pin_drive[] = { + { + .value = 0, + .ma = 2, + }, + { + .value = 1, + .ma = 4, + }, + { + .value = 2, + .ma = 8, + }, + { + .value = 3, + .ma = 12, + }, +}; + +struct rk_pinctrl_conf rk3328_conf = { + .iomux_conf = rk3328_iomux_bank, + .iomux_nbanks = nitems(rk3328_iomux_bank), + .pin_fixup = rk3328_pin_fixup, + .npin_fixup = nitems(rk3328_pin_fixup), + .pin_drive = rk3328_pin_drive, + .npin_drive = nitems(rk3328_pin_drive), + .pd_offset = 0x100, + .drive_offset = 0x200, +}; + +static struct ofw_compat_data compat_data[] = { +#ifdef SOC_ROCKCHIP_RK3328 + {"rockchip,rk3328-pinctrl", (uintptr_t)&rk3328_conf}, +#endif + {NULL, 0} +}; + +static int +rk_pinctrl_parse_bias(phandle_t node) +{ + if (OF_hasprop(node, "bias-disable")) + return (0); + if (OF_hasprop(node, "bias-pull-up")) + return (1); + if (OF_hasprop(node, "bias-pull-down")) + return (2); + + return (-1); +} + +static int rk_pinctrl_parse_drive(struct rk_pinctrl_softc *sc, phandle_t node, + uint32_t *drive) +{ + uint32_t value; + int i; + + if (OF_getencprop(node, "drive-strength", &value, + sizeof(value)) != 0) + return (-1); + + /* Map to the correct drive value */ + for (i = 0; i < sc->conf->npin_drive; i++) + if (sc->conf->pin_drive[i].ma == value) { + *drive = sc->conf->pin_drive[i].value; + return (0); + } + + return (-1); +} + +static void +rk_pinctrl_get_fixup(struct rk_pinctrl_softc *sc, uint32_t bank, uint32_t pin, + uint32_t *reg, uint32_t *mask, uint32_t *bit) +{ + int i; + + for (i = 0; i < sc->conf->npin_fixup; i++) + if (sc->conf->pin_fixup[i].bank == bank && + sc->conf->pin_fixup[i].pin == pin) { + *reg = sc->conf->pin_fixup[i].reg; + *mask = sc->conf->pin_fixup[i].mask; + *bit = sc->conf->pin_fixup[i].bit; + + return; + } +} + +static void +rk_pinctrl_configure_pin(struct rk_pinctrl_softc *sc, uint32_t *pindata) +{ + phandle_t pin_conf; + uint32_t bank, subbank, pin, function, bias; + uint32_t bit, mask, reg, drive; + int i; + + bank = pindata[0]; + pin = pindata[1]; + function = pindata[2]; + pin_conf = OF_node_from_xref(pindata[3]); + subbank = pin / 8; + + for (i = 0; i < sc->conf->iomux_nbanks; i++) + if (sc->conf->iomux_conf[i].bank_num == bank && + sc->conf->iomux_conf[i].subbank_num == subbank) + break; + + if (i == sc->conf->iomux_nbanks) { + device_printf(sc->dev, "Unknown pin %d in bank %d\n", pin, + bank); + return; + } + + /* Parse pin function */ + reg = sc->conf->iomux_conf[i].offset; + switch (sc->conf->iomux_conf[i].nbits) { + case 3: + if ((pin % 8) >= 5) + reg += 4; + bit = (pin % 8 % 5) * 3; + mask = (0x7 << bit) << 16; + break; + case 2: + default: + bit = (pin % 8) * 2; + mask = (0x3 << bit) << 16; + break; + } + rk_pinctrl_get_fixup(sc, bank, pin, ®, &mask, &bit); + SYSCON_WRITE_4(sc->grf, reg, function << bit | mask); + + /* Pull-Up/Down */ + bias = rk_pinctrl_parse_bias(pin_conf); + if (bias >= 0) { + reg = sc->conf->pd_offset; + + reg += bank * 0x10 + ((pin / 8) * 0x4); + bit = (pin % 8) * 2; + mask = (0x3 << bit) << 16; + SYSCON_WRITE_4(sc->grf, reg, bias << bit | mask); + } + + /* Drive Strength */ + if (rk_pinctrl_parse_drive(sc, pin_conf, &drive) == 0) { + reg = sc->conf->drive_offset; + + reg += bank * 0x10 + ((pin / 8) * 0x4); + bit = (pin % 8) * 2; + mask = (0x3 << bit) << 16; + SYSCON_WRITE_4(sc->grf, reg, bias << bit | mask); + } +} + +static int +rk_pinctrl_configure_pins(device_t dev, phandle_t cfgxref) +{ + struct rk_pinctrl_softc *sc; + phandle_t node; + uint32_t *pins; + int i, npins; + + sc = device_get_softc(dev); + node = OF_node_from_xref(cfgxref); + + npins = OF_getencprop_alloc_multi(node, "rockchip,pins", sizeof(*pins), + (void **)&pins); + if (npins <= 0) + return (ENOENT); + + for (i = 0; i != npins; i += 4) + rk_pinctrl_configure_pin(sc, pins + i); + + return (0); +} + +static int +rk_pinctrl_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 Pinctrl controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +rk_pinctrl_attach(device_t dev) +{ + struct rk_pinctrl_softc *sc; + phandle_t node; + device_t cdev; + + sc = device_get_softc(dev); + sc->dev = dev; + + node = ofw_bus_get_node(dev); + + if (OF_hasprop(node, "rockchip,grf") && + syscon_get_by_ofw_property(dev, node, + "rockchip,grf", &sc->grf) != 0) { + device_printf(dev, "cannot get grf driver handle\n"); + return (ENXIO); + } + + sc->conf = (struct rk_pinctrl_conf *)ofw_bus_search_compatible(dev, + compat_data)->ocd_data; + + fdt_pinctrl_register(dev, "rockchip,pins"); + fdt_pinctrl_configure_tree(dev); + + simplebus_init(dev, node); + + bus_generic_probe(dev); + + /* Attach child devices */ + for (node = OF_child(node); node > 0; node = OF_peer(node)) { + cdev = simplebus_add_device(dev, node, 0, NULL, -1, NULL); + if (cdev != NULL) + device_probe_and_attach(cdev); + } + + return (bus_generic_attach(dev)); +} + +static int +rk_pinctrl_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t rk_pinctrl_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rk_pinctrl_probe), + DEVMETHOD(device_attach, rk_pinctrl_attach), + DEVMETHOD(device_detach, rk_pinctrl_detach), + + /* fdt_pinctrl interface */ + DEVMETHOD(fdt_pinctrl_configure,rk_pinctrl_configure_pins), + + DEVMETHOD_END +}; + +static devclass_t rk_pinctrl_devclass; + +DEFINE_CLASS_1(rk_pinctrl, rk_pinctrl_driver, rk_pinctrl_methods, + sizeof(struct rk_pinctrl_softc), simplebus_driver); + +EARLY_DRIVER_MODULE(rk_pinctrl, simplebus, rk_pinctrl_driver, + rk_pinctrl_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(rk_pinctrl, 1); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Apr 26 21:35:04 2018 (r333037) +++ head/sys/conf/files.arm64 Thu Apr 26 21:37:38 2018 (r333038) @@ -243,6 +243,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_grf.c optional fdt soc_rockchip_rk3328 +arm64/rockchip/rk_pinctrl.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_cru.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_clk_composite.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_clk_gate.c optional fdt soc_rockchip_rk3328 From owner-svn-src-head@freebsd.org Thu Apr 26 21:39:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A74BFB8CA1; Thu, 26 Apr 2018 21:39:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510C46D8A9; Thu, 26 Apr 2018 21:39:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B97D1D9DE; Thu, 26 Apr 2018 21:39: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 w3QLd0Ib024839; Thu, 26 Apr 2018 21:39:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QLd0YP024838; Thu, 26 Apr 2018 21:39:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804262139.w3QLd0YP024838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Apr 2018 21:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333039 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 333039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 21:39:00 -0000 Author: manu Date: Thu Apr 26 21:38:59 2018 New Revision: 333039 URL: https://svnweb.freebsd.org/changeset/base/333039 Log: arm64: rockchip: Rk3328 CRU Fix some offset for gates Some offset of some clock gates where wrong, correct them so we can use thoses clocks. Pointy Hat to: me Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Apr 26 21:37:38 2018 (r333038) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Apr 26 21:38:59 2018 (r333039) @@ -175,7 +175,7 @@ static struct rk_clk_composite_def aclk_bus_pre = { .div_shift = 8, .div_width = 5, - .gate_offset = 0x232, + .gate_offset = 0x220, .gate_shift = 0, .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, @@ -199,7 +199,7 @@ static struct rk_clk_composite_def hclk_bus_pre = { .div_shift = 8, .div_width = 2, - .gate_offset = 0x232, + .gate_offset = 0x220, .gate_shift = 1, .flags = RK_CLK_COMPOSITE_HAVE_GATE, @@ -218,7 +218,7 @@ static struct rk_clk_composite_def pclk_bus_pre = { .div_shift = 12, .div_width = 3, - .gate_offset = 0x232, + .gate_offset = 0x220, .gate_shift = 2, .flags = RK_CLK_COMPOSITE_HAVE_GATE, From owner-svn-src-head@freebsd.org Thu Apr 26 21:40:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B797FFB8D6F; Thu, 26 Apr 2018 21:40:06 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6605E6DA42; Thu, 26 Apr 2018 21:40:06 +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 60C871D9E2; Thu, 26 Apr 2018 21:40:06 +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 w3QLe6HH024946; Thu, 26 Apr 2018 21:40:06 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QLe6eJ024945; Thu, 26 Apr 2018 21:40:06 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804262140.w3QLe6eJ024945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Apr 2018 21:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333040 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 333040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 21:40:06 -0000 Author: manu Date: Thu Apr 26 21:40:05 2018 New Revision: 333040 URL: https://svnweb.freebsd.org/changeset/base/333040 Log: arm64: rockchip: RK3328 CRU Add gpio gates Add the gates for the gpio controller in order to properly support them. Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Apr 26 21:38:59 2018 (r333039) +++ head/sys/arm64/rockchip/clk/rk3328_cru.c Thu Apr 26 21:40:05 2018 (r333040) @@ -52,11 +52,15 @@ __FBSDID("$FreeBSD$"); /* GATES */ -#define ACLK_PERI 153 -#define HCLK_SDMMC 317 -#define HCLK_SDIO 318 -#define HCLK_EMMC 319 -#define HCLK_SDMMC_EXT 320 +#define ACLK_PERI 153 +#define PCLK_GPIO0 200 +#define PCLK_GPIO1 201 +#define PCLK_GPIO2 202 +#define PCLK_GPIO3 203 +#define HCLK_SDMMC 317 +#define HCLK_SDIO 318 +#define HCLK_EMMC 319 +#define HCLK_SDMMC_EXT 320 static struct rk_cru_gate rk3328_gates[] = { /* CRU_CLKGATE_CON0 */ @@ -75,6 +79,12 @@ static struct rk_cru_gate rk3328_gates[] = { /* CRU_CLKGATE_CON10 */ CRU_GATE(ACLK_PERI, "aclk_peri", "aclk_peri_pre", 0x228, 0) + + /* CRU_CLKGATE_CON16 */ + CRU_GATE(PCLK_GPIO0, "pclk_gpio0", "pclk_bus", 0x240, 7) + CRU_GATE(PCLK_GPIO1, "pclk_gpio1", "pclk_bus", 0x240, 8) + CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_bus", 0x240, 9) + CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_bus", 0x240, 10) /* CRU_CLKGATE_CON19 */ CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0x24C, 0) From owner-svn-src-head@freebsd.org Thu Apr 26 21:41:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FE23FB8F42; Thu, 26 Apr 2018 21:41:17 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E64A6E19D; Thu, 26 Apr 2018 21:41:16 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9951F1DB08; Thu, 26 Apr 2018 21:41:16 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QLfGDe025730; Thu, 26 Apr 2018 21:41:16 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QLfG0E025729; Thu, 26 Apr 2018 21:41:16 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201804262141.w3QLfG0E025729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 26 Apr 2018 21:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333041 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 21:41:17 -0000 Author: rrs Date: Thu Apr 26 21:41:16 2018 New Revision: 333041 URL: https://svnweb.freebsd.org/changeset/base/333041 Log: This change re-arranges the fields within the tcp-pcb so that they are more in order of cache line use as one passes through the tcp_input/output paths (non-errors most likely path). This helps speed up cache line optimization so that the tcp stack runs a bit more efficently. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D15136 Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Apr 26 21:40:05 2018 (r333040) +++ head/sys/netinet/tcp_var.h Thu Apr 26 21:41:16 2018 (r333041) @@ -83,125 +83,123 @@ STAILQ_HEAD(tcp_log_stailq, tcp_log_mem); /* * Tcp control block, one per tcp; fields: - * Organized for 16 byte cacheline efficiency. + * Organized for 64 byte cacheline efficiency based + * on common tcp_input/tcp_output processing. */ struct tcpcb { - struct tsegqe_head t_segq; /* segment reassembly queue */ - int t_segqlen; /* segment reassembly queue length */ - int t_dupacks; /* consecutive dup acks recd */ - - struct mbuf *t_in_pkt; /* head of the input packet queue for the tcp_hpts system */ - struct mbuf *t_tail_pkt; /* tail of the input packet queue for the tcp_hpts system */ - struct tcp_timer *t_timers; /* All the TCP timers in one struct */ - + /* Cache line 1 */ struct inpcb *t_inpcb; /* back pointer to internet pcb */ - int t_state; /* state of this connection */ + struct tcp_function_block *t_fb;/* TCP function call block */ + void *t_fb_ptr; /* Pointer to t_fb specific data */ + uint32_t t_maxseg:24, /* maximum segment size */ + t_logstate:8; /* State of "black box" logging */ + uint32_t t_state:4, /* state of this connection */ + bits_spare : 24; u_int t_flags; - - struct vnet *t_vnet; /* back pointer to parent vnet */ - tcp_seq snd_una; /* sent but unacknowledged */ tcp_seq snd_max; /* highest sequence number sent; * used to recognize retransmits */ tcp_seq snd_nxt; /* send next */ tcp_seq snd_up; /* send urgent pointer */ - - tcp_seq snd_wl1; /* window update seg seq number */ - tcp_seq snd_wl2; /* window update seg ack number */ - tcp_seq iss; /* initial send sequence number */ - tcp_seq irs; /* initial receive sequence number */ - + uint32_t snd_wnd; /* send window */ + uint32_t snd_cwnd; /* congestion-controlled window */ + uint32_t cl1_spare; /* Spare to round out CL 1 */ + /* Cache line 2 */ + u_int32_t ts_offset; /* our timestamp offset */ + u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ + int rcv_numsacks; /* # distinct sack blks present */ + u_int t_tsomax; /* TSO total burst length limit in bytes */ + u_int t_tsomaxsegcount; /* TSO maximum segment count */ + u_int t_tsomaxsegsize; /* TSO maximum segment size in bytes */ tcp_seq rcv_nxt; /* receive next */ tcp_seq rcv_adv; /* advertised window */ uint32_t rcv_wnd; /* receive window */ + u_int t_flags2; /* More tcpcb flags storage */ + int t_srtt; /* smoothed round-trip time */ + int t_rttvar; /* variance in round-trip time */ + u_int32_t ts_recent; /* timestamp echo data */ + u_char snd_scale; /* window scaling for send window */ + u_char rcv_scale; /* window scaling for recv window */ + u_char snd_limited; /* segments limited transmitted */ + u_char request_r_scale; /* pending window scaling */ + tcp_seq last_ack_sent; + u_int t_rcvtime; /* inactivity time */ + /* Cache line 3 */ tcp_seq rcv_up; /* receive urgent pointer */ - - uint32_t snd_wnd; /* send window */ - uint32_t snd_cwnd; /* congestion-controlled window */ + int t_segqlen; /* segment reassembly queue length */ + struct tsegqe_head t_segq; /* segment reassembly queue */ + struct mbuf *t_in_pkt; + struct mbuf *t_tail_pkt; + struct tcp_timer *t_timers; /* All the TCP timers in one struct */ + struct vnet *t_vnet; /* back pointer to parent vnet */ uint32_t snd_ssthresh; /* snd_cwnd size threshold for * for slow start exponential to * linear switch */ + tcp_seq snd_wl1; /* window update seg seq number */ + /* Cache line 4 */ + tcp_seq snd_wl2; /* window update seg ack number */ + + tcp_seq irs; /* initial receive sequence number */ + tcp_seq iss; /* initial send sequence number */ + u_int t_acktime; + u_int ts_recent_age; /* when last updated */ tcp_seq snd_recover; /* for use in NewReno Fast Recovery */ + uint16_t cl4_spare; /* Spare to adjust CL 4 */ + char t_oobflags; /* have some */ + char t_iobc; /* input character */ + int t_rxtcur; /* current retransmit value (ticks) */ - u_int t_rcvtime; /* inactivity time */ - u_int t_starttime; /* time connection was established */ + int t_rxtshift; /* log(2) of rexmt exp. backoff */ u_int t_rtttime; /* RTT measurement start time */ + tcp_seq t_rtseq; /* sequence number being timed */ + u_int t_starttime; /* time connection was established */ - int t_rxtcur; /* current retransmit value (ticks) */ - u_int t_maxseg; /* maximum segment size */ u_int t_pmtud_saved_maxseg; /* pre-blackhole MSS */ - int t_srtt; /* smoothed round-trip time */ - int t_rttvar; /* variance in round-trip time */ - - int t_rxtshift; /* log(2) of rexmt exp. backoff */ u_int t_rttmin; /* minimum rtt allowed */ + u_int t_rttbest; /* best rtt we've seen */ - u_long t_rttupdated; /* number of times rtt sampled */ - uint32_t max_sndwnd; /* largest window peer has offered */ int t_softerror; /* possible error not yet reported */ -/* out-of-band data */ - char t_oobflags; /* have some */ - char t_iobc; /* input character */ -/* RFC 1323 variables */ - u_char snd_scale; /* window scaling for send window */ - u_char rcv_scale; /* window scaling for recv window */ - u_char request_r_scale; /* pending window scaling */ - u_int32_t ts_recent; /* timestamp echo data */ - u_int ts_recent_age; /* when last updated */ - u_int32_t ts_offset; /* our timestamp offset */ - - tcp_seq last_ack_sent; -/* experimental */ + uint32_t max_sndwnd; /* largest window peer has offered */ + /* Cache line 5 */ uint32_t snd_cwnd_prev; /* cwnd prior to retransmit */ uint32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ int t_sndzerowin; /* zero-window updates sent */ - u_int t_badrxtwin; /* window for retransmit recovery */ - u_char snd_limited; /* segments limited transmitted */ -/* SACK related state */ + u_long t_rttupdated; /* number of times rtt sampled */ int snd_numholes; /* number of holes seen by sender */ + u_int t_badrxtwin; /* window for retransmit recovery */ TAILQ_HEAD(sackhole_head, sackhole) snd_holes; /* SACK scoreboard (sorted) */ tcp_seq snd_fack; /* last seq number(+1) sack'd by rcv'r*/ - int rcv_numsacks; /* # distinct sack blks present */ - struct sackblk sackblks[MAX_SACK_BLKS]; /* seq nos. of sack blocks */ tcp_seq sack_newdata; /* New data xmitted in this recovery episode starts at this seq number */ + struct sackblk sackblks[MAX_SACK_BLKS]; /* seq nos. of sack blocks */ struct sackhint sackhint; /* SACK scoreboard hint */ int t_rttlow; /* smallest observerved RTT */ - u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ int rfbuf_cnt; /* recv buffer autoscaling byte count */ struct toedev *tod; /* toedev handling this connection */ int t_sndrexmitpack; /* retransmit packets sent */ int t_rcvoopack; /* out-of-order packets received */ void *t_toe; /* TOE pcb pointer */ - int t_bytes_acked; /* # bytes acked during current RTT */ struct cc_algo *cc_algo; /* congestion control algorithm */ struct cc_var *ccv; /* congestion control specific vars */ struct osd *osd; /* storage for Khelp module data */ - + int t_bytes_acked; /* # bytes acked during current RTT */ u_int t_keepinit; /* time to establish connection */ u_int t_keepidle; /* time before keepalive probes begin */ u_int t_keepintvl; /* interval between keepalives */ u_int t_keepcnt; /* number of keepalives before close */ - - u_int t_tsomax; /* TSO total burst length limit in bytes */ - u_int t_tsomaxsegcount; /* TSO maximum segment count */ - u_int t_tsomaxsegsize; /* TSO maximum segment size in bytes */ - u_int t_flags2; /* More tcpcb flags storage */ - int t_logstate; /* State of "black box" logging */ - struct tcp_log_stailq t_logs; /* Log buffer */ + int t_dupacks; /* consecutive dup acks recd */ int t_lognum; /* Number of log entries */ - uint32_t t_logsn; /* Log "serial number" */ + struct tcp_log_stailq t_logs; /* Log buffer */ struct tcp_log_id_node *t_lin; struct tcp_log_id_bucket *t_lib; const char *t_output_caller; /* Function that called tcp_output */ - struct tcp_function_block *t_fb;/* TCP function call block */ - void *t_fb_ptr; /* Pointer to t_fb specific data */ + uint32_t t_logsn; /* Log "serial number" */ uint8_t t_tfo_client_cookie_len; /* TCP Fast Open client cookie length */ unsigned int *t_tfo_pending; /* TCP Fast Open server pending counter */ union { From owner-svn-src-head@freebsd.org Thu Apr 26 21:44:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01DEEFB91E3; Thu, 26 Apr 2018 21:44:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 930BB6F871; Thu, 26 Apr 2018 21:44: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 755291DB7D; Thu, 26 Apr 2018 21:44:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QLi1tB029795; Thu, 26 Apr 2018 21:44:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QLi1Xa029790; Thu, 26 Apr 2018 21:44:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804262144.w3QLi1Xa029790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Apr 2018 21:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333042 - in head: share/man/man4 sys/arm64/rockchip sys/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: share/man/man4 sys/arm64/rockchip sys/conf X-SVN-Commit-Revision: 333042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 21:44:02 -0000 Author: manu Date: Thu Apr 26 21:44:00 2018 New Revision: 333042 URL: https://svnweb.freebsd.org/changeset/base/333042 Log: arm64: rockchip: Add gpio controller driver Add a driver that match on 'rockchip,gpio-bank', this compatible string is found on almost all RockChip SoC so this driver is compatible with almost all of the RockChip SoCs. The only features missing for this driver are : - Interrupts support - Debouncing Added: head/share/man/man4/rk_gpio.4 (contents, props changed) head/sys/arm64/rockchip/rk_gpio.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files.arm64 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Apr 26 21:41:16 2018 (r333041) +++ head/share/man/man4/Makefile Thu Apr 26 21:44:00 2018 (r333042) @@ -444,6 +444,7 @@ MAN= aac.4 \ re.4 \ rgephy.4 \ rights.4 \ + ${_rk_gpio.4} \ ${_rk_grf.4} \ ${_rk_pinctrl.4} \ rl.4 \ @@ -767,6 +768,7 @@ MLINKS+=xl.4 if_xl.4 .if ${MACHINE_CPUARCH} == "aarch64" _armv8crypto.4= armv8crypto.4 +_rk_gpio.4= rk_gpio.4 _rk_grf.4= rk_grf.4 _rk_pinctrl.4= rk_pinctrl.4 .endif Added: head/share/man/man4/rk_gpio.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/rk_gpio.4 Thu Apr 26 21:44:00 2018 (r333042) @@ -0,0 +1,63 @@ +.\"- +.\" 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$ +.\" +.Dd Apr 26, 2018 +.Dt RK_GPIO 4 +.Os +.Sh NAME +.Nm rk_gpio +.Nd driver for the gpio controller on RockChip SoCs +.Sh SYNOPSIS +.Cd "options SOC_ROCKCHIP_RK3328" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the gpio controller device present +on RockChip SoC. +.Sh HARDWARE +The current version of the +.Nm +driver supports the gpio banks with one of the following +compatible strings : +.Pp +.Bl -bullet -compact +.It +rockchip,gpio-bank +.El +.Sh SEE ALSO +.Xr gpiobus 4 , +.Xr gpioctl 8 , +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver and manpage was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . Added: head/sys/arm64/rockchip/rk_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_gpio.c Thu Apr 26 21:44:00 2018 (r333042) @@ -0,0 +1,426 @@ +/*- + * 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 +#include +#include + +#include "opt_soc.h" + +#include "gpio_if.h" + +#define RK_GPIO_SWPORTA_DR 0x00 /* Data register */ +#define RK_GPIO_SWPORTA_DDR 0x04 /* Data direction register */ + +#define RK_GPIO_INTEN 0x30 /* Interrupt enable register */ +#define RK_GPIO_INTMASK 0x34 /* Interrupt mask register */ +#define RK_GPIO_INTTYPE_LEVEL 0x38 /* Interrupt level register */ +#define RK_GPIO_INT_POLARITY 0x3C /* Interrupt polarity register */ +#define RK_GPIO_INT_STATUS 0x40 /* Interrupt status register */ +#define RK_GPIO_INT_RAWSTATUS 0x44 /* Raw Interrupt status register */ + +#define RK_GPIO_DEBOUNCE 0x48 /* Debounce enable register */ + +#define RK_GPIO_PORTA_EOI 0x4C /* Clear interrupt register */ +#define RK_GPIO_EXT_PORTA 0x50 /* External port register */ + +#define RK_GPIO_LS_SYNC 0x60 /* Level sensitive syncronization enable register */ + +struct rk_gpio_softc { + device_t sc_dev; + device_t sc_busdev; + struct mtx sc_mtx; + struct resource *sc_res[2]; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + clk_t clk; +}; + +static struct ofw_compat_data compat_data[] = { + {"rockchip,gpio-bank", 1}, + {NULL, 0} +}; + +static struct resource_spec rk_gpio_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int rk_gpio_detach(device_t dev); + +#define RK_GPIO_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) +#define RK_GPIO_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) +#define RK_GPIO_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) + +#define RK_GPIO_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) +#define RK_GPIO_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + +static int +rk_gpio_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 GPIO Bank controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +rk_gpio_attach(device_t dev) +{ + struct rk_gpio_softc *sc; + phandle_t node; + int err; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + node = ofw_bus_get_node(sc->sc_dev); + if (!OF_hasprop(node, "gpio-controller")) + return (ENXIO); + + mtx_init(&sc->sc_mtx, "rk gpio", "gpio", MTX_SPIN); + + if (bus_alloc_resources(dev, rk_gpio_spec, sc->sc_res)) { + device_printf(dev, "could not allocate resources\n"); + bus_release_resources(dev, rk_gpio_spec, sc->sc_res); + mtx_destroy(&sc->sc_mtx); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_res[0]); + sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]); + + if (clk_get_by_ofw_index(dev, 0, 0, &sc->clk) != 0) { + device_printf(dev, "Cannot get clock\n"); + rk_gpio_detach(dev); + return (ENXIO); + } + err = clk_enable(sc->clk); + if (err != 0) { + device_printf(dev, "Could not enable clock %s\n", + clk_get_name(sc->clk)); + rk_gpio_detach(dev); + return (ENXIO); + } + + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) { + rk_gpio_detach(dev); + return (ENXIO); + } + + return (0); +} + +static int +rk_gpio_detach(device_t dev) +{ + struct rk_gpio_softc *sc; + + sc = device_get_softc(dev); + + if (sc->sc_busdev) + gpiobus_detach_bus(dev); + bus_release_resources(dev, rk_gpio_spec, sc->sc_res); + mtx_destroy(&sc->sc_mtx); + clk_disable(sc->clk); + + return(0); +} + +static device_t +rk_gpio_get_bus(device_t dev) +{ + struct rk_gpio_softc *sc; + + sc = device_get_softc(dev); + + return (sc->sc_busdev); +} + +static int +rk_gpio_pin_max(device_t dev, int *maxpin) +{ + + /* Each bank have always 32 pins */ + *maxpin = 32; + return (0); +} + +static int +rk_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct rk_gpio_softc *sc; + + sc = device_get_softc(dev); + + if (pin >= 32) + return (EINVAL); + + RK_GPIO_LOCK(sc); + snprintf(name, GPIOMAXNAME, "gpio%d", pin); + RK_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct rk_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + RK_GPIO_LOCK(sc); + reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DDR); + RK_GPIO_UNLOCK(sc); + + if (reg & (1 << pin)) + *flags = GPIO_PIN_OUTPUT; + else + *flags = GPIO_PIN_INPUT; + + return (0); +} + +static int +rk_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + + /* Caps are managed by the pinctrl device */ + *caps = 0; + return (0); +} + +static int +rk_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct rk_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + RK_GPIO_LOCK(sc); + + reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DDR); + if (flags & GPIO_PIN_INPUT) + reg &= ~(1 << pin); + else if (flags & GPIO_PIN_OUTPUT) + reg |= (1 << pin); + + RK_GPIO_WRITE(sc, RK_GPIO_SWPORTA_DDR, reg); + RK_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct rk_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + RK_GPIO_LOCK(sc); + reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DR); + RK_GPIO_UNLOCK(sc); + + *val = reg & (1 << pin) ? 1 : 0; + + return (0); +} + +static int +rk_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct rk_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + RK_GPIO_LOCK(sc); + reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DR); + if (value) + reg |= (1 << pin); + else + reg &= ~(1 << pin); + RK_GPIO_WRITE(sc, RK_GPIO_SWPORTA_DR, reg); + RK_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct rk_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + RK_GPIO_LOCK(sc); + reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DR); + if (reg & (1 << pin)) + reg &= ~(1 << pin); + else + reg |= (1 << pin); + RK_GPIO_WRITE(sc, RK_GPIO_SWPORTA_DR, reg); + RK_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk_gpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t clear_pins, + uint32_t change_pins, uint32_t *orig_pins) +{ + struct rk_gpio_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + + RK_GPIO_LOCK(sc); + reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DR); + if (orig_pins) + *orig_pins = reg; + + if ((clear_pins | change_pins) != 0) { + reg = (reg & ~clear_pins) ^ change_pins; + RK_GPIO_WRITE(sc, RK_GPIO_SWPORTA_DR, reg); + } + RK_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins, + uint32_t *pin_flags) +{ + uint32_t reg, set, mask, flask; + int i; + + if (first_pin != 0 || num_pins > 32) + return (EINVAL); + + set = 0; + mask = 0; + for (i = 0; i < num_pins; i++) { + mask = (mask << 1) | 1; + flags = pin_flags[i]; + if (flags & GPIO_PIN_INPUT) { + set &= ~(1 << i); + } else if (flags & GPIO_PIN_OUTPUT) { + set |= (1 << i); + } + } + + RK_GPIO_LOCK(sc); + reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DDR); + reg &= ~mask; + reg |= set; + RK_GPIO_WRITE(sc, RK_GPIO_SWPORTA_DDR); + RK_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rk_gpio_map_gpios(device_t bus, phandle_t dev, phandle_t gparent, int gcells, + pcell_t *gpios, uint32_t *pin, uint32_t *flags) +{ + + /* The gpios are mapped as */ + *pin = gpios[1]; + *flags = gpios[2]; + return (0); +} + +static device_method_t rk_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rk_gpio_probe), + DEVMETHOD(device_attach, rk_gpio_attach), + DEVMETHOD(device_detach, rk_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, rk_gpio_get_bus), + DEVMETHOD(gpio_pin_max, rk_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, rk_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, rk_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, rk_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, rk_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, rk_gpio_pin_get), + DEVMETHOD(gpio_pin_set, rk_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, rk_gpio_pin_toggle), + DEVMETHOD(gpio_pin_access_32, rk_gpio_pin_access_32), + DEVMETHOD(gpio_pin_config_32, rk_gpio_pin_config_32), + DEVMETHOD(gpio_map_gpios, rk_gpio_map_gpios), + + DEVMETHOD_END +}; + +static driver_t rk_gpio_driver = { + "gpio", + rk_gpio_methods, + sizeof(struct rk_gpio_softc), +}; + +static devclass_t rk_gpio_devclass; + +EARLY_DRIVER_MODULE(rk_gpio, simplebus, rk_gpio_driver, + rk_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Apr 26 21:41:16 2018 (r333041) +++ head/sys/conf/files.arm64 Thu Apr 26 21:44:00 2018 (r333042) @@ -244,6 +244,7 @@ cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt 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 arm64/rockchip/clk/rk_cru.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_clk_composite.c optional fdt soc_rockchip_rk3328 arm64/rockchip/clk/rk_clk_gate.c optional fdt soc_rockchip_rk3328 From owner-svn-src-head@freebsd.org Thu Apr 26 22:04:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D915FB96DA; Thu, 26 Apr 2018 22:04:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C89E673844; Thu, 26 Apr 2018 22:04:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF9171DE90; Thu, 26 Apr 2018 22:04:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QM4LJ1039567; Thu, 26 Apr 2018 22:04:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QM4LJN039562; Thu, 26 Apr 2018 22:04:21 GMT (envelope-from np@FreeBSD.org) Message-Id: <201804262204.w3QM4LJN039562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 26 Apr 2018 22:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333043 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 333043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 22:04:22 -0000 Author: np Date: Thu Apr 26 22:04:21 2018 New Revision: 333043 URL: https://svnweb.freebsd.org/changeset/base/333043 Log: cxgbe(4): Move release_tid to the base NIC driver for future consumers. Sponsored by: Chelsio Communications. Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Apr 26 21:44:00 2018 (r333042) +++ head/sys/dev/cxgbe/adapter.h Thu Apr 26 22:04:21 2018 (r333043) @@ -1169,6 +1169,7 @@ void free_atid_tab(struct tid_info *); int alloc_atid(struct adapter *, void *); void *lookup_atid(struct adapter *, int); void free_atid(struct adapter *, int); +void release_tid(struct adapter *, int, struct sge_wrq *); #ifdef DEV_NETMAP /* t4_netmap.c */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Apr 26 21:44:00 2018 (r333042) +++ head/sys/dev/cxgbe/t4_main.c Thu Apr 26 22:04:21 2018 (r333043) @@ -2535,6 +2535,31 @@ free_atid(struct adapter *sc, int atid) mtx_unlock(&t->atid_lock); } +static void +queue_tid_release(struct adapter *sc, int tid) +{ + + CXGBE_UNIMPLEMENTED("deferred tid release"); +} + +void +release_tid(struct adapter *sc, int tid, struct sge_wrq *ctrlq) +{ + struct wrqe *wr; + struct cpl_tid_release *req; + + wr = alloc_wrqe(sizeof(*req), ctrlq); + if (wr == NULL) { + queue_tid_release(sc, tid); /* defer */ + return; + } + req = wrtod(wr); + + INIT_TP_WR_MIT_CPL(req, CPL_TID_RELEASE, tid); + + t4_wrq_tx(sc, wr); +} + static int t4_range_cmp(const void *a, const void *b) { Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 26 21:44:00 2018 (r333042) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu Apr 26 22:04:21 2018 (r333043) @@ -96,7 +96,6 @@ static struct uld_info tom_uld_info = { .deactivate = t4_tom_deactivate, }; -static void queue_tid_release(struct adapter *, int); static void release_offload_resources(struct toepcb *); static int alloc_tid_tabs(struct tid_info *); static void free_tid_tabs(struct tid_info *); @@ -539,31 +538,6 @@ remove_tid(struct adapter *sc, int tid, int ntids) t->tid_tab[tid] = NULL; atomic_subtract_int(&t->tids_in_use, ntids); -} - -void -release_tid(struct adapter *sc, int tid, struct sge_wrq *ctrlq) -{ - struct wrqe *wr; - struct cpl_tid_release *req; - - wr = alloc_wrqe(sizeof(*req), ctrlq); - if (wr == NULL) { - queue_tid_release(sc, tid); /* defer */ - return; - } - req = wrtod(wr); - - INIT_TP_WR_MIT_CPL(req, CPL_TID_RELEASE, tid); - - t4_wrq_tx(sc, wr); -} - -static void -queue_tid_release(struct adapter *sc, int tid) -{ - - CXGBE_UNIMPLEMENTED("deferred tid release"); } /* Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Apr 26 21:44:00 2018 (r333042) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Apr 26 22:04:21 2018 (r333043) @@ -333,7 +333,6 @@ void insert_tid(struct adapter *, int, void *, int); void *lookup_tid(struct adapter *, int); void update_tid(struct adapter *, int, void *); void remove_tid(struct adapter *, int, int); -void release_tid(struct adapter *, int, struct sge_wrq *); int find_best_mtu_idx(struct adapter *, struct in_conninfo *, struct offload_settings *); u_long select_rcv_wnd(struct socket *); From owner-svn-src-head@freebsd.org Thu Apr 26 22:15:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCE3FB9A69; Thu, 26 Apr 2018 22:15:11 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FD0375433; Thu, 26 Apr 2018 22:15:09 +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 E05E71E041; Thu, 26 Apr 2018 22:15:09 +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 w3QMF9sI045002; Thu, 26 Apr 2018 22:15:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QMF9jR045001; Thu, 26 Apr 2018 22:15:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804262215.w3QMF9jR045001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 26 Apr 2018 22:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333045 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 333045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 22:15:11 -0000 Author: manu Date: Thu Apr 26 22:15:09 2018 New Revision: 333045 URL: https://svnweb.freebsd.org/changeset/base/333045 Log: arm64: rockchip: rk_gpio fix rk_gpio_pin_config32 Pointy Hat to: me Modified: head/sys/arm64/rockchip/rk_gpio.c Modified: head/sys/arm64/rockchip/rk_gpio.c ============================================================================== --- head/sys/arm64/rockchip/rk_gpio.c Thu Apr 26 22:15:06 2018 (r333044) +++ head/sys/arm64/rockchip/rk_gpio.c Thu Apr 26 22:15:09 2018 (r333045) @@ -352,9 +352,12 @@ static int rk_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins, uint32_t *pin_flags) { - uint32_t reg, set, mask, flask; + struct rk_gpio_softc *sc; + uint32_t reg, set, mask, flags; int i; + sc = device_get_softc(dev); + if (first_pin != 0 || num_pins > 32) return (EINVAL); @@ -374,7 +377,7 @@ rk_gpio_pin_config_32(device_t dev, uint32_t first_pin reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DDR); reg &= ~mask; reg |= set; - RK_GPIO_WRITE(sc, RK_GPIO_SWPORTA_DDR); + RK_GPIO_WRITE(sc, RK_GPIO_SWPORTA_DDR, reg); RK_GPIO_UNLOCK(sc); return (0); From owner-svn-src-head@freebsd.org Thu Apr 26 22:43:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86961FBA853; Thu, 26 Apr 2018 22:43:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 391CA7DCF7; Thu, 26 Apr 2018 22:43:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33FE71E4F0; Thu, 26 Apr 2018 22:43:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QMhPBv060096; Thu, 26 Apr 2018 22:43:25 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QMhPXt060094; Thu, 26 Apr 2018 22:43:25 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201804262243.w3QMhPXt060094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 26 Apr 2018 22:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333046 - in head/sys: amd64/conf conf X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys: amd64/conf conf X-SVN-Commit-Revision: 333046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 22:43:26 -0000 Author: sbruno Date: Thu Apr 26 22:43:25 2018 New Revision: 333046 URL: https://svnweb.freebsd.org/changeset/base/333046 Log: move smartpqi(4) controller out of NOTES and into sys/amd64/NOTES to appease LINT Submitted by: rpokala Reported by: npn Modified: head/sys/amd64/conf/NOTES head/sys/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Thu Apr 26 22:15:09 2018 (r333045) +++ head/sys/amd64/conf/NOTES Thu Apr 26 22:43:25 2018 (r333046) @@ -415,6 +415,13 @@ device ntb_hw_plx # PLX NTB hardware driver device arcmsr # Areca SATA II RAID # +# Microsemi smartpqi controllers. +# These controllers have a SCSI-like interface, and require the +# CAM infrastructure. +# +device smartpqi + +# # 3ware 9000 series PATA/SATA RAID controller driver and options. # The driver is implemented as a SIM, and so, needs the CAM infrastructure. # Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Apr 26 22:15:09 2018 (r333045) +++ head/sys/conf/NOTES Thu Apr 26 22:43:25 2018 (r333046) @@ -1717,13 +1717,6 @@ options MFI_DEBUG device mrsas # LSI/Avago MegaRAID SAS/SATA, 6Gb/s and 12Gb/s # -# Microsemi smartpqi controllers. -# These controllers have a SCSI-like interface, and require the -# CAM infrastructure. -# -device smartpqi - -# # 3ware ATA RAID # device twe # 3ware ATA RAID From owner-svn-src-head@freebsd.org Fri Apr 27 00:12:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90039FBC191; Fri, 27 Apr 2018 00:12:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BFD272A3C; Fri, 27 Apr 2018 00:12: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 367791F302; Fri, 27 Apr 2018 00:12:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3R0C0QL001477; Fri, 27 Apr 2018 00:12:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R0C0Qh001474; Fri, 27 Apr 2018 00:12:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804270012.w3R0C0Qh001474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 27 Apr 2018 00:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333047 - in head/sys: dev/extres/clk kern sys X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: dev/extres/clk kern sys X-SVN-Commit-Revision: 333047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 00:12:01 -0000 Author: manu Date: Fri Apr 27 00:12:00 2018 New Revision: 333047 URL: https://svnweb.freebsd.org/changeset/base/333047 Log: clk: Put the sysctls under hw.clock instead of clock This is more consistant with hw.regulator and other hardware related sysctls. Modified: head/sys/dev/extres/clk/clk.c head/sys/kern/kern_mib.c head/sys/sys/sysctl.h Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Thu Apr 26 22:43:25 2018 (r333046) +++ head/sys/dev/extres/clk/clk.c Fri Apr 27 00:12:00 2018 (r333047) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #endif #include +SYSCTL_NODE(_hw, OID_AUTO, clock, CTLFLAG_RD, NULL, "Clocks"); + MALLOC_DEFINE(M_CLOCK, "clocks", "Clock framework"); /* Forward declarations. */ @@ -570,7 +572,7 @@ clknode_create(struct clkdom * clkdom, clknode_class_t sysctl_ctx_init(&clknode->sysctl_ctx); clknode_oid = SYSCTL_ADD_NODE(&clknode->sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_clock), + SYSCTL_STATIC_CHILDREN(_hw_clock), OID_AUTO, clknode->name, CTLFLAG_RD, 0, "A clock node"); Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Thu Apr 26 22:43:25 2018 (r333046) +++ head/sys/kern/kern_mib.c Fri Apr 27 00:12:00 2018 (r333047) @@ -90,11 +90,6 @@ SYSCTL_ROOT_NODE(OID_AUTO, regression, CTLFLAG_RW, 0, "Regression test MIB"); #endif -#ifdef EXT_RESOURCES -SYSCTL_ROOT_NODE(OID_AUTO, clock, CTLFLAG_RW, 0, - "Clocks"); -#endif - SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD|CTLFLAG_MPSAFE, kern_ident, 0, "Kernel identifier"); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Thu Apr 26 22:43:25 2018 (r333046) +++ head/sys/sys/sysctl.h Fri Apr 27 00:12:00 2018 (r333047) @@ -1009,9 +1009,6 @@ SYSCTL_DECL(_compat); SYSCTL_DECL(_regression); SYSCTL_DECL(_security); SYSCTL_DECL(_security_bsd); -#ifdef EXT_RESOURCES -SYSCTL_DECL(_clock); -#endif extern char machine[]; extern char osrelease[]; From owner-svn-src-head@freebsd.org Fri Apr 27 04:49:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D4FDFC05BD; Fri, 27 Apr 2018 04:49:33 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 496DF6A0E9; Fri, 27 Apr 2018 04:49:31 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 95422bd1; Fri, 27 Apr 2018 06:49:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=1t4qRWJbszdqdTxIdICE7jYjsIw=; b=ahVf6RjqchtfFfMQ/prb2/0xnr6V nGFH/4Xw3+3Aiox2l/DpQl05YxBh6z38A7iZ/GWEYsEtOVsw7rHs5foAcy2sTY0Y QqgvlcVKeSQ3OmEw7PcflPmXz9/2oVPT8kKwyo5h/bitKHEajC01IfKcgSLHFX57 +XxWxbAuxOSRT5s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=ANdjRoa5ek55/dZX0xxQvnsDXDk9uSL6YriiWYnrNtE9EY/c3vQnbd1L adoJVQ5jRW6zcShRnIGc8chRSdNpzdNDS2xBqkmlgNz8TqHoLP2RYXKS6zTATBJd 5n+0preAIij4pTEKrSL5mzaTt62T927KFoKDOOoyJ36+q/esjX4= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 14c27a2d TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Fri, 27 Apr 2018 06:49:23 +0200 (CEST) Date: Fri, 27 Apr 2018 06:49:22 +0200 From: Emmanuel Vadot To: Marcin Wojtas Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333035 - head/sys/arm/conf Message-Id: <20180427064922.4a4a1746c799d4bd0b686556@bidouilliste.com> In-Reply-To: <201804261923.w3QJNchI057529@repo.freebsd.org> References: <201804261923.w3QJNchI057529@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 04:49:33 -0000 Hi Marcin, On Thu, 26 Apr 2018 19:23:38 +0000 (UTC) Marcin Wojtas wrote: > Author: mw > Date: Thu Apr 26 19:23:37 2018 > New Revision: 333035 > URL: https://svnweb.freebsd.org/changeset/base/333035 > > Log: > Add Marvell ArmadaXP and Armada38X to GENERIC config > > Include source files and drivers for Marvell ArmadaXP and Armada38X > in GENERIC kernel config. > > Submitted by: Michal Mazur > Rafal Kozik > Obtained from: Semihalf > Sponsored by: Stormshield > Differential Revision: https://reviews.freebsd.org/D14747 > > Modified: > head/sys/arm/conf/GENERIC This break GENERIC when running on !marvell. The code in sys/arm/mv/mv_common.c tries to read a register in a memory region that doesn't exist in !marvell (in soc_id). Could you revert this commit please. Thanks, -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Fri Apr 27 05:32:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A6CDFC130D; Fri, 27 Apr 2018 05:32:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2816E72AD8; Fri, 27 Apr 2018 05:32:10 +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 0A81C225B6; Fri, 27 Apr 2018 05:32:10 +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 w3R5W9GJ064208; Fri, 27 Apr 2018 05:32:09 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R5W9mM064207; Fri, 27 Apr 2018 05:32:09 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201804270532.w3R5W9mM064207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Fri, 27 Apr 2018 05:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333050 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 333050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 05:32:10 -0000 Author: mw Date: Fri Apr 27 05:32:09 2018 New Revision: 333050 URL: https://svnweb.freebsd.org/changeset/base/333050 Log: Revert r333035 due broken booting on !Marvell GENERIC platforms Reported by: manu Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Fri Apr 27 02:39:36 2018 (r333049) +++ head/sys/arm/conf/GENERIC Fri Apr 27 05:32:09 2018 (r333050) @@ -21,7 +21,6 @@ ident GENERIC cpu CPU_CORTEXA -cpu CPU_MV_PJ4B options SMP_ON_UP machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a" @@ -39,7 +38,6 @@ files "../allwinner/h3/files.h3" files "../broadcom/bcm2835/files.bcm2836" files "../broadcom/bcm2835/files.bcm283x" files "../freescale/imx/files.imx6" -files "../mv/files.arm7" files "../nvidia/tegra124/files.tegra124" files "../qemu/files.qemu" files "../ti/files.ti" @@ -59,8 +57,6 @@ options SOC_ALLWINNER_H3 options SOC_BCM2836 options SOC_TI_AM335X options SOC_OMAP4 -options SOC_MV_ARMADA38X -options SOC_MV_ARMADAXP options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores @@ -189,10 +185,9 @@ device pass # Passthrough device (direct ATA/SCSI a # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb -device uhci +#device uhci device ohci device ehci -device xhci device dwcotg # DWC OTG controller device musb @@ -201,8 +196,6 @@ device umass # Disks/Mass storage - Requires scbus device uhid # "Human Interface Devices" device ukbd # Allow keyboard like HIDs to control console -device firmware - # Device mode support device usb_template # Control of the gadget @@ -211,11 +204,6 @@ device loop device ether device vlan # 802.1Q VLAN support device bpf -device mii -device mdio -device etherswitch -device e6000sw -device neta # Marvell Network controller # Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! @@ -255,11 +243,6 @@ device ti_sdma # Extensible Firmware Interface options EFI - -# Marvell Cryptographic Engine and Security Accelerator -device cesa -device crypto -device cryptodev # Flattened Device Tree options FDT # Configure using FDT/DTB data From owner-svn-src-head@freebsd.org Fri Apr 27 05:36:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0188FFC140B; Fri, 27 Apr 2018 05:36:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA33F7310B; Fri, 27 Apr 2018 05:36:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0462225DA; Fri, 27 Apr 2018 05:36:02 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3R5a2lC064418; Fri, 27 Apr 2018 05:36:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R5a2tG064416; Fri, 27 Apr 2018 05:36:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804270536.w3R5a2tG064416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 Apr 2018 05:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333051 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 333051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 05:36:03 -0000 Author: mjg Date: Fri Apr 27 05:36:02 2018 New Revision: 333051 URL: https://svnweb.freebsd.org/changeset/base/333051 Log: vm: move vm_cnt to __read_mostly now that it is not written to While here whack unused locking keys for the struct. Discussed with: jeff Modified: head/sys/sys/vmmeter.h head/sys/vm/vm_meter.c Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Fri Apr 27 05:32:09 2018 (r333050) +++ head/sys/sys/vmmeter.h Fri Apr 27 05:36:02 2018 (r333051) @@ -73,11 +73,8 @@ struct vmtotal { /* * System wide statistics counters. * Locking: - * a - locked by atomic operations * c - constant after initialization - * f - locked by vm_page_queue_free_mtx * p - uses counter(9) - * q - changes are synchronized by the corresponding vm_pagequeue lock */ struct vmmeter { /* Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Fri Apr 27 05:32:09 2018 (r333050) +++ head/sys/vm/vm_meter.c Fri Apr 27 05:36:02 2018 (r333051) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct vmmeter __exclusive_cache_line vm_cnt = { +struct vmmeter __read_mostly vm_cnt = { .v_swtch = EARLY_COUNTER, .v_trap = EARLY_COUNTER, .v_syscall = EARLY_COUNTER, From owner-svn-src-head@freebsd.org Fri Apr 27 05:37:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B96CFC14B6; Fri, 27 Apr 2018 05:37:36 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE4F873F7E; Fri, 27 Apr 2018 05:37:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7A0A225DB; Fri, 27 Apr 2018 05:37:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3R5bZIG064516; Fri, 27 Apr 2018 05:37:35 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R5bZIl064515; Fri, 27 Apr 2018 05:37:35 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804270537.w3R5bZIl064515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 Apr 2018 05:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333052 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 333052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 05:37:36 -0000 Author: mjg Date: Fri Apr 27 05:37:35 2018 New Revision: 333052 URL: https://svnweb.freebsd.org/changeset/base/333052 Log: uma: whack main zone counter update in the slow path Cached counters are typically zero at this point so it performs avoidable atomics. Everything reading them also reads the cached ones, thus there is really no point. Reviewed by: jeff Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Apr 27 05:36:02 2018 (r333051) +++ head/sys/vm/uma_core.c Fri Apr 27 05:37:35 2018 (r333052) @@ -2329,14 +2329,6 @@ zalloc_start: cpu = curcpu; cache = &zone->uz_cpu[cpu]; - /* - * Since we have locked the zone we may as well send back our stats. - */ - atomic_add_long(&zone->uz_allocs, cache->uc_allocs); - atomic_add_long(&zone->uz_frees, cache->uc_frees); - cache->uc_allocs = 0; - cache->uc_frees = 0; - /* See if we lost the race to fill the cache. */ if (cache->uc_allocbucket != NULL) { ZONE_UNLOCK(zone); From owner-svn-src-head@freebsd.org Fri Apr 27 09:23:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14D0FFC59BF; Fri, 27 Apr 2018 09:23:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC0AD833E4; Fri, 27 Apr 2018 09:23:07 +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 A169424A0A; Fri, 27 Apr 2018 09:23:07 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3R9N7Rp079779; Fri, 27 Apr 2018 09:23:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R9N7Jn079778; Fri, 27 Apr 2018 09:23:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804270923.w3R9N7Jn079778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 27 Apr 2018 09:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333054 - 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: 333054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 09:23:08 -0000 Author: manu Date: Fri Apr 27 09:23:07 2018 New Revision: 333054 URL: https://svnweb.freebsd.org/changeset/base/333054 Log: allwinner: clk: Correct aw_clk_get_factor Switch test between zero based factor and power of two one. This resulted in a miscalculation of the factor if it was a power of two one. Some clocks frequencies were not calculated correctly because of that. Modified: head/sys/arm/allwinner/clkng/aw_clk.h Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Fri Apr 27 08:56:17 2018 (r333053) +++ head/sys/arm/allwinner/clkng/aw_clk.h Fri Apr 27 09:23:07 2018 (r333054) @@ -110,10 +110,11 @@ aw_clk_get_factor(uint32_t val, struct aw_clk_factor * return (factor->value); factor_val = (val & factor->mask) >> factor->shift; - if (!(factor->flags & AW_CLK_FACTOR_ZERO_BASED)) - factor_val += 1; - else if (factor->flags & AW_CLK_FACTOR_POWER_OF_TWO) + + if (factor->flags & AW_CLK_FACTOR_POWER_OF_TWO) factor_val = 1 << factor_val; + else if (!(factor->flags & AW_CLK_FACTOR_ZERO_BASED)) + factor_val += 1; return (factor_val); } From owner-svn-src-head@freebsd.org Fri Apr 27 09:25:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7626FC5A60; Fri, 27 Apr 2018 09:25: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C9B0835C3; Fri, 27 Apr 2018 09:25: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 5755024A0C; Fri, 27 Apr 2018 09:25: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 w3R9PR0D079902; Fri, 27 Apr 2018 09:25:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R9PRv2079901; Fri, 27 Apr 2018 09:25:27 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804270925.w3R9PRv2079901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 27 Apr 2018 09:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333055 - 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: 333055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 09:25:27 -0000 Author: manu Date: Fri Apr 27 09:25:27 2018 New Revision: 333055 URL: https://svnweb.freebsd.org/changeset/base/333055 Log: allwinner: clk: Add gate_shift to the clock definition WHile gate_shift was present in the NM_CLK macro it wasn't set into the clock definition structure resulting in NM clocks not being correctly gated when they should. If the module wasn't enabled by the bootloader it will have stayed ungated. Modified: head/sys/arm/allwinner/clkng/aw_clk.h Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Fri Apr 27 09:23:07 2018 (r333054) +++ head/sys/arm/allwinner/clkng/aw_clk.h Fri Apr 27 09:25:27 2018 (r333055) @@ -331,6 +331,7 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .m.value = _mvalue, \ .m.flags = _mflags, \ .mux_width = _mux_width, \ + .gate_shift = _gate_shift, \ .flags = _flags, \ } From owner-svn-src-head@freebsd.org Fri Apr 27 12:44:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82F8AFA7313; Fri, 27 Apr 2018 12:44:22 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2893B6AA06; Fri, 27 Apr 2018 12:44:22 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F07C26974; Fri, 27 Apr 2018 12:44:22 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RCiLYU080124; Fri, 27 Apr 2018 12:44:21 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RCiLaD080115; Fri, 27 Apr 2018 12:44:21 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201804271244.w3RCiLaD080115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Fri, 27 Apr 2018 12:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333059 - in head/sys/amd64: amd64 include X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys/amd64: amd64 include X-SVN-Commit-Revision: 333059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 12:44:22 -0000 Author: tychon Date: Fri Apr 27 12:44:20 2018 New Revision: 333059 URL: https://svnweb.freebsd.org/changeset/base/333059 Log: Expand the checks for UCR3 == PMAP_NO_CR3 to enable processes to be excluded from PTI. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15100 Modified: head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/asmacros.h head/sys/amd64/include/pcpu.h Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/amd64/cpu_switch.S Fri Apr 27 12:44:20 2018 (r333059) @@ -215,10 +215,13 @@ done_tss: movq %r8,PCPU(RSP0) movq %r8,PCPU(CURPCB) /* Update the TSS_RSP0 pointer for the next interrupt */ - cmpb $0,pti(%rip) - jne 1f - movq %r8,TSS_RSP0(%rdx) -1: movq %r12,PCPU(CURTHREAD) /* into next thread */ + cmpq $~0,PCPU(UCR3) + je 1f + movq PCPU(PTI_RSP0),%rax + movq %rax,TSS_RSP0(%rdx) + jmp 2f +1: movq %r8,TSS_RSP0(%rdx) +2: movq %r12,PCPU(CURTHREAD) /* into next thread */ /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%r8) @@ -295,12 +298,7 @@ do_tss: movq %rdx,PCPU(TSSP) shrq $8,%rcx movl %ecx,8(%rax) movb $0x89,5(%rax) /* unset busy */ - cmpb $0,pti(%rip) - je 1f - movq PCPU(PRVSPACE),%rax - addq $PC_PTI_STACK+PC_PTI_STACK_SZ*8,%rax - movq %rax,TSS_RSP0(%rdx) -1: movl $TSSSEL,%eax + movl $TSSSEL,%eax ltr %ax jmp done_tss Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/amd64/exception.S Fri Apr 27 12:44:20 2018 (r333059) @@ -298,11 +298,15 @@ IDTVEC(page_pti) jz Xpage swapgs pushq %rax - pushq %rdx movq %cr3,%rax movq %rax,PCPU(SAVED_UCR3) + cmpq $~0,PCPU(UCR3) + jne 1f + popq %rax + jmp 2f +1: pushq %rdx PTI_UUENTRY has_err=1 - subq $TF_ERR,%rsp +2: subq $TF_ERR,%rsp movq %rdi,TF_RDI(%rsp) movq %rax,TF_RAX(%rsp) movq %rdx,TF_RDX(%rsp) @@ -347,9 +351,11 @@ page_cr2: */ .macro PROTF_ENTRY name,trapno \name\()_pti_doreti: + swapgs + cmpq $~0,PCPU(UCR3) + je 1f pushq %rax pushq %rdx - swapgs movq PCPU(KCR3),%rax movq %rax,%cr3 movq PCPU(RSP0),%rax @@ -362,7 +368,7 @@ page_cr2: movq %rax,%rsp popq %rdx popq %rax - swapgs +1: swapgs jmp X\name IDTVEC(\name\()_pti) cmpq $doreti_iret,PTI_RIP-2*8(%rsp) @@ -438,6 +444,8 @@ prot_addrf: IDTVEC(fast_syscall_pti) swapgs movq %rax,PCPU(SCRATCH_RAX) + cmpq $~0,PCPU(UCR3) + je fast_syscall_common movq PCPU(KCR3),%rax movq %rax,%cr3 jmp fast_syscall_common @@ -503,7 +511,7 @@ fast_syscall_common: movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ movq TF_RSP(%rsp),%rsp /* user stack pointer */ - cmpb $0,pti + cmpq $~0,PCPU(UCR3) je 2f movq PCPU(UCR3),%r9 movq %r9,%cr3 @@ -1011,11 +1019,11 @@ ld_regs: jz 2f /* keep running with kernel GS.base */ cli call handle_ibrs_exit_rs - cmpb $0,pti + cmpq $~0,PCPU(UCR3) je 1f pushq %rdx - movq PCPU(PRVSPACE),%rdx - addq $PC_PTI_STACK+PC_PTI_STACK_SZ*8-PTI_SIZE,%rdx + movq PCPU(PTI_RSP0),%rdx + subq $PTI_SIZE,%rdx movq %rax,PTI_RAX(%rdx) popq %rax movq %rax,PTI_RDX(%rdx) Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/amd64/genassym.c Fri Apr 27 12:44:20 2018 (r333059) @@ -227,6 +227,7 @@ ASSYM(PC_UCR3, offsetof(struct pcpu, pc_ucr3)); ASSYM(PC_SAVED_UCR3, offsetof(struct pcpu, pc_saved_ucr3)); ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack)); ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ); +ASSYM(PC_PTI_RSP0, offsetof(struct pcpu, pc_pti_rsp0)); ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set)); ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/amd64/machdep.c Fri Apr 27 12:44:20 2018 (r333059) @@ -1795,9 +1795,10 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) rsp0 = (vm_offset_t)thread0.td_pcb; /* Ensure the stack is aligned to 16 bytes */ rsp0 &= ~0xFul; - common_tss[0].tss_rsp0 = pti ? ((vm_offset_t)PCPU_PTR(pti_stack) + - PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful : rsp0; + common_tss[0].tss_rsp0 = rsp0; PCPU_SET(rsp0, rsp0); + PCPU_SET(pti_rsp0, ((vm_offset_t)PCPU_PTR(pti_stack) + + PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful); PCPU_SET(curpcb, thread0.td_pcb); /* transfer to user mode */ Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/amd64/mp_machdep.c Fri Apr 27 12:44:20 2018 (r333059) @@ -276,6 +276,8 @@ init_secondary(void) pc->pc_tssp = &common_tss[cpu]; pc->pc_commontssp = &common_tss[cpu]; pc->pc_rsp0 = 0; + pc->pc_pti_rsp0 = ((vm_offset_t)&pc->pc_pti_stack + + PC_PTI_STACK_SZ * sizeof(uint64_t) & ~0xful); pc->pc_tss = (struct system_segment_descriptor *)&gdt[NGDT * cpu + GPROC0_SEL]; pc->pc_fs32p = &gdt[NGDT * cpu + GUFS32_SEL]; @@ -285,8 +287,7 @@ init_secondary(void) pc->pc_curpmap = kernel_pmap; pc->pc_pcid_gen = 1; pc->pc_pcid_next = PMAP_PCID_KERN + 1; - common_tss[cpu].tss_rsp0 = pti ? ((vm_offset_t)&pc->pc_pti_stack + - PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful : 0; + common_tss[cpu].tss_rsp0 = 0; /* Save the per-cpu pointer for use by the NMI handler. */ np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/amd64/pmap.c Fri Apr 27 12:44:20 2018 (r333059) @@ -2607,8 +2607,10 @@ pmap_pinit0(pmap_t pmap) CPU_FOREACH(i) { pmap->pm_pcids[i].pm_pcid = PMAP_PCID_NONE; pmap->pm_pcids[i].pm_gen = 0; - if (!pti) + if (!pti) { __pcpu[i].pc_kcr3 = PMAP_NO_CR3; + __pcpu[i].pc_ucr3 = PMAP_NO_CR3; + } } PCPU_SET(curpmap, kernel_pmap); pmap_activate(curthread); @@ -2783,7 +2785,8 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str * the kernel-mode page table active on return * to user space. */ - *pml4 |= pg_nx; + if (pmap->pm_ucr3 != PMAP_NO_CR3) + *pml4 |= pg_nx; pml4u = &pmap->pm_pml4u[pml4index]; *pml4u = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | @@ -7359,9 +7362,10 @@ pmap_activate_sw(struct thread *td) { pmap_t oldpmap, pmap; struct invpcid_descr d; - uint64_t cached, cr3, kcr3, kern_pti_cached, ucr3; + uint64_t cached, cr3, kcr3, kern_pti_cached, rsp0, ucr3; register_t rflags; u_int cpuid; + struct amd64tss *tssp; oldpmap = PCPU_GET(curpmap); pmap = vmspace_pmap(td->td_proc->p_vmspace); @@ -7451,6 +7455,12 @@ pmap_activate_sw(struct thread *td) PCPU_SET(kcr3, pmap->pm_cr3); PCPU_SET(ucr3, pmap->pm_ucr3); } + } + if (pmap->pm_ucr3 != PMAP_NO_CR3) { + rsp0 = ((vm_offset_t)PCPU_PTR(pti_stack) + + PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful; + tssp = PCPU_GET(tssp); + tssp->tss_rsp0 = rsp0; } #ifdef SMP CPU_CLR_ATOMIC(cpuid, &oldpmap->pm_active); Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/amd64/trap.c Fri Apr 27 12:44:20 2018 (r333059) @@ -461,11 +461,13 @@ trap(struct trapframe *frame) */ if (frame->tf_rip == (long)doreti_iret) { frame->tf_rip = (long)doreti_iret_fault; - if (pti && frame->tf_rsp == (uintptr_t)PCPU_PTR( - pti_stack) + (PC_PTI_STACK_SZ - 5) * - sizeof(register_t)) + if ((PCPU_GET(curpmap)->pm_ucr3 != + PMAP_NO_CR3) && + (frame->tf_rsp == (uintptr_t)PCPU_GET( + pti_rsp0) - 5 * sizeof(register_t))) { frame->tf_rsp = PCPU_GET(rsp0) - 5 * sizeof(register_t); + } return; } if (frame->tf_rip == (long)ld_ds) { Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/include/asmacros.h Fri Apr 27 12:44:20 2018 (r333059) @@ -196,9 +196,12 @@ .macro PTI_UENTRY has_err swapgs + cmpq $~0,PCPU(UCR3) + je 1f pushq %rax pushq %rdx PTI_UUENTRY \has_err +1: .endm .macro PTI_ENTRY name, cont, has_err=0 Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Fri Apr 27 12:03:27 2018 (r333058) +++ head/sys/amd64/include/pcpu.h Fri Apr 27 12:44:20 2018 (r333059) @@ -68,14 +68,15 @@ uint64_t pc_pm_save_cnt; \ u_int pc_cmci_mask; /* MCx banks for CMCI */ \ uint64_t pc_dbreg[16]; /* ddb debugging regs */ \ - uint64_t pc_pti_stack[PC_PTI_STACK_SZ]; \ + uint64_t pc_pti_stack[PC_PTI_STACK_SZ]; \ + register_t pc_pti_rsp0; \ int pc_dbreg_cmd; /* ddb debugging reg cmd */ \ u_int pc_vcpu_id; /* Xen vCPU ID */ \ uint32_t pc_pcid_next; \ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[224] /* be divisor of PAGE_SIZE \ + char __pad[216] /* be divisor of PAGE_SIZE \ after cache alignment */ #define PC_DBREG_CMD_NONE 0 From owner-svn-src-head@freebsd.org Fri Apr 27 13:55:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F91AFA852B; Fri, 27 Apr 2018 13:55: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D1D379E78; Fri, 27 Apr 2018 13:55: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 34AE72746D; Fri, 27 Apr 2018 13:55:47 +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 w3RDtlAY015325; Fri, 27 Apr 2018 13:55:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RDtloK015324; Fri, 27 Apr 2018 13:55:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804271355.w3RDtloK015324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Apr 2018 13:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333062 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 13:55:47 -0000 Author: emaste Date: Fri Apr 27 13:55:46 2018 New Revision: 333062 URL: https://svnweb.freebsd.org/changeset/base/333062 Log: elf_common.h: add DT_SUNW_ASLR tag For upcoming ELF Tool Chain import (readelf). Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Fri Apr 27 12:57:39 2018 (r333061) +++ head/sys/sys/elf_common.h Fri Apr 27 13:55:46 2018 (r333062) @@ -598,6 +598,7 @@ typedef struct { #define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */ #define DT_SUNW_FILTER 0x6000000f /* symbol filter name */ #define DT_SUNW_CAP 0x60000010 /* hardware/software */ +#define DT_SUNW_ASLR 0x60000023 /* ASLR control */ #define DT_HIOS 0x6ffff000 /* Last OS-specific */ /* From owner-svn-src-head@freebsd.org Fri Apr 27 13:59:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 953B0FA8683; Fri, 27 Apr 2018 13:59:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 461A67C120; Fri, 27 Apr 2018 13:59:27 +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 3826227473; Fri, 27 Apr 2018 13:59:27 +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 w3RDxRki015814; Fri, 27 Apr 2018 13:59:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RDxOZo015789; Fri, 27 Apr 2018 13:59:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804271359.w3RDxOZo015789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Apr 2018 13:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333063 - in head: contrib/elftoolchain/ar contrib/elftoolchain/common contrib/elftoolchain/elfcopy contrib/elftoolchain/elfdump contrib/elftoolchain/libdwarf contrib/elftoolchain/libel... X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: contrib/elftoolchain/ar contrib/elftoolchain/common contrib/elftoolchain/elfcopy contrib/elftoolchain/elfdump contrib/elftoolchain/libdwarf contrib/elftoolchain/libelf contrib/elftoolchain/li... X-SVN-Commit-Revision: 333063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 13:59:27 -0000 Author: emaste Date: Fri Apr 27 13:59:24 2018 New Revision: 333063 URL: https://svnweb.freebsd.org/changeset/base/333063 Log: Update ELF Tool Chain to r3614 MFC after: 1 week Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/ar/Makefile head/contrib/elftoolchain/common/Makefile head/contrib/elftoolchain/common/os.Linux.mk head/contrib/elftoolchain/elfcopy/Makefile head/contrib/elftoolchain/elfcopy/binary.c head/contrib/elftoolchain/elfcopy/elfcopy.1 head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/libdwarf/Makefile head/contrib/elftoolchain/libdwarf/libdwarf.h head/contrib/elftoolchain/libdwarf/libdwarf_frame.c head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c head/contrib/elftoolchain/libelf/Makefile head/contrib/elftoolchain/libelf/_libelf_config.h head/contrib/elftoolchain/libelf/gelf_phdr.c head/contrib/elftoolchain/libelf/libelf_ehdr.c head/contrib/elftoolchain/libelftc/Makefile head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c head/contrib/elftoolchain/libpe/Makefile head/contrib/elftoolchain/nm/nm.1 head/contrib/elftoolchain/readelf/readelf.c head/contrib/elftoolchain/strings/strings.c head/lib/libelftc/elftc_version.c Directory Properties: head/contrib/elftoolchain/ (props changed) head/contrib/elftoolchain/ar/ (props changed) head/contrib/elftoolchain/elfdump/ (props changed) Modified: head/contrib/elftoolchain/ar/Makefile ============================================================================== --- head/contrib/elftoolchain/ar/Makefile Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/ar/Makefile Fri Apr 27 13:59:24 2018 (r333063) @@ -1,4 +1,4 @@ -# $Id: Makefile 3107 2014-12-20 08:31:58Z kaiwang27 $ +# $Id: Makefile 3608 2018-04-14 21:23:04Z jkoshy $ TOP= .. @@ -32,4 +32,6 @@ ${EXTRA_TARGETS}: ${PROG} .if ${OS_HOST} == "OpenBSD" CFLAGS+= -I/usr/local/include LDFLAGS+= -L/usr/local/lib +.elif ${OS_HOST} == "DragonFly" +LDADD+= -lbz2 .endif Modified: head/contrib/elftoolchain/common/Makefile ============================================================================== --- head/contrib/elftoolchain/common/Makefile Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/common/Makefile Fri Apr 27 13:59:24 2018 (r333063) @@ -1,4 +1,4 @@ -# $Id: Makefile 3022 2014-04-17 18:05:58Z jkoshy $ +# $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $ TOP= .. @@ -7,12 +7,12 @@ INCSDIR= /usr/include .PHONY: all clean clobber depend obj -all depend obj: +all depend: clean clobber: rm -f ${CLEANFILES} cleandepend: - rm -f .depend + rm -f ${.OBJDIR}/.depend .include "${TOP}/mk/elftoolchain.inc.mk" Modified: head/contrib/elftoolchain/common/os.Linux.mk ============================================================================== --- head/contrib/elftoolchain/common/os.Linux.mk Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/common/os.Linux.mk Fri Apr 27 13:59:24 2018 (r333063) @@ -1,13 +1,15 @@ # # Build recipes for Linux based operating systems. # -# $Id: os.Linux.mk 2064 2011-10-26 15:12:32Z jkoshy $ +# $Id: os.Linux.mk 3594 2018-04-11 18:26:50Z jkoshy $ _NATIVE_ELF_FORMAT = native-elf-format -.BEGIN: ${_NATIVE_ELF_FORMAT}.h +.if !make(obj) +.BEGIN: ${.OBJDIR}/${_NATIVE_ELF_FORMAT}.h -${_NATIVE_ELF_FORMAT}.h: +${.OBJDIR}/${_NATIVE_ELF_FORMAT}.h: ${.CURDIR}/${_NATIVE_ELF_FORMAT} > ${.TARGET} || rm ${.TARGET} +.endif -CLEANFILES += ${_NATIVE_ELF_FORMAT}.h +CLEANFILES += ${.OBJDIR}/${_NATIVE_ELF_FORMAT}.h Modified: head/contrib/elftoolchain/elfcopy/Makefile ============================================================================== --- head/contrib/elftoolchain/elfcopy/Makefile Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/elfcopy/Makefile Fri Apr 27 13:59:24 2018 (r333063) @@ -1,4 +1,4 @@ -# $Id: Makefile 3381 2016-01-30 19:39:47Z jkoshy $ +# $Id: Makefile 3608 2018-04-14 21:23:04Z jkoshy $ TOP= .. @@ -18,7 +18,7 @@ LDADD= -lelf -lelftc LDADD+= -larchive .endif -.if defined(WITH_PE) && ${WITH_PE:tl} == "yes" +.if defined(WITH_PE) && ${WITH_PE} == "yes" SRCS+= pe.c CFLAGS+= -DWITH_PE=1 @@ -51,4 +51,6 @@ ${EXTRA_TARGETS}: ${PROG} .if ${OS_HOST} == "OpenBSD" CFLAGS+= -I/usr/local/include LDFLAGS+= -L/usr/local/lib +.elif ${OS_HOST} == "DragonFly" +LDADD+= -lbz2 .endif Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/elfcopy/binary.c Fri Apr 27 13:59:24 2018 (r333063) @@ -36,7 +36,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: binary.c 3445 2016-04-20 19:08:30Z emaste $"); +ELFTC_VCSID("$Id: binary.c 3611 2018-04-16 21:35:18Z jkoshy $"); /* * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set @@ -215,7 +215,7 @@ create_elf_from_binary(struct elfcopy *ecp, int ifd, c if ((sym_basename = strdup(ifn)) == NULL) err(1, "strdup"); for (p = sym_basename; *p != '\0'; p++) - if (!isalnum(*p)) + if (!isalnum(*p & 0xFF)) *p = '_'; #define _GEN_SYMNAME(S) do { \ snprintf(name, sizeof(name), "%s%s%s", "_binary_", sym_basename, S); \ Modified: head/contrib/elftoolchain/elfcopy/elfcopy.1 ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.1 Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/elfcopy/elfcopy.1 Fri Apr 27 13:59:24 2018 (r333063) @@ -21,9 +21,9 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3426 2016-03-05 13:32:28Z emaste $ +.\" $Id: elfcopy.1 3565 2017-08-31 02:24:19Z emaste $ .\" -.Dd April 20, 2017 +.Dd August 30, 2017 .Os .Dt ELFCOPY 1 .Sh NAME Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/elfcopy/main.c Fri Apr 27 13:59:24 2018 (r333063) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3520 2017-04-17 01:47:52Z kaiwang27 $"); +ELFTC_VCSID("$Id: main.c 3577 2017-09-14 02:19:42Z emaste $"); enum options { Modified: head/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- head/contrib/elftoolchain/elfdump/elfdump.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/elfdump/elfdump.c Fri Apr 27 13:59:24 2018 (r333063) @@ -50,7 +50,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: elfdump.c 3521 2017-06-04 20:07:09Z jkoshy $"); +ELFTC_VCSID("$Id: elfdump.c 3584 2017-11-05 20:51:43Z jkoshy $"); #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" @@ -915,7 +915,7 @@ elf_print_ar(struct elfdump *ed, int fd) Elf_Arhdr *arh; Elf_Arsym *arsym; Elf_Cmd cmd; - char idx[10]; + char idx[21]; size_t cnt, i; ed->ar = ed->elf; @@ -1496,7 +1496,7 @@ elf_print_symtab(struct elfdump *ed, int i) struct section *s; const char *name; uint16_t *vs; - char idx[10]; + char idx[13]; Elf_Data *data; GElf_Sym sym; int len, j, elferr, nvs; @@ -1590,7 +1590,7 @@ elf_print_dynamic(struct elfdump *ed) { struct section *s; const char *name; - char idx[10]; + char idx[13]; Elf_Data *data; GElf_Dyn dyn; int elferr, i, len; @@ -2052,7 +2052,7 @@ elf_print_note(struct elfdump *ed) size_t count; int elferr, i; uint8_t *src; - char idx[10]; + char idx[17]; s = NULL; for (i = 0; (size_t)i < ed->shnum; i++) { Modified: head/contrib/elftoolchain/libdwarf/Makefile ============================================================================== --- head/contrib/elftoolchain/libdwarf/Makefile Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libdwarf/Makefile Fri Apr 27 13:59:24 2018 (r333063) @@ -1,6 +1,6 @@ -# $Id: Makefile 3097 2014-09-02 22:10:18Z kaiwang27 $ +# $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $ -TOP= ${.CURDIR}/.. +TOP= .. LIB= dwarf Modified: head/contrib/elftoolchain/libdwarf/libdwarf.h ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf.h Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libdwarf/libdwarf.h Fri Apr 27 13:59:24 2018 (r333063) @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: libdwarf.h 3295 2016-01-08 22:08:10Z jkoshy $ + * $Id: libdwarf.h 3578 2017-09-14 02:21:28Z emaste $ */ #ifndef _LIBDWARF_H_ Modified: head/contrib/elftoolchain/libdwarf/libdwarf_frame.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_frame.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libdwarf/libdwarf_frame.c Fri Apr 27 13:59:24 2018 (r333063) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: libdwarf_frame.c 3106 2014-12-19 16:00:58Z kaiwang27 $"); +ELFTC_VCSID("$Id: libdwarf_frame.c 3589 2018-03-13 20:34:33Z kaiwang27 $"); static int _dwarf_frame_find_cie(Dwarf_FrameSec fs, Dwarf_Unsigned offset, @@ -142,6 +142,8 @@ _dwarf_frame_parse_lsb_cie_augment(Dwarf_Debug dbg, Dw augdata_p = cie->cie_augdata; while (*aug_p != '\0') { switch (*aug_p) { + case 'S': + break; case 'L': /* Skip one augment in augment data. */ augdata_p++; Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Fri Apr 27 13:59:24 2018 (r333063) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: libdwarf_reloc.c 3198 2015-05-14 18:36:19Z emaste $"); +ELFTC_VCSID("$Id: libdwarf_reloc.c 3578 2017-09-14 02:21:28Z emaste $"); Dwarf_Unsigned _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) Modified: head/contrib/elftoolchain/libelf/Makefile ============================================================================== --- head/contrib/elftoolchain/libelf/Makefile Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libelf/Makefile Fri Apr 27 13:59:24 2018 (r333063) @@ -1,6 +1,6 @@ -# $Id: Makefile 2605 2012-10-02 17:52:20Z jkoshy $ +# $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $ -TOP= ${.CURDIR}/.. +TOP= .. LIB= elf Modified: head/contrib/elftoolchain/libelf/_libelf_config.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf_config.h Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libelf/_libelf_config.h Fri Apr 27 13:59:24 2018 (r333063) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _libelf_config.h 3400 2016-02-12 18:38:49Z emaste $ + * $Id: _libelf_config.h 3566 2017-08-31 02:28:40Z emaste $ */ #if defined(__APPLE__) || defined(__DragonFly__) Modified: head/contrib/elftoolchain/libelf/gelf_phdr.c ============================================================================== --- head/contrib/elftoolchain/libelf/gelf_phdr.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libelf/gelf_phdr.c Fri Apr 27 13:59:24 2018 (r333063) @@ -31,7 +31,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: gelf_phdr.c 3177 2015-03-30 18:19:41Z emaste $"); +ELFTC_VCSID("$Id: gelf_phdr.c 3576 2017-09-14 02:15:29Z emaste $"); Elf32_Phdr * elf32_getphdr(Elf *e) Modified: head/contrib/elftoolchain/libelf/libelf_ehdr.c ============================================================================== --- head/contrib/elftoolchain/libelf/libelf_ehdr.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libelf/libelf_ehdr.c Fri Apr 27 13:59:24 2018 (r333063) @@ -31,7 +31,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: libelf_ehdr.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: libelf_ehdr.c 3575 2017-09-14 02:13:36Z emaste $"); /* * Retrieve counts for sections, phdrs and the section string table index Modified: head/contrib/elftoolchain/libelftc/Makefile ============================================================================== --- head/contrib/elftoolchain/libelftc/Makefile Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libelftc/Makefile Fri Apr 27 13:59:24 2018 (r333063) @@ -1,6 +1,6 @@ -# $Id: Makefile 3489 2016-08-31 00:12:15Z emaste $ +# $Id: Makefile 3601 2018-04-12 16:58:53Z jkoshy $ -TOP= ${.CURDIR}/.. +TOP= .. LIB= elftc @@ -28,7 +28,8 @@ SHLIB_MAJOR= 1 WARNS?= 6 -CLEANFILES+= elftc_version.c +ELFTC_VERSION_FILE= ${.OBJDIR}/elftc_version.c +CLEANFILES+= ${ELFTC_VERSION_FILE} LDADD+= -lelf @@ -50,10 +51,10 @@ MLINKS= elftc_bfd_find_target.3 elftc_bfd_target_byteo elftc_string_table_create.3 elftc_string_table_insert.3 \ elftc_string_table_create.3 elftc_string_table_lookup.3 -.if !make(clean) && !make(clobber) +.if !make(clean) && !make(clobber) && !make(obj) .BEGIN: .SILENT - ${.CURDIR}/make-toolchain-version -t ${TOP} -r ${RELEASE} \ - -h ${OS_HOST} + ${.CURDIR}/make-toolchain-version -t ${.CURDIR}/${TOP} \ + -r ${RELEASE} -h ${OS_HOST} -o ${ELFTC_VERSION_FILE} .endif .include "${TOP}/mk/elftoolchain.lib.mk" Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Fri Apr 27 13:59:24 2018 (r333063) @@ -37,7 +37,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3560 2017-06-25 00:28:23Z kaiwang27 $"); +ELFTC_VCSID("$Id: libelftc_dem_gnu3.c 3583 2017-10-15 15:38:47Z emaste $"); /** * @file cpp_demangle.c @@ -574,8 +574,7 @@ cpp_demangle_push_type_qualifier(struct cpp_demangle_d if (!DEM_PUSH_STR(ddata, " imaginary")) goto clean; if (type_str != NULL) { - if (!vector_str_push(&subst_v, " imaginary", - 10)) + if (!VEC_PUSH_STR(&subst_v, " imaginary")) goto clean; if (!cpp_demangle_push_subst_v(ddata, &subst_v)) @@ -1616,8 +1615,7 @@ cpp_demangle_read_encoding(struct cpp_demangle_data *d case SIMPLE_HASH('T', 'v'): /* virtual function virtual override thunk */ - if (!DEM_PUSH_STR(ddata, - "virtual function virtual override ")) + if (!DEM_PUSH_STR(ddata, "virtual function virtual override ")) return (0); ddata->cur += 2; if (*ddata->cur == '\0') Modified: head/contrib/elftoolchain/libpe/Makefile ============================================================================== --- head/contrib/elftoolchain/libpe/Makefile Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/libpe/Makefile Fri Apr 27 13:59:24 2018 (r333063) @@ -1,6 +1,6 @@ -# $Id: Makefile 3349 2016-01-18 21:09:16Z jkoshy $ +# $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $ -TOP= ${.CURDIR}/.. +TOP= .. LIB= pe Modified: head/contrib/elftoolchain/nm/nm.1 ============================================================================== --- head/contrib/elftoolchain/nm/nm.1 Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/nm/nm.1 Fri Apr 27 13:59:24 2018 (r333063) @@ -22,9 +22,9 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: nm.1 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: nm.1 3573 2017-09-14 02:06:31Z emaste $ .\" -.Dd May 21, 2017 +.Dd September 13, 2017 .Os .Dt NM 1 .Sh NAME Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Apr 27 13:59:24 2018 (r333063) @@ -47,7 +47,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: readelf.c 3519 2017-04-09 23:15:58Z kaiwang27 $"); +ELFTC_VCSID("$Id: readelf.c 3580 2017-09-15 23:29:59Z emaste $"); /* Backwards compatability for older FreeBSD releases. */ #ifndef STB_GNU_UNIQUE @@ -822,6 +822,7 @@ dt_type(unsigned int mach, unsigned int dtype) case DT_SUNW_RTLDINF: return "SUNW_RTLDINF"; case DT_SUNW_FILTER: return "SUNW_FILTER"; case DT_SUNW_CAP: return "SUNW_CAP"; + case DT_SUNW_ASLR: return "SUNW_ASLR"; case DT_CHECKSUM: return "CHECKSUM"; case DT_PLTPADSZ: return "PLTPADSZ"; case DT_MOVEENT: return "MOVEENT"; Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/contrib/elftoolchain/strings/strings.c Fri Apr 27 13:59:24 2018 (r333063) @@ -46,7 +46,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: strings.c 3498 2016-10-26 19:25:13Z emaste $"); +ELFTC_VCSID("$Id: strings.c 3571 2017-09-14 02:04:50Z emaste $"); enum radix_style { RADIX_DECIMAL, Modified: head/lib/libelftc/elftc_version.c ============================================================================== --- head/lib/libelftc/elftc_version.c Fri Apr 27 13:55:46 2018 (r333062) +++ head/lib/libelftc/elftc_version.c Fri Apr 27 13:59:24 2018 (r333063) @@ -6,5 +6,5 @@ const char * elftc_version(void) { - return "elftoolchain r3561M"; + return "elftoolchain r3614M"; } From owner-svn-src-head@freebsd.org Fri Apr 27 14:29:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CFFAFA90A8; Fri, 27 Apr 2018 14:29:34 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7135582536; Fri, 27 Apr 2018 14:29:33 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w3RETO5C006822; Fri, 27 Apr 2018 07:29:24 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w3RETMCl006821; Fri, 27 Apr 2018 07:29:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201804271429.w3RETMCl006821@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333052 - head/sys/vm In-Reply-To: <201804270537.w3R5bZIl064515@repo.freebsd.org> To: Mateusz Guzik Date: Fri, 27 Apr 2018 07:29:22 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 14:29:34 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: mjg > Date: Fri Apr 27 05:37:35 2018 > New Revision: 333052 > URL: https://svnweb.freebsd.org/changeset/base/333052 > > Log: > uma: whack main zone counter update in the slow path Remove might be a better word, whack is ambigous in this context. > Cached counters are typically zero at this point so it performs > avoidable atomics. Everything reading them also reads the cached > ones, thus there is really no point. No point in? reading them, writting them, updating them? > > Reviewed by: jeff > > Modified: > head/sys/vm/uma_core.c > > Modified: head/sys/vm/uma_core.c > ============================================================================== > --- head/sys/vm/uma_core.c Fri Apr 27 05:36:02 2018 (r333051) > +++ head/sys/vm/uma_core.c Fri Apr 27 05:37:35 2018 (r333052) > @@ -2329,14 +2329,6 @@ zalloc_start: > cpu = curcpu; > cache = &zone->uz_cpu[cpu]; > > - /* > - * Since we have locked the zone we may as well send back our stats. > - */ > - atomic_add_long(&zone->uz_allocs, cache->uc_allocs); > - atomic_add_long(&zone->uz_frees, cache->uc_frees); > - cache->uc_allocs = 0; > - cache->uc_frees = 0; > - > /* See if we lost the race to fill the cache. */ > if (cache->uc_allocbucket != NULL) { > ZONE_UNLOCK(zone); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Apr 27 14:35:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BD2FFA92C3; Fri, 27 Apr 2018 14:35:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22F8382F62; Fri, 27 Apr 2018 14:35:46 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x243.google.com with SMTP id g13-v6so2508253qth.8; Fri, 27 Apr 2018 07:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0jMC8cyPeqmq0iTHoIxMtGiM+7LLI5SDw/ny+wwwnMo=; b=lsQCH5fmuSAj3ANGdNLH7Jhf9XzDj5sQu5gIM5fnEXDtdj+/PZZvtBhOTcdhGqhkPg sDlZLuRP/2aRKR46xq55wbAB4SfVftVyPXDYbjhTp/MjbCEC/S8rqBpQvQ0V/89lE0J0 3SDGoIbNPABcVqNE+lA0vwYpqbhRH9mX5ZKlsXABbRJ3QpH/cfNbydIt82Gjo46NmgEc yyFmjKyFinoPJuBDgAOwtEt/KG2ZnyxRWSnh11CLM2U4ltY5GqeRbPACUuPbxotLOVXq hsnv+B5tjEt0mGPQvpndvWGvaP2AdiYsX+Cy3+xEfSN1H09UDZfEqh3iT3Wsah9E9HS2 s/mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0jMC8cyPeqmq0iTHoIxMtGiM+7LLI5SDw/ny+wwwnMo=; b=mQnMcbiT7jWiqP4w8ngCqw6CtA7tjBsqrRBZGbkNgZk/Va4EN+JZlhpr8BgPVY8c5P THA0l3mCmzXAEr86OHFRXzt5SyBmdt1ELD2KCBzVKrjtD3e6czIak6tjQti/jYsm5W6d d9QnOGfAFwndAGydy7X6vyl2k8tUuH1FE7bQ4OMRyw71o7N0ZHy5SAZBHZaUBMAtdaCa vbP29gLZtIkfFs5QbQUr5uf7B+LnJ8Sw6KjwZa65g5HXgWTrbmTEg9FuaVVAydIsIx3V Yw5fzHB4W1GO7lw5nyt/59FIKrZvWz10mPaU3Ik65aGDamdunael31foO3BlzcKR6o8L ZL4Q== X-Gm-Message-State: ALQs6tA9mCY5Oo6bgrs4iR19Ehf67zXjOwlol81GcVJWKe5WEnZHpap/ 1SCnyt1TFNvvMoU8rhVIV61At6LsDjWfbtx82Z8= X-Google-Smtp-Source: AB8JxZo61eC7irs5MSfniOg+KH5jOU1mLPfgAky5nFSrYUVSmxayrWNpTv4VIf7XpEsdhUrZ7uh4Tax94TwBhPxgx3Y= X-Received: by 2002:aed:3edd:: with SMTP id o29-v6mr2269036qtf.248.1524839745660; Fri, 27 Apr 2018 07:35:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.28.74 with HTTP; Fri, 27 Apr 2018 07:35:45 -0700 (PDT) In-Reply-To: <201804271429.w3RETMCl006821@pdx.rh.CN85.dnsmgr.net> References: <201804270537.w3R5bZIl064515@repo.freebsd.org> <201804271429.w3RETMCl006821@pdx.rh.CN85.dnsmgr.net> From: Mateusz Guzik Date: Fri, 27 Apr 2018 16:35:45 +0200 Message-ID: Subject: Re: svn commit: r333052 - head/sys/vm To: rgrimes@freebsd.org Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 14:35:46 -0000 On Fri, Apr 27, 2018 at 4:29 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: mjg > > Date: Fri Apr 27 05:37:35 2018 > > New Revision: 333052 > > URL: https://svnweb.freebsd.org/changeset/base/333052 > > > > Log: > > uma: whack main zone counter update in the slow path > > Remove might be a better word, whack is ambigous in this context. > > Ok. > > Cached counters are typically zero at this point so it performs > > avoidable atomics. Everything reading them also reads the cached > > ones, thus there is really no point. > > No point in? reading them, writting them, updating them? > No point in doing the update, hence the removal. > > > > > Reviewed by: jeff > > > > Modified: > > head/sys/vm/uma_core.c > > > > Modified: head/sys/vm/uma_core.c > > ============================================================ > ================== > > --- head/sys/vm/uma_core.c Fri Apr 27 05:36:02 2018 (r333051) > > +++ head/sys/vm/uma_core.c Fri Apr 27 05:37:35 2018 (r333052) > > @@ -2329,14 +2329,6 @@ zalloc_start: > > cpu = curcpu; > > cache = &zone->uz_cpu[cpu]; > > > > - /* > > - * Since we have locked the zone we may as well send back our > stats. > > - */ > > - atomic_add_long(&zone->uz_allocs, cache->uc_allocs); > > - atomic_add_long(&zone->uz_frees, cache->uc_frees); > > - cache->uc_allocs = 0; > > - cache->uc_frees = 0; > > - > > /* See if we lost the race to fill the cache. */ > > if (cache->uc_allocbucket != NULL) { > > ZONE_UNLOCK(zone); > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Apr 27 15:16:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1740AFAA181; Fri, 27 Apr 2018 15:16:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C11B26D6B7; Fri, 27 Apr 2018 15:16:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA7D1262; Fri, 27 Apr 2018 15:16:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RFGYhZ056350; Fri, 27 Apr 2018 15:16:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RFGYFU056346; Fri, 27 Apr 2018 15:16:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804271516.w3RFGYFU056346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 Apr 2018 15:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333064 - in head/sys: cddl/dev/systrace kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/dev/systrace kern sys X-SVN-Commit-Revision: 333064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 15:16:35 -0000 Author: mjg Date: Fri Apr 27 15:16:34 2018 New Revision: 333064 URL: https://svnweb.freebsd.org/changeset/base/333064 Log: systrace: track it like sdt probes While here predict false. Note the code is wrong (regardless of this change). Dereference of the pointer can race with module unload. A fix would set the probe to a nop stub instead of NULL. Modified: head/sys/cddl/dev/systrace/systrace.c head/sys/kern/kern_dtrace.c head/sys/kern/subr_syscall.c head/sys/sys/sysent.h Modified: head/sys/cddl/dev/systrace/systrace.c ============================================================================== --- head/sys/cddl/dev/systrace/systrace.c Fri Apr 27 13:59:24 2018 (r333063) +++ head/sys/cddl/dev/systrace/systrace.c Fri Apr 27 15:16:34 2018 (r333064) @@ -135,6 +135,8 @@ extern const char *freebsd32_syscallnames[]; #error 1 << SYSTRACE_SHIFT must exceed number of system calls #endif +static int systrace_enabled_count; + static void systrace_load(void *); static void systrace_unload(void *); @@ -315,6 +317,9 @@ systrace_enable(void *arg, dtrace_id_t id, void *parg) SYSENT[sysnum].sy_entry = id; else SYSENT[sysnum].sy_return = id; + systrace_enabled_count++; + if (systrace_enabled_count == 1) + systrace_enabled = true; } static void @@ -324,6 +329,9 @@ systrace_disable(void *arg, dtrace_id_t id, void *parg SYSENT[sysnum].sy_entry = 0; SYSENT[sysnum].sy_return = 0; + systrace_enabled_count--; + if (systrace_enabled_count == 0) + systrace_enabled = false; } static void Modified: head/sys/kern/kern_dtrace.c ============================================================================== --- head/sys/kern/kern_dtrace.c Fri Apr 27 13:59:24 2018 (r333063) +++ head/sys/kern/kern_dtrace.c Fri Apr 27 15:16:34 2018 (r333064) @@ -56,7 +56,8 @@ dtrace_doubletrap_func_t dtrace_doubletrap_func; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; -systrace_probe_func_t __read_frequently systrace_probe_func; +bool __read_frequently systrace_enabled; +systrace_probe_func_t systrace_probe_func; /* Return the DTrace process data size compiled in the kernel hooks. */ size_t Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Fri Apr 27 13:59:24 2018 (r333063) +++ head/sys/kern/subr_syscall.c Fri Apr 27 15:16:34 2018 (r333064) @@ -126,7 +126,8 @@ syscallenter(struct thread *td) #ifdef KDTRACE_HOOKS /* Give the syscall:::entry DTrace probe a chance to fire. */ - if (systrace_probe_func != NULL && sa->callp->sy_entry != 0) + if (__predict_false(systrace_enabled && + sa->callp->sy_entry != 0)) (*systrace_probe_func)(sa, SYSTRACE_ENTRY, 0); #endif @@ -140,7 +141,8 @@ syscallenter(struct thread *td) #ifdef KDTRACE_HOOKS /* Give the syscall:::return DTrace probe a chance to fire. */ - if (systrace_probe_func != NULL && sa->callp->sy_return != 0) + if (__predict_false(systrace_enabled && + sa->callp->sy_return != 0)) (*systrace_probe_func)(sa, SYSTRACE_RETURN, error ? -1 : td->td_retval[0]); #endif Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Fri Apr 27 13:59:24 2018 (r333063) +++ head/sys/sys/sysent.h Fri Apr 27 15:16:34 2018 (r333064) @@ -53,6 +53,7 @@ typedef void (*systrace_probe_func_t)(struct syscall_a enum systrace_probe_t, int); typedef void (*systrace_args_func_t)(int, void *, uint64_t *, int *); +extern bool systrace_enabled; extern systrace_probe_func_t systrace_probe_func; struct sysent { /* system call table */ From owner-svn-src-head@freebsd.org Fri Apr 27 15:25:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF43AFAA8BA; Fri, 27 Apr 2018 15:25:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C3126F273; Fri, 27 Apr 2018 15:25:25 +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 86E18402; Fri, 27 Apr 2018 15:25:25 +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 w3RFPPxj061601; Fri, 27 Apr 2018 15:25:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RFPPDf061594; Fri, 27 Apr 2018 15:25:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804271525.w3RFPPDf061594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Apr 2018 15:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333065 - head/bin/setfacl X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/bin/setfacl X-SVN-Commit-Revision: 333065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 15:25:26 -0000 Author: emaste Date: Fri Apr 27 15:25:24 2018 New Revision: 333065 URL: https://svnweb.freebsd.org/changeset/base/333065 Log: setfacl: style and break main() into manageable pieces Submitted by: Mitchell Horne MFC with: r332396 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15060 Modified: head/bin/setfacl/file.c head/bin/setfacl/mask.c head/bin/setfacl/merge.c head/bin/setfacl/remove.c head/bin/setfacl/setfacl.c head/bin/setfacl/setfacl.h Modified: head/bin/setfacl/file.c ============================================================================== --- head/bin/setfacl/file.c Fri Apr 27 15:16:34 2018 (r333064) +++ head/bin/setfacl/file.c Fri Apr 27 15:25:24 2018 (r333065) @@ -50,10 +50,10 @@ get_acl_from_file(const char *filename) err(1, "(null) filename in get_acl_from_file()"); if (strcmp(filename, "-") == 0) { - if (have_stdin != 0) + if (have_stdin) err(1, "cannot specify more than one stdin"); file = stdin; - have_stdin = 1; + have_stdin = true; } else { file = fopen(filename, "r"); if (file == NULL) Modified: head/bin/setfacl/mask.c ============================================================================== --- head/bin/setfacl/mask.c Fri Apr 27 15:16:34 2018 (r333064) +++ head/bin/setfacl/mask.c Fri Apr 27 15:25:24 2018 (r333065) @@ -61,7 +61,7 @@ set_acl_mask(acl_t *prev_acl, const char *filename) if (acl == NULL) err(1, "%s: acl_dup() failed", filename); - if (n_flag == 0) { + if (!n_flag) { /* * If no mask entry is specified and the -n option is not * specified, then the permissions of the resulting ACL mask Modified: head/bin/setfacl/merge.c ============================================================================== --- head/bin/setfacl/merge.c Fri Apr 27 15:16:34 2018 (r333064) +++ head/bin/setfacl/merge.c Fri Apr 27 15:25:24 2018 (r333065) @@ -123,7 +123,7 @@ merge_acl(acl_t acl, acl_t *prev_acl, const char *file err(1, "%s: acl_get_tag_type() failed - " "invalid ACL entry", filename); if (tag == ACL_MASK) - have_mask = 1; + have_mask = true; /* check against the existing ACL entries */ entry_id_new = ACL_FIRST_ENTRY; Modified: head/bin/setfacl/remove.c ============================================================================== --- head/bin/setfacl/remove.c Fri Apr 27 15:16:34 2018 (r333064) +++ head/bin/setfacl/remove.c Fri Apr 27 15:25:24 2018 (r333065) @@ -75,7 +75,7 @@ remove_acl(acl_t acl, acl_t *prev_acl, const char *fil if (acl_get_tag_type(entry, &tag) == -1) err(1, "%s: acl_get_tag_type() failed", filename); if (tag == ACL_MASK) - have_mask++; + have_mask = true; if (acl_delete_entry(acl_new, entry) == -1) { carried_error++; warnx("%s: cannot remove non-existent ACL entry", @@ -124,7 +124,7 @@ remove_by_number(uint entry_number, acl_t *prev_acl, c if (acl_get_tag_type(entry, &tag) == -1) err(1, "%s: acl_get_tag_type() failed", filename); if (tag == ACL_MASK) - have_mask++; + have_mask = true; } if (acl_delete_entry_np(acl_new, entry_number) == -1) { Modified: head/bin/setfacl/setfacl.c ============================================================================== --- head/bin/setfacl/setfacl.c Fri Apr 27 15:16:34 2018 (r333064) +++ head/bin/setfacl/setfacl.c Fri Apr 27 15:25:24 2018 (r333065) @@ -62,11 +62,18 @@ struct sf_entry { }; static TAILQ_HEAD(, sf_entry) entrylist; -uint have_mask; -uint need_mask; -uint have_stdin; -uint n_flag; +bool have_mask; +bool have_stdin; +bool n_flag; +static bool h_flag; +static bool H_flag; +static bool L_flag; +static bool R_flag; +static bool need_mask; +static acl_type_t acl_type = ACL_TYPE_ACCESS; +static int handle_file(FTS *ftsp, FTSENT *file); +static char **stdin_files(void); static void usage(void); static void @@ -79,16 +86,215 @@ usage(void) exit(1); } -int -main(int argc, char *argv[]) +static char ** +stdin_files(void) { - acl_t acl; - acl_type_t acl_type; - acl_entry_t unused_entry; + char **files_list; char filename[PATH_MAX]; - int local_error, carried_error, ch, entry_number, ret, fts_options; - bool h_flag, H_flag, L_flag, R_flag, follow_symlink; size_t fl_count, i; + + if (have_stdin) + err(1, "cannot have more than one stdin"); + + i = 0; + have_stdin = true; + bzero(&filename, sizeof(filename)); + /* Start with an array size sufficient for basic cases. */ + fl_count = 1024; + files_list = zmalloc(fl_count * sizeof(char *)); + while (fgets(filename, (int)sizeof(filename), stdin)) { + /* remove the \n */ + filename[strlen(filename) - 1] = '\0'; + files_list[i] = strdup(filename); + if (files_list[i] == NULL) + err(1, "strdup() failed"); + /* Grow array if necessary. */ + if (++i == fl_count) { + fl_count <<= 1; + if (fl_count > SIZE_MAX / sizeof(char *)) + errx(1, "Too many input files"); + files_list = zrealloc(files_list, + fl_count * sizeof(char *)); + } + } + + /* fts_open() requires the last array element to be NULL. */ + files_list[i] = NULL; + + return (files_list); +} + +static int +handle_file(FTS *ftsp, FTSENT *file) +{ + acl_t acl; + acl_entry_t unused_entry; + int local_error, ret; + struct sf_entry *entry; + bool follow_symlink; + + local_error = 0; + switch (file->fts_info) { + case FTS_D: + /* Do not recurse if -R not specified. */ + if (!R_flag) + fts_set(ftsp, file, FTS_SKIP); + break; + case FTS_DP: + /* Skip the second visit to a directory. */ + return (0); + case FTS_DNR: + case FTS_ERR: + warnx("%s: %s", file->fts_path, strerror(file->fts_errno)); + return (0); + default: + break; + } + + if (acl_type == ACL_TYPE_DEFAULT && file->fts_info != FTS_D) { + warnx("%s: default ACL may only be set on a directory", + file->fts_path); + return (1); + } + + follow_symlink = (!R_flag && !h_flag) || (R_flag && L_flag) || + (R_flag && H_flag && file->fts_level == FTS_ROOTLEVEL); + + if (follow_symlink) + ret = pathconf(file->fts_accpath, _PC_ACL_NFS4); + else + ret = lpathconf(file->fts_accpath, _PC_ACL_NFS4); + if (ret > 0) { + if (acl_type == ACL_TYPE_DEFAULT) { + warnx("%s: there are no default entries in NFSv4 ACLs", + file->fts_path); + return (1); + } + acl_type = ACL_TYPE_NFS4; + } else if (ret == 0) { + if (acl_type == ACL_TYPE_NFS4) + acl_type = ACL_TYPE_ACCESS; + } else if (ret < 0 && errno != EINVAL) { + warn("%s: pathconf(..., _PC_ACL_NFS4) failed", + file->fts_path); + } + + if (follow_symlink) + acl = acl_get_file(file->fts_accpath, acl_type); + else + acl = acl_get_link_np(file->fts_accpath, acl_type); + if (acl == NULL) { + if (follow_symlink) + warn("%s: acl_get_file() failed", file->fts_path); + else + warn("%s: acl_get_link_np() failed", file->fts_path); + return (1); + } + + /* Cycle through each option. */ + TAILQ_FOREACH(entry, &entrylist, next) { + if (local_error) + continue; + + switch(entry->op) { + case OP_ADD_ACL: + local_error += add_acl(entry->acl, entry->entry_number, + &acl, file->fts_path); + break; + case OP_MERGE_ACL: + local_error += merge_acl(entry->acl, &acl, + file->fts_path); + need_mask = true; + break; + case OP_REMOVE_EXT: + /* + * Don't try to call remove_ext() for empty + * default ACL. + */ + if (acl_type == ACL_TYPE_DEFAULT && + acl_get_entry(acl, ACL_FIRST_ENTRY, + &unused_entry) == 0) { + local_error += remove_default(&acl, + file->fts_path); + break; + } + remove_ext(&acl, file->fts_path); + need_mask = false; + break; + case OP_REMOVE_DEF: + if (acl_type == ACL_TYPE_NFS4) { + warnx("%s: there are no default entries in " + "NFSv4 ACLs; cannot remove", + file->fts_path); + local_error++; + break; + } + if (acl_delete_def_file(file->fts_accpath) == -1) { + warn("%s: acl_delete_def_file() failed", + file->fts_path); + local_error++; + } + if (acl_type == ACL_TYPE_DEFAULT) + local_error += remove_default(&acl, + file->fts_path); + need_mask = false; + break; + case OP_REMOVE_ACL: + local_error += remove_acl(entry->acl, &acl, + file->fts_path); + need_mask = true; + break; + case OP_REMOVE_BY_NUMBER: + local_error += remove_by_number(entry->entry_number, + &acl, file->fts_path); + need_mask = true; + break; + } + } + + /* + * Don't try to set an empty default ACL; it will always fail. + * Use acl_delete_def_file(3) instead. + */ + if (acl_type == ACL_TYPE_DEFAULT && + acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { + if (acl_delete_def_file(file->fts_accpath) == -1) { + warn("%s: acl_delete_def_file() failed", + file->fts_path); + return (1); + } + return (0); + } + + /* Don't bother setting the ACL if something is broken. */ + if (local_error) { + return (1); + } + + if (acl_type != ACL_TYPE_NFS4 && need_mask && + set_acl_mask(&acl, file->fts_path) == -1) { + warnx("%s: failed to set ACL mask", file->fts_path); + return (1); + } else if (follow_symlink) { + if (acl_set_file(file->fts_accpath, acl_type, acl) == -1) { + warn("%s: acl_set_file() failed", file->fts_path); + return (1); + } + } else { + if (acl_set_link_np(file->fts_accpath, acl_type, acl) == -1) { + warn("%s: acl_set_link_np() failed", file->fts_path); + return (1); + } + } + + acl_free(acl); + return (0); +} + +int +main(int argc, char *argv[]) +{ + int carried_error, ch, entry_number, fts_options; FTS *ftsp; FTSENT *file; char **files_list; @@ -96,9 +302,8 @@ main(int argc, char *argv[]) char *end; acl_type = ACL_TYPE_ACCESS; - carried_error = local_error = fts_options = 0; - have_mask = have_stdin = n_flag = need_mask = 0; - h_flag = H_flag = L_flag = R_flag = false; + carried_error = fts_options = 0; + have_mask = have_stdin = n_flag = false; TAILQ_INIT(&entrylist); @@ -116,7 +321,8 @@ main(int argc, char *argv[]) entry = zmalloc(sizeof(struct sf_entry)); entry->acl = get_acl_from_file(optarg); if (entry->acl == NULL) - err(1, "%s: get_acl_from_file() failed", optarg); + err(1, "%s: get_acl_from_file() failed", + optarg); entry->op = OP_MERGE_ACL; TAILQ_INSERT_TAIL(&entrylist, entry, next); break; @@ -139,7 +345,9 @@ main(int argc, char *argv[]) if (end - optarg != (int)strlen(optarg)) errx(1, "%s: invalid entry number", optarg); if (entry_number < 0) - errx(1, "%s: entry number cannot be less than zero", optarg); + errx(1, + "%s: entry number cannot be less than zero", + optarg); entry->entry_number = entry_number; if (argv[optind] == NULL) @@ -176,14 +384,16 @@ main(int argc, char *argv[]) TAILQ_INSERT_TAIL(&entrylist, entry, next); break; case 'n': - n_flag++; + n_flag = true; break; case 'x': entry = zmalloc(sizeof(struct sf_entry)); entry_number = strtol(optarg, &end, 10); if (end - optarg == (int)strlen(optarg)) { if (entry_number < 0) - errx(1, "%s: entry number cannot be less than zero", optarg); + errx(1, + "%s: entry number cannot be less than zero", + optarg); entry->entry_number = entry_number; entry->op = OP_REMOVE_BY_NUMBER; } else { @@ -201,37 +411,12 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - if (n_flag == 0 && TAILQ_EMPTY(&entrylist)) + if (!n_flag && TAILQ_EMPTY(&entrylist)) usage(); - /* take list of files from stdin */ + /* Take list of files from stdin. */ if (argc == 0 || strcmp(argv[0], "-") == 0) { - if (have_stdin) - err(1, "cannot have more than one stdin"); - have_stdin = 1; - bzero(&filename, sizeof(filename)); - i = 0; - /* Start with an array size sufficient for basic cases. */ - fl_count = 1024; - files_list = zmalloc(fl_count * sizeof(char *)); - while (fgets(filename, (int)sizeof(filename), stdin)) { - /* remove the \n */ - filename[strlen(filename) - 1] = '\0'; - files_list[i] = strdup(filename); - if (files_list[i] == NULL) - err(1, "strdup() failed"); - /* Grow array if necessary. */ - if (++i == fl_count) { - fl_count <<= 1; - if (fl_count > SIZE_MAX / sizeof(char *)) - errx(1, "Too many input files"); - files_list = zrealloc(files_list, - fl_count * sizeof(char *)); - } - } - - /* fts_open() requires the last array element to be NULL. */ - files_list[i] = NULL; + files_list = stdin_files(); } else files_list = argv; @@ -257,176 +442,8 @@ main(int argc, char *argv[]) /* Open all files. */ if ((ftsp = fts_open(files_list, fts_options | FTS_NOSTAT, 0)) == NULL) err(1, "fts_open"); - while ((file = fts_read(ftsp)) != NULL) { - switch (file->fts_info) { - case FTS_D: - /* Do not recurse if -R not specified. */ - if (!R_flag) - fts_set(ftsp, file, FTS_SKIP); - break; - case FTS_DP: - /* Skip the second visit to a directory. */ - continue; - case FTS_DNR: - case FTS_ERR: - warnx("%s: %s", file->fts_path, - strerror(file->fts_errno)); - continue; - default: - break; - } - - if (acl_type == ACL_TYPE_DEFAULT && file->fts_info != FTS_D) { - warnx("%s: default ACL may only be set on " - "a directory", file->fts_path); - carried_error++; - continue; - } - - local_error = 0; - - follow_symlink = ((fts_options & FTS_LOGICAL) || - ((fts_options & FTS_COMFOLLOW) && - file->fts_level == FTS_ROOTLEVEL)); - - if (follow_symlink) - ret = pathconf(file->fts_accpath, _PC_ACL_NFS4); - else - ret = lpathconf(file->fts_accpath, _PC_ACL_NFS4); - if (ret > 0) { - if (acl_type == ACL_TYPE_DEFAULT) { - warnx("%s: there are no default entries " - "in NFSv4 ACLs", file->fts_path); - carried_error++; - continue; - } - acl_type = ACL_TYPE_NFS4; - } else if (ret == 0) { - if (acl_type == ACL_TYPE_NFS4) - acl_type = ACL_TYPE_ACCESS; - } else if (ret < 0 && errno != EINVAL) { - warn("%s: pathconf(..., _PC_ACL_NFS4) failed", - file->fts_path); - } - - if (follow_symlink) - acl = acl_get_file(file->fts_accpath, acl_type); - else - acl = acl_get_link_np(file->fts_accpath, acl_type); - if (acl == NULL) { - if (follow_symlink) - warn("%s: acl_get_file() failed", - file->fts_path); - else - warn("%s: acl_get_link_np() failed", - file->fts_path); - carried_error++; - continue; - } - - /* cycle through each option */ - TAILQ_FOREACH(entry, &entrylist, next) { - if (local_error) - continue; - - switch(entry->op) { - case OP_ADD_ACL: - local_error += add_acl(entry->acl, - entry->entry_number, - &acl, file->fts_path); - break; - case OP_MERGE_ACL: - local_error += merge_acl(entry->acl, &acl, - file->fts_path); - need_mask = 1; - break; - case OP_REMOVE_EXT: - /* - * Don't try to call remove_ext() for empty - * default ACL. - */ - if (acl_type == ACL_TYPE_DEFAULT && - acl_get_entry(acl, ACL_FIRST_ENTRY, - &unused_entry) == 0) { - local_error += remove_default(&acl, - file->fts_path); - break; - } - remove_ext(&acl, file->fts_path); - need_mask = 0; - break; - case OP_REMOVE_DEF: - if (acl_type == ACL_TYPE_NFS4) { - warnx("%s: there are no default entries in NFSv4 ACLs; " - "cannot remove", file->fts_path); - local_error++; - break; - } - if (acl_delete_def_file(file->fts_accpath) == -1) { - warn("%s: acl_delete_def_file() failed", - file->fts_path); - local_error++; - } - if (acl_type == ACL_TYPE_DEFAULT) - local_error += remove_default(&acl, - file->fts_path); - need_mask = 0; - break; - case OP_REMOVE_ACL: - local_error += remove_acl(entry->acl, &acl, - file->fts_path); - need_mask = 1; - break; - case OP_REMOVE_BY_NUMBER: - local_error += remove_by_number(entry->entry_number, - &acl, file->fts_path); - need_mask = 1; - break; - } - } - - /* - * Don't try to set an empty default ACL; it will always fail. - * Use acl_delete_def_file(3) instead. - */ - if (acl_type == ACL_TYPE_DEFAULT && - acl_get_entry(acl, ACL_FIRST_ENTRY, &unused_entry) == 0) { - if (acl_delete_def_file(file->fts_accpath) == -1) { - warn("%s: acl_delete_def_file() failed", - file->fts_path); - carried_error++; - } - continue; - } - - /* don't bother setting the ACL if something is broken */ - if (local_error) { - carried_error++; - continue; - } - - if (acl_type != ACL_TYPE_NFS4 && need_mask && - set_acl_mask(&acl, file->fts_path) == -1) { - warnx("%s: failed to set ACL mask", file->fts_path); - carried_error++; - } else if (follow_symlink) { - if (acl_set_file(file->fts_accpath, acl_type, - acl) == -1) { - carried_error++; - warn("%s: acl_set_file() failed", - file->fts_path); - } - } else { - if (acl_set_link_np(file->fts_accpath, acl_type, - acl) == -1) { - carried_error++; - warn("%s: acl_set_link_np() failed", - file->fts_path); - } - } - - acl_free(acl); - } + while ((file = fts_read(ftsp)) != NULL) + carried_error += handle_file(ftsp, file); return (carried_error); } Modified: head/bin/setfacl/setfacl.h ============================================================================== --- head/bin/setfacl/setfacl.h Fri Apr 27 15:16:34 2018 (r333064) +++ head/bin/setfacl/setfacl.h Fri Apr 27 15:25:24 2018 (r333065) @@ -29,31 +29,34 @@ #ifndef _SETFACL_H #define _SETFACL_H +#include + #include #include #include /* files.c */ -acl_t get_acl_from_file(const char *filename); +acl_t get_acl_from_file(const char *filename); /* merge.c */ -int merge_acl(acl_t acl, acl_t *prev_acl, const char *filename); -int add_acl(acl_t acl, uint entry_number, acl_t *prev_acl, const char *filename); +int merge_acl(acl_t acl, acl_t *prev_acl, const char *filename); +int add_acl(acl_t acl, uint entry_number, acl_t *prev_acl, + const char *filename); /* remove.c */ -int remove_acl(acl_t acl, acl_t *prev_acl, const char *filename); -int remove_by_number(uint entry_number, acl_t *prev_acl, const char *filename); -int remove_default(acl_t *prev_acl, const char *filename); -void remove_ext(acl_t *prev_acl, const char *filename); +int remove_acl(acl_t acl, acl_t *prev_acl, const char *filename); +int remove_by_number(uint entry_number, acl_t *prev_acl, + const char *filename); +int remove_default(acl_t *prev_acl, const char *filename); +void remove_ext(acl_t *prev_acl, const char *filename); /* mask.c */ -int set_acl_mask(acl_t *prev_acl, const char *filename); +int set_acl_mask(acl_t *prev_acl, const char *filename); /* util.c */ -void *zmalloc(size_t size); -void *zrealloc(void *ptr, size_t size); +void *zmalloc(size_t size); +void *zrealloc(void *ptr, size_t size); const char *brand_name(int brand); -int branding_mismatch(int brand1, int brand2); +int branding_mismatch(int brand1, int brand2); -extern uint have_mask; -extern uint need_mask; -extern uint have_stdin; -extern uint n_flag; +extern bool have_mask; +extern bool have_stdin; +extern bool n_flag; #endif /* _SETFACL_H */ From owner-svn-src-head@freebsd.org Fri Apr 27 15:26:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DDA7FAA9B6; Fri, 27 Apr 2018 15:26:51 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83DCC6FF08; Fri, 27 Apr 2018 15:26:50 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.220.77]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MK0bZ-1fCucG3DWf-001PdT; Fri, 27 Apr 2018 17:26:41 +0200 Date: Fri, 27 Apr 2018 17:26:08 +0200 From: "O. Hartmann" To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333064 - in head/sys: cddl/dev/systrace kern sys Message-ID: <20180427172635.2560f470@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201804271516.w3RFGYFU056346@repo.freebsd.org> References: <201804271516.w3RFGYFU056346@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:AImvCK2lFAiWyIwxBmdJ7smIJVd1dODDSfN8cYOyCA8sRIevs3/ faRpGRjyrUsOEfplrjQ2ZIeC+1wASbiDBk2JGO44x3ZKLpu3EWFlYaFGWlmUyPyJ0UiBzta XcNQPIHtjD5BMJBiRljpxWnM9epSmyeOPz2ebIJgbwmTwDha5HfL1PDx0Ec1iRvrRVdTt8L bd5nGvF1IhgPiCFSYRmdg== X-UI-Out-Filterresults: notjunk:1;V01:K0:8Sf62GDhiQA=:6oCggeWdmGKz36Lw/EhkP8 5bwVmhzNKa3PxTeOKa5u3NiG4QewB+aA2l+4OfNZ1s5zV516dXSPblbzSQ3AQeyhr7CotZH8y Lc1RnXvqxK/7G9sqph3QmdmXNmolNhY1zsZofqVLBDNGprVDsMCiQ4Ty9nlP3ztC+wsu5AueR upMm2L5Q26d3MYeWIgFqcGWGxOCOO2xlIjaEE0AcmecJhYLDaWdaw7/DSR6S6ruFZINkgdF5Z c4Ist3+1Yx0lt2AF2kPPgXs2fthw6FHl6GM6n2iEfCj3DaPDmA96t7sSdeysOAWsb1NP0r3+J autmWeUu7jCYwlDivl6j+PY4s5XkV1ZXqWfXn4cOl2Bpz5v1XA6tb0EYokpiFLRmcV41XdvvF /zLBDA/V4850KSPJ4/Wl62BEbBk5gkcSIgEWR++ASNWlIYx+CMtiiZRymQDWRSmDzeymQsndV 1KabrAELINV6L5D6jI/brBFxnJ0WUv3Dp7d+v0Cuxyq/NzokdYTnIoD0mJ84+YjtAT/OY4I67 FtN5Nk3bRUepXtRofb3Mtw3/oAOcTxQNLf2Ox+P+Aw7/IpZneCAncEBSqHw+5vnrMMoFrxQKs d2nZs3ah3P3J95ni21AFmoRyolt1S3UyjiQrFbFGd6TUhcio5RYehzl9+L6RPIM//v8TrGJJE +VcZwWUSPIysrfn83EwIJM0D6CJPSJm3SH71OwIBCujbyd7yAG5s9cNcBZfhd4CUfl9OT1N3q ZwrIypuM5QXIc0PvfOhuHim6OSAvwJkiqAxbswgmR5KP0xv9re4zhsrFXYdYVIzDVHmwA0A6G PcgpCdG X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 15:26:51 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIEZy aSwgMjcgQXByIDIwMTggMTU6MTY6MzQgKzAwMDAgKFVUQykNCk1hdGV1c3ogR3V6aWsgPG1qZ0BG cmVlQlNELm9yZz4gc2NocmllYjoNCg0KPiBBdXRob3I6IG1qZw0KPiBEYXRlOiBGcmkgQXByIDI3 IDE1OjE2OjM0IDIwMTgNCj4gTmV3IFJldmlzaW9uOiAzMzMwNjQNCj4gVVJMOiBodHRwczovL3N2 bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8zMzMwNjQNCj4gDQo+IExvZzoNCj4gICBz eXN0cmFjZTogdHJhY2sgaXQgbGlrZSBzZHQgcHJvYmVzDQo+ICAgDQo+ICAgV2hpbGUgaGVyZSBw cmVkaWN0IGZhbHNlLg0KPiAgIA0KPiAgIE5vdGUgdGhlIGNvZGUgaXMgd3JvbmcgKHJlZ2FyZGxl c3Mgb2YgdGhpcyBjaGFuZ2UpLiBEZXJlZmVyZW5jZSBvZiB0aGUNCj4gICBwb2ludGVyIGNhbiBy YWNlIHdpdGggbW9kdWxlIHVubG9hZC4gQSBmaXggd291bGQgc2V0IHRoZSBwcm9iZSB0byBhDQo+ ICAgbm9wIHN0dWIgaW5zdGVhZCBvZiBOVUxMLg0KPiANCj4gTW9kaWZpZWQ6DQo+ICAgaGVhZC9z eXMvY2RkbC9kZXYvc3lzdHJhY2Uvc3lzdHJhY2UuYw0KPiAgIGhlYWQvc3lzL2tlcm4va2Vybl9k dHJhY2UuYw0KPiAgIGhlYWQvc3lzL2tlcm4vc3Vicl9zeXNjYWxsLmMNCj4gICBoZWFkL3N5cy9z eXMvc3lzZW50LmgNCj4gDQo+IE1vZGlmaWVkOiBoZWFkL3N5cy9jZGRsL2Rldi9zeXN0cmFjZS9z eXN0cmFjZS5jDQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMvY2RkbC9k ZXYvc3lzdHJhY2Uvc3lzdHJhY2UuYwlGcmkgQXByIDI3IDEzOjU5OjI0IDIwMTgNCj4gKHIzMzMw NjMpICsrKyBoZWFkL3N5cy9jZGRsL2Rldi9zeXN0cmFjZS9zeXN0cmFjZS5jCUZyaSBBcHIgMjcg MTU6MTY6MzQNCj4gMjAxOAkocjMzMzA2NCkgQEAgLTEzNSw2ICsxMzUsOCBAQCBleHRlcm4gY29u c3QgY2hhciAqZnJlZWJzZDMyX3N5c2NhbGxuYW1lc1tdOw0KPiAgI2Vycm9yIDEgPDwgU1lTVFJB Q0VfU0hJRlQgbXVzdCBleGNlZWQgbnVtYmVyIG9mIHN5c3RlbSBjYWxscw0KPiAgI2VuZGlmDQo+ ICANCj4gK3N0YXRpYyBpbnQgc3lzdHJhY2VfZW5hYmxlZF9jb3VudDsNCj4gKw0KPiAgc3RhdGlj IHZvaWQJc3lzdHJhY2VfbG9hZCh2b2lkICopOw0KPiAgc3RhdGljIHZvaWQJc3lzdHJhY2VfdW5s b2FkKHZvaWQgKik7DQo+ICANCj4gQEAgLTMxNSw2ICszMTcsOSBAQCBzeXN0cmFjZV9lbmFibGUo dm9pZCAqYXJnLCBkdHJhY2VfaWRfdCBpZCwgdm9pZCAqcGFyZykNCj4gIAkJU1lTRU5UW3N5c251 bV0uc3lfZW50cnkgPSBpZDsNCj4gIAllbHNlDQo+ICAJCVNZU0VOVFtzeXNudW1dLnN5X3JldHVy biA9IGlkOw0KPiArCXN5c3RyYWNlX2VuYWJsZWRfY291bnQrKzsNCj4gKwlpZiAoc3lzdHJhY2Vf ZW5hYmxlZF9jb3VudCA9PSAxKQ0KPiArCQlzeXN0cmFjZV9lbmFibGVkID0gdHJ1ZTsNCj4gIH0N Cj4gIA0KPiAgc3RhdGljIHZvaWQNCj4gQEAgLTMyNCw2ICszMjksOSBAQCBzeXN0cmFjZV9kaXNh YmxlKHZvaWQgKmFyZywgZHRyYWNlX2lkX3QgaWQsIHZvaWQgKnBhcmcNCj4gIA0KPiAgCVNZU0VO VFtzeXNudW1dLnN5X2VudHJ5ID0gMDsNCj4gIAlTWVNFTlRbc3lzbnVtXS5zeV9yZXR1cm4gPSAw Ow0KPiArCXN5c3RyYWNlX2VuYWJsZWRfY291bnQtLTsNCj4gKwlpZiAoc3lzdHJhY2VfZW5hYmxl ZF9jb3VudCA9PSAwKQ0KPiArCQlzeXN0cmFjZV9lbmFibGVkID0gZmFsc2U7DQo+ICB9DQo+ICAN Cj4gIHN0YXRpYyB2b2lkDQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMva2Vybi9rZXJuX2R0cmFj ZS5jDQo+ID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KPiAtLS0gaGVhZC9zeXMva2Vybi9rZXJuX2R0 cmFjZS5jCUZyaSBBcHIgMjcgMTM6NTk6MjQgMjAxOAkocjMzMzA2MykNCj4gKysrIGhlYWQvc3lz L2tlcm4va2Vybl9kdHJhY2UuYwlGcmkgQXByIDI3IDE1OjE2OjM0IDIwMTgJKHIzMzMwNjQpDQo+ IEBAIC01Niw3ICs1Niw4IEBAIGR0cmFjZV9kb3VibGV0cmFwX2Z1bmNfdAlkdHJhY2VfZG91Ymxl dHJhcF9mdW5jOw0KPiAgZHRyYWNlX3BpZF9wcm9iZV9wdHJfdAkJZHRyYWNlX3BpZF9wcm9iZV9w dHI7DQo+ICBkdHJhY2VfcmV0dXJuX3Byb2JlX3B0cl90CWR0cmFjZV9yZXR1cm5fcHJvYmVfcHRy Ow0KPiAgDQo+IC1zeXN0cmFjZV9wcm9iZV9mdW5jX3QgX19yZWFkX2ZyZXF1ZW50bHkJc3lzdHJh Y2VfcHJvYmVfZnVuYzsNCj4gK2Jvb2wgX19yZWFkX2ZyZXF1ZW50bHkJCXN5c3RyYWNlX2VuYWJs ZWQ7DQo+ICtzeXN0cmFjZV9wcm9iZV9mdW5jX3QgCQlzeXN0cmFjZV9wcm9iZV9mdW5jOw0KPiAg DQo+ICAvKiBSZXR1cm4gdGhlIERUcmFjZSBwcm9jZXNzIGRhdGEgc2l6ZSBjb21waWxlZCBpbiB0 aGUga2VybmVsIGhvb2tzLiAqLw0KPiAgc2l6ZV90DQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMv a2Vybi9zdWJyX3N5c2NhbGwuYw0KPiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQv c3lzL2tlcm4vc3Vicl9zeXNjYWxsLmMJRnJpIEFwciAyNyAxMzo1OToyNCAyMDE4CShyMzMzMDYz KQ0KPiArKysgaGVhZC9zeXMva2Vybi9zdWJyX3N5c2NhbGwuYwlGcmkgQXByIDI3IDE1OjE2OjM0 IDIwMTgJKHIzMzMwNjQpDQo+IEBAIC0xMjYsNyArMTI2LDggQEAgc3lzY2FsbGVudGVyKHN0cnVj dCB0aHJlYWQgKnRkKQ0KPiAgDQo+ICAjaWZkZWYgS0RUUkFDRV9IT09LUw0KPiAgCQkvKiBHaXZl IHRoZSBzeXNjYWxsOjo6ZW50cnkgRFRyYWNlIHByb2JlIGEgY2hhbmNlIHRvIGZpcmUuICovDQo+ IC0JCWlmIChzeXN0cmFjZV9wcm9iZV9mdW5jICE9IE5VTEwgJiYgc2EtPmNhbGxwLT5zeV9lbnRy eSAhPSAwKQ0KPiArCQlpZiAoX19wcmVkaWN0X2ZhbHNlKHN5c3RyYWNlX2VuYWJsZWQgJiYNCj4g KwkJICAgIHNhLT5jYWxscC0+c3lfZW50cnkgIT0gMCkpDQo+ICAJCQkoKnN5c3RyYWNlX3Byb2Jl X2Z1bmMpKHNhLCBTWVNUUkFDRV9FTlRSWSwgMCk7DQo+ICAjZW5kaWYNCj4gIA0KPiBAQCAtMTQw LDcgKzE0MSw4IEBAIHN5c2NhbGxlbnRlcihzdHJ1Y3QgdGhyZWFkICp0ZCkNCj4gIA0KPiAgI2lm ZGVmIEtEVFJBQ0VfSE9PS1MNCj4gIAkJLyogR2l2ZSB0aGUgc3lzY2FsbDo6OnJldHVybiBEVHJh Y2UgcHJvYmUgYSBjaGFuY2UgdG8gZmlyZS4gKi8NCj4gLQkJaWYgKHN5c3RyYWNlX3Byb2JlX2Z1 bmMgIT0gTlVMTCAmJiBzYS0+Y2FsbHAtPnN5X3JldHVybiAhPSAwKQ0KPiArCQlpZiAoX19wcmVk aWN0X2ZhbHNlKHN5c3RyYWNlX2VuYWJsZWQgJiYNCj4gKwkJICAgIHNhLT5jYWxscC0+c3lfcmV0 dXJuICE9IDApKQ0KPiAgCQkJKCpzeXN0cmFjZV9wcm9iZV9mdW5jKShzYSwgU1lTVFJBQ0VfUkVU VVJOLA0KPiAgCQkJICAgIGVycm9yID8gLTEgOiB0ZC0+dGRfcmV0dmFsWzBdKTsNCj4gICNlbmRp Zg0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvc3lzL3N5cy9zeXNlbnQuaA0KPiA9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0NCj4gLS0tIGhlYWQvc3lzL3N5cy9zeXNlbnQuaAlGcmkgQXByIDI3IDEzOjU5OjI0 IDIwMTgJKHIzMzMwNjMpDQo+ICsrKyBoZWFkL3N5cy9zeXMvc3lzZW50LmgJRnJpIEFwciAyNyAx NToxNjozNCAyMDE4CShyMzMzMDY0KQ0KPiBAQCAtNTMsNiArNTMsNyBAQCB0eXBlZGVmCXZvaWQJ KCpzeXN0cmFjZV9wcm9iZV9mdW5jX3QpKHN0cnVjdCBzeXNjYWxsX2ENCj4gIAkJICAgIGVudW0g c3lzdHJhY2VfcHJvYmVfdCwgaW50KTsNCj4gIHR5cGVkZWYJdm9pZAkoKnN5c3RyYWNlX2FyZ3Nf ZnVuY190KShpbnQsIHZvaWQgKiwgdWludDY0X3QgKiwgaW50ICopOw0KPiAgDQo+ICtleHRlcm4g Ym9vbAkJCXN5c3RyYWNlX2VuYWJsZWQ7DQo+ICBleHRlcm4gc3lzdHJhY2VfcHJvYmVfZnVuY190 CXN5c3RyYWNlX3Byb2JlX2Z1bmM7DQo+ICANCj4gIHN0cnVjdCBzeXNlbnQgewkJCS8qIHN5c3Rl bSBjYWxsIHRhYmxlICovDQo+IF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fDQo+IHN2bi1zcmMtaGVhZEBmcmVlYnNkLm9yZyBtYWlsaW5nIGxpc3QNCj4gaHR0 cHM6Ly9saXN0cy5mcmVlYnNkLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3N2bi1zcmMtaGVhZA0KPiBU byB1bnN1YnNjcmliZSwgc2VuZCBhbnkgbWFpbCB0byAic3ZuLXNyYy1oZWFkLXVuc3Vic2NyaWJl QGZyZWVic2Qub3JnIg0KDQpGYWlsIDotKA0KDQpbLi4uXQ0KLSAtLS0ga3ZtX3Byb2MubyAtLS0N CkluIGZpbGUgaW5jbHVkZWQgZnJvbSAvcG9vbC9zb3VyY2VzL0NVUlJFTlQvc3JjL2xpYi9saWJr dm0va3ZtX3Byb2MuYzo2NjoNCi9wb29sL3NvdXJjZXMvQ1VSUkVOVC9vYmovcG9vbC9zb3VyY2Vz L0NVUlJFTlQvc3JjL2FtZDY0LmFtZDY0L3RtcC91c3IvaW5jbHVkZS9zeXMvc3lzZW50Lmg6NTY6 ODoNCmVycm9yOiB1bmtub3duIHR5cGUgbmFtZSAnYm9vbCcgZXh0ZXJuIGJvb2wgICAgICAgICAg ICAgICAgICAgICBzeXN0cmFjZV9lbmFibGVkOw0KICAgICAgIF4NCg0KDQotIC0tIA0KTy4gSGFy dG1hbm4NCg0KSWNoIHdpZGVyc3ByZWNoZSBkZXIgTnV0enVuZyBvZGVyIMOcYmVybWl0dGx1bmcg bWVpbmVyIERhdGVuIGbDvHINCldlcmJlendlY2tlIG9kZXIgZsO8ciBkaWUgTWFya3QtIG9kZXIg TWVpbnVuZ3Nmb3JzY2h1bmcgKMKnIDI4IEFicy4gNCBCRFNHKS4NCi0tLS0tQkVHSU4gUEdQIFNJ R05BVFVSRS0tLS0tDQoNCmlMVUVBUk1LQUIwV0lRUVpWWk16QXR3QzJULzg2VHJTNTI4ZnlGaFls QVVDV3VOQkt3QUtDUkRTNTI4ZnlGaFkNCmxQZnJBZ0NuUjRBbkFackkrZ3NCUW1tdlZJZG9TcUhX R1lQcXM0MUFwZUxUVGhtaVd2VWZNaHN1QTVpeklwTWYNCjFaTEtKMnJpTkFJbnRaSVVzUWNFSU55 Ull4djBBZ0NuOHFTUVp2b1RXb3h1anNneTZ3NEw2TUdjOVpWbmtjVGoNCmhHMWFoNWJvRDZNQVQw U0pZb2RLNWhxOFlRM2tYcVZBZFlCb3JxWmFmam9UMDkzak9tVk4NCj00MDB4DQotLS0tLUVORCBQ R1AgU0lHTkFUVVJFLS0tLS0NCg== From owner-svn-src-head@freebsd.org Fri Apr 27 15:50:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21E87FAB24B; Fri, 27 Apr 2018 15:50:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0AAA76388; Fri, 27 Apr 2018 15:50:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B67F676C; Fri, 27 Apr 2018 15:50:22 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RFoMYT072132; Fri, 27 Apr 2018 15:50:22 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RFoMoW072131; Fri, 27 Apr 2018 15:50:22 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201804271550.w3RFoMoW072131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 27 Apr 2018 15:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333066 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 15:50:23 -0000 Author: mjg Date: Fri Apr 27 15:50:22 2018 New Revision: 333066 URL: https://svnweb.freebsd.org/changeset/base/333066 Log: Unbreak world build after r333064 Reported by: O. Hartmann Modified: head/sys/sys/sysent.h Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Fri Apr 27 15:25:24 2018 (r333065) +++ head/sys/sys/sysent.h Fri Apr 27 15:50:22 2018 (r333066) @@ -53,7 +53,9 @@ typedef void (*systrace_probe_func_t)(struct syscall_a enum systrace_probe_t, int); typedef void (*systrace_args_func_t)(int, void *, uint64_t *, int *); +#ifdef _KERNEL extern bool systrace_enabled; +#endif extern systrace_probe_func_t systrace_probe_func; struct sysent { /* system call table */ From owner-svn-src-head@freebsd.org Fri Apr 27 16:01:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C47FABBAB; Fri, 27 Apr 2018 16:01:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 702E87A6A6; Fri, 27 Apr 2018 16:01:05 +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 w3RG0r8a053635 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 27 Apr 2018 19:00:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w3RG0r8a053635 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w3RG0rFR053631; Fri, 27 Apr 2018 19:00:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Apr 2018 19:00:53 +0300 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333066 - head/sys/sys Message-ID: <20180427160053.GM6887@kib.kiev.ua> References: <201804271550.w3RFoMoW072131@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201804271550.w3RFoMoW072131@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 16:01:06 -0000 On Fri, Apr 27, 2018 at 03:50:22PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Fri Apr 27 15:50:22 2018 > New Revision: 333066 > URL: https://svnweb.freebsd.org/changeset/base/333066 > > Log: > Unbreak world build after r333064 > > Reported by: O. Hartmann > > Modified: > head/sys/sys/sysent.h > > Modified: head/sys/sys/sysent.h > ============================================================================== > --- head/sys/sys/sysent.h Fri Apr 27 15:25:24 2018 (r333065) > +++ head/sys/sys/sysent.h Fri Apr 27 15:50:22 2018 (r333066) > @@ -53,7 +53,9 @@ typedef void (*systrace_probe_func_t)(struct syscall_a > enum systrace_probe_t, int); > typedef void (*systrace_args_func_t)(int, void *, uint64_t *, int *); > > +#ifdef _KERNEL > extern bool systrace_enabled; > +#endif > extern systrace_probe_func_t systrace_probe_func; I think systrace_probe_func also has nothing to do with userspace. > > struct sysent { /* system call table */ From owner-svn-src-head@freebsd.org Fri Apr 27 16:02:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3B68FABDE2; Fri, 27 Apr 2018 16:02:36 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 774B17AFAE; Fri, 27 Apr 2018 16:02:36 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x241.google.com with SMTP id b39so1769692qkb.5; Fri, 27 Apr 2018 09:02:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Relt6UXJuYSW+Wile556M64fHS+z3k+/w43trCtlfCM=; b=ThFy47+Gao/yOhiryNsTQm5LVBKBf+z2YHp0tt60DngeLYnB5OhXAqiMY7EknyUAM9 Vyn87xxuBe4YFLZrrJd2BU2E+xvhcETdhg8sDaVTSXm3IDUmciSzI44BMpr6HlPTtyAe 927bMH6+JhhE2TFZkvUABNkecVP+Dex/TmRQ/p1gyviq+Qy9WUMuYkxwTDK42/+h1brK LbOJ/ET+9lyKXiiUlGzBrhOqWSRD1mUPKlN33WLVHb/PNUY+vGdNOIgxwLFUHpyoOj6t o12HUdhVKZHr8tsHxPMWJe+yrUT5vwMuLucRYSFtcgVXLWtT5zTGjGBSqAGWmbqzOMDH bpeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Relt6UXJuYSW+Wile556M64fHS+z3k+/w43trCtlfCM=; b=rEbRmgymM8HQIgww/Pi0anlT78e26LaqNaBABXoyeTg4pqaLi0aJ9KZ7SWrCOhvyyE HzBF+7gPmGlfxxriNwd4oL2FhZMeOiBJZPHPXntCv/uT23sUXkOYz11ADQMIjbMTnfCI NQQwo9iUoFHpDMWFnedVsS0SA4fyUwXu3YMvbyz0rXKwRkzuxlxc+ZxqISxoXZpAus2m QOZ2+T3+nrxgdLyw6QW/OQtskoF/FPUqcFPU2q6ZeFlxD0jbB78lbh17vJ3wIMiOwY/G 3l0VwQZkVsY2qK3qglbsTxCaewCnrGDcvrMHnlftFH4Samoi02xgjJnCNH17d0uEvXb+ zV4g== X-Gm-Message-State: ALQs6tC5ZcgnpMepvrk+MTJ59gjOH9+wb+xQtRAWe8oSf23hurr01B18 c3a007qThAXuK+nLXSD7XMFwe71unCa8zZDyjog= X-Google-Smtp-Source: AB8JxZrw0rVh/WMZY3qCbTyZZX9fqnWRiPub5unG2Oxl5e10AYMHinrOML2ZRjEbc6bhF2i5NMsTzI3JegmR5ZptW+Q= X-Received: by 10.233.232.88 with SMTP id a85mr2412628qkg.121.1524844955539; Fri, 27 Apr 2018 09:02:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.28.74 with HTTP; Fri, 27 Apr 2018 09:02:34 -0700 (PDT) In-Reply-To: <20180427160053.GM6887@kib.kiev.ua> References: <201804271550.w3RFoMoW072131@repo.freebsd.org> <20180427160053.GM6887@kib.kiev.ua> From: Mateusz Guzik Date: Fri, 27 Apr 2018 18:02:34 +0200 Message-ID: Subject: Re: svn commit: r333066 - head/sys/sys To: Konstantin Belousov Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 16:02:37 -0000 On Fri, Apr 27, 2018 at 6:00 PM, Konstantin Belousov wrote: > On Fri, Apr 27, 2018 at 03:50:22PM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Fri Apr 27 15:50:22 2018 > > New Revision: 333066 > > URL: https://svnweb.freebsd.org/changeset/base/333066 > > > > Log: > > Unbreak world build after r333064 > > > > Reported by: O. Hartmann > > > > Modified: > > head/sys/sys/sysent.h > > > > Modified: head/sys/sys/sysent.h > > ============================================================ > ================== > > --- head/sys/sys/sysent.h Fri Apr 27 15:25:24 2018 (r333065) > > +++ head/sys/sys/sysent.h Fri Apr 27 15:50:22 2018 (r333066) > > @@ -53,7 +53,9 @@ typedef void (*systrace_probe_func_t)(struct > syscall_a > > enum systrace_probe_t, int); > > typedef void (*systrace_args_func_t)(int, void *, uint64_t *, > int *); > > > > +#ifdef _KERNEL > > extern bool systrace_enabled; > > +#endif > > extern systrace_probe_func_t systrace_probe_func; > I think systrace_probe_func also has nothing to do with userspace. > > > > > struct sysent { /* system call table */ > I don't know why this is included to begin with. I made the smallest possible change to get it out of the way. Someone else(tm) should sort this out. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Apr 27 16:34:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3282DFAC923; Fri, 27 Apr 2018 16:34:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA76981585; Fri, 27 Apr 2018 16:34:28 +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 D0A96F8E; Fri, 27 Apr 2018 16:34:28 +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 w3RGYSl7000719; Fri, 27 Apr 2018 16:34:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RGYSwO000718; Fri, 27 Apr 2018 16:34:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804271634.w3RGYSwO000718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 27 Apr 2018 16:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333067 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 333067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 16:34:29 -0000 Author: kib Date: Fri Apr 27 16:34:28 2018 New Revision: 333067 URL: https://svnweb.freebsd.org/changeset/base/333067 Log: Remove redundant pipe from pdeathsig.c test. A pipe was was left over from a development version of pdeathsig.c and is not needed. Process C waits for a signal that'll be generated when process B exists. Process B waits for process D to send it a byte via pipe_db before it exits. Process D sends the byte after it has started ptrace()ing process C. The point of the test is to show that process C receives the signal because process B exited, even though C has been reparented to process D. The pipe pipe_cd isn't doing anything useful (though in an earlier version of the patch it did). Clean that up by removing the useless pipe. Submitted by: Thomas Munro MFC after: 6 days Differential revision: https://reviews.freebsd.org/D15214 Modified: head/tests/sys/kern/pdeathsig.c Modified: head/tests/sys/kern/pdeathsig.c ============================================================================== --- head/tests/sys/kern/pdeathsig.c Fri Apr 27 15:50:22 2018 (r333066) +++ head/tests/sys/kern/pdeathsig.c Fri Apr 27 16:34:28 2018 (r333067) @@ -229,7 +229,6 @@ ATF_TC_BODY(signal_delivered_ptrace, tc) int rc; int pipe_ca[2]; int pipe_db[2]; - int pipe_cd[2]; char buffer; int status; @@ -237,8 +236,6 @@ ATF_TC_BODY(signal_delivered_ptrace, tc) ATF_REQUIRE(rc == 0); rc = pipe(pipe_db); ATF_REQUIRE(rc == 0); - rc = pipe(pipe_cd); - ATF_REQUIRE(rc == 0); rc = fork(); ATF_REQUIRE(rc != -1); @@ -265,10 +262,6 @@ ATF_TC_BODY(signal_delivered_ptrace, tc) /* request a signal on parent death and register a handler */ rc = procctl(P_PID, 0, PROC_PDEATHSIG_CTL, &signum); assert(rc == 0); - - /* tell D we are ready for it to attach */ - rc = write(pipe_cd[1], ".", 1); - assert(rc == 1); /* wait for B to die and signal us... */ signum = 0xdeadbeef; From owner-svn-src-head@freebsd.org Fri Apr 27 17:20:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDE19FAD75A; Fri, 27 Apr 2018 17:20:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E80B6BB95; Fri, 27 Apr 2018 17:20:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6531E1642; Fri, 27 Apr 2018 17:20:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RHKN2o021216; Fri, 27 Apr 2018 17:20:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RHKNrb021215; Fri, 27 Apr 2018 17:20:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804271720.w3RHKNrb021215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 27 Apr 2018 17:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333068 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 333068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 17:20:24 -0000 Author: jhb Date: Fri Apr 27 17:20:23 2018 New Revision: 333068 URL: https://svnweb.freebsd.org/changeset/base/333068 Log: Use the correct key address when renegotiating the transmit key. Previously, get_keyid() was returning the address of the receive key instead of the transmit key when renegotiating the transmit key. This could either hang the card (if a connection was only offloading TLS TX and thus had a receive key address of -1) or cause the connection to fail by overwriting the wrong key (if both RX and TX TLS were offloaded). Submitted by: Harsh Jain @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tls.c Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Fri Apr 27 16:34:28 2018 (r333067) +++ head/sys/dev/cxgbe/tom/t4_tls.c Fri Apr 27 17:20:23 2018 (r333068) @@ -488,7 +488,7 @@ static int get_keyid(struct tls_ofld_info *tls_ofld, unsigned int ops) { return (ops & KEY_WRITE_RX ? tls_ofld->rx_key_addr : - ((ops & KEY_WRITE_TX) ? tls_ofld->rx_key_addr : -1)); + ((ops & KEY_WRITE_TX) ? tls_ofld->tx_key_addr : -1)); } static int From owner-svn-src-head@freebsd.org Fri Apr 27 19:50:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 653F1FB07DE; Fri, 27 Apr 2018 19:50: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12D946D472; Fri, 27 Apr 2018 19:50: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 0DBA22EA3; Fri, 27 Apr 2018 19:50: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 w3RJoUC7097892; Fri, 27 Apr 2018 19:50:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RJoUjX097891; Fri, 27 Apr 2018 19:50:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804271950.w3RJoUjX097891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Apr 2018 19:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333071 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 333071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 19:50:31 -0000 Author: emaste Date: Fri Apr 27 19:50:30 2018 New Revision: 333071 URL: https://svnweb.freebsd.org/changeset/base/333071 Log: Bump min supported release for building HEAD to 10.3 r307825 and r333017 disallow building FreeBSD-HEAD from 9.x or 10.x versions that have some clang issues. The minimum supported Subversion revisions and osreldates containing the fix are: Version Min Rev osreldate 9.x r286035 903509 10.x r286033 1002501 9.3 is the final 9.x release and does not contain the r286035 fix. 10.3 is the first 10.x release with the fix. Thus, in practice 10.3 is the oldest release that can build HEAD. Although it may still be possible to build HEAD from an up-to-date stable/9 it's not worth maintaining the special case when the branch itself is unsupported and there are no usable releases from that branch. Old UPDATING entries can be removed and the Clang warning in UPDATING may be updated, in a future commit. Approved by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15209 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Apr 27 19:21:39 2018 (r333070) +++ head/Makefile.inc1 Fri Apr 27 19:50:30 2018 (r333071) @@ -524,9 +524,9 @@ PACKAGE= kernel # BOOTSTRAPPING?= 0 -# Keep these in sync -- see below for special case exception -MINIMUM_SUPPORTED_OSREL?= 900044 -MINIMUM_SUPPORTED_REL?= 9.1 +# Keep these in sync +MINIMUM_SUPPORTED_OSREL?= 1002501 +MINIMUM_SUPPORTED_REL?= 10.3 # Common environment for world related stages CROSSENV+= \ @@ -1845,18 +1845,6 @@ _elftoolchain_libs= lib/libelf lib/libdwarf .endif legacy: .PHONY -# Temporary special case for automatically detecting the clang compiler issue -# Note: 9.x didn't have FreeBSD_version bumps often enough, so you may need to -# set BOOTSTRAPPING to 0 if you're stable/9 tree post-dates r286035 but is before -# the version bump in r296219 (from July 29, 2015 -> Feb 29, 2016). -.if ${BOOTSTRAPPING} != 0 && \ - ${WANT_COMPILER_TYPE} == "clang" && ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30601 -.if ${BOOTSTRAPPING} > 1000000 && ${BOOTSTRAPPING} < 1002501 - @echo "ERROR: Source upgrades from stable/10 prior to r286033 are not supported."; false -.elif ${BOOTSTRAPPING} > 900000 && ${BOOTSTRAPPING} < 903509 - @echo "ERROR: Source upgrades from stable/9 prior to r286035 are not supported."; false -.endif -.endif .if ${BOOTSTRAPPING} < ${MINIMUM_SUPPORTED_OSREL} && ${BOOTSTRAPPING} != 0 @echo "ERROR: Source upgrades from versions prior to ${MINIMUM_SUPPORTED_REL} are not supported."; \ false From owner-svn-src-head@freebsd.org Fri Apr 27 20:20:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB2EAFB0FC8; Fri, 27 Apr 2018 20:20:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 902CD743F1; Fri, 27 Apr 2018 20:20:57 +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 8AF8F336C; Fri, 27 Apr 2018 20:20:57 +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 w3RKKvxJ015346; Fri, 27 Apr 2018 20:20:57 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RKKvNx015345; Fri, 27 Apr 2018 20:20:57 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804272020.w3RKKvNx015345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Apr 2018 20:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333072 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 333072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 20:20:58 -0000 Author: emaste Date: Fri Apr 27 20:20:57 2018 New Revision: 333072 URL: https://svnweb.freebsd.org/changeset/base/333072 Log: Retire UPDATING entries prior to the stable/10 branch We do not support building from FreeBSD 9.x releases. Approved by: imp Sponsored by: The FreeBSD Foundation Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Apr 27 19:50:30 2018 (r333071) +++ head/UPDATING Fri Apr 27 20:20:57 2018 (r333072) @@ -1425,512 +1425,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: The stable/10 branch has been created in subversion from head revision r256279. -20131010: - The rc.d/jail script has been updated to support jail(8) - configuration file. The "jail__*" rc.conf(5) variables - for per-jail configuration are automatically converted to - /var/run/jail..conf before the jail(8) utility is invoked. - This is transparently backward compatible. See below about some - incompatibilities and rc.conf(5) manual page for more details. - - These variables are now deprecated in favor of jail(8) configuration - file. One can use "rc.d/jail config " command to generate - a jail(8) configuration file in /var/run/jail..conf without - running the jail(8) utility. The default pathname of the - configuration file is /etc/jail.conf and can be specified by - using $jail_conf or $jail__conf variables. - - Please note that jail_devfs_ruleset accepts an integer at - this moment. Please consider to rewrite the ruleset name - with an integer. - -20130930: - BIND has been removed from the base system. If all you need - is a local resolver, simply enable and start the local_unbound - service instead. Otherwise, several versions of BIND are - available in the ports tree. The dns/bind99 port is one example. - - With this change, nslookup(1) and dig(1) are no longer in the base - system. Users should instead use host(1) and drill(1) which are - in the base system. Alternatively, nslookup and dig can - be obtained by installing the dns/bind-tools port. - -20130916: - With the addition of unbound(8), a new unbound user is now - required during installworld. "mergemaster -p" can be used to - add the user prior to installworld, as documented in the handbook. - -20130911: - OpenSSH is now built with DNSSEC support, and will by default - silently trust signed SSHFP records. This can be controlled with - the VerifyHostKeyDNS client configuration setting. DNSSEC support - can be disabled entirely with the WITHOUT_LDNS option in src.conf. - -20130906: - The GNU Compiler Collection and C++ standard library (libstdc++) - are no longer built by default on platforms where clang is the system - compiler. You can enable them with the WITH_GCC and WITH_GNUCXX - options in src.conf. - -20130905: - The PROCDESC kernel option is now part of the GENERIC kernel - configuration and is required for the rwhod(8) to work. - If you are using custom kernel configuration, you should include - 'options PROCDESC'. - -20130905: - The API and ABI related to the Capsicum framework was modified - in backward incompatible way. The userland libraries and programs - have to be recompiled to work with the new kernel. This includes the - following libraries and programs, but the whole buildworld is - advised: libc, libprocstat, dhclient, tcpdump, hastd, hastctl, - kdump, procstat, rwho, rwhod, uniq. - -20130903: - AES-NI intrinsic support has been added to gcc. The AES-NI module - has been updated to use this support. A new gcc is required to build - the aesni module on both i386 and amd64. - -20130821: - The PADLOCK_RNG and RDRAND_RNG kernel options are now devices. - Thus "device padlock_rng" and "device rdrand_rng" should be - used instead of "options PADLOCK_RNG" & "options RDRAND_RNG". - -20130813: - WITH_ICONV has been split into two feature sets. WITH_ICONV now - enables just the iconv* functionality and is now on by default. - WITH_LIBICONV_COMPAT enables the libiconv api and link time - compatibility. Set WITHOUT_ICONV to build the old way. - If you have been using WITH_ICONV before, you will very likely - need to turn on WITH_LIBICONV_COMPAT. - -20130806: - INVARIANTS option now enables DEBUG for code with OpenSolaris and - Illumos origin, including ZFS. If you have INVARIANTS in your - kernel configuration, then there is no need to set DEBUG or ZFS_DEBUG - explicitly. - DEBUG used to enable witness(9) tracking of OpenSolaris (mostly ZFS) - locks if WITNESS option was set. Because that generated a lot of - witness(9) reports and all of them were believed to be false - positives, this is no longer done. New option OPENSOLARIS_WITNESS - can be used to achieve the previous behavior. - -20130806: - Timer values in IPv6 data structures now use time_uptime instead - of time_second. Although this is not a user-visible functional - change, userland utilities which directly use them---ndp(8), - rtadvd(8), and rtsold(8) in the base system---need to be updated - to r253970 or later. - -20130802: - find -delete can now delete the pathnames given as arguments, - instead of only files found below them or if the pathname did - not contain any slashes. Formerly, the following error message - would result: - - find: -delete: : relative path potentially not safe - - Deleting the pathnames given as arguments can be prevented - without error messages using -mindepth 1 or by changing - directory and passing "." as argument to find. This works in the - old as well as the new version of find. - -20130726: - Behavior of devfs rules path matching has been changed. - Pattern is now always matched against fully qualified devfs - path and slash characters must be explicitly matched by - slashes in pattern (FNM_PATHNAME). Rulesets involving devfs - subdirectories must be reviewed. - -20130716: - The default ARM ABI has changed to the ARM EABI. The old ABI is - incompatible with the ARM EABI and all programs and modules will - need to be rebuilt to work with a new kernel. - - To keep using the old ABI ensure the WITHOUT_ARM_EABI knob is set. - - NOTE: Support for the old ABI will be removed in the future and - users are advised to upgrade. - -20130709: - pkg_install has been disconnected from the build if you really need it - you should add WITH_PKGTOOLS in your src.conf(5). - -20130709: - Most of network statistics structures were changed to be able - keep 64-bits counters. Thus all tools, that work with networking - statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.) - -20130618: - Fix a bug that allowed a tracing process (e.g. gdb) to write - to a memory-mapped file in the traced process's address space - even if neither the traced process nor the tracing process had - write access to that file. - -20130615: - CVS has been removed from the base system. An exact copy - of the code is available from the devel/cvs port. - -20130613: - Some people report the following error after the switch to bmake: - - make: illegal option -- J - usage: make [-BPSXeiknpqrstv] [-C directory] [-D variable] - ... - *** [buildworld] Error code 2 - - this likely due to an old instance of make in - ${MAKEPATH} (${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}) - which src/Makefile will use that blindly, if it exists, so if - you see the above error: - - rm -rf `make -V MAKEPATH` - - should resolve it. - -20130516: - Use bmake by default. - Whereas before one could choose to build with bmake via - -DWITH_BMAKE one must now use -DWITHOUT_BMAKE to use the old - make. The goal is to remove these knobs for 10-RELEASE. - - It is worth noting that bmake (like gmake) treats the command - line as the unit of failure, rather than statements within the - command line. Thus '(cd some/where && dosomething)' is safer - than 'cd some/where; dosomething'. The '()' allows consistent - behavior in parallel build. - -20130429: - Fix a bug that allows NFS clients to issue READDIR on files. - -20130426: - The WITHOUT_IDEA option has been removed because - the IDEA patent expired. - -20130426: - The sysctl which controls TRIM support under ZFS has been renamed - from vfs.zfs.trim_disable -> vfs.zfs.trim.enabled and has been - enabled by default. - -20130425: - The mergemaster command now uses the default MAKEOBJDIRPREFIX - rather than creating it's own in the temporary directory in - order allow access to bootstrapped versions of tools such as - install and mtree. When upgrading from version of FreeBSD where - the install command does not support -l, you will need to - install a new mergemaster command if mergemaster -p is required. - This can be accomplished with the command (cd src/usr.sbin/mergemaster - && make install). - -20130404: - Legacy ATA stack, disabled and replaced by new CAM-based one since - FreeBSD 9.0, completely removed from the sources. Kernel modules - atadisk and atapi*, user-level tools atacontrol and burncd are - removed. Kernel option `options ATA_CAM` is now permanently enabled - and removed. - -20130319: - SOCK_CLOEXEC and SOCK_NONBLOCK flags have been added to socket(2) - and socketpair(2). Software, in particular Kerberos, may - automatically detect and use these during building. The resulting - binaries will not work on older kernels. - -20130308: - CTL_DISABLE has also been added to the sparc64 GENERIC (for further - information, see the respective 20130304 entry). - -20130304: - Recent commits to callout(9) changed the size of struct callout, - so the KBI is probably heavily disturbed. Also, some functions - in callout(9)/sleep(9)/sleepqueue(9)/condvar(9) KPIs were replaced - by macros. Every kernel module using it won't load, so rebuild - is requested. - - The ctl device has been re-enabled in GENERIC for i386 and amd64, - but does not initialize by default (because of the new CTL_DISABLE - option) to save memory. To re-enable it, remove the CTL_DISABLE - option from the kernel config file or set kern.cam.ctl.disable=0 - in /boot/loader.conf. - -20130301: - The ctl device has been disabled in GENERIC for i386 and amd64. - This was done due to the extra memory being allocated at system - initialisation time by the ctl driver which was only used if - a CAM target device was created. This makes a FreeBSD system - unusable on 128MB or less of RAM. - -20130208: - A new compression method (lz4) has been merged to -HEAD. Please - refer to zpool-features(7) for more information. - - Please refer to the "ZFS notes" section of this file for information - on upgrading boot ZFS pools. - -20130129: - A BSD-licensed patch(1) variant has been added and is installed - as bsdpatch, being the GNU version the default patch. - To inverse the logic and use the BSD-licensed one as default, - while having the GNU version installed as gnupatch, rebuild - and install world with the WITH_BSD_PATCH knob set. - -20130121: - Due to the use of the new -l option to install(1) during build - and install, you must take care not to directly set the INSTALL - make variable in your /etc/make.conf, /etc/src.conf, or on the - command line. If you wish to use the -C flag for all installs - you may be able to add INSTALL+=-C to /etc/make.conf or - /etc/src.conf. - -20130118: - The install(1) option -M has changed meaning and now takes an - argument that is a file or path to append logs to. In the - unlikely event that -M was the last option on the command line - and the command line contained at least two files and a target - directory the first file will have logs appended to it. The -M - option served little practical purpose in the last decade so its - use is expected to be extremely rare. - -20121223: - After switching to Clang as the default compiler some users of ZFS - on i386 systems started to experience stack overflow kernel panics. - Please consider using 'options KSTACK_PAGES=4' in such configurations. - -20121222: - GEOM_LABEL now mangles label names read from file system metadata. - Mangling affect labels containing spaces, non-printable characters, - '%' or '"'. Device names in /etc/fstab and other places may need to - be updated. - -20121217: - By default, only the 10 most recent kernel dumps will be saved. To - restore the previous behaviour (no limit on the number of kernel dumps - stored in the dump directory) add the following line to /etc/rc.conf: - - savecore_flags="" - -20121201: - With the addition of auditdistd(8), a new auditdistd user is now - required during installworld. "mergemaster -p" can be used to - add the user prior to installworld, as documented in the handbook. - -20121117: - The sin6_scope_id member variable in struct sockaddr_in6 is now - filled by the kernel before passing the structure to the userland via - sysctl or routing socket. This means the KAME-specific embedded scope - id in sin6_addr.s6_addr[2] is always cleared in userland application. - This behavior can be controlled by net.inet6.ip6.deembed_scopeid. - __FreeBSD_version is bumped to 1000025. - -20121105: - On i386 and amd64 systems WITH_CLANG_IS_CC is now the default. - This means that the world and kernel will be compiled with clang - and that clang will be installed as /usr/bin/cc, /usr/bin/c++, - and /usr/bin/cpp. To disable this behavior and revert to building - with gcc, compile with WITHOUT_CLANG_IS_CC. Really old versions - of current may need to bootstrap WITHOUT_CLANG first if the clang - build fails (its compatibility window doesn't extend to the 9 stable - branch point). - -20121102: - The IPFIREWALL_FORWARD kernel option has been removed. Its - functionality now turned on by default. - -20121023: - The ZERO_COPY_SOCKET kernel option has been removed and - split into SOCKET_SEND_COW and SOCKET_RECV_PFLIP. - NB: SOCKET_SEND_COW uses the VM page based copy-on-write - mechanism which is not safe and may result in kernel crashes. - NB: The SOCKET_RECV_PFLIP mechanism is useless as no current - driver supports disposeable external page sized mbuf storage. - Proper replacements for both zero-copy mechanisms are under - consideration and will eventually lead to complete removal - of the two kernel options. - -20121023: - The IPv4 network stack has been converted to network byte - order. The following modules need to be recompiled together - with kernel: carp(4), divert(4), gif(4), siftr(4), gre(4), - pf(4), ipfw(4), ng_ipfw(4), stf(4). - -20121022: - Support for non-MPSAFE filesystems was removed from VFS. The - VFS_VERSION was bumped, all filesystem modules shall be - recompiled. - -20121018: - All the non-MPSAFE filesystems have been disconnected from - the build. The full list includes: codafs, hpfs, ntfs, nwfs, - portalfs, smbfs, xfs. - -20121016: - The interface cloning API and ABI has changed. The following - modules need to be recompiled together with kernel: - ipfw(4), pfsync(4), pflog(4), usb(4), wlan(4), stf(4), - vlan(4), disc(4), edsc(4), if_bridge(4), gif(4), tap(4), - faith(4), epair(4), enc(4), tun(4), if_lagg(4), gre(4). - -20121015: - The sdhci driver was split in two parts: sdhci (generic SD Host - Controller logic) and sdhci_pci (actual hardware driver). - No kernel config modifications are required, but if you - load sdhc as a module you must switch to sdhci_pci instead. - -20121014: - Import the FUSE kernel and userland support into base system. - -20121013: - The GNU sort(1) program has been removed since the BSD-licensed - sort(1) has been the default for quite some time and no serious - problems have been reported. The corresponding WITH_GNU_SORT - knob has also gone. - -20121006: - The pfil(9) API/ABI for AF_INET family has been changed. Packet - filtering modules: pf(4), ipfw(4), ipfilter(4) need to be recompiled - with new kernel. - -20121001: - The net80211(4) ABI has been changed to allow for improved driver - PS-POLL and power-save support. All wireless drivers need to be - recompiled to work with the new kernel. - -20120913: - The random(4) support for the VIA hardware random number - generator (`PADLOCK') is no longer enabled unconditionally. - Add the padlock_rng device in the custom kernel config if - needed. The GENERIC kernels on i386 and amd64 do include the - device, so the change only affects the custom kernel - configurations. - -20120908: - The pf(4) packet filter ABI has been changed. pfctl(8) and - snmp_pf module need to be recompiled to work with new kernel. - -20120828: - A new ZFS feature flag "com.delphix:empty_bpobj" has been merged - to -HEAD. Pools that have empty_bpobj in active state can not be - imported read-write with ZFS implementations that do not support - this feature. For more information read the zpool-features(5) - manual page. - -20120727: - The sparc64 ZFS loader has been changed to no longer try to auto- - detect ZFS providers based on diskN aliases but now requires these - to be explicitly listed in the OFW boot-device environment variable. - -20120712: - The OpenSSL has been upgraded to 1.0.1c. Any binaries requiring - libcrypto.so.6 or libssl.so.6 must be recompiled. Also, there are - configuration changes. Make sure to merge /etc/ssl/openssl.cnf. - -20120712: - The following sysctls and tunables have been renamed for consistency - with other variables: - kern.cam.da.da_send_ordered -> kern.cam.da.send_ordered - kern.cam.ada.ada_send_ordered -> kern.cam.ada.send_ordered - -20120628: - The sort utility has been replaced with BSD sort. For now, GNU sort - is also available as "gnusort" or the default can be set back to - GNU sort by setting WITH_GNU_SORT. In this case, BSD sort will be - installed as "bsdsort". - -20120611: - A new version of ZFS (pool version 5000) has been merged to -HEAD. - Starting with this version the old system of ZFS pool versioning - is superseded by "feature flags". This concept enables forward - compatibility against certain future changes in functionality of ZFS - pools. The first read-only compatible "feature flag" for ZFS pools - is named "com.delphix:async_destroy". For more information - read the new zpool-features(5) manual page. - Please refer to the "ZFS notes" section of this file for information - on upgrading boot ZFS pools. - -20120417: - The malloc(3) implementation embedded in libc now uses sources imported - as contrib/jemalloc. The most disruptive API change is to - /etc/malloc.conf. If your system has an old-style /etc/malloc.conf, - delete it prior to installworld, and optionally re-create it using the - new format after rebooting. See malloc.conf(5) for details - (specifically the TUNING section and the "opt.*" entries in the MALLCTL - NAMESPACE section). - -20120328: - Big-endian MIPS TARGET_ARCH values no longer end in "eb". mips64eb - is now spelled mips64. mipsn32eb is now spelled mipsn32. mipseb is - now spelled mips. This is to aid compatibility with third-party - software that expects this naming scheme in uname(3). Little-endian - settings are unchanged. If you are updating a big-endian mips64 machine - from before this change, you may need to set MACHINE_ARCH=mips64 in - your environment before the new build system will recognize your machine. - -20120306: - Disable by default the option VFS_ALLOW_NONMPSAFE for all supported - platforms. - -20120229: - Now unix domain sockets behave "as expected" on nullfs(5). Previously - nullfs(5) did not pass through all behaviours to the underlying layer, - as a result if we bound to a socket on the lower layer we could connect - only to the lower path; if we bound to the upper layer we could connect - only to the upper path. The new behavior is one can connect to both the - lower and the upper paths regardless what layer path one binds to. - -20120211: - The getifaddrs upgrade path broken with 20111215 has been restored. - If you have upgraded in between 20111215 and 20120209 you need to - recompile libc again with your kernel. You still need to recompile - world to be able to configure CARP but this restriction already - comes from 20111215. - -20120114: - The set_rcvar() function has been removed from /etc/rc.subr. All - base and ports rc.d scripts have been updated, so if you have a - port installed with a script in /usr/local/etc/rc.d you can either - hand-edit the rcvar= line, or reinstall the port. - - An easy way to handle the mass-update of /etc/rc.d: - rm /etc/rc.d/* && mergemaster -i - -20120109: - panic(9) now stops other CPUs in the SMP systems, disables interrupts - on the current CPU and prevents other threads from running. - This behavior can be reverted using the kern.stop_scheduler_on_panic - tunable/sysctl. - The new behavior can be incompatible with kern.sync_on_panic. - -20111215: - The carp(4) facility has been changed significantly. Configuration - of the CARP protocol via ifconfig(8) has changed, as well as format - of CARP events submitted to devd(8) has changed. See manual pages - for more information. The arpbalance feature of carp(4) is currently - not supported anymore. - - Size of struct in_aliasreq, struct in6_aliasreq has changed. User - utilities using SIOCAIFADDR, SIOCAIFADDR_IN6, e.g. ifconfig(8), - need to be recompiled. - -20111122: - The acpi_wmi(4) status device /dev/wmistat has been renamed to - /dev/wmistat0. - -20111108: - The option VFS_ALLOW_NONMPSAFE option has been added in order to - explicitely support non-MPSAFE filesystems. - It is on by default for all supported platform at this present - time. - -20111101: - The broken amd(4) driver has been replaced with esp(4) in the amd64, - i386 and pc98 GENERIC kernel configuration files. - -20110930: - sysinstall has been removed - -20110923: - The stable/9 branch created in subversion. This corresponds to the - RELENG_9 branch in CVS. - COMMON ITEMS: General Notes From owner-svn-src-head@freebsd.org Fri Apr 27 21:05:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE2D8FB1AA0; Fri, 27 Apr 2018 21:05:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 581467CD22; Fri, 27 Apr 2018 21:05:19 +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 4D6793F90; Fri, 27 Apr 2018 21:05:19 +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 w3RL5Ja9041876; Fri, 27 Apr 2018 21:05:19 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RL5JbD041874; Fri, 27 Apr 2018 21:05:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804272105.w3RL5JbD041874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 27 Apr 2018 21:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333073 - in head/sys/arm: allwinner freescale/imx X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm: allwinner freescale/imx X-SVN-Commit-Revision: 333073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 21:05:19 -0000 Author: manu Date: Fri Apr 27 21:05:18 2018 New Revision: 333073 URL: https://svnweb.freebsd.org/changeset/base/333073 Log: arm: Fix duplicate ahci DRIVER_MODULE Name each ahci driver uniquely. This remove the warning printed at each arm boot : module_register: cannot register simplebus/ahci from kernel; already loaded from kernel Modified: head/sys/arm/allwinner/a10_ahci.c head/sys/arm/freescale/imx/imx6_ahci.c Modified: head/sys/arm/allwinner/a10_ahci.c ============================================================================== --- head/sys/arm/allwinner/a10_ahci.c Fri Apr 27 20:20:57 2018 (r333072) +++ head/sys/arm/allwinner/a10_ahci.c Fri Apr 27 21:05:18 2018 (r333073) @@ -392,4 +392,4 @@ static driver_t ahci_ata_driver = { sizeof(struct ahci_controller) }; -DRIVER_MODULE(ahci, simplebus, ahci_ata_driver, ahci_devclass, 0, 0); +DRIVER_MODULE(a10_ahci, simplebus, ahci_ata_driver, ahci_devclass, 0, 0); Modified: head/sys/arm/freescale/imx/imx6_ahci.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ahci.c Fri Apr 27 20:20:57 2018 (r333072) +++ head/sys/arm/freescale/imx/imx6_ahci.c Fri Apr 27 21:05:18 2018 (r333073) @@ -353,4 +353,4 @@ static driver_t ahci_ata_driver = { sizeof(struct ahci_controller) }; -DRIVER_MODULE(ahci, simplebus, ahci_ata_driver, ahci_devclass, 0, 0); +DRIVER_MODULE(imx6_ahci, simplebus, ahci_ata_driver, ahci_devclass, 0, 0); From owner-svn-src-head@freebsd.org Fri Apr 27 21:05:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DCEBFB1B0A; Fri, 27 Apr 2018 21:05:59 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24DBD7CE70; Fri, 27 Apr 2018 21:05:59 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FCAC3F91; Fri, 27 Apr 2018 21:05:59 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RL5xeM041947; Fri, 27 Apr 2018 21:05:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RL5w4V041941; Fri, 27 Apr 2018 21:05:58 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804272105.w3RL5w4V041941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 27 Apr 2018 21:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333074 - in head/sys/arm: allwinner cavium/cns11xx freescale/vybrid samsung/exynos ti/usb xilinx X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/arm: allwinner cavium/cns11xx freescale/vybrid samsung/exynos ti/usb xilinx X-SVN-Commit-Revision: 333074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 21:05:59 -0000 Author: manu Date: Fri Apr 27 21:05:58 2018 New Revision: 333074 URL: https://svnweb.freebsd.org/changeset/base/333074 Log: arm: Fix duplicate ehci DRIVER_MODULE Name each ehci driver uniquely. This remove the warning printed at each arm boot : module_register: cannot register simplebus/ehci from kernel; already loaded from kernel Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/cavium/cns11xx/ehci_ebus.c head/sys/arm/freescale/vybrid/vf_ehci.c head/sys/arm/samsung/exynos/exynos5_ehci.c head/sys/arm/ti/usb/omap_ehci.c head/sys/arm/xilinx/zy7_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Fri Apr 27 21:05:18 2018 (r333073) +++ head/sys/arm/allwinner/a10_ehci.c Fri Apr 27 21:05:58 2018 (r333074) @@ -365,5 +365,5 @@ static driver_t ehci_driver = { static devclass_t ehci_devclass; -DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); +DRIVER_MODULE(a10_ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(a10_ehci, usb, 1, 1, 1); Modified: head/sys/arm/cavium/cns11xx/ehci_ebus.c ============================================================================== --- head/sys/arm/cavium/cns11xx/ehci_ebus.c Fri Apr 27 21:05:18 2018 (r333073) +++ head/sys/arm/cavium/cns11xx/ehci_ebus.c Fri Apr 27 21:05:58 2018 (r333074) @@ -244,5 +244,5 @@ static driver_t ehci_driver = { static devclass_t ehci_devclass; -DRIVER_MODULE(ehci, econaarm, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); +DRIVER_MODULE(ebus_ehci, econaarm, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ebus_ehci, usb, 1, 1, 1); Modified: head/sys/arm/freescale/vybrid/vf_ehci.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_ehci.c Fri Apr 27 21:05:18 2018 (r333073) +++ head/sys/arm/freescale/vybrid/vf_ehci.c Fri Apr 27 21:05:58 2018 (r333074) @@ -166,8 +166,8 @@ static driver_t ehci_driver = { static devclass_t ehci_devclass; -DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); +DRIVER_MODULE(vybrid_ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(vybrid_ehci, usb, 1, 1, 1); static void vybrid_ehci_post_reset(struct ehci_softc *ehci_softc) Modified: head/sys/arm/samsung/exynos/exynos5_ehci.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_ehci.c Fri Apr 27 21:05:18 2018 (r333073) +++ head/sys/arm/samsung/exynos/exynos5_ehci.c Fri Apr 27 21:05:58 2018 (r333074) @@ -131,8 +131,8 @@ static driver_t ehci_driver = { static devclass_t ehci_devclass; -DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); +DRIVER_MODULE(exynos_ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(exynos_ehci, usb, 1, 1, 1); /* * Public methods Modified: head/sys/arm/ti/usb/omap_ehci.c ============================================================================== --- head/sys/arm/ti/usb/omap_ehci.c Fri Apr 27 21:05:18 2018 (r333073) +++ head/sys/arm/ti/usb/omap_ehci.c Fri Apr 27 21:05:58 2018 (r333074) @@ -469,4 +469,4 @@ static driver_t ehci_driver = { static devclass_t ehci_devclass; -DRIVER_MODULE(ehci, omap_uhh, ehci_driver, ehci_devclass, 0, 0); +DRIVER_MODULE(omap_ehci, omap_uhh, ehci_driver, ehci_devclass, 0, 0); Modified: head/sys/arm/xilinx/zy7_ehci.c ============================================================================== --- head/sys/arm/xilinx/zy7_ehci.c Fri Apr 27 21:05:18 2018 (r333073) +++ head/sys/arm/xilinx/zy7_ehci.c Fri Apr 27 21:05:58 2018 (r333074) @@ -370,5 +370,5 @@ static driver_t ehci_driver = { }; static devclass_t ehci_devclass; -DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, NULL, NULL); -MODULE_DEPEND(ehci, usb, 1, 1, 1); +DRIVER_MODULE(zy7_ehci, simplebus, ehci_driver, ehci_devclass, NULL, NULL); +MODULE_DEPEND(zy7_ehci, usb, 1, 1, 1); From owner-svn-src-head@freebsd.org Fri Apr 27 21:15:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C873FB2164; Fri, 27 Apr 2018 21:15:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA9007F915; Fri, 27 Apr 2018 21:15: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 A4FF54179; Fri, 27 Apr 2018 21:15: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 w3RLFpJX047129; Fri, 27 Apr 2018 21:15:51 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RLFpjR047127; Fri, 27 Apr 2018 21:15:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201804272115.w3RLFpjR047127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 27 Apr 2018 21:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333075 - in head/sys: arm/conf modules/dtb/allwinner modules/dtb/overlays X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/conf modules/dtb/allwinner modules/dtb/overlays X-SVN-Commit-Revision: 333075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 21:15:52 -0000 Author: manu Date: Fri Apr 27 21:15:51 2018 New Revision: 333075 URL: https://svnweb.freebsd.org/changeset/base/333075 Log: arm: dts: overlays: Remove the overlay module Move the DTSO variables in the main SoC dtb file Discussed with: ian Deleted: head/sys/modules/dtb/overlays/ Modified: head/sys/arm/conf/GENERIC head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Fri Apr 27 21:05:58 2018 (r333074) +++ head/sys/arm/conf/GENERIC Fri Apr 27 21:15:51 2018 (r333075) @@ -246,4 +246,4 @@ options EFI # Flattened Device Tree options FDT # Configure using FDT/DTB data -makeoptions MODULES_EXTRA="dtb/allwinner dtb/am335x dtb/imx6 dtb/nvidia dtb/rpi dtb/zynq dtb/omap4 dtb/overlays" +makeoptions MODULES_EXTRA="dtb/allwinner dtb/am335x dtb/imx6 dtb/nvidia dtb/rpi dtb/zynq dtb/omap4" Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Fri Apr 27 21:05:58 2018 (r333074) +++ head/sys/modules/dtb/allwinner/Makefile Fri Apr 27 21:15:51 2018 (r333075) @@ -19,6 +19,8 @@ DTS= \ sun8i-h3-orangepi-one.dts \ sun8i-h3-orangepi-plus2e.dts +DTSO= sun8i-h3-sid.dtso + LINKS= \ ${DTBDIR}/sun4i-a10-cubieboard.dtb ${DTBDIR}/cubieboard.dtb \ ${DTBDIR}/sun4i-a10-olinuxino-lime.dtb ${DTBDIR}/olinuxino-lime.dtb \ From owner-svn-src-head@freebsd.org Fri Apr 27 21:22:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F5C3FB23AC; Fri, 27 Apr 2018 21:22:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3192580039; Fri, 27 Apr 2018 21:22:33 +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 2C8D04308; Fri, 27 Apr 2018 21:22:33 +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 w3RLMX5b051895; Fri, 27 Apr 2018 21:22:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RLMXAC051894; Fri, 27 Apr 2018 21:22:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804272122.w3RLMXAC051894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 27 Apr 2018 21:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333076 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 333076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 21:22:33 -0000 Author: jhb Date: Fri Apr 27 21:22:32 2018 New Revision: 333076 URL: https://svnweb.freebsd.org/changeset/base/333076 Log: Use %p to print uintptr_t values rather than %z in MIPS single-step code. Modified: head/sys/mips/mips/pm_machdep.c Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Fri Apr 27 21:15:51 2018 (r333075) +++ head/sys/mips/mips/pm_machdep.c Fri Apr 27 21:22:32 2018 (r333076) @@ -264,8 +264,9 @@ ptrace_single_step(struct thread *td) va = locr0->pc + 4; } if (td->td_md.md_ss_addr) { - printf("SS %s (%d): breakpoint already set at %zx (va %zx)\n", - p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ + printf("SS %s (%d): breakpoint already set at %p (va %p)\n", + p->p_comm, p->p_pid, (void *)td->td_md.md_ss_addr, + (void *)va); /* XXX */ error = EFAULT; goto out; } @@ -500,8 +501,8 @@ ptrace_clear_single_step(struct thread *td) if (error != 0) { log(LOG_ERR, - "SS %s %d: can't restore instruction at %zx: %x\n", - p->p_comm, p->p_pid, td->td_md.md_ss_addr, + "SS %s %d: can't restore instruction at %p: %x\n", + p->p_comm, p->p_pid, (void *)td->td_md.md_ss_addr, td->td_md.md_ss_instr); } td->td_md.md_ss_addr = 0; From owner-svn-src-head@freebsd.org Fri Apr 27 21:25:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 728CBFB244C; Fri, 27 Apr 2018 21:25:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10DE7801D2; Fri, 27 Apr 2018 21:25:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id F0E3410AFAD; Fri, 27 Apr 2018 17:25:49 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: Li-Wen Hsu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333010 - head/sys/mips/mips Date: Fri, 27 Apr 2018 12:42:30 -0700 Message-ID: <25448250.A6B4XqlUaS@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <1524756570.57768.115.camel@freebsd.org> References: <201804251946.w3PJkdkH040243@repo.freebsd.org> <1524756570.57768.115.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 27 Apr 2018 17:25:50 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 21:25:51 -0000 On Thursday, April 26, 2018 09:29:30 AM Ian Lepore wrote: > On Thu, 2018-04-26 at 19:01 +0800, Li-Wen Hsu wrote: > > On Thu, Apr 26, 2018 at 7:59 AM, Ian Lepore wrote: > > > > > > On Wed, 2018-04-25 at 19:46 +0000, Li-Wen Hsu wrote: > > > > > > > > Author: lwhsu (ports committer) > > > > Date: Wed Apr 25 19:46:39 2018 > > > > New Revision: 333010 > > > > URL: https://svnweb.freebsd.org/changeset/base/333010 > > > > > > > > Log: > > > > Fix mips32 build after r332951. > > > > > > > > Approved by: jhb > > > > > > > > Modified: > > > > head/sys/mips/mips/pm_machdep.c > > > > > > > > Modified: head/sys/mips/mips/pm_machdep.c > > > > ============================================================================== > > > > --- head/sys/mips/mips/pm_machdep.c Wed Apr 25 18:59:29 2018 (r333009) > > > > +++ head/sys/mips/mips/pm_machdep.c Wed Apr 25 19:46:39 2018 (r333010) > > > > @@ -264,7 +264,7 @@ ptrace_single_step(struct thread *td) > > > > va = locr0->pc + 4; > > > > } > > > > if (td->td_md.md_ss_addr) { > > > > - printf("SS %s (%d): breakpoint already set at %lx (va %lx)\n", > > > > + printf("SS %s (%d): breakpoint already set at %zx (va %zx)\n", > > > > p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ > > > > error = EFAULT; > > > > goto out; > > > > @@ -500,7 +500,7 @@ ptrace_clear_single_step(struct thread *td) > > > > > > > > if (error != 0) { > > > > log(LOG_ERR, > > > > - "SS %s %d: can't restore instruction at %lx: %x\n", > > > > + "SS %s %d: can't restore instruction at %zx: %x\n", > > > > p->p_comm, p->p_pid, td->td_md.md_ss_addr, > > > > td->td_md.md_ss_instr); > > > > } > > > > > > > This isn't right either. %z is for size_t values, both md_ss_addr and > > > va are integers and a plain %x should be the right format. > > But it will break mips64: > > > > cc1: warnings being treated as errors > > /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function 'ptrace_single_step': > > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' > > expects type 'unsigned int', but argument 4 has type 'uintptr_t' > > [-Wformat] > > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' > > expects type 'unsigned int', but argument 5 has type 'uintptr_t' > > [-Wformat] > > /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function > > 'ptrace_clear_single_step': > > /home/lwhsu/src/sys/mips/mips/pm_machdep.c:505: warning: format '%x' > > expects type 'unsigned int', but argument 5 has type 'uintptr_t' > > [-Wformat] > > *** [pm_machdep.o] Error code 1 > > > > Another way is cast arguments to uintmax_t and use %jx. Will that be better? > > > > Li-Wen > > > > Oh, my bad, my source was out of date. Now I see that the types are not > plain integers anymore. In that case, I think the only options are to > cast to uintmax_t and use %jx, or cast to void* and use %p. The %z does happen to work in this case since size_t == uintptr_t on MIPS, but I think %p is the best route since these really are pointers. I've build-tested a patch to use %p and will commit it in a bit. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Apr 27 22:15:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43F46FB3110; Fri, 27 Apr 2018 22:15:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E70F46B642; Fri, 27 Apr 2018 22:15:18 +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 DCAE74AE4; Fri, 27 Apr 2018 22:15:18 +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 w3RMFIOR077336; Fri, 27 Apr 2018 22:15:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RMFIAv077335; Fri, 27 Apr 2018 22:15:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201804272215.w3RMFIAv077335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 27 Apr 2018 22:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333079 - head/stand/arm64 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/arm64 X-SVN-Commit-Revision: 333079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 22:15:19 -0000 Author: imp Date: Fri Apr 27 22:15:18 2018 New Revision: 333079 URL: https://svnweb.freebsd.org/changeset/base/333079 Log: No need to make objects here. Modified: head/stand/arm64/Makefile Modified: head/stand/arm64/Makefile ============================================================================== --- head/stand/arm64/Makefile Fri Apr 27 21:30:48 2018 (r333078) +++ head/stand/arm64/Makefile Fri Apr 27 22:15:18 2018 (r333079) @@ -1,3 +1,5 @@ # $FreeBSD$ +NO_OBJ=t + .include From owner-svn-src-head@freebsd.org Sat Apr 28 00:35:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92725FB5CB7; Sat, 28 Apr 2018 00:35:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id D720885D9E; Sat, 28 Apr 2018 00:35:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id CD27B1A2E6A; Sat, 28 Apr 2018 10:18:14 +1000 (AEST) Date: Sat, 28 Apr 2018 10:18:13 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Ian Lepore , Li-Wen Hsu , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333010 - head/sys/mips/mips In-Reply-To: <25448250.A6B4XqlUaS@ralph.baldwin.cx> Message-ID: <20180428082729.F3982@besplex.bde.org> References: <201804251946.w3PJkdkH040243@repo.freebsd.org> <1524756570.57768.115.camel@freebsd.org> <25448250.A6B4XqlUaS@ralph.baldwin.cx> 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=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=pNZfrhq-Dav1uGoF_aIA:9 a=gEDmztwniwxxe4nX:21 a=CtCnc-sCAy8039-h:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 00:35:19 -0000 On Fri, 27 Apr 2018, John Baldwin wrote: > On Thursday, April 26, 2018 09:29:30 AM Ian Lepore wrote: >> On Thu, 2018-04-26 at 19:01 +0800, Li-Wen Hsu wrote: >>> On Thu, Apr 26, 2018 at 7:59 AM, Ian Lepore wrote: >>>> >>>> On Wed, 2018-04-25 at 19:46 +0000, Li-Wen Hsu wrote: >>>>> >>>>> Author: lwhsu (ports committer) >>>>> Date: Wed Apr 25 19:46:39 2018 >>>>> New Revision: 333010 >>>>> URL: https://svnweb.freebsd.org/changeset/base/333010 >>>>> >>>>> Log: >>>>> Fix mips32 build after r332951. >>>>> >>>>> Approved by: jhb >>>>> >>>>> Modified: >>>>> head/sys/mips/mips/pm_machdep.c >>>>> >>>>> Modified: head/sys/mips/mips/pm_machdep.c >>>>> ============================================================================== >>>>> --- head/sys/mips/mips/pm_machdep.c Wed Apr 25 18:59:29 2018 (r333009) >>>>> +++ head/sys/mips/mips/pm_machdep.c Wed Apr 25 19:46:39 2018 (r333010) >>>>> @@ -264,7 +264,7 @@ ptrace_single_step(struct thread *td) >>>>> va = locr0->pc + 4; >>>>> } >>>>> if (td->td_md.md_ss_addr) { >>>>> - printf("SS %s (%d): breakpoint already set at %lx (va %lx)\n", >>>>> + printf("SS %s (%d): breakpoint already set at %zx (va %zx)\n", >>>>> p->p_comm, p->p_pid, td->td_md.md_ss_addr, va); /* XXX */ >>>>> error = EFAULT; >>>>> goto out; >>>>> @@ -500,7 +500,7 @@ ptrace_clear_single_step(struct thread *td) >>>>> >>>>> if (error != 0) { >>>>> log(LOG_ERR, >>>>> - "SS %s %d: can't restore instruction at %lx: %x\n", >>>>> + "SS %s %d: can't restore instruction at %zx: %x\n", >>>>> p->p_comm, p->p_pid, td->td_md.md_ss_addr, >>>>> td->td_md.md_ss_instr); >>>>> } >>>>> >>>> This isn't right either. %z is for size_t values, both md_ss_addr and >>>> va are integers and a plain %x should be the right format. >>> But it will break mips64: >>> >>> cc1: warnings being treated as errors >>> /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function 'ptrace_single_step': >>> /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' >>> expects type 'unsigned int', but argument 4 has type 'uintptr_t' >>> [-Wformat] >>> /home/lwhsu/src/sys/mips/mips/pm_machdep.c:268: warning: format '%x' >>> expects type 'unsigned int', but argument 5 has type 'uintptr_t' >>> [-Wformat] >>> /home/lwhsu/src/sys/mips/mips/pm_machdep.c: In function >>> 'ptrace_clear_single_step': >>> /home/lwhsu/src/sys/mips/mips/pm_machdep.c:505: warning: format '%x' >>> expects type 'unsigned int', but argument 5 has type 'uintptr_t' >>> [-Wformat] >>> *** [pm_machdep.o] Error code 1 >>> >>> Another way is cast arguments to uintmax_t and use %jx. Will that be better? >> Oh, my bad, my source was out of date. Now I see that the types are not >> plain integers anymore. In that case, I think the only options are to >> cast to uintmax_t and use %jx, or cast to void* and use %p. > > The %z does happen to work in this case since size_t == uintptr_t on MIPS, > but I think %p is the best route since these really are pointers. I've > build-tested a patch to use %p and will commit it in a bit. Ugh, these really aren't (kernel data) pointers. They are user(?) instruction pointers. The correct integer type for representing (both kernel and user) instruction pointers is uintfptr_t. vm_offset_t is next best. vm_offset_t must be large enough to represent any virtual address. Both it and uintfptr_t were recently broken for at least kernel profiling purposes on i386. i386 still has a flat address space, so a bit is not needed to distinguish function addresses from data addresses, but kernel instruction addresses are now indistinguishable from user instruction addresses. ddb backtracing and pmc have problems with this too, but are used more and have some fixes. %p is only good for simple printing of pointers even for data pointers, since it doesn't allow controlling the format. E.g., it forces an 0x prefix and doesn't allow controlling the field width or padding (except possibly in the kernel where it has undocumented extensions). This gives bugs like wasting 2 columns for printing '0x' for wchan in db_ps (wchan is about the least useful kernel pointer to print by default, but that is another bug). ps(1) has better printing for kernel pointers, but still has lots of bogus like casting ki_wchan to long instead of to uintptr_t for printing it, but before that it is an ABI design bug for ki_wchan to be a kernel pointer instead of a good representation of a kernel pointer as an integer. ki_wchan ends up as being raw bits via a type pun. Bruce From owner-svn-src-head@freebsd.org Sat Apr 28 01:14:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55CD9FB6932; Sat, 28 Apr 2018 01:14:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A7FD6D192; Sat, 28 Apr 2018 01:14:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0585D67F3; Sat, 28 Apr 2018 01:14:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3S1EGd1068994; Sat, 28 Apr 2018 01:14:16 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3S1EGw4068993; Sat, 28 Apr 2018 01:14:16 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201804280114.w3S1EGw4068993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 28 Apr 2018 01:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333081 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 333081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 01:14:17 -0000 Author: eadler Date: Sat Apr 28 01:14:16 2018 New Revision: 333081 URL: https://svnweb.freebsd.org/changeset/base/333081 Log: zpool(8): correct list of default properties in 'list'. The default provides output in the following form: ``` NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT ``` this corrects the man page. Also submitted upstream as https://github.com/openzfs/openzfs/pull/632/files (with slightly different changes needed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Apr 28 00:16:54 2018 (r333080) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Apr 28 01:14:16 2018 (r333081) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 08, 2017 +.Dd April 27, 2018 .Dt ZPOOL 8 .Os .Sh NAME @@ -1548,9 +1548,11 @@ section for a list of valid properties. The default li .Sy size , .Sy used , .Sy available , -.Sy fragmentation , +.Sy checkpoint , .Sy expandsize , +.Sy fragmentation , .Sy capacity , +.Sy dedupratio , .Sy health , .Sy altroot . .It Fl T Cm d Ns | Ns Cm u From owner-svn-src-head@freebsd.org Sat Apr 28 12:24:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E800FFADA3F; Sat, 28 Apr 2018 12:24:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78FEE7844C; Sat, 28 Apr 2018 12:24:05 +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 723A115ABF; Sat, 28 Apr 2018 12:24:05 +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 w3SCO5LH008863; Sat, 28 Apr 2018 12:24:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3SCO54a008862; Sat, 28 Apr 2018 12:24:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804281224.w3SCO54a008862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 28 Apr 2018 12:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333083 - head/usr.bin/tip/tip X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/tip/tip X-SVN-Commit-Revision: 333083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 12:24:06 -0000 Author: trasz Date: Sat Apr 28 12:24:05 2018 New Revision: 333083 URL: https://svnweb.freebsd.org/changeset/base/333083 Log: Add EXAMPLES to tip(1) man page. MFC after: 2 weeks Modified: head/usr.bin/tip/tip/tip.1 Modified: head/usr.bin/tip/tip/tip.1 ============================================================================== --- head/usr.bin/tip/tip/tip.1 Sat Apr 28 02:32:05 2018 (r333082) +++ head/usr.bin/tip/tip/tip.1 Sat Apr 28 12:24:05 2018 (r333083) @@ -31,7 +31,7 @@ .\" @(#)tip.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 31, 2006 +.Dd April 28, 2018 .Dt TIP 1 .Os .Sh NAME @@ -589,6 +589,11 @@ line access log lock file to avoid conflicts with .Xr uucp 1 Pq Pa ports/net/freebsd-uucp .El +.Sh EXAMPLES +Connect to the first USB serial port at the speed of 115200 baud: +.Bd -literal -offset indent +tip ucom1 -115200 +.Ed .Sh SEE ALSO .Xr cu 1 , .Xr phones 5 , From owner-svn-src-head@freebsd.org Sat Apr 28 13:16:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 714DDFAEC5B; Sat, 28 Apr 2018 13:16:59 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21D878295A; Sat, 28 Apr 2018 13:16:59 +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 180FB162CD; Sat, 28 Apr 2018 13:16:59 +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 w3SDGwwS033673; Sat, 28 Apr 2018 13:16:58 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3SDGwC9033672; Sat, 28 Apr 2018 13:16:58 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201804281316.w3SDGwC9033672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 28 Apr 2018 13:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333084 - head/sbin/pfctl X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/pfctl X-SVN-Commit-Revision: 333084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 13:16:59 -0000 Author: kp Date: Sat Apr 28 13:16:58 2018 New Revision: 333084 URL: https://svnweb.freebsd.org/changeset/base/333084 Log: pfctl: Don't break connections on skipped interfaces on reload On reload we used to first flush everything, including the list of skipped interfaces. This can lead to termination of these connections if they send packets before the new configuration is applied. Note that this doesn't currently happen on 12 or 11, because of special EACCES handling introduced in r315514. This special behaviour in tcp_output() may change, hence the fix in pfctl. PR: 214613 Modified: head/sbin/pfctl/pfctl.c Modified: head/sbin/pfctl/pfctl.c ============================================================================== --- head/sbin/pfctl/pfctl.c Sat Apr 28 12:24:05 2018 (r333083) +++ head/sbin/pfctl/pfctl.c Sat Apr 28 13:16:58 2018 (r333084) @@ -67,6 +67,9 @@ void usage(void); int pfctl_enable(int, int); int pfctl_disable(int, int); int pfctl_clear_stats(int, int); +int pfctl_get_skip_ifaces(void); +int pfctl_check_skip_ifaces(char *); +int pfctl_clear_skip_ifaces(struct pfctl *); int pfctl_clear_interface_flags(int, int); int pfctl_clear_rules(int, int, char *); int pfctl_clear_nat(int, int, char *); @@ -106,6 +109,7 @@ const char *pfctl_lookup_option(char *, const char * c static struct pf_anchor_global pf_anchors; static struct pf_anchor pf_main_anchor; +static struct pfr_buffer skip_b; static const char *clearopt; static char *rulesopt; @@ -295,6 +299,44 @@ pfctl_clear_stats(int dev, int opts) } int +pfctl_get_skip_ifaces(void) +{ + bzero(&skip_b, sizeof(skip_b)); + skip_b.pfrb_type = PFRB_IFACES; + for (;;) { + pfr_buf_grow(&skip_b, skip_b.pfrb_size); + skip_b.pfrb_size = skip_b.pfrb_msize; + if (pfi_get_ifaces(NULL, skip_b.pfrb_caddr, &skip_b.pfrb_size)) + err(1, "pfi_get_ifaces"); + if (skip_b.pfrb_size <= skip_b.pfrb_msize) + break; + } + return (0); +} + +int +pfctl_check_skip_ifaces(char *ifname) +{ + struct pfi_kif *p; + + PFRB_FOREACH(p, &skip_b) + if ((p->pfik_flags & PFI_IFLAG_SKIP) && !strcmp(ifname, p->pfik_name)) + p->pfik_flags &= ~PFI_IFLAG_SKIP; + return (0); +} + +int +pfctl_clear_skip_ifaces(struct pfctl *pf) +{ + struct pfi_kif *p; + + PFRB_FOREACH(p, &skip_b) + if (p->pfik_flags & PFI_IFLAG_SKIP) + pfctl_set_interface_flags(pf, p->pfik_name, PFI_IFLAG_SKIP, 0); + return (0); +} + +int pfctl_clear_interface_flags(int dev, int opts) { struct pfioc_iface pi; @@ -1479,6 +1521,8 @@ pfctl_rules(int dev, char *filename, int opts, int opt else goto _error; } + if (loadopt & PFCTL_FLAG_OPTION) + pfctl_clear_skip_ifaces(&pf); if ((pf.loadopt & PFCTL_FLAG_FILTER && (pfctl_load_ruleset(&pf, path, rs, PF_RULESET_SCRUB, 0))) || @@ -1889,6 +1933,7 @@ pfctl_set_interface_flags(struct pfctl *pf, char *ifna } else { if (ioctl(pf->dev, DIOCSETIFFLAG, &pi)) err(1, "DIOCSETIFFLAG"); + pfctl_check_skip_ifaces(ifname); } } return (0); @@ -2347,7 +2392,7 @@ main(int argc, char *argv[]) if ((rulesopt != NULL) && (loadopt & PFCTL_FLAG_OPTION) && !anchorname[0]) - if (pfctl_clear_interface_flags(dev, opts | PF_OPT_QUIET)) + if (pfctl_get_skip_ifaces()) error = 1; if (rulesopt != NULL && !(opts & (PF_OPT_MERGE|PF_OPT_NOACTION)) && From owner-svn-src-head@freebsd.org Sat Apr 28 15:46:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E82C7FB2910; Sat, 28 Apr 2018 15:46:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD3F7B145; Sat, 28 Apr 2018 15:46:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 795AAFAD2; Sat, 28 Apr 2018 15:46:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [172.28.128.1] (78-23-137-185.access.telenet.be [78.23.137.185]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 1BF1433982; Sat, 28 Apr 2018 17:46:00 +0200 (CEST) From: "Kristof Provost" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333084 - head/sbin/pfctl Date: Sat, 28 Apr 2018 17:46:09 +0200 X-Mailer: MailMate (2.0BETAr6110) Message-ID: <8718621D-0A62-46C3-AC51-892637B911E0@FreeBSD.org> In-Reply-To: <201804281316.w3SDGwC9033672@repo.freebsd.org> References: <201804281316.w3SDGwC9033672@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 15:46:03 -0000 On 28 Apr 2018, at 15:16, Kristof Provost wrote: > Author: kp > Date: Sat Apr 28 13:16:58 2018 > New Revision: 333084 > URL: https://svnweb.freebsd.org/changeset/base/333084 > > Log: > pfctl: Don't break connections on skipped interfaces on reload > > On reload we used to first flush everything, including the list of > skipped > interfaces. This can lead to termination of these connections if > they send > packets before the new configuration is applied. > > Note that this doesn't currently happen on 12 or 11, because of > special EACCES > handling introduced in r315514. This special behaviour in > tcp_output() may > change, hence the fix in pfctl. > > PR: 214613 > That should have had ‘Submitted by: Andreas Longwitz ’. Regards, Kristof From owner-svn-src-head@freebsd.org Sat Apr 28 17:43:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7EECFB546D; Sat, 28 Apr 2018 17:43:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2AA76CAD; Sat, 28 Apr 2018 17:43:21 +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 54B7618E2D; Sat, 28 Apr 2018 17:43:21 +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 w3SHhLBc069572; Sat, 28 Apr 2018 17:43:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3SHhKhN069568; Sat, 28 Apr 2018 17:43:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804281743.w3SHhKhN069568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 28 Apr 2018 17:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333085 - head/sys/dev/smartpqi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/smartpqi X-SVN-Commit-Revision: 333085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 17:43:22 -0000 Author: cem Date: Sat Apr 28 17:43:20 2018 New Revision: 333085 URL: https://svnweb.freebsd.org/changeset/base/333085 Log: smartpqi(4): Unbreak GCC build Remove redundant declarations. Modified: head/sys/dev/smartpqi/smartpqi_cam.c head/sys/dev/smartpqi/smartpqi_ioctl.c head/sys/dev/smartpqi/smartpqi_main.c head/sys/dev/smartpqi/smartpqi_prototypes.h Modified: head/sys/dev/smartpqi/smartpqi_cam.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_cam.c Sat Apr 28 13:16:58 2018 (r333084) +++ head/sys/dev/smartpqi/smartpqi_cam.c Sat Apr 28 17:43:20 2018 (r333085) @@ -1199,7 +1199,3 @@ void deregister_sim(struct pqisrc_softstate *softs) DBG_FUNC("OUT\n"); } - -static void smartpqi_cam_action(struct cam_sim *, union ccb *); -static void smartpqi_poll(struct cam_sim *); - Modified: head/sys/dev/smartpqi/smartpqi_ioctl.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_ioctl.c Sat Apr 28 13:16:58 2018 (r333084) +++ head/sys/dev/smartpqi/smartpqi_ioctl.c Sat Apr 28 17:43:20 2018 (r333085) @@ -166,10 +166,6 @@ static int smartpqi_ioctl(struct cdev *cdev, u_long cm return error; } -static d_open_t smartpqi_open; -static d_ioctl_t smartpqi_ioctl; -static d_close_t smartpqi_close; - static struct cdevsw smartpqi_cdevsw = { .d_version = D_VERSION, Modified: head/sys/dev/smartpqi/smartpqi_main.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_main.c Sat Apr 28 13:16:58 2018 (r333084) +++ head/sys/dev/smartpqi/smartpqi_main.c Sat Apr 28 17:43:20 2018 (r333085) @@ -467,13 +467,6 @@ smartpqi_shutdown(void *arg) return rval; } - -static int smartpqi_probe(device_t dev); -static int smartpqi_attach(device_t dev); -static int smartpqi_detach(device_t dev); -static int smartpqi_suspend(device_t dev); -static int smartpqi_resume(device_t dev); - /* * PCI bus interface. */ @@ -496,5 +489,3 @@ static driver_t smartpqi_pci_driver = { DRIVER_MODULE(smartpqi, pci, smartpqi_pci_driver, pqi_devclass, 0, 0); MODULE_DEPEND(smartpqi, pci, 1, 1, 1); - - Modified: head/sys/dev/smartpqi/smartpqi_prototypes.h ============================================================================== --- head/sys/dev/smartpqi/smartpqi_prototypes.h Sat Apr 28 13:16:58 2018 (r333084) +++ head/sys/dev/smartpqi/smartpqi_prototypes.h Sat Apr 28 17:43:20 2018 (r333085) @@ -131,9 +131,6 @@ int pqisrc_process_event_intr_src(pqisrc_softstate_t * void pqisrc_ack_all_events(void *arg); -void pqisrc_event_worker(void *, int); -int pqisrc_scsi_setup(struct pqisrc_softstate *); -void pqisrc_scsi_cleanup(struct pqisrc_softstate *); boolean_t pqisrc_update_scsi_sense(const uint8_t *, int, struct sense_header_scsi *); int pqisrc_build_send_raid_request(pqisrc_softstate_t *, pqisrc_raid_req_t *, @@ -180,7 +177,6 @@ int pqisrc_create_op_aio_ibq(pqisrc_softstate_t *, ib_ int pqisrc_create_op_raid_ibq(pqisrc_softstate_t *, ib_queue_t *); int pqisrc_alloc_and_create_event_queue(pqisrc_softstate_t *); int pqisrc_alloc_and_create_ib_queues(pqisrc_softstate_t *); -int pqisrc_alloc_and_create_ib_queues(pqisrc_softstate_t *); int pqisrc_alloc_and_create_ob_queues(pqisrc_softstate_t *); int pqisrc_process_task_management_response(pqisrc_softstate_t *, pqi_tmf_resp_t *); @@ -231,10 +227,7 @@ void os_stop_heartbeat_timer(pqisrc_softstate_t *); void os_start_heartbeat_timer(void *); /* FreeBSD_cam.c */ -int pqisrc_scsi_setup(struct pqisrc_softstate *); -void pqisrc_scsi_cleanup(struct pqisrc_softstate *); uint8_t os_get_task_attr(rcb_t *); -void os_wellness_periodic(void *); void smartpqi_target_rescan(struct pqisrc_softstate *); /* FreeBSD_intr.c FreeBSD_main.c */ From owner-svn-src-head@freebsd.org Sat Apr 28 17:43:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCAFBFB54BF; Sat, 28 Apr 2018 17:43: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EA2376DD8; Sat, 28 Apr 2018 17:43: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 89AAB18E2E; Sat, 28 Apr 2018 17:43: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 w3SHhp85069628; Sat, 28 Apr 2018 17:43:51 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3SHhpgk069627; Sat, 28 Apr 2018 17:43:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804281743.w3SHhpgk069627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 28 Apr 2018 17:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333086 - head/sys/modules/smartpqi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/modules/smartpqi X-SVN-Commit-Revision: 333086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 17:43:52 -0000 Author: cem Date: Sat Apr 28 17:43:51 2018 New Revision: 333086 URL: https://svnweb.freebsd.org/changeset/base/333086 Log: smartpqi(4): Use conventional path to driver sources Modified: head/sys/modules/smartpqi/Makefile Modified: head/sys/modules/smartpqi/Makefile ============================================================================== --- head/sys/modules/smartpqi/Makefile Sat Apr 28 17:43:20 2018 (r333085) +++ head/sys/modules/smartpqi/Makefile Sat Apr 28 17:43:51 2018 (r333086) @@ -3,7 +3,7 @@ KMOD = smartpqi -.PATH: ${.CURDIR}/../../dev/${KMOD} +.PATH: ${SRCTOP}/sys/dev/${KMOD} SRCS=smartpqi_mem.c smartpqi_intr.c smartpqi_main.c smartpqi_cam.c smartpqi_ioctl.c smartpqi_misc.c smartpqi_sis.c smartpqi_init.c smartpqi_queue.c smartpqi_tag.c smartpqi_cmd.c smartpqi_request.c smartpqi_response.c smartpqi_event.c smartpqi_helper.c smartpqi_discovery.c From owner-svn-src-head@freebsd.org Sat Apr 28 17:55:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6D68FB5930; Sat, 28 Apr 2018 17:55: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B18779B01; Sat, 28 Apr 2018 17:55: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 4F8C918FD0; Sat, 28 Apr 2018 17:55: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 w3SHtTNB074763; Sat, 28 Apr 2018 17:55:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3SHtTEV074762; Sat, 28 Apr 2018 17:55:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804281755.w3SHtTEV074762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 28 Apr 2018 17:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333087 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 333087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 17:55:29 -0000 Author: cem Date: Sat Apr 28 17:55:28 2018 New Revision: 333087 URL: https://svnweb.freebsd.org/changeset/base/333087 Log: amd64/mp_machdep.c: Fix GCC build after r333059 GCC warns about the potentially confusing use of the binary AND ('&') operator with a left operand containing an addition expression. (The confusion would be around the operator precedence between the + and & infix operators.) The warning is converted into an error with -Werror. No functional change. This construct was actually introduced in r328083, but r333059 (re)moved the closing parentheses. For reference, see http://en.cppreference.com/w/c/language/operator_precedence . Modified: head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sat Apr 28 17:43:51 2018 (r333086) +++ head/sys/amd64/amd64/mp_machdep.c Sat Apr 28 17:55:28 2018 (r333087) @@ -276,8 +276,8 @@ init_secondary(void) pc->pc_tssp = &common_tss[cpu]; pc->pc_commontssp = &common_tss[cpu]; pc->pc_rsp0 = 0; - pc->pc_pti_rsp0 = ((vm_offset_t)&pc->pc_pti_stack + - PC_PTI_STACK_SZ * sizeof(uint64_t) & ~0xful); + pc->pc_pti_rsp0 = (((vm_offset_t)&pc->pc_pti_stack + + PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful); pc->pc_tss = (struct system_segment_descriptor *)&gdt[NGDT * cpu + GPROC0_SEL]; pc->pc_fs32p = &gdt[NGDT * cpu + GUFS32_SEL];