From owner-svn-src-all@freebsd.org Sun Apr 22 00:26:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1696FFB0B1C; Sun, 22 Apr 2018 00:26:36 +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 BFEE780735; Sun, 22 Apr 2018 00:26:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAD0C653C; Sun, 22 Apr 2018 00:26:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3M0QZjU073327; Sun, 22 Apr 2018 00:26:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3M0QZRY073326; Sun, 22 Apr 2018 00:26:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201804220026.w3M0QZRY073326@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 00:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332864 - stable/11/etc/rc.d X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/etc/rc.d X-SVN-Commit-Revision: 332864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 00:26:36 -0000 Author: kevans Date: Sun Apr 22 00:26:35 2018 New Revision: 332864 URL: https://svnweb.freebsd.org/changeset/base/332864 Log: MFC r332773: Fix ddb rc script r288291 added a call to limits(1), which isn't available before partitions are mounted. This broke the ddb rc script, which does not provide its own start_cmd. Alleviate the situation here by providing a start_cmd. We still have other problems with diskless setups that need to be considered, but this is a start. PR: 206291 Modified: stable/11/etc/rc.d/ddb Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.d/ddb ============================================================================== --- stable/11/etc/rc.d/ddb Sat Apr 21 20:48:03 2018 (r332863) +++ stable/11/etc/rc.d/ddb Sun Apr 22 00:26:35 2018 (r332864) @@ -15,6 +15,7 @@ desc="DDB kernel debugger" rcvar="ddb_enable" command="/sbin/${name}" start_precmd="ddb_prestart" +start_cmd="ddb_start" stop_cmd=":" ddb_prestart() @@ -23,6 +24,11 @@ ddb_prestart() if [ -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then return 1 fi +} + +ddb_start() +{ + ${command} ${command_args} } load_rc_config $name From owner-svn-src-all@freebsd.org Sun Apr 22 02:20:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 02:40:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 02:36:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 03:58:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 04:27:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AE3EFBD408 for ; Sun, 22 Apr 2018 04:27:13 +0000 (UTC) (envelope-from Store155@xlparts.com) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0081.outbound.protection.outlook.com [104.47.34.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9FE1726CF for ; Sun, 22 Apr 2018 04:27:12 +0000 (UTC) (envelope-from Store155@xlparts.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xlparts.onmicrosoft.com; s=selector1-xlparts-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=g6lQ5bShDVPvGyE5zy/SvE/Kz+NNO1TiTuynja4U6Xc=; b=LQ6SpRTQU7kxL/3MS6JiaHJ8qNkBmeindi0mwJW7fZead7qz1hC/bqUoUnnUZMbHRdvD1LKC3vRwjxI8B9KuKzVuWaA+UW9mMHxJEZ3DtBkVAV9mUxf3j+punqnEH/6qiw4Fw1rHD7DGmvQB7OIv4tc69hZGa/wRMIfR7N4ydb0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Store155@xlparts.com; Received: from VM-LABDESK326.local (192.150.115.150) by CO1PR18MB0839.namprd18.prod.outlook.com (2a01:111:e400:7b6c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Sun, 22 Apr 2018 04:27:09 +0000 From: "SL Parts" To: svn-src-all@freebsd.org Subject: urgent Date: Sun, 22 Apr 2018 04:27:09 +0000 Message-ID: <1524370946a8597cb01e01166a657ed37c7efa5601_4769@xlparts.com> X-Originating-IP: [192.150.115.150] X-ClientProxiedBy: CY4PR21CA0040.namprd21.prod.outlook.com (2603:10b6:903:12b::26) To CO1PR18MB0839.namprd18.prod.outlook.com (2a01:111:e400:7b6c::17) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:CO1PR18MB0839; X-Microsoft-Exchange-Diagnostics: 1; CO1PR18MB0839; 3:yr+HYEmzgvHaHqL094oRxOEOzzTQeKFYZNTJ4Lc6COA1+7epw5RWl7gjQrUDkXHOtveFkc16y01eC1Da4N+kTvkIX6uPMdx/2C3R1fEoKKSzSr13CJw+2q5O3CU9bJGNVfFGnD5aCEbYP+cq80XXxmDu7ZUweygALzff+aWmFSXB+ZoLSfbl0BiXTPax2rytebPHaHXQSGoanqw00aCkPbhBp7LRYkmjxVNNXu+7s5GI4h3jAb7bPdHsFlg6iv5g; 25:bvPaYY7j5kr3trq0XOBJ/gfd/CclvnQixmSL1jQNjFmEih6ONXDp8h8W/5Usf9n4G9FBr2Heyhnu4G0qgSsaTF18WvihX2IuGv4oerQ1RNBl42uoovAUhtLwqm0qnAyQE7gT5qJm3BaJ0r4nAKwPH9qa2SaON0NXPlgMZ35fByH3M7O7G45qBnCH9Wbvqx8P8OkhBF/Ts3H2rnmOpZWw5YNhWQ+FfdqX7+TgcwiZWNp107g4xPt0eq0JcB0Ww7B6Kr5gE2fbBsHceKlAQBgov80aD43YeVvUEkGw7tAc+TgqYvo/oivo4VjrM4M5OP+cbpZeJ6anLSyVfivWHkTDJw==; 31:xdqSq72jwL/VGR6JbIW5nR1ZGryrCrUoLpfgkyIo5Bi7/S5nawjYJZna+TzdaJeSMvnnuhbbgwEaRgN7EmOK4O2OIBg40Lok0AIBCfmIjPQOze3RasTR4Dvh8a7QKJKPvoa7s0V84IHIUzhvz12QfdtYm9p7WkBMKcjH8GPnZOP0ggZQ4K+pdaMmWTW3AcJvj9UjO6/geB/nZqA8s/3zwl3tJyTYltReRrQWp4cRMug= X-MS-TrafficTypeDiagnostic: CO1PR18MB0839: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(110762155241884)(245274153566520)(192374486261705)(38060298277622)(73312121905874)(223854080701215)(211936372134217)(179696456005106)(142917363850598)(182049213717631); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231232)(944501410)(52105095)(3002001)(6041310)(20161123558120)(20161123560045)(2016111802025)(20161123562045)(20161123564045)(6043046)(6072148)(201708071742011); SRVR:CO1PR18MB0839; BCL:0; PCL:0; RULEID:; SRVR:CO1PR18MB0839; X-Microsoft-Exchange-Diagnostics: 1; CO1PR18MB0839; 4:Wo8i7Kb2SJPnSvx8fEVCnP3DJD+sz5kOLuixV7xKqPxy/3DOei0BeJsb0Xo+jb8QP+fdsDkObg39hR6Hk6ql+b4x9nCS6YG0eYkIRxZAR1HPO7M3vBS+zjtAjPbvDn2Tkw7/SfRSkn+bASGmmAdiaZfRqB3Pw06VQhucH7Q+/5u/n2TNO2uOdHdZDY/VlZEDLYQwbO06q0ss1/ItpKDU5LQiXmBuc3vYHPQab5dScWuoEmXisylpKqkCSw8reHjy1p1SQyG9JArDAqZnYhHEGsniky+vIj+c4AS7qNPBdR+9Vk2VsuyFssxRPfsZMDh5l2huRF7c3hDuL7evXMj2DizRVswzOi7ihsgXzXPCHyNn2vq7D/5pibWLd35AfX0Zr1DHCGHuY4l4tCHuwmPFIFsUvbMEvnyQzJYz+ZdttqGgiU0azoV2hLxlfF8Fa8YpA5KrYYXzzCM0aatCucakU2waXUhYO1PSJrZAaeUPNxJvAKu5GUKEEdTp2eM60OcdGKxw7+DTx5kt4kqInA7jyB6AbuLiegkQIXJtVmJvfso1/Zmyvyq4UQxN8K5GTDGzYUtvA8mNpoPgbls0TGyFhDamaYJDtBoBuWixh2+7+tktnOo14s2iROQ0az6vnNkr X-Forefront-PRVS: 0650714AAA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(376002)(396003)(39850400004)(366004)(346002)(2616005)(7116003)(956004)(81166006)(3846002)(6916009)(8676002)(59450400001)(6116002)(861006)(28505004)(23676004)(52116002)(476003)(2486003)(218543002)(3480700004)(25786009)(66066001)(23846002)(118296001)(16526019)(186003)(551934003)(733005)(316002)(8936002)(6486002)(8746002)(221733001)(53936002)(36756003)(50466002)(478600001)(19627145003)(7736002)(26005)(72206003)(5660300001)(606006)(2351001)(2361001)(2906002)(54896002)(6306002)(6506007)(386003)(236005)(6512007)(86362001)(60810400007)(135393001)(178943002)(220243001)(217283001)(110126008); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR18MB0839; H:VM-LABDESK326.local; FPR:; SPF:None; LANG:en; MLV:ovr; PTR:InfoNoRecords; Received-SPF: None (protection.outlook.com: xlparts.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDTzFQUjE4TUIwODM5OzIzOjhHMlY0bm5QV3dTOTF6U29jUWcwNUNGWWhs?= =?utf-8?B?bFFTNlJXVGZ3eC80TzZucFJsWlBpZ2ZOYmlsMmNnS1M2SGxmenY5NEZjMUZZ?= =?utf-8?B?ai9jeE9xdkFuU1hnTFlyU28xOFFvTitET3hrS1RzVnZZTVo2NkFxWXlpVmlZ?= =?utf-8?B?Nk41OXJkTVNoSFZFOGZwdVBBVXNrWFE1d0JEY1ZaM0dWM2k5cG5iMEowSm43?= =?utf-8?B?dGFsbWZ1bnpaRm8waHVHVXBGRFkyUTFrczFiUkFwSXJoUnAxVVczY05DVWNv?= =?utf-8?B?b051NnNERzdHb3Zqb2xLQVQvb0c4Q0pTOWVSTi9XKzhFZm9UbGJUWWFkWHZa?= =?utf-8?B?K2dXR0loRFlzbnNibWsvQjlwbWowTDlsSDR5NkgxNHJ6TWJTR0dWV3piOHVF?= =?utf-8?B?VkVYWVhFV2RlYkdOWHhlbGdCdUJhRncyQlRWOUZRWjZMMEg3OU55OTlKVWNZ?= =?utf-8?B?QjlSMUlsSERJc1VsTU4ybUdvTUtmdFFudWFOSXZTZ01WeHZ6cW00cXkzNHFw?= =?utf-8?B?VGppY1V1a2ZoMTZqVkRPazdHR0ROTlBWU0l0Z2JCWVdHai9GTnhxZk54Qlla?= =?utf-8?B?ME9DcEtyM3Q1NEcvekt2MkY4bVQ0OFBoc0lzRWNNUTFlS01TMXRpUk9NS2FG?= =?utf-8?B?aHNmR3Z0SFdkckdKd2s3TnIrczN4N3JKRHdaUnIyTkJSbElhYnJDNXAzZml4?= =?utf-8?B?NUoxR0VTRkdnRENWODd6bEpIL2VzTjBPcmg5MFRNeisvNWg3aVI0UzlIY0VQ?= =?utf-8?B?T3VLVGdyWFBXVEwzN3hxb29kdW9Rdm9iZ1hwNDZvWUh1a3VVQTBEcTBIZFAz?= =?utf-8?B?RGxpSTRxSmlKVStVK3A2NXV1MEZVWWhxTCtmemg1S0UxOHBQSUpUb3FzNFUz?= =?utf-8?B?QVRVbjNPekJRaXJOMkxyaVZCVldtMXZPamlCNzhxanBmMUsyRDR0WVdkQU5r?= =?utf-8?B?eFA1RXVZZS81b0RqV1VIbjRCSVB1Ri9WMUswWWpKMnhUTWJrRGZER0YrTEMy?= =?utf-8?B?SWhPZG56cTVRRTdPZkNtUS91YVhObjJYTFh0cngzMVJHczNVTFU4dnN5aC9s?= =?utf-8?B?Si8vUXZXaHI2eC9zekdmLzM0VkdvR0VKbHdPZmI0WFJFanJ4aWw4eWxZbm9S?= =?utf-8?B?aHp5ZEQwUGh1NWwwdFlxbUZmZ1ovbWdvb3ZjV0MrWENQZHlnWE9acmlCZjc3?= =?utf-8?B?N205Z1UzaFZDZXhiQVZERHZLUk1FdzJUQjZSR3F2Y0lzU01RNzhjcjVIOWZ4?= =?utf-8?B?SVI3dGRiTVBIMWRxeEZDR1YzNVkraFBPZkU3V2dKbWdVbU5BdC9rdzdqbU9F?= =?utf-8?B?V3Zlazc2aHU0SWRFdGZmQlVOdzd0YWRqbDRJUXV1ZDBuWDJKL0ZNakFMbjc5?= =?utf-8?B?ZjFxR3NNWVpDOGxpaUtMcGw1eWNoT0NmbXFBYUZReklEQWRxL29ZYmUwYVJT?= =?utf-8?B?YUYxWDF4UDNoMitRZHBMRGVDWmQyQ2crR211RTcrUEl4TVBaUHBlSmxLMmpQ?= =?utf-8?B?VjZqejc2di9lMGxOOXh0cGtMdGlTWDJnQVRuckd5dFpCblBKcExOd2NmM1kz?= =?utf-8?B?NkJtMFVuL1cyZnM0SmZSU0piUURmbXM1Umh4MjBsd2tqZGZkcGRudVBXSnBj?= =?utf-8?B?UEFnREZJd0k1NUZuak1jQnVxMEpsTjk2UTIxOVg2aHRPcURBejg5SXBJZGs5?= =?utf-8?B?ei9QVzgzL0dVNmhGWVAreHZ3TGhVRlZpYmtGck84STlhS2ZpanE5ZUVrYURW?= =?utf-8?B?bENqNDV0VWFyUmx3UlVmVStrWnF4Q2tDSkoxQU1ER3RkVWpQRkFDVVovMlRa?= =?utf-8?B?TkFvQXByQkVZMzl5em1OU2JVOHpzUTA3aXorU1RKREdMaGV4aG5ScHNyd1N6?= =?utf-8?Q?25rFukuS+jg=3D?= X-Microsoft-Antispam-Message-Info: dED0teunexA8o2GdnaBSmTOHVn4quBVCUKdB4j7UjK6viort84aVKj35eUvAmxqVSneA9ZutJv/D8vj0ttumbzD6E5S3I0EEJDPCUSOu+8zJUSk8Vj6jOIBs/Tg2JLVakgE48sT27WAbjvgTkU1H+URwxRVcmpC7h27Buu4NgJT9dr3QGetR7mYL2YQTCHNf X-Microsoft-Exchange-Diagnostics: 1; CO1PR18MB0839; 6:I28N8K3oLjC1B2pwaq/58xuPoq41y3jUco1H2cbW2e7ZtgnFPx0TAcjrCA2RI5lPxvtRntnciIpI8r1Pb+7lfs/6NWYSOVOVxZWbCxXovnCjkvE+cEFrl2srjsnkES04y3ZOkCJr/bjOZNfes8OT4H0yfE959CxxLbUD0149x/A6M9LfGEqWwNuUIxopOicJUQIOg8I8l4iJkzOer2oAe95z7PW8cCz39VUdyUVjgMM4350WheP7a5SZT/zlBL2R6Vhr2qc6++c/MG29cvHWhp9/mrtGxcrPhsYje3YIFu3SQljDsJlTD14eYU2R//Ncjw2nyu9fjGbw5AW8onOGqEydE21naUaFa6lKxm3XcuMMFJx8giFwHVzoyA7WAJrya60mH3Fg55mLkvwiQPcg8M6P9cA4se9F4J4zivCdDlkyq7pYp9AXVBZ5UVoFWjhtVLQcCLoFvdUmOjD2YNnnNQ==; 5:EAhB+PfKYVFjFQtxmA5XcUjGhBbwV7dYL0x5nmJN3XfXwPe1DUUt4TQPf2rhY03yfb8chz4mf+3mP6qemzeotIFP4sDvaklIgHFigPBWhHiAJ9AGQf+x7W6ErpFucp7eDw0tEyYlvEE8fCvtXDfoCyZyOZBBUaIveeY2orMzDxc=; 24:np2RSNfRsqS9anKz0kNbrk/ESa2Wjq0pidavWwH+hjavBhVz/r22LdLq5J72tdaHVdg0qSaWPMSrwggfW9Gx5FjcDpbZ7llEgkbVBey5nXw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CO1PR18MB0839; 7:DfFDZh12l0RiaRPvrd1hl4+mW8sMfj3fODld+qMtPFsJ6/OwcZ7GIqid84ToHjkCsJIPvznWPEoc0QA1qYrEUwZQKWF59X43F/v4SvCtNRCssvqXwNPjrYLaY/OvPuvlX8xyqlYA8c2MnCE3m+50lRrkz8R8tLopGvxf5RLzk6TIuEGaNYyuFN0Zu+qQpltN90gT9ihCYnBPlTq3IYn8hCP4QEsrDj77o4PXi2Hr/UDKVXrTTITsP0/Yy5K1SIgT X-MS-Office365-Filtering-Correlation-Id: 1b8a69f0-f73b-4fc6-d356-08d5a809506a X-OriginatorOrg: xlparts.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2018 04:27:09.7955 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b8a69f0-f73b-4fc6-d356-08d5a809506a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 86837a42-8e96-43f0-a978-7b23f3787021 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB0839 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 04:27:13 -0000 From owner-svn-src-all@freebsd.org Sun Apr 22 06:11:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 09:30:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 16:05:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 17:11:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 17:56:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3DC2FB201B; Sun, 22 Apr 2018 17:56:39 +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 A0BB8714CF; Sun, 22 Apr 2018 17:56:39 +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 971D219085; Sun, 22 Apr 2018 17:56:39 +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 w3MHud05006432; Sun, 22 Apr 2018 17:56:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3MHudC7006430; Sun, 22 Apr 2018 17:56:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201804221756.w3MHudC7006430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 22 Apr 2018 17:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r332872 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 332872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2018 17:56:40 -0000 Author: eadler Date: Sun Apr 22 17:56:39 2018 New Revision: 332872 URL: https://svnweb.freebsd.org/changeset/base/332872 Log: welcome back bcran to the world of source committers Rebecca is coming back after a seven year hiatus. They are planning on working in UEFI and Bhyve. I will be their mentor Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun Apr 22 16:05:29 2018 (r332871) +++ svnadmin/conf/access Sun Apr 22 17:56:39 2018 (r332872) @@ -38,6 +38,7 @@ avos badger bapt bde +bcran bdrewery benno br Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun Apr 22 16:05:29 2018 (r332871) +++ svnadmin/conf/mentors Sun Apr 22 17:56:39 2018 (r332872) @@ -13,6 +13,7 @@ achim scottl Co-mentor: emaste anish neel Co-mentor: grehan arichardson jhb Co-mentor: brooks +bcran eadler brd allanjude Co-mentor: bapt def pjd eri ae Co-mentor: thompsa From owner-svn-src-all@freebsd.org Sun Apr 22 19:07:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 19:26:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 20:47:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 20:51:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 21:28:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 23:10:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Apr 22 23:51:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Mon Apr 23 00:27:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 07:15:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 07:51:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 07:52:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 07:52:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 07:54:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 08:23:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 08:51:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB7B5FA8B4B; Mon, 23 Apr 2018 08:51:42 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 719E784FF7; Mon, 23 Apr 2018 08:51:42 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53D0A21E5F; Mon, 23 Apr 2018 08:51:42 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3N8pg9U056764; Mon, 23 Apr 2018 08:51:42 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N8pgrJ056762; Mon, 23 Apr 2018 08:51:42 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201804230851.w3N8pgrJ056762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Mon, 23 Apr 2018 08:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332883 - stable/11/sys/dev/ocs_fc X-SVN-Group: stable-11 X-SVN-Commit-Author: ram X-SVN-Commit-Paths: stable/11/sys/dev/ocs_fc X-SVN-Commit-Revision: 332883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 08:51:42 -0000 Author: ram Date: Mon Apr 23 08:51:41 2018 New Revision: 332883 URL: https://svnweb.freebsd.org/changeset/base/332883 Log: MFC r332471, r332646: Check if STACK is defined before using the stack(9). Moved opts-stack.h include before all other includes. Approved by: mav Modified: stable/11/sys/dev/ocs_fc/ocs_os.c stable/11/sys/dev/ocs_fc/ocs_os.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ocs_fc/ocs_os.c ============================================================================== --- stable/11/sys/dev/ocs_fc/ocs_os.c Mon Apr 23 08:23:10 2018 (r332882) +++ stable/11/sys/dev/ocs_fc/ocs_os.c Mon Apr 23 08:51:41 2018 (r332883) @@ -37,9 +37,6 @@ */ #include "ocs.h" -#include -#include -#include /* for debug of memory allocations */ static MALLOC_DEFINE(M_OCS, "OCS", "OneCore Storage data"); @@ -855,11 +852,13 @@ void ocs_intr_enable(ocs_os_handle_t os) void ocs_print_stack(void) { +#if defined(STACK) struct stack st; stack_zero(&st); stack_save(&st); stack_print(&st); +#endif } void ocs_abort(void) Modified: stable/11/sys/dev/ocs_fc/ocs_os.h ============================================================================== --- stable/11/sys/dev/ocs_fc/ocs_os.h Mon Apr 23 08:23:10 2018 (r332882) +++ stable/11/sys/dev/ocs_fc/ocs_os.h Mon Apr 23 08:51:41 2018 (r332883) @@ -39,11 +39,11 @@ #ifndef _OCS_OS_H #define _OCS_OS_H -typedef struct ocs_softc ocs_t; - /*************************************************************************** * OS specific includes */ +#include "opt_stack.h" + #include #include #include @@ -78,6 +78,8 @@ typedef struct ocs_softc ocs_t; #include #include +#include /* for debug of memory allocations */ + /* OCS_OS_MAX_ISR_TIME_MSEC - maximum time driver code should spend in an interrupt * or kernel thread context without yielding */ @@ -151,6 +153,8 @@ typedef struct ocs_softc ocs_t; /*************************************************************************** * Platform specific operations */ + +typedef struct ocs_softc ocs_t; /** * @ingroup os From owner-svn-src-all@freebsd.org Mon Apr 23 09:01:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED61DFA98E5; Mon, 23 Apr 2018 09:01:25 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A49A874BD; Mon, 23 Apr 2018 09:01:25 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9558821FCB; Mon, 23 Apr 2018 09:01:25 +0000 (UTC) (envelope-from ram@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3N91PH8058114; Mon, 23 Apr 2018 09:01:25 GMT (envelope-from ram@FreeBSD.org) Received: (from ram@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3N91PKm058113; Mon, 23 Apr 2018 09:01:25 GMT (envelope-from ram@FreeBSD.org) Message-Id: <201804230901.w3N91PKm058113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ram set sender to ram@FreeBSD.org using -f From: Ram Kishore Vegesna Date: Mon, 23 Apr 2018 09:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332884 - stable/11/share/misc X-SVN-Group: stable-11 X-SVN-Commit-Author: ram X-SVN-Commit-Paths: stable/11/share/misc X-SVN-Commit-Revision: 332884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 09:01:26 -0000 Author: ram Date: Mon Apr 23 09:01:25 2018 New Revision: 332884 URL: https://svnweb.freebsd.org/changeset/base/332884 Log: MFC r332386, r332430: Updated mentors information. Added entry in the correct section. Approved by: mav Modified: stable/11/share/misc/committers-src.dot Directory Properties: stable/11/ (props changed) Modified: stable/11/share/misc/committers-src.dot ============================================================================== --- stable/11/share/misc/committers-src.dot Mon Apr 23 08:51:41 2018 (r332883) +++ stable/11/share/misc/committers-src.dot Mon Apr 23 09:01:25 2018 (r332884) @@ -282,6 +282,7 @@ pkelsey [label="Patrick Kelsey\pkelsey@FreeBSD.org\n20 pluknet [label="Sergey Kandaurov\npluknet@FreeBSD.org\n2010/10/05"] ps [label="Paul Saab\nps@FreeBSD.org\n2000/02/23"] qingli [label="Qing Li\nqingli@FreeBSD.org\n2005/04/13"] +ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\n2018/04/04"] ray [label="Aleksandr Rybalko\nray@FreeBSD.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n2008/03/13"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] @@ -629,6 +630,7 @@ kan -> kib ken -> asomers ken -> chuck +ken -> ram ken -> slm kib -> ae @@ -671,6 +673,7 @@ markm -> sheldonh mav -> ae mav -> eugen +mav -> ram mdf -> gleb From owner-svn-src-all@freebsd.org Mon Apr 23 10:35:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 12:20:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 12:23:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 13:43:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 13:47:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D131AFBD6FA; Mon, 23 Apr 2018 13:47:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D0D57FCBA; Mon, 23 Apr 2018 13:47:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53B2125058; Mon, 23 Apr 2018 13:47:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NDlUXQ000606; Mon, 23 Apr 2018 13:47:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NDlTKQ000602; Mon, 23 Apr 2018 13:47:29 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804231347.w3NDlTKQ000602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 23 Apr 2018 13:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332888 - in stable: 10/release/arm 11/release/arm X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/arm 11/release/arm X-SVN-Commit-Revision: 332888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 13:47:31 -0000 Author: gjb Date: Mon Apr 23 13:47:29 2018 New Revision: 332888 URL: https://svnweb.freebsd.org/changeset/base/332888 Log: MFC r332674: Increase the msdosfs partition size on arm SoC images where the current size may not be sufficiently large for development and/or testing. PR: 227548 Sponsored by: The FreeBSD Foundation Modified: stable/10/release/arm/BEAGLEBONE.conf stable/10/release/arm/GUMSTIX.conf stable/10/release/arm/PANDABOARD.conf stable/10/release/arm/RPI-B.conf Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/release/arm/BEAGLEBONE.conf stable/11/release/arm/GUMSTIX.conf stable/11/release/arm/PANDABOARD.conf stable/11/release/arm/RPI-B.conf Directory Properties: stable/11/ (props changed) Modified: stable/10/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/10/release/arm/BEAGLEBONE.conf Mon Apr 23 12:23:05 2018 (r332887) +++ stable/10/release/arm/BEAGLEBONE.conf Mon Apr 23 13:47:29 2018 (r332888) @@ -6,7 +6,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="480M" KERNEL="BEAGLEBONE" Modified: stable/10/release/arm/GUMSTIX.conf ============================================================================== --- stable/10/release/arm/GUMSTIX.conf Mon Apr 23 12:23:05 2018 (r332887) +++ stable/10/release/arm/GUMSTIX.conf Mon Apr 23 13:47:29 2018 (r332888) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="arm" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="480M" KERNEL="GUMSTIX" Modified: stable/10/release/arm/PANDABOARD.conf ============================================================================== --- stable/10/release/arm/PANDABOARD.conf Mon Apr 23 12:23:05 2018 (r332887) +++ stable/10/release/arm/PANDABOARD.conf Mon Apr 23 13:47:29 2018 (r332888) @@ -6,7 +6,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="480M" KERNEL="PANDABOARD" Modified: stable/10/release/arm/RPI-B.conf ============================================================================== --- stable/10/release/arm/RPI-B.conf Mon Apr 23 12:23:05 2018 (r332887) +++ stable/10/release/arm/RPI-B.conf Mon Apr 23 13:47:29 2018 (r332888) @@ -6,7 +6,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware" -FAT_SIZE="17m" +FAT_SIZE="41m" FAT_TYPE="16" IMAGE_SIZE="480M" KERNEL="RPI-B" From owner-svn-src-all@freebsd.org Mon Apr 23 13:47:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CAAAFBD700; Mon, 23 Apr 2018 13:47:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4E8D7FCBB; Mon, 23 Apr 2018 13:47:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF7F425059; Mon, 23 Apr 2018 13:47:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3NDlUao000615; Mon, 23 Apr 2018 13:47:30 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NDlUWh000611; Mon, 23 Apr 2018 13:47:30 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201804231347.w3NDlUWh000611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 23 Apr 2018 13:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332888 - in stable: 10/release/arm 11/release/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release/arm 11/release/arm X-SVN-Commit-Revision: 332888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 13:47:31 -0000 Author: gjb Date: Mon Apr 23 13:47:29 2018 New Revision: 332888 URL: https://svnweb.freebsd.org/changeset/base/332888 Log: MFC r332674: Increase the msdosfs partition size on arm SoC images where the current size may not be sufficiently large for development and/or testing. PR: 227548 Sponsored by: The FreeBSD Foundation Modified: stable/11/release/arm/BEAGLEBONE.conf stable/11/release/arm/GUMSTIX.conf stable/11/release/arm/PANDABOARD.conf stable/11/release/arm/RPI-B.conf Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/arm/BEAGLEBONE.conf stable/10/release/arm/GUMSTIX.conf stable/10/release/arm/PANDABOARD.conf stable/10/release/arm/RPI-B.conf Directory Properties: stable/10/ (props changed) Modified: stable/11/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/11/release/arm/BEAGLEBONE.conf Mon Apr 23 12:23:05 2018 (r332887) +++ stable/11/release/arm/BEAGLEBONE.conf Mon Apr 23 13:47:29 2018 (r332888) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="1G" KERNEL="BEAGLEBONE" Modified: stable/11/release/arm/GUMSTIX.conf ============================================================================== --- stable/11/release/arm/GUMSTIX.conf Mon Apr 23 12:23:05 2018 (r332887) +++ stable/11/release/arm/GUMSTIX.conf Mon Apr 23 13:47:29 2018 (r332888) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="arm" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="1G" KERNEL="GUMSTIX" Modified: stable/11/release/arm/PANDABOARD.conf ============================================================================== --- stable/11/release/arm/PANDABOARD.conf Mon Apr 23 12:23:05 2018 (r332887) +++ stable/11/release/arm/PANDABOARD.conf Mon Apr 23 13:47:29 2018 (r332888) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" -FAT_SIZE="2m" +FAT_SIZE="41m" FAT_TYPE="12" IMAGE_SIZE="1G" KERNEL="PANDABOARD" Modified: stable/11/release/arm/RPI-B.conf ============================================================================== --- stable/11/release/arm/RPI-B.conf Mon Apr 23 12:23:05 2018 (r332887) +++ stable/11/release/arm/RPI-B.conf Mon Apr 23 13:47:29 2018 (r332888) @@ -7,7 +7,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware" -FAT_SIZE="17m" +FAT_SIZE="41m" FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="RPI-B" From owner-svn-src-all@freebsd.org Mon Apr 23 14:22:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60FD0F89D3F; Mon, 23 Apr 2018 14:22:17 +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 0EDD168F04; Mon, 23 Apr 2018 14:22:17 +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 0700625686; Mon, 23 Apr 2018 14:22:17 +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 w3NEMGhO019418; Mon, 23 Apr 2018 14:22:16 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3NEMG5q019417; Mon, 23 Apr 2018 14:22:16 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201804231422.w3NEMG5q019417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 23 Apr 2018 14:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332889 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 332889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 14:22:17 -0000 Author: jtl Date: Mon Apr 23 14:22:16 2018 New Revision: 332889 URL: https://svnweb.freebsd.org/changeset/base/332889 Log: MFC r331745 (by np): Fix RSS build (broken in r331309). Sponsored by: Chelsio Communications PR: 227691 Pointy-hat to: jtl Modified: stable/11/sys/netinet/in_pcb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/in_pcb.c ============================================================================== --- stable/11/sys/netinet/in_pcb.c Mon Apr 23 13:47:29 2018 (r332888) +++ stable/11/sys/netinet/in_pcb.c Mon Apr 23 14:22:16 2018 (r332889) @@ -1807,9 +1807,9 @@ in_pcblookup_group(struct inpcbinfo *pcbinfo, struct i found: if (lookupflags & INPLOOKUP_WLOCKPCB) - locked = TRY_INP_WLOCK(inp); + locked = INP_TRY_WLOCK(inp); else if (lookupflags & INPLOOKUP_RLOCKPCB) - locked = TRY_INP_RLOCK(inp); + locked = INP_TRY_RLOCK(inp); else panic("%s: locking bug", __func__); if (!locked) From owner-svn-src-all@freebsd.org Mon Apr 23 14:52:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9196FA2784 for ; Mon, 23 Apr 2018 14:52:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25AF66E89A for ; Mon, 23 Apr 2018 14:52:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id 71-v6so11015826ith.2 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=uSo0QGmyLMrmOMkOdSxhrOx9luL203X3Pl0mfrUJpurineRwznVj+dFyaj9lHGvEda H+l7Ugc/87G82dCj7wKChDCn4YqO+7CC22r0PdaEY+k12MGpsNZVmlxHVaLLOnRx8/7V gE/tDPUK7zdu3eF1OeAfXA4H8oVvusy8MoDMQLQNiAb5izuyzUDaMkB6DpmwaINCAAj3 YHTkgzBF3PbN+1HYfrcNP82/ZGQfn460CepMsv1hI1ZU2hCGtxvWcrCAT72lxO/CXlZ3 Ci08OcEk0DL93fTXeZJ6rCiuUe4Zd+ws8X77pfiaQtDmCLrc6MpIIuPkkHMsvV4XdKMP MoCw== X-Gm-Message-State: ALQs6tB7EmhU99IFd2E5A+MbbJ+S1JojKqvB3xM3kBMY8id4+snaGNil 1rFaYW2KP/K4fHCCuxwbRfDxkTW0YJ46LyBrqws2eg== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 14:58:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C9CDFA31A0 for ; Mon, 23 Apr 2018 14:58:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (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 9039670D46 for ; Mon, 23 Apr 2018 14:58:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id e20-v6so11054160itc.1 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=YRJxuDBR/CtBF8z3GX30YCHWwIME47gc1Dz4DNy4qtvnKBMnJAeqFFFC/SlTkl271u av0kkGUXSfHLrRoN1UW/DA/5rV27hWXqeoGkKzg+PVqWUmzwcbqJzwNGN7gWb9khGenK JQPs6IQNO8py6nOm+jqDtUZxzi5GOheuprQ+ToAMQveeAdupNmiB51fW+Uv0XyW8ZKX7 JzaCGKMlctEYra19Eiw6WeAryeHyznR/ikTXG/ZtTioMtCmTcCf6SXabszfGSjN6xEWU /EtRVWQ6J6X1bIKK2qQYWOAxObUP8uQnXv30thC5sWguZGsvvUC1p7tyBuqVSkx+Upil yNXw== X-Gm-Message-State: ALQs6tBifri7/jZi8pMG7xVwvFLRdw6DUJ12COE/Co5yau6LvYzeGyp+ koajp+QvWX8nI0/5ApxVOqiYCmVGYjzPa4tX95gouQ== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 15:18:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 16:07:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C2FEFA5882 for ; Mon, 23 Apr 2018 16:07:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (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 C40A3809AA for ; Mon, 23 Apr 2018 16:07:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id d11-v6so11213082iof.11 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=dX2/ggJk0ZVY+2Us2k0YUXAEKuEu3QfghE0sQBa2vUpFz/jFZzRj8k3rsaYv6idZmN oT5lvBWzjUtMLPETaB3bHybMyIxeyAHx96MwuZnI6HHHpNf+RqCgoCAnQNNNo1UyBujN h8CXlZ+e6aisp5GFQwwN4IiPmaOA2MCu8dNM9F4Dyy2ifK/LwO9Wg9iI7he+dOW+xTHd gbQLZSxuwb8AAmZ/7WcHcoRz0H8AQz8Gluc9UwDcVx26UImgDFi/TZ/u9YDY9Zcqpi2j itnS0UGFs+TbkvHRZv+FxUCR5E3fKhvy92KNPcNJ7gInufn0LS2I9AEs1qoF6ybZRHrR Uf7g== X-Gm-Message-State: ALQs6tDzL8gNNm3WAjfhw1E0bjMpinM8Pp2GB9+PuJGOxTAictFzscWz ZpDa+b7KRRdALxa7fxC6a3wa6+CuL3z/y/UpQmJnjQ== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2018 16:07:06 -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-all@freebsd.org Mon Apr 23 16:38:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 16:50:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 17:00:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 18:00:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 18:33:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 19:51:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 21:10:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 21:36:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 22:16:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 22:16:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 22:28:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 22:30:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Apr 23 23:07:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Tue Apr 24 00:47:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC77FFAF9A5; Tue, 24 Apr 2018 00:47:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D824763B2; Tue, 24 Apr 2018 00:47:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DC983DC6; Tue, 24 Apr 2018 00:47:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O0lIXK035664; Tue, 24 Apr 2018 00:47:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O0lI6V035663; Tue, 24 Apr 2018 00:47:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804240047.w3O0lI6V035663@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 00:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332899 - stable/11/lib/clang/include/lld/Common X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/lib/clang/include/lld/Common X-SVN-Commit-Revision: 332899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 00:47:19 -0000 Author: emaste Date: Tue Apr 24 00:47:17 2018 New Revision: 332899 URL: https://svnweb.freebsd.org/changeset/base/332899 Log: MFC r332649: lld: add a __FreeBSD_version-style identifier to version This will faciliate a WITH_SYSTEM_LINKER option. MFC r332803: lld: use correct number of digits in __FreeBSD_version-style ID __FreeBSD_version-style IDs should have 5 digits following the major. Also, use 11xxxxx for stable/11. Sponsored by: The FreeBSD Foundation Modified: stable/11/lib/clang/include/lld/Common/Version.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/clang/include/lld/Common/Version.inc ============================================================================== --- stable/11/lib/clang/include/lld/Common/Version.inc Mon Apr 23 23:07:57 2018 (r332898) +++ stable/11/lib/clang/include/lld/Common/Version.inc Tue Apr 24 00:47:17 2018 (r332899) @@ -4,5 +4,7 @@ #define LLD_VERSION_STRING "6.0.0" #define LLD_VERSION_MAJOR 6 #define LLD_VERSION_MINOR 0 -#define LLD_REVISION_STRING "326565" + #define LLD_REPOSITORY_STRING "FreeBSD" +// - +#define LLD_REVISION_STRING "326565-1100001" From owner-svn-src-all@freebsd.org Tue Apr 24 01:04:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 01:06:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 01:22:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 03:06:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A873FB5F6E; Tue, 24 Apr 2018 03:06:06 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1FD175D88; Tue, 24 Apr 2018 03:06:05 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D27E85663; Tue, 24 Apr 2018 03:06:05 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O365Ym006302; Tue, 24 Apr 2018 03:06:05 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O365pm006301; Tue, 24 Apr 2018 03:06:05 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201804240306.w3O365pm006301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Tue, 24 Apr 2018 03:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332903 - stable/11/sys/dev/hyperv/storvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: dexuan X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/storvsc X-SVN-Commit-Revision: 332903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 03:06:06 -0000 Author: dexuan Date: Tue Apr 24 03:06:05 2018 New Revision: 332903 URL: https://svnweb.freebsd.org/changeset/base/332903 Log: MFC: 332385 r332385: hyperv/storvsc: storvsc_io_done(): do not use CAM_SEL_TIMEOUT CAM_SEL_TIMEOUT was introduced in https://reviews.freebsd.org/D7521 (r304251), which claimed: "VM shall response to CAM layer with CAM_SEL_TIMEOUT to filter those invalid LUNs. Never use CAM_DEV_NOT_THERE which will block LUN scan for LUN number higher than 7." But it turns out this is not correct: I think what really filters the invalid LUNs in r304251 is that: before r304251, we could set the CAM_REQ_CMP without checking vm_srb->srb_status at all: ccb->ccb_h.status |= CAM_REQ_CMP. r304251 checks vm_srb->srb_status and sets ccb->ccb_h.status properly, so the invalid LUNs are filtered. I changed my code version to r304251 but replaced the CAM_SEL_TIMEOUT with CAM_DEV_NOT_THERE, and I confirmed the invalid LUNs can also be filtered, and I successfully hot-added and hot-removed 8 disks to/from the VM without any issue. CAM_SEL_TIMEOUT has an unwanted side effect -- see cam_periph_error(): For a selection timeout, we consider all of the LUNs on the target to be gone. If the status is CAM_DEV_NOT_THERE, then we only get rid of the device(s) specified by the path in the original CCB. This means: for a VM with a valid LUN on 3:0:0:0, when the VM inquires 3:0:0:1 and the host reports 3:0:0:1 doesn't exist and storvsc returns CAM_SEL_TIMEOUT to the CAM layer, CAM will detech 3:0:0:0 as well: this is the bug I reported recently: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226583 PR: 226583 Reviewed by: mav Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D14690 Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 24 01:22:57 2018 (r332902) +++ stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 24 03:06:05 2018 (r332903) @@ -2172,20 +2172,7 @@ storvsc_io_done(struct hv_storvsc_request *reqp) scsi_op_desc(cmd->opcode, NULL)); } } - - /* - * XXX For a selection timeout, all of the LUNs - * on the target will be gone. It works for SCSI - * disks, but does not work for IDE disks. - * - * For CAM_DEV_NOT_THERE, CAM will only get - * rid of the device(s) specified by the path. - */ - if (storvsc_get_storage_type(sc->hs_dev) == - DRIVER_STORVSC) - ccb->ccb_h.status |= CAM_SEL_TIMEOUT; - else - ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; } else { ccb->ccb_h.status |= CAM_REQ_CMP; } From owner-svn-src-all@freebsd.org Tue Apr 24 03:07:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 737F7FB613C; Tue, 24 Apr 2018 03:07:50 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2367375FA0; Tue, 24 Apr 2018 03:07:50 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 059FB566E; Tue, 24 Apr 2018 03:07:50 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3O37nZ6006428; Tue, 24 Apr 2018 03:07:49 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3O37nrb006427; Tue, 24 Apr 2018 03:07:49 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201804240307.w3O37nrb006427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Tue, 24 Apr 2018 03:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332904 - stable/10/sys/dev/hyperv/storvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: dexuan X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/storvsc X-SVN-Commit-Revision: 332904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 03:07:50 -0000 Author: dexuan Date: Tue Apr 24 03:07:49 2018 New Revision: 332904 URL: https://svnweb.freebsd.org/changeset/base/332904 Log: MFC: 332385 r332385: hyperv/storvsc: storvsc_io_done(): do not use CAM_SEL_TIMEOUT CAM_SEL_TIMEOUT was introduced in https://reviews.freebsd.org/D7521 (r304251), which claimed: "VM shall response to CAM layer with CAM_SEL_TIMEOUT to filter those invalid LUNs. Never use CAM_DEV_NOT_THERE which will block LUN scan for LUN number higher than 7." But it turns out this is not correct: I think what really filters the invalid LUNs in r304251 is that: before r304251, we could set the CAM_REQ_CMP without checking vm_srb->srb_status at all: ccb->ccb_h.status |= CAM_REQ_CMP. r304251 checks vm_srb->srb_status and sets ccb->ccb_h.status properly, so the invalid LUNs are filtered. I changed my code version to r304251 but replaced the CAM_SEL_TIMEOUT with CAM_DEV_NOT_THERE, and I confirmed the invalid LUNs can also be filtered, and I successfully hot-added and hot-removed 8 disks to/from the VM without any issue. CAM_SEL_TIMEOUT has an unwanted side effect -- see cam_periph_error(): For a selection timeout, we consider all of the LUNs on the target to be gone. If the status is CAM_DEV_NOT_THERE, then we only get rid of the device(s) specified by the path in the original CCB. This means: for a VM with a valid LUN on 3:0:0:0, when the VM inquires 3:0:0:1 and the host reports 3:0:0:1 doesn't exist and storvsc returns CAM_SEL_TIMEOUT to the CAM layer, CAM will detech 3:0:0:0 as well: this is the bug I reported recently: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226583 PR: 226583 Reviewed by: mav Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D14690 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 24 03:06:05 2018 (r332903) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 24 03:07:49 2018 (r332904) @@ -2172,20 +2172,7 @@ storvsc_io_done(struct hv_storvsc_request *reqp) scsi_op_desc(cmd->opcode, NULL)); } } - - /* - * XXX For a selection timeout, all of the LUNs - * on the target will be gone. It works for SCSI - * disks, but does not work for IDE disks. - * - * For CAM_DEV_NOT_THERE, CAM will only get - * rid of the device(s) specified by the path. - */ - if (storvsc_get_storage_type(sc->hs_dev) == - DRIVER_STORVSC) - ccb->ccb_h.status |= CAM_SEL_TIMEOUT; - else - ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; } else { ccb->ccb_h.status |= CAM_REQ_CMP; } From owner-svn-src-all@freebsd.org Tue Apr 24 04:07:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 05:20:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 05:26:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 05:30:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 05:33:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 05:42:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 06:10:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 09:42:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 10:02:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E78AFC20E2; Tue, 24 Apr 2018 10:02:19 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFF1D76D97; Tue, 24 Apr 2018 10:02:17 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A805C11B0A; Tue, 24 Apr 2018 10:02:17 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OA2HUb016524; Tue, 24 Apr 2018 10:02:17 GMT (envelope-from riggs@FreeBSD.org) Received: (from riggs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OA2Hcn016523; Tue, 24 Apr 2018 10:02:17 GMT (envelope-from riggs@FreeBSD.org) Message-Id: <201804241002.w3OA2Hcn016523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: riggs set sender to riggs@FreeBSD.org using -f From: Thomas Zander Date: Tue, 24 Apr 2018 10:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332920 - stable/10/sys/dev/bktr X-SVN-Group: stable-10 X-SVN-Commit-Author: riggs X-SVN-Commit-Paths: stable/10/sys/dev/bktr X-SVN-Commit-Revision: 332920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 10:02:20 -0000 Author: riggs (ports committer) Date: Tue Apr 24 10:02:17 2018 New Revision: 332920 URL: https://svnweb.freebsd.org/changeset/base/332920 Log: MFC r332861: Remove unused definition bl_dfp; fix build with bktr compiled into kernel Approved by: cognet Modified: stable/10/sys/dev/bktr/msp34xx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/bktr/msp34xx.c ============================================================================== --- stable/10/sys/dev/bktr/msp34xx.c Tue Apr 24 10:02:12 2018 (r332919) +++ stable/10/sys/dev/bktr/msp34xx.c Tue Apr 24 10:02:17 2018 (r332920) @@ -109,10 +109,6 @@ #define VIDEO_SOUND_LANG2 8 #define DFP_COUNT 0x41 -static const int bl_dfp[] = { - 0x00, 0x01, 0x02, 0x03, 0x06, 0x08, 0x09, 0x0a, - 0x0b, 0x0d, 0x0e, 0x10 -}; struct msp3400c { int simple; From owner-svn-src-all@freebsd.org Tue Apr 24 10:05:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88C4EFC21BC; Tue, 24 Apr 2018 10:05:24 +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 005777801C; Tue, 24 Apr 2018 10:05:24 +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 EF2AD11B25; Tue, 24 Apr 2018 10:05:23 +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 w3OA5NaF016727; Tue, 24 Apr 2018 10:05:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OA5N1m016726; Tue, 24 Apr 2018 10:05:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804241005.w3OA5N1m016726@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 Apr 2018 10:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332922 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/include/linux X-SVN-Commit-Revision: 332922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 10:05:24 -0000 Author: hselasky Date: Tue Apr 24 10:05:23 2018 New Revision: 332922 URL: https://svnweb.freebsd.org/changeset/base/332922 Log: MFC r331355: Clear old MSIX IRQ numbers in the LinuxKPI. When disabling the MSIX IRQ vectors for a PCI device through the LinuxKPI, make sure any old MSIX IRQ numbers are no longer visible to the linux_pci_find_irq_dev() function else IRQs can be requested from the wrong PCI device. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/pci.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/pci.h ============================================================================== --- stable/10/sys/ofed/include/linux/pci.h Tue Apr 24 10:03:16 2018 (r332921) +++ stable/10/sys/ofed/include/linux/pci.h Tue Apr 24 10:05:23 2018 (r332922) @@ -349,6 +349,15 @@ pci_disable_msix(struct pci_dev *pdev) { pci_release_msi(pdev->dev.bsddev); + + /* + * The MSIX IRQ numbers associated with this PCI device are no + * longer valid and might be re-assigned. Make sure + * linux_pci_find_irq_dev() does no longer see them by + * resetting their references to zero: + */ + pdev->dev.msix = 0; + pdev->dev.msix_max = 0; } #define PCI_CAP_ID_EXP PCIY_EXPRESS From owner-svn-src-all@freebsd.org Tue Apr 24 10:07:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38223FC2291; Tue, 24 Apr 2018 10:07:16 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B162278EA1; Tue, 24 Apr 2018 10:07:14 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67BE411B29; Tue, 24 Apr 2018 10:07:13 +0000 (UTC) (envelope-from riggs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OA7DQt016903; Tue, 24 Apr 2018 10:07:13 GMT (envelope-from riggs@FreeBSD.org) Received: (from riggs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OA7Dwx016902; Tue, 24 Apr 2018 10:07:13 GMT (envelope-from riggs@FreeBSD.org) Message-Id: <201804241007.w3OA7Dwx016902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: riggs set sender to riggs@FreeBSD.org using -f From: Thomas Zander Date: Tue, 24 Apr 2018 10:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332924 - stable/11/sys/dev/bktr X-SVN-Group: stable-11 X-SVN-Commit-Author: riggs X-SVN-Commit-Paths: stable/11/sys/dev/bktr X-SVN-Commit-Revision: 332924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 10:07:16 -0000 Author: riggs (ports committer) Date: Tue Apr 24 10:07:13 2018 New Revision: 332924 URL: https://svnweb.freebsd.org/changeset/base/332924 Log: MFC r332861: Remove unused definition bl_dfp; fix build with bktr compiled into kernel Approved by: cognet Modified: stable/11/sys/dev/bktr/msp34xx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/bktr/msp34xx.c ============================================================================== --- stable/11/sys/dev/bktr/msp34xx.c Tue Apr 24 10:07:07 2018 (r332923) +++ stable/11/sys/dev/bktr/msp34xx.c Tue Apr 24 10:07:13 2018 (r332924) @@ -109,10 +109,6 @@ #define VIDEO_SOUND_LANG2 8 #define DFP_COUNT 0x41 -static const int bl_dfp[] = { - 0x00, 0x01, 0x02, 0x03, 0x06, 0x08, 0x09, 0x0a, - 0x0b, 0x0d, 0x0e, 0x10 -}; struct msp3400c { int simple; From owner-svn-src-all@freebsd.org Tue Apr 24 10:32:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F6DFC290C; Tue, 24 Apr 2018 10:32:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 245C27D860; Tue, 24 Apr 2018 10:32:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F40F11FD0; Tue, 24 Apr 2018 10:32:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OAWPog031715; Tue, 24 Apr 2018 10:32:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OAWPAS031714; Tue, 24 Apr 2018 10:32:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804241032.w3OAWPAS031714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 Apr 2018 10:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332928 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/ofed/include/linux X-SVN-Commit-Revision: 332928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 10:32:26 -0000 Author: hselasky Date: Tue Apr 24 10:32:25 2018 New Revision: 332928 URL: https://svnweb.freebsd.org/changeset/base/332928 Log: MFC r329372 and r329464: Implement enable_irq() and disable_irq() in the LinuxKPI and add checks for valid IRQ tag before setting up or tearing down an interrupt handler in the LinuxKPI. This is needed when the interrupt handler is disabled before freeing the interrupt. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/interrupt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/interrupt.h ============================================================================== --- stable/10/sys/ofed/include/linux/interrupt.h Tue Apr 24 10:11:01 2018 (r332927) +++ stable/10/sys/ofed/include/linux/interrupt.h Tue Apr 24 10:32:25 2018 (r332928) @@ -118,6 +118,39 @@ request_irq(unsigned int irq, irq_handler_t handler, u } static inline int +enable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = _pci_find_irq_dev(irq); + if (dev == NULL) + return -EINVAL; + irqe = _irq_ent(dev, irq); + if (irqe == NULL || irqe->tag != NULL) + return -EINVAL; + return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, _irq_handler, irqe, &irqe->tag); +} + +static inline void +disable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = _pci_find_irq_dev(irq); + if (dev == NULL) + return; + irqe = _irq_ent(dev, irq); + if (irqe == NULL) + return; + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + irqe->tag = NULL; +} + +static inline int bind_irq_to_cpu(unsigned int irq, int cpu_id) { struct irq_ent *irqe; @@ -148,7 +181,8 @@ free_irq(unsigned int irq, void *device) irqe = _irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); list_del(&irqe->links); kfree(irqe); From owner-svn-src-all@freebsd.org Tue Apr 24 12:17:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84F58FA22B5; Tue, 24 Apr 2018 12:17:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37F1674BE2; Tue, 24 Apr 2018 12:17:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A32E12FAC; Tue, 24 Apr 2018 12:17:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OCHSf6081280; Tue, 24 Apr 2018 12:17:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OCHSex081278; Tue, 24 Apr 2018 12:17:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804241217.w3OCHSex081278@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 12:17:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332929 - stable/11/usr.sbin/pwd_mkdb X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/pwd_mkdb X-SVN-Commit-Revision: 332929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 12:17:29 -0000 Author: emaste Date: Tue Apr 24 12:17:28 2018 New Revision: 332929 URL: https://svnweb.freebsd.org/changeset/base/332929 Log: pwd_mkdb: add legacy support deprecation notice MFC r332789: 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. MFC r332875: 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. Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.sbin/pwd_mkdb/pwd_mkdb.8 stable/11/usr.sbin/pwd_mkdb/pwd_mkdb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pwd_mkdb/pwd_mkdb.8 ============================================================================== --- stable/11/usr.sbin/pwd_mkdb/pwd_mkdb.8 Tue Apr 24 10:32:25 2018 (r332928) +++ stable/11/usr.sbin/pwd_mkdb/pwd_mkdb.8 Tue Apr 24 12:17:28 2018 (r332929) @@ -28,7 +28,7 @@ .\" @(#)pwd_mkdb.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 5, 2014 +.Dd April 24, 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. Modified: stable/11/usr.sbin/pwd_mkdb/pwd_mkdb.c ============================================================================== --- stable/11/usr.sbin/pwd_mkdb/pwd_mkdb.c Tue Apr 24 10:32:25 2018 (r332928) +++ stable/11/usr.sbin/pwd_mkdb/pwd_mkdb.c Tue Apr 24 12:17:28 2018 (r332929) @@ -164,6 +164,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-all@freebsd.org Tue Apr 24 12:50:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 13:07:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 13:44:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 13:52:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDB26FA51FC; Tue, 24 Apr 2018 13:52:39 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA4769473; Tue, 24 Apr 2018 13:52:39 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 778E513FCC; Tue, 24 Apr 2018 13:52:39 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ODqdkT030868; Tue, 24 Apr 2018 13:52:39 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ODqdPO030867; Tue, 24 Apr 2018 13:52:39 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201804241352.w3ODqdPO030867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 24 Apr 2018 13:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r332933 - stable/10/sys/cam/scsi X-SVN-Group: stable-10 X-SVN-Commit-Author: ken X-SVN-Commit-Paths: stable/10/sys/cam/scsi X-SVN-Commit-Revision: 332933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 13:52:40 -0000 Author: ken Date: Tue Apr 24 13:52:39 2018 New Revision: 332933 URL: https://svnweb.freebsd.org/changeset/base/332933 Log: MFC r332458: ------------------------------------------------------------------------ r332458 | ken | 2018-04-12 15:21:18 -0600 (Thu, 12 Apr 2018) | 34 lines Handle Programmable Early Warning for control commands in sa(4). When the tape position is inside the Early Warning area, the tape drive will return a sense key of NO SENSE, and an ASC/ASCQ of 0x00,0x02, which means: End-of-partition/medium detected". If this was in response to a control command like WRITE FILEMARKS, we correctly translate this as informational status and return 0 from saerror(). Programmable Early Warning should be handled the same way, but we weren't handling it that way. As a result, if a PEW status (sense key of NO SENSE, ASC/ASCQ of 0x00,0x07, "Programmable early warning detected") came back in response to a WRITE FILEMARKS, we returned an error. The impact of this was that if an application was writing to a sa(4) device, and a PEW area was set (in the Device Configuration Extension subpage -- mode page 0x10, subpage 1), and a filemark needed to be written on close, we could wind up returning an error to the user on close because of a "failure" to write the filemarks. It actually isn't a failure, but rather just a status report from the drive, and shouldn't be treated as a failure. sys/cam/scsi/scsi_sa.c: For control commands in saerror(), treat asc/ascq 0x00,0x07 the same as 0x00,{0-5} -- not an error. Return 0, since the command actually did succeed. Reported by: Dr. Andreas Haakh Tested by: Dr. Andreas Haakh Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/10/sys/cam/scsi/scsi_sa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sa.c Tue Apr 24 13:44:19 2018 (r332932) +++ stable/10/sys/cam/scsi/scsi_sa.c Tue Apr 24 13:52:39 2018 (r332933) @@ -3453,12 +3453,13 @@ saerror(union ccb *ccb, u_int32_t cflgs, u_int32_t sfl break; } /* - * If this was just EOM/EOP, Filemark, Setmark or ILI detected - * on a non read/write command, we assume it's not an error - * and propagate the residule and return. + * If this was just EOM/EOP, Filemark, Setmark, ILI or + * PEW detected on a non read/write command, we assume + * it's not an error and propagate the residual and return. */ - if ((aqvalid && asc == 0 && ascq > 0 && ascq <= 5) || - (aqvalid == 0 && sense_key == SSD_KEY_NO_SENSE)) { + if ((aqvalid && asc == 0 && ((ascq > 0 && ascq <= 5) + || (ascq == 0x07))) + || (aqvalid == 0 && sense_key == SSD_KEY_NO_SENSE)) { csio->resid = resid; QFRLS(ccb); return (0); From owner-svn-src-all@freebsd.org Tue Apr 24 14:02:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 14:35:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8409FA766C; Tue, 24 Apr 2018 14:35:39 +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 7386B73B2F; Tue, 24 Apr 2018 14:35:39 +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 6BEB614697; Tue, 24 Apr 2018 14:35:39 +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 w3OEZd3j052642; Tue, 24 Apr 2018 14:35:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OEZdmo052641; Tue, 24 Apr 2018 14:35:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804241435.w3OEZdmo052641@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 14:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332935 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 332935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 14:35:40 -0000 Author: markj Date: Tue Apr 24 14:35:39 2018 New Revision: 332935 URL: https://svnweb.freebsd.org/changeset/base/332935 Log: MFC r332658: Ensure that m and skip_m belong to the same object. Modified: stable/11/sys/vm/vm_page.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Tue Apr 24 14:02:46 2018 (r332934) +++ stable/11/sys/vm/vm_page.c Tue Apr 24 14:35:39 2018 (r332935) @@ -3733,6 +3733,8 @@ vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip int i, npages; object = m->object; + if (skip_m != NULL && skip_m->object != object) + return (false); VM_OBJECT_ASSERT_LOCKED(object); npages = atop(pagesizes[m->psind]); From owner-svn-src-all@freebsd.org Tue Apr 24 14:49:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 15:04:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 249B1FA8626; Tue, 24 Apr 2018 15:04:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8E9B7BCD5; Tue, 24 Apr 2018 15:04:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3DDF14B88; Tue, 24 Apr 2018 15:04:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OF47Jc067784; Tue, 24 Apr 2018 15:04:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OF47FR067782; Tue, 24 Apr 2018 15:04:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201804241504.w3OF47FR067782@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 15:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332939 - in stable/11/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/11/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Commit-Revision: 332939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 15:04:08 -0000 Author: markj Date: Tue Apr 24 15:04:07 2018 New Revision: 332939 URL: https://svnweb.freebsd.org/changeset/base/332939 Log: MFC r332364: Assert that dtrace_probe() doesn't re-enter itself. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/11/sys/cddl/dev/dtrace/dtrace_cddl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Apr 24 14:55:22 2018 (r332938) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Apr 24 15:04:07 2018 (r332939) @@ -7116,6 +7116,44 @@ dtrace_store_by_ref(dtrace_difo_t *dp, caddr_t tomax, } /* + * Disables interrupts and sets the per-thread inprobe flag. When DEBUG is + * defined, we also assert that we are not recursing unless the probe ID is an + * error probe. + */ +static dtrace_icookie_t +dtrace_probe_enter(dtrace_id_t id) +{ + dtrace_icookie_t cookie; + + cookie = dtrace_interrupt_disable(); + + /* + * Unless this is an ERROR probe, we are not allowed to recurse in + * dtrace_probe(). Recursing into DTrace probe usually means that a + * function is instrumented that should not have been instrumented or + * that the ordering guarantee of the records will be violated, + * resulting in unexpected output. If there is an exception to this + * assertion, a new case should be added. + */ + ASSERT(curthread->t_dtrace_inprobe == 0 || + id == dtrace_probeid_error); + curthread->t_dtrace_inprobe = 1; + + return (cookie); +} + +/* + * Disables interrupts and clears the per-thread inprobe flag. + */ +static void +dtrace_probe_exit(dtrace_icookie_t cookie) +{ + + curthread->t_dtrace_inprobe = 0; + dtrace_interrupt_enable(cookie); +} + +/* * If you're looking for the epicenter of DTrace, you just found it. This * is the function called by the provider to fire a probe -- from which all * subsequent probe-context DTrace activity emanates. @@ -7149,7 +7187,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t return; #endif - cookie = dtrace_interrupt_disable(); + cookie = dtrace_probe_enter(id); probe = dtrace_probes[id - 1]; cpuid = curcpu; onintr = CPU_ON_INTR(CPU); @@ -7160,7 +7198,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t * We have hit in the predicate cache; we know that * this predicate would evaluate to be false. */ - dtrace_interrupt_enable(cookie); + dtrace_probe_exit(cookie); return; } @@ -7172,7 +7210,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t /* * We don't trace anything if we're panicking. */ - dtrace_interrupt_enable(cookie); + dtrace_probe_exit(cookie); return; } @@ -7858,7 +7896,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t if (vtime) curthread->t_dtrace_start = dtrace_gethrtime(); - dtrace_interrupt_enable(cookie); + dtrace_probe_exit(cookie); } /* Modified: stable/11/sys/cddl/dev/dtrace/dtrace_cddl.h ============================================================================== --- stable/11/sys/cddl/dev/dtrace/dtrace_cddl.h Tue Apr 24 14:55:22 2018 (r332938) +++ stable/11/sys/cddl/dev/dtrace/dtrace_cddl.h Tue Apr 24 15:04:07 2018 (r332939) @@ -46,6 +46,7 @@ typedef struct kdtrace_proc { typedef struct kdtrace_thread { u_int8_t td_dtrace_stop; /* Indicates a DTrace-desired stop */ u_int8_t td_dtrace_sig; /* Signal sent via DTrace's raise() */ + u_int8_t td_dtrace_inprobe; /* Are we in a probe? */ u_int td_predcache; /* DTrace predicate cache */ u_int64_t td_dtrace_vtime; /* DTrace virtual time */ u_int64_t td_dtrace_start; /* DTrace slice start time */ @@ -97,6 +98,7 @@ typedef struct kdtrace_thread { #define t_dtrace_start td_dtrace->td_dtrace_start #define t_dtrace_stop td_dtrace->td_dtrace_stop #define t_dtrace_sig td_dtrace->td_dtrace_sig +#define t_dtrace_inprobe td_dtrace->td_dtrace_inprobe #define t_predcache td_dtrace->td_predcache #define t_dtrace_ft td_dtrace->td_dtrace_ft #define t_dtrace_on td_dtrace->td_dtrace_on From owner-svn-src-all@freebsd.org Tue Apr 24 15:59:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 16:45:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7051FAB90F; Tue, 24 Apr 2018 16:45:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 964F37484E; Tue, 24 Apr 2018 16:45:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9130C15BB6; Tue, 24 Apr 2018 16:45:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OGjDCf017647; Tue, 24 Apr 2018 16:45:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OGjD2I017646; Tue, 24 Apr 2018 16:45:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804241645.w3OGjD2I017646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 24 Apr 2018 16:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332941 - stable/11/sys/dev/wl X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/sys/dev/wl X-SVN-Commit-Revision: 332941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 16:45:14 -0000 Author: ian Date: Tue Apr 24 16:45:13 2018 New Revision: 332941 URL: https://svnweb.freebsd.org/changeset/base/332941 Log: Fix wl(4) after r332288, using the same fix applied in r332331. This driver no longer exists in head, so this is a direct commit to 11-stable. Modified: stable/11/sys/dev/wl/if_wl.c Modified: stable/11/sys/dev/wl/if_wl.c ============================================================================== --- stable/11/sys/dev/wl/if_wl.c Tue Apr 24 15:59:39 2018 (r332940) +++ stable/11/sys/dev/wl/if_wl.c Tue Apr 24 16:45:13 2018 (r332941) @@ -1426,7 +1426,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) /* read out the number of used cache elements */ case SIOCGWLCITEM: WL_LOCK(sc); - ifr_data_get_ptr(ifr) = (caddr_t) sc->w_sigitems; + ifr->ifr_ifru.ifru_data = (caddr_t) sc->w_sigitems; WL_UNLOCK(sc); break; From owner-svn-src-all@freebsd.org Tue Apr 24 17:00:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63A01FABEF2; Tue, 24 Apr 2018 17:00:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C38977935; Tue, 24 Apr 2018 17:00:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCE4F15D5B; Tue, 24 Apr 2018 17:00:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OH08vs022803; Tue, 24 Apr 2018 17:00:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OH08v4022796; Tue, 24 Apr 2018 17:00:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804241700.w3OH08v4022796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 24 Apr 2018 17:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332942 - in stable/11: share/man/man4 sys/dev/spibus sys/modules/spigen sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/spibus sys/modules/spigen sys/sys X-SVN-Commit-Revision: 332942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:00:09 -0000 Author: ian Date: Tue Apr 24 17:00:08 2018 New Revision: 332942 URL: https://svnweb.freebsd.org/changeset/base/332942 Log: MFC r331868, r332046, r332194-r332196, r332198, r332219, r332231, r332233, r332240, r332258-r332259, r332261, r332292 r331868: Add opt_platform.h for several modules that have #ifdef FDT in the source. Submitted by: Andre Albsmeier r332046: Add a missing MODULE_DEPEND(). r332194: Add support for writing/changing spi device ivars. The SPI mode (polarity and phase) and the maximum bus speed can be changed. The chip select number cannot be changed, because the device instances which are children of spibus are inherently associated with the chip select number they were instantiated for. r332195: A couple minor improvements to spibus.c... - Change the description string to "SPI bus" (was "spibus bus"). - This is the default driver for a SPI bus, not a generic implementation, so return the probe value that indicates such. - Use device_delete_children() at detach time, instead of a local loop to enumerate the children and detach each one individually. r332196: Return BUS_PROBE_DEFAULT, not zero, because this is not the one driver implementation that must be used, it's just the base system default driver. Also add a comment noting that we're being more liberal about the bus frequency property than the dts binding documents require. r332198: Arrange the list of generated sources as 1-per-line alphbetical, and add the files required when building for FDT-based systems. r332219: Remove the existing identify() hack to force-add a spigen device on FDT-based systems, and instead add proper FDT probe code. Because this driver is freebsd-specific and just provides generic userland access to run spibus transactions, there is no bindings document to mandate a compatible string, so just arbitrarily use "freebsd,spigen". r332231: Generate a spibus_set_[ivarname]() convenience function for each ivar, now that they can be set. r332233: Add an ioctl to get/set the SPI transfer mode. Also, make the bus clock frequency ioctl actually set the corresponding ivar instead of just storing the value locally in the softc (and then not using it for anything). Also, return the correct error code if the ioctl cmd is not recognized. r332240: Add the ioctl definitions for spigen get/set spi mode. Should have been part of r332233. r332258: Don't check for impossible NULL return from malloc(..., M_WAITOK). r332259: Cast the data pointer to the correct type for the data being accessed (as opposed to one that accidentally worked on the one arch I test-compiled for on my first try). Reported by: np@, O. Hartmann Pointy hat: ian@ r332261: Add a manpage for spigen(4). r332292: Allow hinted attachment on FDT-based systems. Instead of returning ENXIO when the FDT data doesn't enable the device instance, return BUS_PROBE_NOWILDCARD, the same as for non-FDT systems. Added: stable/11/share/man/man4/spigen.4 - copied unchanged from r332261, head/share/man/man4/spigen.4 Modified: stable/11/sys/dev/spibus/ofw_spibus.c stable/11/sys/dev/spibus/spibus.c stable/11/sys/dev/spibus/spibusvar.h stable/11/sys/dev/spibus/spigen.c stable/11/sys/modules/spigen/Makefile stable/11/sys/sys/spigenio.h Directory Properties: stable/11/ (props changed) Copied: stable/11/share/man/man4/spigen.4 (from r332261, head/share/man/man4/spigen.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/spigen.4 Tue Apr 24 17:00:08 2018 (r332942, copy of r332261, head/share/man/man4/spigen.4) @@ -0,0 +1,206 @@ +.\" +.\" Copyright (c) 2018 Ian Lepore +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 7, 2018 +.Dt SPIGEN 4 +.Os +.Sh NAME +.Nm spigen +.Nd SPI generic I/O device driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device spi" +.Cd "device spibus" +.Cd "device spigen" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +spigen_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides direct access to a slave device on the SPI bus. +Each instance of a +.Nm +device is associated with a single chip-select +line on the bus, and all I/O performed through that instance is done +with that chip-select line asserted. +.Pp +SPI data transfers are inherently bi-directional; there are not separate +read and write operations. +When commands and data are sent to a device, data also comes back from +the device, although in some cases the data may not be useful (or even +documented or predictable for some devices). +Likewise on a read operation, whatever data is in the buffer at the start +of the operation is sent to (and typically ignored by) the device, with each +outgoing byte then replaced in the buffer by the corresponding incoming byte. +Thus, all buffers passed to the transfer functions are both input and +output buffers. +.Pp +The +.Nm +driver provides access to the SPI slave device with the following +.Xr ioctl 2 +calls, defined in +.In sys/spigenio.h : +.Bl -tag -width indent +.It Dv SPIGENIOC_TRANSFER Pq Vt "struct spigen_transfer" +Transfer a command and optional associated data to/from the device, +using the buffers described by the st_command and st_data fields in the +.Vt spigen_transfer . +Set +.Vt st_data.iov_len +to zero if there is no data associated with the command. +.Bd -literal +struct spigen_transfer { + struct iovec st_command; + struct iovec st_data; +}; +.Ed +.It Dv SPIGENIOC_TRANSFER_MMAPPED Pq Vt "spigen_transfer_mmapped" +Transfer a command and optional associated data to/from the device. +The buffers for the transfer are a previously-mmap'd region. +The length of the command and data within that region are described by the +.Vt stm_command_length +and +.Vt stm_data_length +fields of +.Vt spigen_transfer_mmapped . +If +.Vt stm_data_length +is non-zero, the data appears in the memory region immediately +following the command (that is, at offset +.Vt stm_command_length +from the start of the mapped region). +.Bd -literal +struct spigen_transfer_mmapped { + size_t stm_command_length; + size_t stm_data_length; +}; +.Ed +.It Dv SPIGENIOC_GET_CLOCK_SPEED Pq Vt uint32_t +Get the maximum clock speed (bus frequency in Hertz) to be used +when communicating with this slave device. +.It Dv SPIGENIOC_SET_CLOCK_SPEED Pq Vt uint32_t +Set the maximum clock speed (bus frequency in Hertz) to be used +when communicating with this slave device. +The setting remains in effect for subsequent transfers; it +is not necessary to reset this before each transfer. +The actual bus frequency may be lower due to hardware limitiations +of the SPI bus controller device. +.It Dv SPIGENIOC_GET_SPI_MODE Pq Vt uint32_t +Get the SPI mode (clock polarity and phase) to be used +when communicating with this device. +.It Dv SPIGENIOC_SET_SPI_MODE Pq Vt uint32_t +Set the SPI mode (clock polarity and phase) to be used +when communicating with this device. +The setting remains in effect for subsequent transfers; it +is not necessary to reset this before each transfer. +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, such as +.Li MIPS , +these values are configurable for +.Nm : +.Bl -tag -width indent +.It Va hint.spigen.%d.at +The spibus the +.Nm +instance is attached to. +.It Va hint.spigen.%d.clock +The maximum bus frequency to use when communicating with this device. +Actual bus speed may be lower, depending on the capabilities of the SPI +bus controller hardware. +.It Va hint.spigen.%d.cs +The chip-select number to assert when performing I/O for this device. +Set the high bit (1 << 31) to invert the logic level of the chip select line. +.It Va hint.spigen.%d.mode +The SPI mode (0-3) to use when communicating with this device. +.El +.Sh FDT CONFIGURATION +On an +.Xr fdt 4 +based system, the spigen device is defined as a slave device subnode +of the SPI bus controller node. +All properties documented in the +.Va spibus.txt +bindings document can be used with the +.Nm +device. +The most commonly-used ones are documented below. +.Pp +The following properties are required in the +.Nm +device subnode: +.Bl -tag -width indent +.It Va compatible +Must be the string "freebsd,spigen". +.It Va reg +Chip select address of device. +.It Va spi-max-frequency +The maximum bus frequency to use when communicating with this slave device. +Actual bus speed may be lower, depending on the capabilities of the SPI +bus controller hardware. +.El +.Pp +The following properties are optional for the +.Nm +device subnode: +.Bl -tag -width indent +.It Va spi-cpha +Empty property indicating the slave device requires shifted clock +phase (CPHA) mode. +.It Va spi-cpol +Empty property indicating the slave device requires inverse clock +polarity (CPOL) mode. +.It Va spi-cs-high +Empty property indicating the slave device requires chip select active high. +.El +.Sh FILES +.Bl -tag -width -compact +.It Pa /dev/spigen* +.El +.Sh SEE ALSO +.Xr fdt 4 , +.Xr device.hints 5 +.Sh HISTORY +The +.Nm +driver +appeared in +.Fx 11.0 . +FDT support appeared in +.Fx 11.2 . Modified: stable/11/sys/dev/spibus/ofw_spibus.c ============================================================================== --- stable/11/sys/dev/spibus/ofw_spibus.c Tue Apr 24 16:45:13 2018 (r332941) +++ stable/11/sys/dev/spibus/ofw_spibus.c Tue Apr 24 17:00:08 2018 (r332942) @@ -69,7 +69,7 @@ ofw_spibus_probe(device_t dev) return (ENXIO); device_set_desc(dev, "OFW SPI bus"); - return (0); + return (BUS_PROBE_DEFAULT); } static int @@ -105,6 +105,10 @@ ofw_spibus_attach(device_t dev) /* * Get the maximum clock frequency for device, zero means * use the default bus speed. + * + * XXX Note that the current (2018-04-07) dts bindings say that + * spi-max-frequency is a required property (but says nothing of + * how to interpret a value of zero). */ if (OF_getencprop(child, "spi-max-frequency", &clock, sizeof(clock)) == -1) Modified: stable/11/sys/dev/spibus/spibus.c ============================================================================== --- stable/11/sys/dev/spibus/spibus.c Tue Apr 24 16:45:13 2018 (r332941) +++ stable/11/sys/dev/spibus/spibus.c Tue Apr 24 17:00:08 2018 (r332942) @@ -49,8 +49,9 @@ __FBSDID("$FreeBSD$"); static int spibus_probe(device_t dev) { - device_set_desc(dev, "spibus bus"); - return (BUS_PROBE_GENERIC); + + device_set_desc(dev, "SPI bus"); + return (BUS_PROBE_DEFAULT); } static int @@ -70,16 +71,11 @@ spibus_attach(device_t dev) static int spibus_detach(device_t dev) { - int err, ndevs, i; - device_t *devlist; + int err; if ((err = bus_generic_detach(dev)) != 0) return (err); - if ((err = device_get_children(dev, &devlist, &ndevs)) != 0) - return (err); - for (i = 0; i < ndevs; i++) - device_delete_child(dev, devlist[i]); - free(devlist, M_TEMP); + device_delete_children(dev); return (0); } @@ -160,6 +156,37 @@ spibus_read_ivar(device_t bus, device_t child, int whi return (0); } +static int +spibus_write_ivar(device_t bus, device_t child, int which, uintptr_t value) +{ + struct spibus_ivar *devi = SPIBUS_IVAR(child); + + if (devi == NULL || device_get_parent(child) != bus) + return (EDOOFUS); + + switch (which) { + case SPIBUS_IVAR_CLOCK: + /* Any non-zero value is allowed for max clock frequency. */ + if (value == 0) + return (EINVAL); + devi->clock = (uint32_t)value; + break; + case SPIBUS_IVAR_CS: + /* Chip select cannot be changed. */ + return (EINVAL); + case SPIBUS_IVAR_MODE: + /* Valid SPI modes are 0-3. */ + if (value > 3) + return (EINVAL); + devi->mode = (uint32_t)value; + break; + default: + return (EINVAL); + } + + return (0); +} + static device_t spibus_add_child(device_t dev, u_int order, const char *name, int unit) { @@ -211,6 +238,7 @@ static device_method_t spibus_methods[] = { DEVMETHOD(bus_print_child, spibus_print_child), DEVMETHOD(bus_probe_nomatch, spibus_probe_nomatch), DEVMETHOD(bus_read_ivar, spibus_read_ivar), + DEVMETHOD(bus_write_ivar, spibus_write_ivar), DEVMETHOD(bus_child_pnpinfo_str, spibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, spibus_child_location_str), DEVMETHOD(bus_hinted_child, spibus_hinted_child), Modified: stable/11/sys/dev/spibus/spibusvar.h ============================================================================== --- stable/11/sys/dev/spibus/spibusvar.h Tue Apr 24 16:45:13 2018 (r332941) +++ stable/11/sys/dev/spibus/spibusvar.h Tue Apr 24 17:00:08 2018 (r332942) @@ -60,8 +60,14 @@ spibus_get_ ## A(device_t dev, T *t) \ { \ return BUS_READ_IVAR(device_get_parent(dev), dev, \ SPIBUS_IVAR_ ## B, (uintptr_t *) t); \ +} \ +static inline int \ +spibus_set_ ## A(device_t dev, T t) \ +{ \ + return BUS_WRITE_IVAR(device_get_parent(dev), dev, \ + SPIBUS_IVAR_ ## B, (uintptr_t) t); \ } - + SPIBUS_ACCESSOR(cs, CS, uint32_t) SPIBUS_ACCESSOR(mode, MODE, uint32_t) SPIBUS_ACCESSOR(clock, CLOCK, uint32_t) Modified: stable/11/sys/dev/spibus/spigen.c ============================================================================== --- stable/11/sys/dev/spibus/spigen.c Tue Apr 24 16:45:13 2018 (r332941) +++ stable/11/sys/dev/spibus/spigen.c Tue Apr 24 17:00:08 2018 (r332942) @@ -50,7 +50,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#ifdef FDT +#include +#endif + #include "spibus_if.h" #define SPIGEN_OPEN (1 << 0) @@ -60,7 +65,6 @@ struct spigen_softc { device_t sc_dev; struct cdev *sc_cdev; struct mtx sc_mtx; - uint32_t sc_clock_speed; uint32_t sc_command_length_max; /* cannot change while mmapped */ uint32_t sc_data_length_max; /* cannot change while mmapped */ vm_object_t sc_mmap_buffer; /* command, then data */ @@ -70,24 +74,27 @@ struct spigen_softc { int sc_flags; }; -#ifdef FDT -static void -spigen_identify(driver_t *driver, device_t parent) -{ - if (device_find_child(parent, "spigen", -1) != NULL) - return; - if (BUS_ADD_CHILD(parent, 0, "spigen", -1) == NULL) - device_printf(parent, "add child failed\n"); -} -#endif - static int spigen_probe(device_t dev) { + int rv; + /* + * By default we only bid to attach if specifically added by our parent + * (usually via hint.spigen.#.at=busname). On FDT systems we bid as the + * default driver based on being configured in the FDT data. + */ + rv = BUS_PROBE_NOWILDCARD; + +#ifdef FDT + if (ofw_bus_status_okay(dev) && + ofw_bus_is_compatible(dev, "freebsd,spigen")) + rv = BUS_PROBE_DEFAULT; +#endif + device_set_desc(dev, "SPI Generic IO"); - return (BUS_PROBE_NOWILDCARD); + return (rv); } static int spigen_open(struct cdev *, int, int, struct thread *); @@ -238,15 +245,9 @@ spigen_transfer(struct cdev *cdev, struct spigen_trans #endif transfer.tx_cmd = transfer.rx_cmd = malloc(st->st_command.iov_len, M_DEVBUF, M_WAITOK); - if (transfer.tx_cmd == NULL) - return (ENOMEM); if (st->st_data.iov_len > 0) { transfer.tx_data = transfer.rx_data = malloc(st->st_data.iov_len, M_DEVBUF, M_WAITOK); - if (transfer.tx_data == NULL) { - free(transfer.tx_cmd, M_DEVBUF); - return (ENOMEM); - } } else transfer.tx_data = transfer.rx_data = NULL; @@ -316,7 +317,6 @@ spigen_ioctl(struct cdev *cdev, u_long cmd, caddr_t da struct thread *td) { device_t dev = cdev->si_drv1; - struct spigen_softc *sc = device_get_softc(dev); int error; switch (cmd) { @@ -327,20 +327,20 @@ spigen_ioctl(struct cdev *cdev, u_long cmd, caddr_t da error = spigen_transfer_mmapped(cdev, (struct spigen_transfer_mmapped *)data); break; case SPIGENIOC_GET_CLOCK_SPEED: - mtx_lock(&sc->sc_mtx); - *(uint32_t *)data = sc->sc_clock_speed; - /* XXX TODO: implement spibus ivar call */ - mtx_unlock(&sc->sc_mtx); - error = 0; + error = spibus_get_clock(dev, (uint32_t *)data); break; case SPIGENIOC_SET_CLOCK_SPEED: - mtx_lock(&sc->sc_mtx); - sc->sc_clock_speed = *(uint32_t *)data; - mtx_unlock(&sc->sc_mtx); - error = 0; + error = spibus_set_clock(dev, *(uint32_t *)data); break; + case SPIGENIOC_GET_SPI_MODE: + error = spibus_get_mode(dev, (uint32_t *)data); + break; + case SPIGENIOC_SET_SPI_MODE: + error = spibus_set_mode(dev, *(uint32_t *)data); + break; default: - error = EOPNOTSUPP; + error = ENOTTY; + break; } return (error); } @@ -439,9 +439,6 @@ static devclass_t spigen_devclass; static device_method_t spigen_methods[] = { /* Device interface */ -#ifdef FDT - DEVMETHOD(device_identify, spigen_identify), -#endif DEVMETHOD(device_probe, spigen_probe), DEVMETHOD(device_attach, spigen_attach), DEVMETHOD(device_detach, spigen_detach), @@ -456,3 +453,4 @@ static driver_t spigen_driver = { }; DRIVER_MODULE(spigen, spibus, spigen_driver, spigen_devclass, 0, 0); +MODULE_DEPEND(spigen, spibus, 1, 1, 1); Modified: stable/11/sys/modules/spigen/Makefile ============================================================================== --- stable/11/sys/modules/spigen/Makefile Tue Apr 24 16:45:13 2018 (r332941) +++ stable/11/sys/modules/spigen/Makefile Tue Apr 24 17:00:08 2018 (r332942) @@ -3,6 +3,16 @@ .PATH: ${SRCTOP}/sys/dev/spibus KMOD= spigen SRCS= spigen.c -SRCS+= device_if.h bus_if.h opt_platform.h spibus_if.h + +# Generated files... +SRCS+= \ + bus_if.h \ + device_if.h \ + opt_platform.h \ + spibus_if.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif .include Modified: stable/11/sys/sys/spigenio.h ============================================================================== --- stable/11/sys/sys/spigenio.h Tue Apr 24 16:45:13 2018 (r332941) +++ stable/11/sys/sys/spigenio.h Tue Apr 24 17:00:08 2018 (r332942) @@ -48,5 +48,7 @@ struct spigen_transfer_mmapped { struct spigen_transfer_mmapped) #define SPIGENIOC_GET_CLOCK_SPEED _IOR(SPIGENIOC_BASE, 2, uint32_t) #define SPIGENIOC_SET_CLOCK_SPEED _IOW(SPIGENIOC_BASE, 3, uint32_t) +#define SPIGENIOC_GET_SPI_MODE _IOR(SPIGENIOC_BASE, 4, uint32_t) +#define SPIGENIOC_SET_SPI_MODE _IOW(SPIGENIOC_BASE, 5, uint32_t) #endif /* !_SYS_SPIGENIO_H_ */ From owner-svn-src-all@freebsd.org Tue Apr 24 17:13:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EEA0FAC634; Tue, 24 Apr 2018 17:13:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4F1A7B5F1; Tue, 24 Apr 2018 17:13:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA3F11608A; Tue, 24 Apr 2018 17:13:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OHDVIB032399; Tue, 24 Apr 2018 17:13:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHDVjv032397; Tue, 24 Apr 2018 17:13:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804241713.w3OHDVjv032397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 24 Apr 2018 17:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332943 - stable/11/usr.sbin/daemon X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/usr.sbin/daemon X-SVN-Commit-Revision: 332943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:13:32 -0000 Author: ian Date: Tue Apr 24 17:13:31 2018 New Revision: 332943 URL: https://svnweb.freebsd.org/changeset/base/332943 Log: MFC r332518, r332527 r332518: Add an option to daemon(8) to specify a delay between restarts of a supervised program. The existing -r option has a hard-coded delay of one second. This change adds a -R option which takes a delay in seconds. This can be used to prevent log spam and rapid restarts, similar to init(8)'s behavior of adding a delay between rapid restarts when it's supervising a program. r332527: Fix cut-and-pasted line to have the right option letter. Modified: stable/11/usr.sbin/daemon/daemon.8 stable/11/usr.sbin/daemon/daemon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/daemon/daemon.8 ============================================================================== --- stable/11/usr.sbin/daemon/daemon.8 Tue Apr 24 17:00:08 2018 (r332942) +++ stable/11/usr.sbin/daemon/daemon.8 Tue Apr 24 17:13:31 2018 (r332943) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 22, 2016 +.Dd April 15, 2018 .Dt DAEMON 8 .Os .Sh NAME @@ -44,6 +44,7 @@ .Op Fl s Ar syslog_priority .Op Fl T Ar syslog_tag .Op Fl l Ar syslog_facility +.Op Fl R Ar restart_delay_seconds .Ar command arguments ... .Sh DESCRIPTION The @@ -114,7 +115,11 @@ regardless of whether the .Fl u option is used or not. .It Fl r -Supervise and restart the program if it has been terminated. +Supervise and restart the program after a one-second delay if it has +been terminated. +.It Fl R restart_delay_seconds +Supervise and restart the program after the specified delay +if it has been terminated. .It Fl t Ar title Set the title for the daemon process. The default is the daemonized invocation. Modified: stable/11/usr.sbin/daemon/daemon.c ============================================================================== --- stable/11/usr.sbin/daemon/daemon.c Tue Apr 24 17:00:08 2018 (r332942) +++ stable/11/usr.sbin/daemon/daemon.c Tue Apr 24 17:13:31 2018 (r332943) @@ -99,7 +99,7 @@ main(int argc, char *argv[]) dosyslog = 0; outfn = NULL; title = NULL; - while ((ch = getopt(argc, argv, "cfSp:P:ru:o:s:l:t:l:m:T:")) != -1) { + while ((ch = getopt(argc, argv, "cfSp:P:ru:o:s:l:t:l:m:R:T:")) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -130,6 +130,11 @@ main(int argc, char *argv[]) case 'r': restart = 1; break; + case 'R': + restart = strtol(optarg, &p, 0); + if (p == optarg || restart < 1) + errx(6, "invalid restart delay"); + break; case 's': logpri = get_log_mapping(optarg, prioritynames); if (logpri == -1) @@ -359,7 +364,7 @@ restart: goto exit; } if (restart && !terminate) { - daemon_sleep(1, 0); + daemon_sleep(restart, 0); close(pfd[0]); pfd[0] = -1; goto restart; @@ -558,7 +563,7 @@ usage(void) "usage: daemon [-cfrS] [-p child_pidfile] [-P supervisor_pidfile]\n" " [-u user] [-o output_file] [-t title]\n" " [-l syslog_facility] [-s syslog_priority]\n" - " [-T syslog_tag] [-m output_mask]\n" + " [-T syslog_tag] [-m output_mask] [-R restart_delay_secs]\n" "command arguments ...\n"); exit(1); } From owner-svn-src-all@freebsd.org Tue Apr 24 17:22:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 17:24:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 17:31:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 17:33:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA9C7FACE27; Tue, 24 Apr 2018 17:33:30 +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 56A327ED01; Tue, 24 Apr 2018 17:33:30 +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 51A03163CC; Tue, 24 Apr 2018 17:33:30 +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 w3OHXUTm042364; Tue, 24 Apr 2018 17:33:30 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHXUwP042363; Tue, 24 Apr 2018 17:33:30 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804241733.w3OHXUwP042363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 24 Apr 2018 17:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332946 - stable/11/usr.bin X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/usr.bin X-SVN-Commit-Revision: 332946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:33:30 -0000 Author: benno Date: Tue Apr 24 17:33:30 2018 New Revision: 332946 URL: https://svnweb.freebsd.org/changeset/base/332946 Log: MFC r331949, r332437, r332438 r331949: Add the etdump utility for dumping El Torito boot catalog information. This can be used to check existing images but will be used in the future to find EFI ESP images placed in El Torito catalogs so they can be used for hybrid boot purposes. r332427: Check the return value of fseek. r332438: Remove a debugging printf that crept in. Sponsored by: iXsystems, Inc. Modified: stable/11/usr.bin/Makefile Modified: stable/11/usr.bin/Makefile ============================================================================== --- stable/11/usr.bin/Makefile Tue Apr 24 17:31:20 2018 (r332945) +++ stable/11/usr.bin/Makefile Tue Apr 24 17:33:30 2018 (r332946) @@ -41,6 +41,7 @@ SUBDIR= alias \ elfdump \ enigma \ env \ + etdump \ expand \ false \ fetch \ From owner-svn-src-all@freebsd.org Tue Apr 24 17:35:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D65E8FACEC7; Tue, 24 Apr 2018 17:35:14 +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 8A3237EE93; Tue, 24 Apr 2018 17:35:14 +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 84C8F163CE; Tue, 24 Apr 2018 17:35:14 +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 w3OHZEtZ042488; Tue, 24 Apr 2018 17:35:14 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHZECo042482; Tue, 24 Apr 2018 17:35:14 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804241735.w3OHZECo042482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 24 Apr 2018 17:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332947 - stable/11/usr.bin/etdump X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/usr.bin/etdump X-SVN-Commit-Revision: 332947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:35:15 -0000 Author: benno Date: Tue Apr 24 17:35:13 2018 New Revision: 332947 URL: https://svnweb.freebsd.org/changeset/base/332947 Log: Actually MFC r331949, r332437, r332438 (Previous commit didn't have new files added.) r331949: Add the etdump utility for dumping El Torito boot catalog information. This can be used to check existing images but will be used in the future to find EFI ESP images placed in El Torito catalogs so they can be used for hybrid boot purposes. r332427: Check the return value of fseek. r332438: Remove a debugging printf that crept in. Sponsored by: iXsystems, Inc. Pointy hat to: benno Added: stable/11/usr.bin/etdump/ stable/11/usr.bin/etdump/Makefile (contents, props changed) stable/11/usr.bin/etdump/etdump.1 (contents, props changed) stable/11/usr.bin/etdump/etdump.c (contents, props changed) stable/11/usr.bin/etdump/etdump.h (contents, props changed) stable/11/usr.bin/etdump/output_shell.c (contents, props changed) stable/11/usr.bin/etdump/output_text.c (contents, props changed) Added: stable/11/usr.bin/etdump/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/etdump/Makefile Tue Apr 24 17:35:13 2018 (r332947) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +PROG= etdump + +MAKEFS_SRC= ${SRCTOP}/usr.sbin/makefs + +CFLAGS+= -I${SRCTOP}/sys/fs/cd9660 -I${MAKEFS_SRC} \ + -I${MAKEFS_SRC}/cd9660 + +.PATH: ${MAKEFS_SRC}/cd9660 + +SRCS= etdump.c output_shell.c output_text.c cd9660_conversion.c + +.include Added: stable/11/usr.bin/etdump/etdump.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/etdump/etdump.1 Tue Apr 24 17:35:13 2018 (r332947) @@ -0,0 +1,104 @@ +.\" Copyright (c) 2018 iXsystems, Inc +.\" 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 3, 2018 +.Dt ETDUMP 8 +.Os +.Sh NAME +.Nm etdump +.Nd Dump El Torito boot catalog information from ISO images +.Sh SYNOPSIS +.Nm +.Op Fl f Ar format +.Op Fl o Ar file +.Ar +.Sh DESCRIPTION +This program reads El Torito boot catalog information from an ISO image and +outputs it in various formats. +It can be used to check the catalog in an image or to output catalog data in +a format that can be used by other tools such as shell scripts. +.Pp +Supported options are: +.Bl -tag -width flag +.It Fl f Ar format Fl -format Ar format +Select the output format. +Supported output formats are: +.Bl -tag -width shell -offset indent +.It Sy text +Human-readable text (default) +.It Sy shell +Each boot entry is emitted as a string suitable for passing to a sh-compatible +eval command. +The variables emitted are: +.Bl -tag -width et_platform -offset indent +.It et_platform +The platform ID from the section header. +Set to 'default' for the initial (default) entry. +.It et_system +The system ID from the boot entry. +.It et_lba +The starting LBA (2048-byte blocks) of the boot image. +.It et_sectors +The number of sectors (512-byte sectors) that comprise the boot image. +.El +.El +.It Fl o Ar file Fl -output Ar file +Write output to +.Ar file . +If '-' is specified then standard out is used. +.El +.Sh EXAMPLES +To see what entries are in a given boot catalog run +.Nm +passing the filename of the image as an argument like so: +.Bd -literal -offset indent +% etdump bootonly.iso +Image in bootonly.iso +Default entry + System i386 + Start LBA 420 (0x1a4), sector count 4 (0x4) + Media type: no emulation + +Section header: efi, final + Section entry + System i386 + Start LBA 20 (0x14), sector count 1600 (0x640) + Media type: no emulation +.Ed +.Pp +To use the output in a shell script a for loop can be used to iterate over the +entries returned using eval: +.Bd -literal -offset indent +for entry in `etdump --format shell bootonly.iso`; do + eval $entry + echo $et_platform $et_system $et_lba $et_sectors +done +.Ed +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 12.0 . Added: stable/11/usr.bin/etdump/etdump.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/etdump/etdump.c Tue Apr 24 17:35:13 2018 (r332947) @@ -0,0 +1,269 @@ +/*- + * Copyright (c) 2018 iXsystems, Inc. + * 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 "cd9660.h" +#include "cd9660_eltorito.h" + +#include "etdump.h" + +const char * +system_id_string(u_char system_id) +{ + + switch (system_id) { + case ET_SYS_X86: + return ("i386"); + case ET_SYS_PPC: + return ("powerpc"); + case ET_SYS_MAC: + return ("mac"); + case ET_SYS_EFI: + return ("efi"); + default: + return ("invalid"); + } +} + +const char * +media_type_string(u_char media_type) +{ + + switch (media_type) { + case ET_MEDIA_NOEM: + return ("no emulation"); + case ET_MEDIA_12FDD: + return ("1.2MB FDD"); + case ET_MEDIA_144FDD: + return ("1.44MB FDD"); + case ET_MEDIA_288FDD: + return ("2.88MB FDD"); + case ET_MEDIA_HDD: + return ("HDD"); + default: + return ("invalid"); + } +} + +static int +read_sector(FILE *iso, daddr_t sector, char *buffer) +{ + + if (fseek(iso, sector * ISO_DEFAULT_BLOCK_SIZE, SEEK_SET) != 0) { + return (errno); + } + if (fread(buffer, ISO_DEFAULT_BLOCK_SIZE, 1, iso) != 1) { + return (errno); + } + return (0); +} + +static bool +boot_catalog_valid(char *entry) +{ + boot_catalog_validation_entry *ve; + int16_t checksum, sum; + unsigned char *csptr; + size_t i; + + ve = (boot_catalog_validation_entry *)entry; + + checksum = isonum_721(ve->checksum); + cd9660_721(0, ve->checksum); + csptr = (unsigned char *)ve; + + for (i = sum = 0; i < sizeof(*ve); i += 2) { + sum += (int16_t)csptr[i]; + sum += 256 * (int16_t)csptr[i + 1]; + } + if (sum + checksum != 0) { + return (false); + } + + cd9660_721(checksum, ve->checksum); + return (true); +} + +static int +dump_section(char *buffer, size_t offset, FILE *outfile, const char *filename, + struct outputter *outputter) +{ + boot_catalog_section_header *sh; + u_char platform_id; + int i; + size_t entry_offset; + boot_catalog_section_entry *entry; + + sh = (boot_catalog_section_header *)&buffer[offset]; + if (outputter->output_section != NULL) { + outputter->output_section(outfile, filename, sh); + } + + platform_id = sh->platform_id[0]; + + if (outputter->output_entry != NULL) { + for (i = 1; i <= (int)sh->num_section_entries[0]; i++) { + entry_offset = offset + i * ET_BOOT_ENTRY_SIZE; + entry = + (boot_catalog_section_entry *)&buffer[entry_offset]; + outputter->output_entry(outfile, filename, entry, + platform_id, false); + } + } + + return (1 + (int)sh->num_section_entries[0]); +} + +static void +dump_eltorito(FILE *iso, const char *filename, FILE *outfile, + struct outputter *outputter) +{ + char buffer[ISO_DEFAULT_BLOCK_SIZE], *entry; + boot_volume_descriptor *bvd; + daddr_t boot_catalog; + size_t offset; + int entry_count; + + if (read_sector(iso, 17, buffer) != 0) + err(1, "failed to read from image"); + + bvd = (boot_volume_descriptor *)buffer; + if (memcmp(bvd->identifier, ISO_VOLUME_DESCRIPTOR_STANDARD_ID, 5) != 0) + warnx("%s: not a valid ISO", filename); + if (bvd->boot_record_indicator[0] != ISO_VOLUME_DESCRIPTOR_BOOT) + warnx("%s: not an El Torito bootable ISO", filename); + if (memcmp(bvd->boot_system_identifier, ET_ID, 23) != 0) + warnx("%s: not an El Torito bootable ISO", filename); + + boot_catalog = isonum_731(bvd->boot_catalog_pointer); + + if (read_sector(iso, boot_catalog, buffer) != 0) + err(1, "failed to read from image"); + + entry = buffer; + offset = 0; + + if (!boot_catalog_valid(entry)) + warnx("%s: boot catalog checksum is invalid", filename); + + if (outputter->output_image != NULL) + outputter->output_image(outfile, filename, bvd); + + offset += ET_BOOT_ENTRY_SIZE; + entry = &buffer[offset]; + if (outputter->output_entry != NULL) + outputter->output_entry(outfile, filename, + (boot_catalog_section_entry *)entry, 0, true); + + offset += ET_BOOT_ENTRY_SIZE; + + while (offset < ISO_DEFAULT_BLOCK_SIZE) { + entry = &buffer[offset]; + + if ((uint8_t)entry[0] != ET_SECTION_HEADER_MORE && + (uint8_t)entry[0] != ET_SECTION_HEADER_LAST) + break; + + entry_count = dump_section(buffer, offset, outfile, filename, + outputter); + + offset += entry_count * ET_BOOT_ENTRY_SIZE; + } +} + +static void +usage(const char *progname) +{ + char *path; + + path = strdup(progname); + + fprintf(stderr, "usage: %s [-f format] [-o filename] filename [...]\n", + basename(path)); + fprintf(stderr, "\tsupported output formats: shell, text\n"); + exit(1); +} + +int +main(int argc, char **argv) +{ + int ch, i; + FILE *outfile, *iso; + struct outputter *outputter; + + outfile = stdout; + outputter = output_text; + + static struct option longopts[] = { + { "format", required_argument, NULL, 'f' }, + { "output", required_argument, NULL, 'o' }, + { NULL, 0, NULL, 0 }, + }; + + while ((ch = getopt_long(argc, argv, "f:o:", longopts, NULL)) != -1) { + switch (ch) { + case 'f': + if (strcmp(optarg, "shell") == 0) + outputter = output_shell; + else if (strcmp(optarg, "text") == 0) + outputter = output_text; + else + usage(argv[0]); + break; + case 'o': + if (strcmp(optarg, "-") == 0) { + outfile = stdout; + } else if ((outfile = fopen(optarg, "w")) == NULL) { + err(1, "unable to open %s for output", optarg); + } + break; + default: + usage(argv[0]); + } + } + + argc -= optind; + argv += optind; + + for (i = 0; i < argc; i++) { + if (strcmp(argv[i], "-") == 0) { + iso = stdin; + } else { + iso = fopen(argv[i], "r"); + if (iso == NULL) + err(1, "could not open %s", argv[1]); + } + dump_eltorito(iso, argv[i], outfile, outputter); + } +} Added: stable/11/usr.bin/etdump/etdump.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/etdump/etdump.h Tue Apr 24 17:35:13 2018 (r332947) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2018 iXsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ETDUMP_H_ +#define _ETDUMP_H_ + +struct outputter { + void (*output_image)(FILE *outfile, const char *filename, + boot_volume_descriptor *bvd); + void (*output_section)(FILE *outfile, const char *filename, + boot_catalog_section_header *bcsh); + void (*output_entry)(FILE *outfile, const char *filename, + boot_catalog_section_entry *bcse, + u_char platform_id, bool initial); +}; + +extern struct outputter *output_text; +extern struct outputter *output_shell; + +const char *system_id_string(u_char system_id); +const char *media_type_string(u_char media_type); + +#endif /* _ETDUMP_H_ */ + Added: stable/11/usr.bin/etdump/output_shell.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/etdump/output_shell.c Tue Apr 24 17:35:13 2018 (r332947) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2018 iXsystems, Inc. + * 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 "cd9660.h" +#include "cd9660_eltorito.h" + +#include "etdump.h" + +static void +output_entry(FILE *outfile, const char *filename __unused, + boot_catalog_section_entry *bcse, u_char platform_id, bool initial) +{ + const char *platform; + + switch (bcse->boot_indicator[0]) { + case ET_BOOTABLE: + break; + case ET_NOT_BOOTABLE: + default: + return; + } + + if (initial) + platform = "default"; + else + platform = system_id_string(platform_id); + + fprintf(outfile, + "et_platform=%s;et_system=%s;et_lba=%d;et_sectors=%d\n", + platform, system_id_string(bcse->system_type[0]), + isonum_731(bcse->load_rba), isonum_721(bcse->sector_count)); +} + +static struct outputter _output_shell = { + .output_image = NULL, + .output_section = NULL, + .output_entry = output_entry, +}; + +struct outputter *output_shell = &_output_shell; Added: stable/11/usr.bin/etdump/output_text.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/etdump/output_text.c Tue Apr 24 17:35:13 2018 (r332947) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 2018 iXsystems, Inc. + * 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 "cd9660.h" +#include "cd9660_eltorito.h" + +#include "etdump.h" + +static void +output_image(FILE *outfile, const char *filename, boot_volume_descriptor *bvd __unused) +{ + + fprintf(outfile, "Image in %s\n", filename); +} + +static void +output_section(FILE *outfile, const char *filename __unused, + boot_catalog_section_header *bcsh) +{ + + fprintf(outfile, "\nSection header: %s", + system_id_string(bcsh->platform_id[0])); + + if (bcsh->header_indicator[0] == ET_SECTION_HEADER_LAST) + fprintf(outfile, ", final\n"); + else + fprintf(outfile, "\n"); +} + +static void +output_entry(FILE *outfile, const char *filename __unused, + boot_catalog_section_entry *bcse, u_char platform_id __unused, + bool initial) +{ + const char *indent; + + switch (bcse->boot_indicator[0]) { + case ET_BOOTABLE: + break; + case ET_NOT_BOOTABLE: + default: + return; + } + + if (initial) { + fprintf(outfile, "Default entry\n"); + indent = "\t"; + } else { + fprintf(outfile, "\tSection entry\n"); + indent = "\t\t"; + } + + fprintf(outfile, "%sSystem %s\n", indent, + system_id_string(bcse->system_type[0])); + fprintf(outfile, "%sStart LBA %d (0x%x), sector count %d (0x%x)\n", + indent, isonum_731(bcse->load_rba), isonum_731(bcse->load_rba), + isonum_721(bcse->sector_count), isonum_721(bcse->sector_count)); + fprintf(outfile, "%sMedia type: %s\n", indent, + media_type_string(bcse->media_type[0])); +} + +static struct outputter _output_text = { + .output_image = output_image, + .output_section = output_section, + .output_entry = output_entry, +}; + +struct outputter *output_text = &_output_text; From owner-svn-src-all@freebsd.org Tue Apr 24 17:37:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E229EFACF9D; Tue, 24 Apr 2018 17:37:30 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93F807F128; Tue, 24 Apr 2018 17:37:30 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76285163D1; Tue, 24 Apr 2018 17:37:30 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OHbUgu042738; Tue, 24 Apr 2018 17:37:30 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHbUmj042734; Tue, 24 Apr 2018 17:37:30 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201804241737.w3OHbUmj042734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Tue, 24 Apr 2018 17:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332948 - stable/11/contrib/top X-SVN-Group: stable-11 X-SVN-Commit-Author: lidl X-SVN-Commit-Paths: stable/11/contrib/top X-SVN-Commit-Revision: 332948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:37:31 -0000 Author: lidl Date: Tue Apr 24 17:37:29 2018 New Revision: 332948 URL: https://svnweb.freebsd.org/changeset/base/332948 Log: MFC r332671: top: fix warnings from clang/gcc Add includes for and where necessary, and rename a few internal functions to have a "top_" prefix to avoid clashes with standard names from curses.h/termcap.h headers. Top now compiles without warnings on both gcc and clang. Modified: stable/11/contrib/top/display.c stable/11/contrib/top/screen.c stable/11/contrib/top/screen.h stable/11/contrib/top/top.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/top/display.c ============================================================================== --- stable/11/contrib/top/display.c Tue Apr 24 17:35:13 2018 (r332947) +++ stable/11/contrib/top/display.c Tue Apr 24 17:37:29 2018 (r332948) @@ -32,7 +32,9 @@ #include +#include #include +#include #include #include @@ -255,7 +257,7 @@ double *avenrun; register int i; /* i_loadave also clears the screen, since it is first */ - clear(); + top_clear(); /* mpid == -1 implies this system doesn't have an _mpid */ if (mpid != -1) @@ -796,7 +798,7 @@ i_message() } if (next_msg[0] != '\0') { - standout(next_msg); + top_standout(next_msg); msglen = strlen(next_msg); next_msg[0] = '\0'; } @@ -1076,7 +1078,7 @@ caddr_t a1, a2, a3; i = strlen(next_msg); if ((type & MT_delayed) == 0) { - type & MT_standout ? standout(next_msg) : + type & MT_standout ? top_standout(next_msg) : fputs(next_msg, stdout); (void) clear_eol(msglen - i); msglen = i; @@ -1088,7 +1090,7 @@ caddr_t a1, a2, a3; { if ((type & MT_delayed) == 0) { - type & MT_standout ? standout(next_msg) : fputs(next_msg, stdout); + type & MT_standout ? top_standout(next_msg) : fputs(next_msg, stdout); msglen = strlen(next_msg); next_msg[0] = '\0'; } Modified: stable/11/contrib/top/screen.c ============================================================================== --- stable/11/contrib/top/screen.c Tue Apr 24 17:35:13 2018 (r332947) +++ stable/11/contrib/top/screen.c Tue Apr 24 17:37:29 2018 (r332948) @@ -45,6 +45,8 @@ # endif # endif #endif +#include +#include #include "screen.h" #include "boolean.h" @@ -432,10 +434,7 @@ get_screensize() } void -standout(msg) - -char *msg; - +top_standout(char *msg) { if (smart_terminal) { @@ -450,8 +449,7 @@ char *msg; } void -clear() - +top_clear() { if (smart_terminal) { @@ -460,10 +458,7 @@ clear() } int -clear_eol(len) - -int len; - +clear_eol(int len) { if (smart_terminal && !overstrike && len > 0) { @@ -496,12 +491,8 @@ go_home() /* This has to be defined as a subroutine for tputs (instead of a macro) */ -void -putstdout(ch) - -char ch; - +int +putstdout(int ch) { - putchar(ch); + return putchar(ch); } - Modified: stable/11/contrib/top/screen.h ============================================================================== --- stable/11/contrib/top/screen.h Tue Apr 24 17:35:13 2018 (r332947) +++ stable/11/contrib/top/screen.h Tue Apr 24 17:37:29 2018 (r332948) @@ -28,10 +28,10 @@ extern int screen_length; extern int screen_width; /* a function that puts a single character on stdout */ -void putstdout(char ch); +int putstdout(int ch); int clear_eol(int len); -void standout(char *msg); -void clear(void); +void top_standout(char *msg); +void top_clear(void); void go_home(void); void reinit_screen(void); void get_screensize(void); Modified: stable/11/contrib/top/top.c ============================================================================== --- stable/11/contrib/top/top.c Tue Apr 24 17:35:13 2018 (r332947) +++ stable/11/contrib/top/top.c Tue Apr 24 17:37:29 2018 (r332948) @@ -39,6 +39,7 @@ char *copyright = #include #include +#include #include #include #include @@ -79,7 +80,7 @@ int pcpu_stats = No; sigret_t leave(); sigret_t tstop(); #ifdef SIGWINCH -sigret_t winch(); +sigret_t top_winch(int); #endif volatile sig_atomic_t leaveflag; @@ -681,7 +682,7 @@ char *argv[]; (void) signal(SIGQUIT, leave); (void) signal(SIGTSTP, tstop); #ifdef SIGWINCH - (void) signal(SIGWINCH, winch); + (void) signal(SIGWINCH, top_winch); #endif #ifdef SIGRELSE sigrelse(SIGINT); @@ -896,7 +897,7 @@ restart: max_topn = display_resize(); /* reset the signal handler */ - (void) signal(SIGWINCH, winch); + (void) signal(SIGWINCH, top_winch); reset_display(); winchflag = 0; @@ -970,9 +971,9 @@ restart: case CMD_help1: /* help */ case CMD_help2: reset_display(); - clear(); + top_clear(); show_help(); - standout("Hit any key to continue: "); + top_standout("Hit any key to continue: "); fflush(stdout); (void) read(0, &ch, 1); break; @@ -988,9 +989,9 @@ restart: else { reset_display(); - clear(); + top_clear(); show_errors(); - standout("Hit any key to continue: "); + top_standout("Hit any key to continue: "); fflush(stdout); (void) read(0, &ch, 1); } @@ -1299,10 +1300,7 @@ int i; } #ifdef SIGWINCH -sigret_t winch(i) /* SIGWINCH handler */ - -int i; - +sigret_t top_winch(int i) /* SIGWINCH handler */ { winchflag = 1; } From owner-svn-src-all@freebsd.org Tue Apr 24 17:39:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 17:40:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 17:42:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 17:46:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 17:53:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 17:53:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A320FFAD8BF; Tue, 24 Apr 2018 17:53:29 +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 5CCDB842FF; Tue, 24 Apr 2018 17:53:28 +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 5477E1672B; Tue, 24 Apr 2018 17:53:28 +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 w3OHrSwU052913; Tue, 24 Apr 2018 17:53:28 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OHrS9D052911; Tue, 24 Apr 2018 17:53:28 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804241753.w3OHrS9D052911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 24 Apr 2018 17:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332952 - stable/11/usr.bin/mkimg X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/usr.bin/mkimg X-SVN-Commit-Revision: 332952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 17:53:29 -0000 Author: benno Date: Tue Apr 24 17:53:27 2018 New Revision: 332952 URL: https://svnweb.freebsd.org/changeset/base/332952 Log: MFC r332436, r332440 r332436: Add the ability to specify absolute and relative offsets to size partitions. To create hybrid boot media we want to specify a partition at a known location. This extends the syntax of size partitions to include an optional offset that can be absolute or relative. It also introduces validation to make sure that this hasn't resulted in overlapping partitions. I haven't added this to the file and process partition specifications yet but the mechanics are designed such that if someone comes up with a good way of specifying the offset it will be fairly easy to add in. r332440: Fix a conditional that got mucked up. Sponsored by: iXsystems, Inc. Modified: stable/11/usr.bin/mkimg/mkimg.c stable/11/usr.bin/mkimg/scheme.h Modified: stable/11/usr.bin/mkimg/mkimg.c ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.c Tue Apr 24 17:53:16 2018 (r332951) +++ stable/11/usr.bin/mkimg/mkimg.c Tue Apr 24 17:53:27 2018 (r332952) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -170,13 +171,14 @@ usage(const char *why) print_schemes(1); fputc('\n', stderr); fprintf(stderr, " partition specification:\n"); - fprintf(stderr, "\t[/]::\t- empty partition of given " - "size\n"); - fprintf(stderr, "\t[/]:=\t- partition content and size " - "are determined\n\t\t\t\t by the named file\n"); - fprintf(stderr, "\t[/]:-\t- partition content and size " - "are taken from\n\t\t\t\t the output of the command to run\n"); - fprintf(stderr, "\t-\t\t\t- unused partition entry\n"); + fprintf(stderr, "\t[/]::[:[+]]\t- " + "empty partition of given size and\n\t\t\t\t\t" + " optional relative or absolute offset\n"); + fprintf(stderr, "\t[/]:=\t\t- partition content and size " + "are\n\t\t\t\t\t determined by the named file\n"); + fprintf(stderr, "\t[/]:-\t\t- partition content and size " + "are taken\n\t\t\t\t\t from the output of the command to run\n"); + fprintf(stderr, "\t-\t\t\t\t- unused partition entry\n"); fprintf(stderr, "\t where:\n"); fprintf(stderr, "\t\t\t- scheme neutral partition type\n"); fprintf(stderr, "\t\t\t- optional scheme-dependent partition " @@ -397,12 +399,48 @@ capacity_resize(lba_t end) } static void +mkimg_validate(void) +{ + struct part *part, *part2; + lba_t start, end, start2, end2; + int i, j; + + i = 0; + + TAILQ_FOREACH(part, &partlist, link) { + start = part->block; + end = part->block + part->size; + j = i + 1; + part2 = TAILQ_NEXT(part, link); + if (part2 == NULL) + break; + + TAILQ_FOREACH_FROM(part2, &partlist, link) { + start2 = part2->block; + end2 = part2->block + part2->size; + + if ((start >= start2 && start < end2) || + (end > start2 && end <= end2)) { + errx(1, "partition %d overlaps partition %d", + i, j); + } + + j++; + } + + i++; + } +} + +static void mkimg(void) { FILE *fp; struct part *part; - lba_t block; - off_t bytesize; + lba_t block, blkoffset; + off_t bytesize, byteoffset; + char *size, *offset; + bool abs_offset; int error, fd; /* First check partition information */ @@ -413,17 +451,46 @@ mkimg(void) } block = scheme_metadata(SCHEME_META_IMG_START, 0); + abs_offset = false; TAILQ_FOREACH(part, &partlist, link) { - block = scheme_metadata(SCHEME_META_PART_BEFORE, block); - if (verbose) - fprintf(stderr, "partition %d: starting block %llu " - "... ", part->index + 1, (long long)block); - part->block = block; + byteoffset = blkoffset = 0; + abs_offset = false; + + /* Look for an offset. Set size too if we can. */ switch (part->kind) { case PART_KIND_SIZE: - if (expand_number(part->contents, &bytesize) == -1) + offset = part->contents; + size = strsep(&offset, ":"); + if (expand_number(size, &bytesize) == -1) error = errno; + if (offset != NULL) { + if (*offset != '+') + abs_offset = true; + else + offset++; + if (expand_number(offset, &byteoffset) == -1) + error = errno; + } break; + } + + /* Work out exactly where the partition starts. */ + blkoffset = (byteoffset + secsz - 1) / secsz; + if (abs_offset) { + part->block = scheme_metadata(SCHEME_META_PART_ABSOLUTE, + blkoffset); + } else { + block = scheme_metadata(SCHEME_META_PART_BEFORE, + block + blkoffset); + part->block = block; + } + + if (verbose) + fprintf(stderr, "partition %d: starting block %llu " + "... ", part->index + 1, (long long)part->block); + + /* Pull in partition contents, set size if we haven't yet. */ + switch (part->kind) { case PART_KIND_FILE: fd = open(part->contents, O_RDONLY, 0); if (fd != -1) { @@ -449,10 +516,25 @@ mkimg(void) bytesize = part->size * secsz; fprintf(stderr, "size %llu bytes (%llu blocks)\n", (long long)bytesize, (long long)part->size); + if (abs_offset) { + fprintf(stderr, + " location %llu bytes (%llu blocks)\n", + (long long)byteoffset, + (long long)blkoffset); + } else if (blkoffset > 0) { + fprintf(stderr, + " offset %llu bytes (%llu blocks)\n", + (long long)byteoffset, + (long long)blkoffset); + } } - block = scheme_metadata(SCHEME_META_PART_AFTER, - part->block + part->size); + if (!abs_offset) { + block = scheme_metadata(SCHEME_META_PART_AFTER, + part->block + part->size); + } } + + mkimg_validate(); block = scheme_metadata(SCHEME_META_IMG_END, block); error = image_set_size(block); Modified: stable/11/usr.bin/mkimg/scheme.h ============================================================================== --- stable/11/usr.bin/mkimg/scheme.h Tue Apr 24 17:53:16 2018 (r332951) +++ stable/11/usr.bin/mkimg/scheme.h Tue Apr 24 17:53:27 2018 (r332952) @@ -65,10 +65,11 @@ struct mkimg_scheme { const char *description; struct mkimg_alias *aliases; lba_t (*metadata)(u_int, lba_t); -#define SCHEME_META_IMG_START 1 -#define SCHEME_META_IMG_END 2 -#define SCHEME_META_PART_BEFORE 3 -#define SCHEME_META_PART_AFTER 4 +#define SCHEME_META_IMG_START 1 +#define SCHEME_META_IMG_END 2 +#define SCHEME_META_PART_BEFORE 3 +#define SCHEME_META_PART_AFTER 4 +#define SCHEME_META_PART_ABSOLUTE 5 int (*write)(lba_t, void *); u_int nparts; u_int labellen; From owner-svn-src-all@freebsd.org Tue Apr 24 18:10:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04EA1FADFF3; Tue, 24 Apr 2018 18:10:05 +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 AAB6D683FF; Tue, 24 Apr 2018 18:10:04 +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 A522C168DC; Tue, 24 Apr 2018 18:10:04 +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 w3OIA4v0058375; Tue, 24 Apr 2018 18:10:04 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIA4cU058374; Tue, 24 Apr 2018 18:10:04 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804241810.w3OIA4cU058374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 24 Apr 2018 18:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332953 - stable/11/stand/i386/gptboot X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/stand/i386/gptboot X-SVN-Commit-Revision: 332953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:10:05 -0000 Author: benno Date: Tue Apr 24 18:10:04 2018 New Revision: 332953 URL: https://svnweb.freebsd.org/changeset/base/332953 Log: MFC r332082 Use consistent whitespace. Sponsored by: iXsystems, Inc. Modified: stable/11/stand/i386/gptboot/gptboot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/gptboot/gptboot.c ============================================================================== --- stable/11/stand/i386/gptboot/gptboot.c Tue Apr 24 17:53:27 2018 (r332952) +++ stable/11/stand/i386/gptboot/gptboot.c Tue Apr 24 18:10:04 2018 (r332953) @@ -132,87 +132,93 @@ xfsread(ufs_ino_t inode, void *buf, size_t nbyte) static void bios_getmem(void) { - uint64_t size; + uint64_t size; - /* Parse system memory map */ - v86.ebx = 0; - do { - v86.ctl = V86_FLAGS; - v86.addr = MEM_EXT; /* int 0x15 function 0xe820*/ - v86.eax = 0xe820; - v86.ecx = sizeof(struct bios_smap); - v86.edx = SMAP_SIG; - v86.es = VTOPSEG(&smap); - v86.edi = VTOPOFF(&smap); - v86int(); - if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) - break; - /* look for a low-memory segment that's large enough */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && - (smap.length >= (512 * 1024))) - bios_basemem = smap.length; - /* look for the first segment in 'extended' memory */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { - bios_extmem = smap.length; - } + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = MEM_EXT; /* int 0x15 function 0xe820*/ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); + v86int(); + if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && + (smap.base == 0x100000)) { + bios_extmem = smap.length; + } - /* - * Look for the largest segment in 'extended' memory beyond - * 1MB but below 4GB. - */ - if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && - (smap.base < 0x100000000ull)) { - size = smap.length; + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && + (smap.base > 0x100000) && (smap.base < 0x100000000ull)) { + size = smap.length; - /* - * If this segment crosses the 4GB boundary, truncate it. - */ - if (smap.base + size > 0x100000000ull) - size = 0x100000000ull - smap.base; + /* + * If this segment crosses the 4GB boundary, + * truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; - if (size > high_heap_size) { - high_heap_size = size; - high_heap_base = smap.base; - } - } - } while (v86.ebx != 0); + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); - /* Fall back to the old compatibility function for base memory */ - if (bios_basemem == 0) { - v86.ctl = 0; - v86.addr = 0x12; /* int 0x12 */ - v86int(); + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12; /* int 0x12 */ + v86int(); - bios_basemem = (v86.eax & 0xffff) * 1024; - } + bios_basemem = (v86.eax & 0xffff) * 1024; + } - /* Fall back through several compatibility functions for extended memory */ - if (bios_extmem == 0) { - v86.ctl = V86_FLAGS; - v86.addr = 0x15; /* int 0x15 function 0xe801*/ - v86.eax = 0xe801; - v86int(); - if (!(v86.efl & 1)) { - bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; + /* + * Fall back through several compatibility functions for extended + * memory + */ + if (bios_extmem == 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe801*/ + v86.eax = 0xe801; + v86int(); + if (!(v86.efl & 1)) { + bios_extmem = ((v86.ecx & 0xffff) + + ((v86.edx & 0xffff) * 64)) * 1024; + } } - } - if (bios_extmem == 0) { - v86.ctl = 0; - v86.addr = 0x15; /* int 0x15 function 0x88*/ - v86.eax = 0x8800; - v86int(); - bios_extmem = (v86.eax & 0xffff) * 1024; - } + if (bios_extmem == 0) { + v86.ctl = 0; + v86.addr = 0x15; /* int 0x15 function 0x88*/ + v86.eax = 0x8800; + v86int(); + bios_extmem = (v86.eax & 0xffff) * 1024; + } - /* - * If we have extended memory and did not find a suitable heap - * region in the SMAP, use the last 3MB of 'extended' memory as a - * high heap candidate. - */ - if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { - high_heap_size = HEAP_MIN; - high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; - } + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; + } } static int @@ -371,207 +377,215 @@ exit(int x) static void load(void) { - union { - struct exec ex; - Elf32_Ehdr eh; - } hdr; - static Elf32_Phdr ep[2]; - static Elf32_Shdr es[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr, x; - int fmt, i, j; + union { + struct exec ex; + Elf32_Ehdr eh; + } hdr; + static Elf32_Phdr ep[2]; + static Elf32_Shdr es[2]; + caddr_t p; + ufs_ino_t ino; + uint32_t addr, x; + int fmt, i, j; - if (!(ino = lookup(kname))) { - if (!ls) { - printf("%s: No %s on %u:%s(%up%u)\n", BOOTPROG, - kname, dsk.drive & DRV_MASK, dev_nm[dsk.type], dsk.unit, - dsk.part); - } - return; - } - if (xfsread(ino, &hdr, sizeof(hdr))) - return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { - addr = hdr.ex.a_entry & 0xffffff; - p = PTOV(addr); - fs_off = PAGE_SIZE; - if (xfsread(ino, p, hdr.ex.a_text)) - return; - p += roundup2(hdr.ex.a_text, PAGE_SIZE); - if (xfsread(ino, p, hdr.ex.a_data)) - return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) + if (!(ino = lookup(kname))) { + if (!ls) { + printf("%s: No %s on %u:%s(%up%u)\n", BOOTPROG, + kname, dsk.drive & DRV_MASK, dev_nm[dsk.type], + dsk.unit, + dsk.part); + } return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; } - } else { - fs_off = hdr.eh.e_phoff; - for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) + if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (ep[j].p_type == PT_LOAD) - j++; - } - for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); - fs_off = ep[i].p_offset; - if (xfsread(ino, p, ep[i].p_filesz)) + if (N_GETMAGIC(hdr.ex) == ZMAGIC) + fmt = 0; + else if (IS_ELF(hdr.eh)) + fmt = 1; + else { + printf("Invalid %s\n", "format"); return; } - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { - fs_off = hdr.eh.e_shoff + sizeof(es[0]) * - (hdr.eh.e_shstrndx + 1); - if (xfsread(ino, &es, sizeof(es))) - return; - for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } + if (fmt == 0) { + addr = hdr.ex.a_entry & 0xffffff; + p = PTOV(addr); + fs_off = PAGE_SIZE; + if (xfsread(ino, p, hdr.ex.a_text)) + return; + p += roundup2(hdr.ex.a_text, PAGE_SIZE); + if (xfsread(ino, p, hdr.ex.a_data)) + return; + p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + p += sizeof(hdr.ex.a_syms); + if (hdr.ex.a_syms) { + if (xfsread(ino, p, hdr.ex.a_syms)) + return; + p += hdr.ex.a_syms; + if (xfsread(ino, p, sizeof(int))) + return; + x = *(uint32_t *)p; + p += sizeof(int); + x -= sizeof(int); + if (xfsread(ino, p, x)) + return; + p += x; + } + } else { + fs_off = hdr.eh.e_phoff; + for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) + return; + if (ep[j].p_type == PT_LOAD) + j++; + } + for (i = 0; i < 2; i++) { + p = PTOV(ep[i].p_paddr & 0xffffff); + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) + return; + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) + return; + for (i = 0; i < 2; i++) { + memcpy(p, &es[i].sh_size, + sizeof(es[i].sh_size)); + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } + } + addr = hdr.eh.e_entry & 0xffffff; } - addr = hdr.eh.e_entry & 0xffffff; - } - bootinfo.bi_esymtab = VTOP(p); - bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.drive; + bootinfo.bi_esymtab = VTOP(p); + bootinfo.bi_kernelname = VTOP(kname); + bootinfo.bi_bios_dev = dsk.drive; #ifdef LOADER_GELI_SUPPORT - geliargs.size = sizeof(geliargs); - explicit_bzero(gelipw, sizeof(gelipw)); - gelibuf = malloc(sizeof(struct keybuf) + (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); - geli_fill_keybuf(gelibuf); - geliargs.notapw = '\0'; - geliargs.keybuf_sentinel = KEYBUF_SENTINEL; - geliargs.keybuf = gelibuf; + geliargs.size = sizeof(geliargs); + explicit_bzero(gelipw, sizeof(gelipw)); + gelibuf = malloc(sizeof(struct keybuf) + + (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); + geli_fill_keybuf(gelibuf); + geliargs.notapw = '\0'; + geliargs.keybuf_sentinel = KEYBUF_SENTINEL; + geliargs.keybuf = gelibuf; #endif - __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), + MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) #ifdef LOADER_GELI_SUPPORT - , geliargs + , geliargs #endif - ); + ); } static int parse_cmds(char *cmdstr, int *dskupdated) { - char *arg = cmdstr; - char *ep, *p, *q; - const char *cp; - unsigned int drv; - int c, i, j; + char *arg = cmdstr; + char *ep, *p, *q; + const char *cp; + unsigned int drv; + int c, i, j; - *dskupdated = 0; - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - if (c == 'P') { - if (*(uint8_t *)PTOV(0x496) & 0x10) { - cp = "yes"; - } else { - opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); - cp = "no"; - } - printf("Keyboard: %s\n", cp); - continue; - } else if (c == 'S') { - j = 0; - while ((unsigned int)(i = *arg++ - '0') <= 9) - j = j * 10 + i; - if (j > 0 && i == -'0') { - comspeed = j; - break; - } - /* Fall through to error below ('S' not in optstr[]). */ + *dskupdated = 0; + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x496) & 0x10) { + cp = "yes"; + } else { + opts |= OPT_SET(RBX_DUAL) | + OPT_SET(RBX_SERIAL); + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; + } else if (c == 'S') { + j = 0; + while ((unsigned int)(i = *arg++ - '0') + <= 9) + j = j * 10 + i; + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* + * Fall through to error below + * ('S' not in optstr[]). + */ + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return -1; + opts ^= OPT_SET(flags[i]); + } + ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } + } else { + for (q = arg--; *q && *q != '('; q++); + if (*q) { + drv = -1; + if (arg[1] == ':') { + drv = *arg - '0'; + if (drv > 9) + return (-1); + arg += 2; + } + if (q - arg != 2) + return -1; + for (i = 0; arg[0] != dev_nm[i][0] || + arg[1] != dev_nm[i][1]; i++) + if (i == NDEV - 1) + return -1; + dsk.type = i; + arg += 3; + dsk.unit = *arg - '0'; + if (arg[1] != 'p' || dsk.unit > 9) + return -1; + arg += 2; + dsk.part = *arg - '0'; + if (dsk.part < 1 || dsk.part > 9) + return -1; + arg++; + if (arg[0] != ')') + return -1; + arg++; + if (drv == -1) + drv = dsk.unit; + dsk.drive = (dsk.type <= TYPE_MAXHARD + ? DRV_HARD : 0) + drv; + *dskupdated = 1; + } + if ((i = ep - arg)) { + if ((size_t)i >= sizeof(kname)) + return -1; + memcpy(kname, arg, i + 1); + } } - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return -1; - opts ^= OPT_SET(flags[i]); - } - ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : - OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) { - if (sio_init(115200 / comspeed) != 0) - ioctrl &= ~IO_SERIAL; - } - } else { - for (q = arg--; *q && *q != '('; q++); - if (*q) { - drv = -1; - if (arg[1] == ':') { - drv = *arg - '0'; - if (drv > 9) - return (-1); - arg += 2; - } - if (q - arg != 2) - return -1; - for (i = 0; arg[0] != dev_nm[i][0] || - arg[1] != dev_nm[i][1]; i++) - if (i == NDEV - 1) - return -1; - dsk.type = i; - arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != 'p' || dsk.unit > 9) - return -1; - arg += 2; - dsk.part = *arg - '0'; - if (dsk.part < 1 || dsk.part > 9) - return -1; - arg++; - if (arg[0] != ')') - return -1; - arg++; - if (drv == -1) - drv = dsk.unit; - dsk.drive = (dsk.type <= TYPE_MAXHARD - ? DRV_HARD : 0) + drv; - *dskupdated = 1; - } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + arg = p; } - arg = p; - } - return 0; + return 0; } static int From owner-svn-src-all@freebsd.org Tue Apr 24 18:11:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D2DFAE349; Tue, 24 Apr 2018 18:11:34 +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 C9575688A1; Tue, 24 Apr 2018 18:11:33 +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 C45D916927; Tue, 24 Apr 2018 18:11:33 +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 w3OIBXbW061504; Tue, 24 Apr 2018 18:11:33 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIBXDf061503; Tue, 24 Apr 2018 18:11:33 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804241811.w3OIBXDf061503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 24 Apr 2018 18:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332954 - stable/11/stand/i386/gptboot X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/stand/i386/gptboot X-SVN-Commit-Revision: 332954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:11:34 -0000 Author: benno Date: Tue Apr 24 18:11:33 2018 New Revision: 332954 URL: https://svnweb.freebsd.org/changeset/base/332954 Log: MFC r332083: Various style(9) fixes. Sponsored by: iXsystems, Inc. Modified: stable/11/stand/i386/gptboot/gptboot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/gptboot/gptboot.c ============================================================================== --- stable/11/stand/i386/gptboot/gptboot.c Tue Apr 24 18:10:04 2018 (r332953) +++ stable/11/stand/i386/gptboot/gptboot.c Tue Apr 24 18:11:33 2018 (r332954) @@ -370,6 +370,7 @@ main(void) void exit(int x) { + while (1); __unreachable(); } @@ -491,12 +492,13 @@ load(void) static int parse_cmds(char *cmdstr, int *dskupdated) { - char *arg = cmdstr; + char *arg; char *ep, *p, *q; const char *cp; unsigned int drv; int c, i, j; + arg = cmdstr; *dskupdated = 0; while ((c = *arg++)) { if (c == ' ' || c == '\t' || c == '\n') @@ -533,7 +535,7 @@ parse_cmds(char *cmdstr, int *dskupdated) } for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) - return -1; + return (-1); opts ^= OPT_SET(flags[i]); } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : @@ -553,23 +555,23 @@ parse_cmds(char *cmdstr, int *dskupdated) arg += 2; } if (q - arg != 2) - return -1; + return (-1); for (i = 0; arg[0] != dev_nm[i][0] || arg[1] != dev_nm[i][1]; i++) if (i == NDEV - 1) - return -1; + return (-1); dsk.type = i; arg += 3; dsk.unit = *arg - '0'; if (arg[1] != 'p' || dsk.unit > 9) - return -1; + return (-1); arg += 2; dsk.part = *arg - '0'; if (dsk.part < 1 || dsk.part > 9) - return -1; + return (-1); arg++; if (arg[0] != ')') - return -1; + return (-1); arg++; if (drv == -1) drv = dsk.unit; @@ -579,13 +581,13 @@ parse_cmds(char *cmdstr, int *dskupdated) } if ((i = ep - arg)) { if ((size_t)i >= sizeof(kname)) - return -1; + return (-1); memcpy(kname, arg, i + 1); } } arg = p; } - return 0; + return (0); } static int @@ -617,7 +619,9 @@ vdev_read(void *vdev __unused, void *priv, off_t off, char *p; daddr_t lba; unsigned int nb; - struct dsk *dskp = (struct dsk *) priv; + struct dsk *dskp; + + dskp = (struct dsk *)priv; if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) return (-1); From owner-svn-src-all@freebsd.org Tue Apr 24 18:13:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 778B5FAE522; Tue, 24 Apr 2018 18:13:29 +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 25A0368BC8; Tue, 24 Apr 2018 18:13:29 +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 2080B16A7A; Tue, 24 Apr 2018 18:13:29 +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 w3OIDTX7063082; Tue, 24 Apr 2018 18:13:29 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIDSxA063079; Tue, 24 Apr 2018 18:13:28 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804241813.w3OIDSxA063079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 24 Apr 2018 18:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332955 - in stable/11: stand/i386 stand/i386/isoboot stand/libsa sys/fs/cd9660 X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: in stable/11: stand/i386 stand/i386/isoboot stand/libsa sys/fs/cd9660 X-SVN-Commit-Revision: 332955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:13:29 -0000 Author: benno Date: Tue Apr 24 18:13:28 2018 New Revision: 332955 URL: https://svnweb.freebsd.org/changeset/base/332955 Log: MFC r332084 Add isoboot(8) for booting BIOS systems from HDDs containing ISO images. This is part of a project for adding the ability to create hybrid CD/USB boot images. In the BIOS case when booting from something that isn't a CD we need some extra boot code to actually find our next stage (loader) within an ISO9660 filesystem. This code will reside in a GPT partition (similar to gptboot(8) from which it is derived) and looks for /boot/loader in an ISO9660 filesystem on the image. Sponsored by: iXsystems, Inc. Added: stable/11/stand/i386/isoboot/ - copied from r332084, head/stand/i386/isoboot/ stable/11/stand/libsa/cd9660read.c - copied unchanged from r332084, head/stand/libsa/cd9660read.c Modified: stable/11/stand/i386/Makefile stable/11/sys/fs/cd9660/iso.h Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/Makefile ============================================================================== --- stable/11/stand/i386/Makefile Tue Apr 24 18:11:33 2018 (r332954) +++ stable/11/stand/i386/Makefile Tue Apr 24 18:13:28 2018 (r332955) @@ -5,7 +5,7 @@ NO_OBJ=t .include SUBDIR.yes= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ - libi386 + isoboot libi386 SUBDIR.${MK_LOADER_FIREWIRE}+= libfirewire Copied: stable/11/stand/libsa/cd9660read.c (from r332084, head/stand/libsa/cd9660read.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/stand/libsa/cd9660read.c Tue Apr 24 18:13:28 2018 (r332955, copy of r332084, head/stand/libsa/cd9660read.c) @@ -0,0 +1,364 @@ +/* + * Copyright (C) 1996 Wolfgang Solfrank. + * Copyright (C) 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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 TOOLS GMBH 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. + */ + +/* Originally derived from libsa/cd9660.c: */ +/* $NetBSD: cd9660.c,v 1.5 1997/06/26 19:11:33 drochner Exp $ */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +static uint64_t cd9660_lookup(const char *); +static ssize_t cd9660_fsread(uint64_t, void *, size_t); + +#define SUSP_CONTINUATION "CE" +#define SUSP_PRESENT "SP" +#define SUSP_STOP "ST" +#define SUSP_EXTREF "ER" +#define RRIP_NAME "NM" + +typedef struct { + ISO_SUSP_HEADER h; + u_char signature [ISODCL ( 5, 6)]; + u_char len_skp [ISODCL ( 7, 7)]; /* 711 */ +} ISO_SUSP_PRESENT; + +static int +read_iso_block(void *buffer, daddr_t blkno) +{ + + return (drvread(&dsk, buffer, blkno * 4, 4)); +} + +static ISO_SUSP_HEADER * +susp_lookup_record(const char *identifier, struct iso_directory_record *dp, + int lenskip) +{ + static char susp_buffer[ISO_DEFAULT_BLOCK_SIZE]; + ISO_SUSP_HEADER *sh; + ISO_RRIP_CONT *shc; + char *p, *end; + int error; + + p = dp->name + isonum_711(dp->name_len) + lenskip; + /* Names of even length have a padding byte after the name. */ + if ((isonum_711(dp->name_len) & 1) == 0) + p++; + end = (char *)dp + isonum_711(dp->length); + while (p + 3 < end) { + sh = (ISO_SUSP_HEADER *)p; + if (bcmp(sh->type, identifier, 2) == 0) + return (sh); + if (bcmp(sh->type, SUSP_STOP, 2) == 0) + return (NULL); + if (bcmp(sh->type, SUSP_CONTINUATION, 2) == 0) { + shc = (ISO_RRIP_CONT *)sh; + error = read_iso_block(susp_buffer, + isonum_733(shc->location)); + + /* Bail if it fails. */ + if (error != 0) + return (NULL); + p = susp_buffer + isonum_733(shc->offset); + end = p + isonum_733(shc->length); + } else { + /* Ignore this record and skip to the next. */ + p += isonum_711(sh->length); + + /* Avoid infinite loops with corrupted file systems */ + if (isonum_711(sh->length) == 0) + return (NULL); + } + } + return (NULL); +} + +static const char * +rrip_lookup_name(struct iso_directory_record *dp, int lenskip, size_t *len) +{ + ISO_RRIP_ALTNAME *p; + + if (len == NULL) + return (NULL); + + p = (ISO_RRIP_ALTNAME *)susp_lookup_record(RRIP_NAME, dp, lenskip); + if (p == NULL) + return (NULL); + switch (*p->flags) { + case ISO_SUSP_CFLAG_CURRENT: + *len = 1; + return ("."); + case ISO_SUSP_CFLAG_PARENT: + *len = 2; + return (".."); + case 0: + *len = isonum_711(p->h.length) - 5; + return ((char *)p + 5); + default: + /* + * We don't handle hostnames or continued names as they are + * too hard, so just bail and use the default name. + */ + return (NULL); + } +} + +static int +rrip_check(struct iso_directory_record *dp, int *lenskip) +{ + ISO_SUSP_PRESENT *sp; + ISO_RRIP_EXTREF *er; + char *p; + + /* First, see if we can find a SP field. */ + p = dp->name + isonum_711(dp->name_len); + if (p > (char *)dp + isonum_711(dp->length)) { + return (0); + } + sp = (ISO_SUSP_PRESENT *)p; + if (bcmp(sp->h.type, SUSP_PRESENT, 2) != 0) { + return (0); + } + if (isonum_711(sp->h.length) != sizeof(ISO_SUSP_PRESENT)) { + return (0); + } + if (sp->signature[0] != 0xbe || sp->signature[1] != 0xef) { + return (0); + } + *lenskip = isonum_711(sp->len_skp); + + /* + * Now look for an ER field. If RRIP is present, then there must + * be at least one of these. It would be more pedantic to walk + * through the list of fields looking for a Rock Ridge ER field. + */ + er = (ISO_RRIP_EXTREF *)susp_lookup_record(SUSP_EXTREF, dp, 0); + if (er == NULL) { + return (0); + } + return (1); +} + +static int +dirmatch(const char *path, struct iso_directory_record *dp, int use_rrip, + int lenskip) +{ + size_t len; + const char *cp = NULL, *name = NULL; + int i, icase; + + if (use_rrip) + cp = rrip_lookup_name(dp, lenskip, &len); + else + cp = NULL; + if (cp == NULL) { + len = isonum_711(dp->name_len); + cp = dp->name; + icase = 1; + } else + icase = 0; + name = cp; + for (i = len; --i >= 0; path++, cp++) { + if (!*path || *path == '/') + break; + if (*path == *cp) + continue; + if (!icase && toupper(*path) == *cp) + continue; + return 0; + } + if (*path && *path != '/') { + return 0; + } + /* + * Allow stripping of trailing dots and the version number. + * Note that this will find the first instead of the last version + * of a file. + */ + if (i >= 0 && (*cp == ';' || *cp == '.')) { + /* This is to prevent matching of numeric extensions */ + if (*cp == '.' && cp[1] != ';') { + return 0; + } + while (--i >= 0) + if (*++cp != ';' && (*cp < '0' || *cp > '9')) { + return 0; + } + } + return 1; +} + +static uint64_t +cd9660_lookup(const char *path) +{ + static char blkbuf[ISO_DEFAULT_BLOCK_SIZE]; + struct iso_primary_descriptor *vd; + struct iso_directory_record rec; + struct iso_directory_record *dp = NULL; + size_t dsize, off; + daddr_t bno, boff; + int rc, first, use_rrip, lenskip; + uint64_t cookie; + + for (bno = 16;; bno++) { + rc = read_iso_block(blkbuf, bno); + vd = (struct iso_primary_descriptor *)blkbuf; + + if (bcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0) + return (0); + if (isonum_711(vd->type) == ISO_VD_END) + return (0); + if (isonum_711(vd->type) == ISO_VD_PRIMARY) + break; + } + + rec = *(struct iso_directory_record *) vd->root_directory_record; + if (*path == '/') path++; /* eat leading '/' */ + + first = 1; + use_rrip = 0; + while (*path) { + bno = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); + dsize = isonum_733(rec.size); + off = 0; + boff = 0; + + while (off < dsize) { + if ((off % ISO_DEFAULT_BLOCK_SIZE) == 0) { + rc = read_iso_block(blkbuf, bno + boff); + if (rc) { + return (0); + } + boff++; + dp = (struct iso_directory_record *) blkbuf; + } + if (isonum_711(dp->length) == 0) { + /* skip to next block, if any */ + off = boff * ISO_DEFAULT_BLOCK_SIZE; + continue; + } + + /* See if RRIP is in use. */ + if (first) + use_rrip = rrip_check(dp, &lenskip); + + if (dirmatch(path, dp, use_rrip, + first ? 0 : lenskip)) { + first = 0; + break; + } else + first = 0; + + dp = (struct iso_directory_record *) + ((char *) dp + isonum_711(dp->length)); + /* If the new block has zero length, it is padding. */ + if (isonum_711(dp->length) == 0) { + /* Skip to next block, if any. */ + off = boff * ISO_DEFAULT_BLOCK_SIZE; + continue; + } + off += isonum_711(dp->length); + } + if (off >= dsize) { + return (0); + } + + rec = *dp; + while (*path && *path != '/') /* look for next component */ + path++; + if (*path) path++; /* skip '/' */ + } + + if ((isonum_711(rec.flags) & 2) != 0) { + return (0); + } + + cookie = isonum_733(rec.extent) + isonum_711(rec.ext_attr_length); + cookie = (cookie << 32) | isonum_733(rec.size); + + return (cookie); +} + +static ssize_t +cd9660_fsread(uint64_t cookie, void *buf, size_t nbytes) +{ + static char blkbuf[ISO_DEFAULT_BLOCK_SIZE]; + static daddr_t curstart = 0, curblk = 0; + daddr_t blk, blk_off; + off_t byte_off; + size_t size, remaining, n; + char *s; + + size = cookie & 0xffffffff; + blk = (cookie >> 32) & 0xffffffff; + + /* Make sure we're looking at the right file. */ + if (((blk << 32) | size) != cookie) { + return (-1); + } + + if (blk != curstart) { + curstart = blk; + fs_off = 0; + } + + size -= fs_off; + if (size < nbytes) { + nbytes = size; + } + remaining = nbytes; + s = buf; + + while (remaining > 0) { + blk_off = fs_off >> ISO_DEFAULT_BLOCK_SHIFT; + byte_off = fs_off & (ISO_DEFAULT_BLOCK_SIZE - 1); + + if (curblk != curstart + blk_off) { + curblk = curstart + blk_off; + read_iso_block(blkbuf, curblk); + } + + if (remaining < ISO_DEFAULT_BLOCK_SIZE - byte_off) { + n = remaining; + } else { + n = ISO_DEFAULT_BLOCK_SIZE - byte_off; + } + memcpy(s, blkbuf + byte_off, n); + remaining -= n; + s += n; + + fs_off += n; + } + + return (nbytes); +} Modified: stable/11/sys/fs/cd9660/iso.h ============================================================================== --- stable/11/sys/fs/cd9660/iso.h Tue Apr 24 18:11:33 2018 (r332954) +++ stable/11/sys/fs/cd9660/iso.h Tue Apr 24 18:13:28 2018 (r332955) @@ -93,7 +93,8 @@ struct iso_primary_descriptor { char application_data [ISODCL (884, 1395)]; char unused5 [ISODCL (1396, 2048)]; }; -#define ISO_DEFAULT_BLOCK_SIZE 2048 +#define ISO_DEFAULT_BLOCK_SHIFT 11 +#define ISO_DEFAULT_BLOCK_SIZE (1 << ISO_DEFAULT_BLOCK_SHIFT) /* * Used by Microsoft Joliet extension to ISO9660. Almost the same From owner-svn-src-all@freebsd.org Tue Apr 24 18:15:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 18:19:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F568FAE978; Tue, 24 Apr 2018 18:19:31 +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 0CDEF6B066; Tue, 24 Apr 2018 18:19:31 +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 04B3D16A83; Tue, 24 Apr 2018 18:19:31 +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 w3OIJUvM063334; Tue, 24 Apr 2018 18:19:30 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIJUfk063331; Tue, 24 Apr 2018 18:19:30 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804241819.w3OIJUfk063331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Tue, 24 Apr 2018 18:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332956 - stable/11/stand/common X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/stand/common X-SVN-Commit-Revision: 332956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2018 18:19:31 -0000 Author: benno Date: Tue Apr 24 18:19:30 2018 New Revision: 332956 URL: https://svnweb.freebsd.org/changeset/base/332956 Log: MFC r332085 Add an ISO9660 "partition table" type to loader. When booted via isoboot(8) loader will be handed a disk that simply contains an ISO9660 image. Currently this confuses it greatly. Teach it how to spot that it's in this situation and that ISO9660 has one "partition" covering the whole disk. Sponsored by: iXsystems, Inc. Modified: stable/11/stand/common/disk.c stable/11/stand/common/part.c stable/11/stand/common/part.h Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/common/disk.c ============================================================================== --- stable/11/stand/common/disk.c Tue Apr 24 18:13:28 2018 (r332955) +++ stable/11/stand/common/disk.c Tue Apr 24 18:19:30 2018 (r332956) @@ -270,6 +270,9 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize dev->d_offset = part.start; od->entrysize = part.end - part.start + 1; } + } else if (ptable_gettype(od->table) == PTABLE_ISO9660) { + dev->d_offset = 0; + od->entrysize = mediasize; } else if (slice >= 0) { /* Try to get information about partition */ if (slice == 0) Modified: stable/11/stand/common/part.c ============================================================================== --- stable/11/stand/common/part.c Tue Apr 24 18:13:28 2018 (r332955) +++ stable/11/stand/common/part.c Tue Apr 24 18:19:30 2018 (r332956) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -97,6 +99,7 @@ static struct parttypes { { PART_LINUX, "Linux" }, { PART_LINUX_SWAP, "Linux swap" }, { PART_DOS, "DOS/Windows" }, + { PART_ISO9660, "ISO9660" }, }; const char * @@ -603,6 +606,45 @@ out: } #endif /* LOADER_VTOC8_SUPPORT */ +#define cdb2devb(bno) ((bno) * ISO_DEFAULT_BLOCK_SIZE / table->sectorsize) + +static struct ptable * +ptable_iso9660read(struct ptable *table, void *dev, diskread_t dread) +{ + uint8_t *buf; + struct iso_primary_descriptor *vd; + struct pentry *entry; + + buf = malloc(table->sectorsize); + if (buf == NULL) + return (table); + + if (dread(dev, buf, 1, cdb2devb(16)) != 0) { + DEBUG("read failed"); + ptable_close(table); + table = NULL; + goto out; + } + vd = (struct iso_primary_descriptor *)buf; + if (bcmp(vd->id, ISO_STANDARD_ID, sizeof vd->id) != 0) + goto out; + + entry = malloc(sizeof(*entry)); + if (entry == NULL) + goto out; + entry->part.start = 0; + entry->part.end = table->sectors; + entry->part.type = PART_ISO9660; + entry->part.index = 0; + STAILQ_INSERT_TAIL(&table->entries, entry, entry); + + table->type = PTABLE_ISO9660; + +out: + free(buf); + return (table); +} + struct ptable * ptable_open(void *dev, uint64_t sectors, uint16_t sectorsize, diskread_t *dread) @@ -633,6 +675,11 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect table->sectorsize = sectorsize; table->type = PTABLE_NONE; STAILQ_INIT(&table->entries); + + if (ptable_iso9660read(table, dev, dread) != NULL) { + if (table->type == PTABLE_ISO9660) + goto out; + } #ifdef LOADER_VTOC8_SUPPORT if (be16dec(buf + offsetof(struct vtoc8, magic)) == VTOC_MAGIC) { Modified: stable/11/stand/common/part.h ============================================================================== --- stable/11/stand/common/part.h Tue Apr 24 18:13:28 2018 (r332955) +++ stable/11/stand/common/part.h Tue Apr 24 18:19:30 2018 (r332956) @@ -36,7 +36,8 @@ enum ptable_type { PTABLE_BSD, PTABLE_MBR, PTABLE_GPT, - PTABLE_VTOC8 + PTABLE_VTOC8, + PTABLE_ISO9660 }; enum partition_type { @@ -52,6 +53,7 @@ enum partition_type { PART_LINUX, PART_LINUX_SWAP, PART_DOS, + PART_ISO9660 }; struct ptable_entry { From owner-svn-src-all@freebsd.org Tue Apr 24 18:28:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 18:41:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 18:47:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 18:54:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 18:59:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:09:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:10:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:11:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:18:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:23:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:26:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:51:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:55:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 19:59:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 20:05:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 20:22:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 20:29:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 20:33:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 20:49:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 21:15:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 23:20:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 23:22:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 23:22:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 23:22:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Apr 24 23:26:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Wed Apr 25 00:37:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 00:43:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 01:12:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95F24FB98CC; Wed, 25 Apr 2018 01:12:41 +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 2684D729AA; Wed, 25 Apr 2018 01:12:41 +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 212A42262E; Wed, 25 Apr 2018 01:12:41 +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 w3P1CfT2074258; Wed, 25 Apr 2018 01:12:41 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P1Cfkg074256; Wed, 25 Apr 2018 01:12:41 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804250112.w3P1Cfkg074256@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 01:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332977 - in stable/11/usr.sbin/makefs: . cd9660 X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: in stable/11/usr.sbin/makefs: . cd9660 X-SVN-Commit-Revision: 332977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 01:12:42 -0000 Author: benno Date: Wed Apr 25 01:12:40 2018 New Revision: 332977 URL: https://svnweb.freebsd.org/changeset/base/332977 Log: MFC r314117 makefs: eliminate global cd9660 structure For diff reduction with NetBSD NetBSD file versions: cd9660.c 1.39 cd9660.h 1.19 cd9660/cd9660_debug.c 1.12 cd9660/cd9660_eltorito.c 1.20 cd9660/cd9660_write.c 1.16 cd9660/iso9660_rrip.c 1.12 cd9660/iso9660_rrip.h 1.6 Sponsored by: iXsystems, Inc. Modified: stable/11/usr.sbin/makefs/cd9660.c stable/11/usr.sbin/makefs/cd9660.h stable/11/usr.sbin/makefs/cd9660/cd9660_debug.c stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/11/usr.sbin/makefs/cd9660/cd9660_write.c stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.h Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660.c Tue Apr 24 23:22:45 2018 (r332976) +++ stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:12:40 2018 (r332977) @@ -110,58 +110,59 @@ __FBSDID("$FreeBSD$"); #include "cd9660/iso9660_rrip.h" #include "cd9660/cd9660_archimedes.h" -/* - * Global variables - */ -iso9660_disk diskStructure; - -static void cd9660_finalize_PVD(void); +static void cd9660_finalize_PVD(iso9660_disk *); static cd9660node *cd9660_allocate_cd9660node(void); -static void cd9660_set_defaults(void); +static void cd9660_set_defaults(iso9660_disk *); static int cd9660_arguments_set_string(const char *, const char *, int, char, char *); static void cd9660_populate_iso_dir_record( struct _iso_directory_record_cd9660 *, u_char, u_char, u_char, const char *); -static void cd9660_setup_root_node(void); -static int cd9660_setup_volume_descriptors(void); +static void cd9660_setup_root_node(iso9660_disk *); +static int cd9660_setup_volume_descriptors(iso9660_disk *); #if 0 static int cd9660_fill_extended_attribute_record(cd9660node *); #endif static void cd9660_sort_nodes(cd9660node *); -static int cd9660_translate_node_common(cd9660node *); -static int cd9660_translate_node(fsnode *, cd9660node *); +static int cd9660_translate_node_common(iso9660_disk *, cd9660node *); +static int cd9660_translate_node(iso9660_disk *, fsnode *, cd9660node *); static int cd9660_compare_filename(const char *, const char *); static void cd9660_sorted_child_insert(cd9660node *, cd9660node *); -static int cd9660_handle_collisions(cd9660node *, int); -static cd9660node *cd9660_rename_filename(cd9660node *, int, int); -static void cd9660_copy_filenames(cd9660node *); +static int cd9660_handle_collisions(iso9660_disk *, cd9660node *, int); +static cd9660node *cd9660_rename_filename(iso9660_disk *, cd9660node *, int, + int); +static void cd9660_copy_filenames(iso9660_disk *, cd9660node *); static void cd9660_sorting_nodes(cd9660node *); static int cd9660_count_collisions(cd9660node *); -static cd9660node *cd9660_rrip_move_directory(cd9660node *); -static int cd9660_add_dot_records(cd9660node *); +static cd9660node *cd9660_rrip_move_directory(iso9660_disk *, cd9660node *); +static int cd9660_add_dot_records(iso9660_disk *, cd9660node *); -static void cd9660_convert_structure(fsnode *, cd9660node *, int, +static void cd9660_convert_structure(iso9660_disk *, fsnode *, cd9660node *, int, int *, int *); static void cd9660_free_structure(cd9660node *); -static int cd9660_generate_path_table(void); -static int cd9660_level1_convert_filename(const char *, char *, int); -static int cd9660_level2_convert_filename(const char *, char *, int); +static int cd9660_generate_path_table(iso9660_disk *); +static int cd9660_level1_convert_filename(iso9660_disk *, const char *, char *, + int); +static int cd9660_level2_convert_filename(iso9660_disk *, const char *, char *, + int); #if 0 -static int cd9660_joliet_convert_filename(const char *, char *, int); +static int cd9660_joliet_convert_filename(iso9660_disk *, const char *, char *, + int); #endif -static int cd9660_convert_filename(const char *, char *, int); -static void cd9660_populate_dot_records(cd9660node *); -static int64_t cd9660_compute_offsets(cd9660node *, int64_t); +static int cd9660_convert_filename(iso9660_disk *, const char *, char *, int); +static void cd9660_populate_dot_records(iso9660_disk *, cd9660node *); +static int64_t cd9660_compute_offsets(iso9660_disk *, cd9660node *, int64_t); #if 0 static int cd9660_copy_stat_info(cd9660node *, cd9660node *, int); #endif -static cd9660node *cd9660_create_virtual_entry(const char *, cd9660node *, int, - int); -static cd9660node *cd9660_create_file(const char *, cd9660node *, cd9660node *); -static cd9660node *cd9660_create_directory(const char *, cd9660node *, +static cd9660node *cd9660_create_virtual_entry(iso9660_disk *, const char *, + cd9660node *, int, int); +static cd9660node *cd9660_create_file(iso9660_disk *, const char *, + cd9660node *, cd9660node *); +static cd9660node *cd9660_create_directory(iso9660_disk *, const char *, + cd9660node *, cd9660node *); +static cd9660node *cd9660_create_special_directory(iso9660_disk *, u_char, cd9660node *); -static cd9660node *cd9660_create_special_directory(u_char, cd9660node *); /* @@ -192,72 +193,79 @@ int cd9660_defaults_set = 0; * Set default values for cd9660 extension to makefs */ static void -cd9660_set_defaults(void) +cd9660_set_defaults(iso9660_disk *diskStructure) { /*Fix the sector size for now, though the spec allows for other sizes*/ - diskStructure.sectorSize = 2048; + diskStructure->sectorSize = 2048; /* Set up defaults in our own structure */ - diskStructure.verbose_level = 0; - diskStructure.keep_bad_images = 0; - diskStructure.follow_sym_links = 0; - diskStructure.isoLevel = 2; + diskStructure->verbose_level = 0; + diskStructure->keep_bad_images = 0; + diskStructure->follow_sym_links = 0; + diskStructure->isoLevel = 2; - diskStructure.rock_ridge_enabled = 0; - diskStructure.rock_ridge_renamed_dir_name = 0; - diskStructure.rock_ridge_move_count = 0; - diskStructure.rr_moved_dir = 0; + diskStructure->rock_ridge_enabled = 0; + diskStructure->rock_ridge_renamed_dir_name = 0; + diskStructure->rock_ridge_move_count = 0; + diskStructure->rr_moved_dir = 0; - diskStructure.archimedes_enabled = 0; - diskStructure.chrp_boot = 0; + diskStructure->archimedes_enabled = 0; + diskStructure->chrp_boot = 0; - diskStructure.include_padding_areas = 1; + diskStructure->include_padding_areas = 1; /* Spec breaking functionality */ - diskStructure.allow_deep_trees = - diskStructure.allow_start_dot = - diskStructure.allow_max_name = - diskStructure.allow_illegal_chars = - diskStructure.allow_lowercase = - diskStructure.allow_multidot = - diskStructure.omit_trailing_period = 0; + diskStructure->allow_deep_trees = + diskStructure->allow_start_dot = + diskStructure->allow_max_name = + diskStructure->allow_illegal_chars = + diskStructure->allow_lowercase = + diskStructure->allow_multidot = + diskStructure->omit_trailing_period = 0; /* Make sure the PVD is clear */ - memset(&diskStructure.primaryDescriptor, 0, 2048); + memset(&diskStructure->primaryDescriptor, 0, 2048); - memset(diskStructure.primaryDescriptor.publisher_id, 0x20,128); - memset(diskStructure.primaryDescriptor.preparer_id, 0x20,128); - memset(diskStructure.primaryDescriptor.application_id, 0x20,128); - memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,37); - memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,37); - memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,37); + memset(diskStructure->primaryDescriptor.publisher_id, 0x20,128); + memset(diskStructure->primaryDescriptor.preparer_id, 0x20,128); + memset(diskStructure->primaryDescriptor.application_id, 0x20,128); + memset(diskStructure->primaryDescriptor.copyright_file_id, 0x20,37); + memset(diskStructure->primaryDescriptor.abstract_file_id, 0x20,37); + memset(diskStructure->primaryDescriptor.bibliographic_file_id, 0x20,37); - strcpy(diskStructure.primaryDescriptor.system_id, "FreeBSD"); + strcpy(diskStructure->primaryDescriptor.system_id, "FreeBSD"); cd9660_defaults_set = 1; /* Boot support: Initially disabled */ - diskStructure.has_generic_bootimage = 0; - diskStructure.generic_bootimage = NULL; + diskStructure->has_generic_bootimage = 0; + diskStructure->generic_bootimage = NULL; - diskStructure.boot_image_directory = 0; - /*memset(diskStructure.boot_descriptor, 0, 2048);*/ + diskStructure->boot_image_directory = 0; + /*memset(diskStructure->boot_descriptor, 0, 2048);*/ - diskStructure.is_bootable = 0; - TAILQ_INIT(&diskStructure.boot_images); - LIST_INIT(&diskStructure.boot_entries); + diskStructure->is_bootable = 0; + TAILQ_INIT(&diskStructure->boot_images); + LIST_INIT(&diskStructure->boot_entries); } void -cd9660_prep_opts(fsinfo_t *fsopts __unused) +cd9660_prep_opts(fsinfo_t *fsopts) { - cd9660_set_defaults(); + iso9660_disk *diskStructure; + + if ((diskStructure = calloc(1, sizeof(*diskStructure))) == NULL) + err(EXIT_FAILURE, "%s: calloc", __func__); + + fsopts->fs_specific = diskStructure; + + cd9660_set_defaults(diskStructure); } void -cd9660_cleanup_opts(fsinfo_t *fsopts __unused) +cd9660_cleanup_opts(fsinfo_t *fsopts) { - + free(fsopts->fs_specific); } static int @@ -296,20 +304,19 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts { char *var, *val; int rv; + iso9660_disk *diskStructure = fsopts->fs_specific; + /* Set up allowed options - integer options ONLY */ option_t cd9660_options[] = { - { "l", &diskStructure.isoLevel, 1, 2, "ISO Level" }, - { "isolevel", &diskStructure.isoLevel, 1, 2, "ISO Level" }, - { "verbose", &diskStructure.verbose_level, 0, 2, + { "l", &diskStructure->isoLevel, 1, 2, "ISO Level" }, + { "isolevel", &diskStructure->isoLevel, 1, 2, "ISO Level" }, + { "verbose", &diskStructure->verbose_level, 0, 2, "Turns on verbose output" }, - { "v", &diskStructure.verbose_level, 0 , 2, + { "v", &diskStructure->verbose_level, 0 , 2, "Turns on verbose output"}, { .name = NULL } }; - if (cd9660_defaults_set == 0) - cd9660_set_defaults(); - /* * Todo : finish implementing this, and make a function that * parses them @@ -336,33 +343,33 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts /* First handle options with no parameters */ if (strcmp(var, "h") == 0) { - diskStructure.displayHelp = 1; + diskStructure->displayHelp = 1; rv = 1; } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "S", "follow-symlinks")) { /* this is not handled yet */ - diskStructure.follow_sym_links = 1; + diskStructure->follow_sym_links = 1; rv = 1; } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "L", "label")) { rv = cd9660_arguments_set_string(val, "Disk Label", 32, 'd', - diskStructure.primaryDescriptor.volume_id); + diskStructure->primaryDescriptor.volume_id); } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "applicationid")) { rv = cd9660_arguments_set_string(val, "Application Identifier", 128, 'a', - diskStructure.primaryDescriptor.application_id); + diskStructure->primaryDescriptor.application_id); } else if(CD9660_IS_COMMAND_ARG_DUAL(var, "P", "publisher")) { rv = cd9660_arguments_set_string(val, "Publisher Identifier", - 128, 'a', diskStructure.primaryDescriptor.publisher_id); + 128, 'a', diskStructure->primaryDescriptor.publisher_id); } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "p", "preparer")) { rv = cd9660_arguments_set_string(val, "Preparer Identifier", - 128, 'a', diskStructure.primaryDescriptor.preparer_id); + 128, 'a', diskStructure->primaryDescriptor.preparer_id); } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "V", "volumeid")) { rv = cd9660_arguments_set_string(val, "Volume Set Identifier", - 128, 'a', diskStructure.primaryDescriptor.volume_set_id); + 128, 'a', diskStructure->primaryDescriptor.volume_set_id); /* Boot options */ } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "B", "bootimage")) { if (val == NULL) warnx("error: The Boot Image parameter requires a valid boot information string"); else - rv = cd9660_add_boot_disk(val); + rv = cd9660_add_boot_disk(diskStructure, val); } else if (CD9660_IS_COMMAND_ARG(var, "bootimagedir")) { /* * XXXfvdl this is unused. @@ -371,7 +378,7 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts errx(1, "error: The Boot Image Directory parameter" " requires a directory name\n"); else { - if ((diskStructure.boot_image_directory = + if ((diskStructure->boot_image_directory = malloc(strlen(val) + 1)) == NULL) { CD9660_MEM_ALLOC_ERROR("cd9660_parse_opts"); exit(1); @@ -379,40 +386,40 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts /* BIG TODO: Add the max length function here */ cd9660_arguments_set_string(val, "Boot Image Directory", - 12 , 'd', diskStructure.boot_image_directory); + 12 , 'd', diskStructure->boot_image_directory); } } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "G", "generic-bootimage")) { if (val == NULL) warnx("error: The Boot Image parameter requires a valid boot information string"); else - rv = cd9660_add_generic_bootimage(val); + rv = cd9660_add_generic_bootimage(diskStructure, val); } else if (CD9660_IS_COMMAND_ARG(var, "no-trailing-padding")) - diskStructure.include_padding_areas = 0; + diskStructure->include_padding_areas = 0; /* RRIP */ else if (CD9660_IS_COMMAND_ARG_DUAL(var, "R", "rockridge")) - diskStructure.rock_ridge_enabled = 1; + diskStructure->rock_ridge_enabled = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "archimedes")) - diskStructure.archimedes_enabled = 1; + diskStructure->archimedes_enabled = 1; else if (CD9660_IS_COMMAND_ARG(var, "chrp-boot")) - diskStructure.chrp_boot = 1; + diskStructure->chrp_boot = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "K", "keep-bad-images")) - diskStructure.keep_bad_images = 1; + diskStructure->keep_bad_images = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-deep-trees")) - diskStructure.allow_deep_trees = 1; + diskStructure->allow_deep_trees = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-max-name")) - diskStructure.allow_max_name = 1; + diskStructure->allow_max_name = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-illegal-chars")) - diskStructure.allow_illegal_chars = 1; + diskStructure->allow_illegal_chars = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-lowercase")) - diskStructure.allow_lowercase = 1; + diskStructure->allow_lowercase = 1; else if (CD9660_IS_COMMAND_ARG(var,"allow-multidot")) - diskStructure.allow_multidot = 1; + diskStructure->allow_multidot = 1; else if (CD9660_IS_COMMAND_ARG(var, "omit-trailing-period")) - diskStructure.omit_trailing_period = 1; + diskStructure->omit_trailing_period = 1; else if (CD9660_IS_COMMAND_ARG(var, "no-emul-boot") || CD9660_IS_COMMAND_ARG(var, "no-boot") || CD9660_IS_COMMAND_ARG(var, "hard-disk-boot")) { - cd9660_eltorito_add_boot_option(var, 0); + cd9660_eltorito_add_boot_option(diskStructure, var, 0); /* End of flag variables */ } else if (CD9660_IS_COMMAND_ARG(var, "boot-load-segment")) { @@ -420,7 +427,8 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts warnx("Option `%s' doesn't contain a value", var); rv = 0; } else { - cd9660_eltorito_add_boot_option(var, val); + cd9660_eltorito_add_boot_option(diskStructure, var, + val); } } else { if (val == NULL) { @@ -453,19 +461,20 @@ cd9660_makefs(const char *image, const char *dir, fsno int64_t totalSpace; int error; cd9660node *real_root; + iso9660_disk *diskStructure = fsopts->fs_specific; - if (diskStructure.verbose_level > 0) + if (diskStructure->verbose_level > 0) printf("cd9660_makefs: ISO level is %i\n", - diskStructure.isoLevel); - if (diskStructure.isoLevel < 2 && - diskStructure.allow_multidot) + diskStructure->isoLevel); + if (diskStructure->isoLevel < 2 && + diskStructure->allow_multidot) errx(1, "allow-multidot requires iso level of 2\n"); assert(image != NULL); assert(dir != NULL); assert(root != NULL); - if (diskStructure.displayHelp) { + if (diskStructure->displayHelp) { /* * Display help here - probably want to put it in * a separate function @@ -473,7 +482,7 @@ cd9660_makefs(const char *image, const char *dir, fsno return; } - if (diskStructure.verbose_level > 0) + if (diskStructure->verbose_level > 0) printf("cd9660_makefs: image %s directory %s root %p\n", image, dir, root); @@ -497,11 +506,12 @@ cd9660_makefs(const char *image, const char *dir, fsno ISO_FILENAME_MAXLENGTH_WITH_PADDING); real_root->level = 0; - diskStructure.rootNode = real_root; + diskStructure->rootNode = real_root; real_root->type = CD9660_TYPE_DIR; error = 0; real_root->node = root; - cd9660_convert_structure(root, real_root, 1, &numDirectories, &error); + cd9660_convert_structure(diskStructure, root, real_root, 1, + &numDirectories, &error); if (TAILQ_EMPTY(&real_root->cn_children)) { errx(1, "cd9660_makefs: converted directory is empty. " @@ -509,109 +519,111 @@ cd9660_makefs(const char *image, const char *dir, fsno } else if (error != 0) { errx(1, "cd9660_makefs: tree conversion failed\n"); } else { - if (diskStructure.verbose_level > 0) + if (diskStructure->verbose_level > 0) printf("cd9660_makefs: tree converted\n"); } /* Add the dot and dot dot records */ - cd9660_add_dot_records(real_root); + cd9660_add_dot_records(diskStructure, real_root); - cd9660_setup_root_node(); + cd9660_setup_root_node(diskStructure); - if (diskStructure.verbose_level > 0) + if (diskStructure->verbose_level > 0) printf("cd9660_makefs: done converting tree\n"); /* non-SUSP extensions */ - if (diskStructure.archimedes_enabled) - archimedes_convert_tree(diskStructure.rootNode); + if (diskStructure->archimedes_enabled) + archimedes_convert_tree(diskStructure->rootNode); /* Rock ridge / SUSP init pass */ - if (diskStructure.rock_ridge_enabled) { - cd9660_susp_initialize(diskStructure.rootNode, - diskStructure.rootNode, NULL); + if (diskStructure->rock_ridge_enabled) { + cd9660_susp_initialize(diskStructure, diskStructure->rootNode, + diskStructure->rootNode, NULL); } /* Build path table structure */ - diskStructure.pathTableLength = cd9660_generate_path_table(); + diskStructure->pathTableLength = cd9660_generate_path_table( + diskStructure); - pathTableSectors = CD9660_BLOCKS(diskStructure.sectorSize, - diskStructure.pathTableLength); + pathTableSectors = CD9660_BLOCKS(diskStructure->sectorSize, + diskStructure->pathTableLength); - firstAvailableSector = cd9660_setup_volume_descriptors(); - if (diskStructure.is_bootable) { - firstAvailableSector = cd9660_setup_boot(firstAvailableSector); + firstAvailableSector = cd9660_setup_volume_descriptors(diskStructure); + if (diskStructure->is_bootable) { + firstAvailableSector = cd9660_setup_boot(diskStructure, + firstAvailableSector); if (firstAvailableSector < 0) errx(1, "setup_boot failed"); } /* LE first, then BE */ - diskStructure.primaryLittleEndianTableSector = firstAvailableSector; - diskStructure.primaryBigEndianTableSector = - diskStructure.primaryLittleEndianTableSector + pathTableSectors; + diskStructure->primaryLittleEndianTableSector = firstAvailableSector; + diskStructure->primaryBigEndianTableSector = + diskStructure->primaryLittleEndianTableSector + pathTableSectors; /* Set the secondary ones to -1, not going to use them for now */ - diskStructure.secondaryBigEndianTableSector = -1; - diskStructure.secondaryLittleEndianTableSector = -1; + diskStructure->secondaryBigEndianTableSector = -1; + diskStructure->secondaryLittleEndianTableSector = -1; - diskStructure.dataFirstSector = - diskStructure.primaryBigEndianTableSector + pathTableSectors; - if (diskStructure.verbose_level > 0) + diskStructure->dataFirstSector = + diskStructure->primaryBigEndianTableSector + pathTableSectors; + if (diskStructure->verbose_level > 0) printf("cd9660_makefs: Path table conversion complete. " "Each table is %i bytes, or %" PRIu64 " sectors.\n", - diskStructure.pathTableLength, pathTableSectors); + diskStructure->pathTableLength, pathTableSectors); - startoffset = diskStructure.sectorSize*diskStructure.dataFirstSector; + startoffset = diskStructure->sectorSize*diskStructure->dataFirstSector; - totalSpace = cd9660_compute_offsets(real_root, startoffset); + totalSpace = cd9660_compute_offsets(diskStructure, real_root, startoffset); - diskStructure.totalSectors = diskStructure.dataFirstSector + - CD9660_BLOCKS(diskStructure.sectorSize, totalSpace); + diskStructure->totalSectors = diskStructure->dataFirstSector + + CD9660_BLOCKS(diskStructure->sectorSize, totalSpace); /* Disabled until pass 1 is done */ - if (diskStructure.rock_ridge_enabled) { - diskStructure.susp_continuation_area_start_sector = - diskStructure.totalSectors; - diskStructure.totalSectors += - CD9660_BLOCKS(diskStructure.sectorSize, - diskStructure.susp_continuation_area_size); - cd9660_susp_finalize(diskStructure.rootNode); + if (diskStructure->rock_ridge_enabled) { + diskStructure->susp_continuation_area_start_sector = + diskStructure->totalSectors; + diskStructure->totalSectors += + CD9660_BLOCKS(diskStructure->sectorSize, + diskStructure->susp_continuation_area_size); + cd9660_susp_finalize(diskStructure, diskStructure->rootNode); } - cd9660_finalize_PVD(); + cd9660_finalize_PVD(diskStructure); /* Add padding sectors, just for testing purposes right now */ - /* diskStructure.totalSectors+=150; */ + /* diskStructure->totalSectors+=150; */ /* Debugging output */ - if (diskStructure.verbose_level > 0) { + if (diskStructure->verbose_level > 0) { printf("cd9660_makefs: Sectors 0-15 reserved\n"); printf("cd9660_makefs: Primary path tables starts in sector %" - PRId64 "\n", diskStructure.primaryLittleEndianTableSector); + PRId64 "\n", diskStructure->primaryLittleEndianTableSector); printf("cd9660_makefs: File data starts in sector %" - PRId64 "\n", diskStructure.dataFirstSector); + PRId64 "\n", diskStructure->dataFirstSector); printf("cd9660_makefs: Total sectors: %" - PRId64 "\n", diskStructure.totalSectors); + PRId64 "\n", diskStructure->totalSectors); } /* * Add padding sectors at the end * TODO: Clean this up and separate padding */ - if (diskStructure.include_padding_areas) - diskStructure.totalSectors += 150; + if (diskStructure->include_padding_areas) + diskStructure->totalSectors += 150; - cd9660_write_image(image); + cd9660_write_image(diskStructure, image); - if (diskStructure.verbose_level > 1) { - debug_print_volume_descriptor_information(); - debug_print_tree(real_root,0); + if (diskStructure->verbose_level > 1) { + debug_print_volume_descriptor_information(diskStructure); + debug_print_tree(diskStructure, real_root, 0); debug_print_path_tree(real_root); } /* Clean up data structures */ cd9660_free_structure(real_root); - if (diskStructure.verbose_level > 0) + if (diskStructure->verbose_level > 0) printf("cd9660_makefs: done\n"); } @@ -619,76 +631,77 @@ cd9660_makefs(const char *image, const char *dir, fsno typedef int (*cd9660node_func)(cd9660node *); static void -cd9660_finalize_PVD(void) +cd9660_finalize_PVD(iso9660_disk *diskStructure) { time_t tstamp = stampst.st_ino ? stampst.st_mtime : time(NULL); /* root should be a fixed size of 34 bytes since it has no name */ - memcpy(diskStructure.primaryDescriptor.root_directory_record, - diskStructure.rootNode->dot_record->isoDirRecord, 34); + memcpy(diskStructure->primaryDescriptor.root_directory_record, + diskStructure->rootNode->dot_record->isoDirRecord, 34); /* In RRIP, this might be longer than 34 */ - diskStructure.primaryDescriptor.root_directory_record[0] = 34; + diskStructure->primaryDescriptor.root_directory_record[0] = 34; /* Set up all the important numbers in the PVD */ - cd9660_bothendian_dword(diskStructure.totalSectors, - (unsigned char *)diskStructure.primaryDescriptor.volume_space_size); + cd9660_bothendian_dword(diskStructure->totalSectors, + (unsigned char *)diskStructure->primaryDescriptor.volume_space_size); cd9660_bothendian_word(1, - (unsigned char *)diskStructure.primaryDescriptor.volume_set_size); + (unsigned char *)diskStructure->primaryDescriptor.volume_set_size); cd9660_bothendian_word(1, (unsigned char *) - diskStructure.primaryDescriptor.volume_sequence_number); - cd9660_bothendian_word(diskStructure.sectorSize, + diskStructure->primaryDescriptor.volume_sequence_number); + cd9660_bothendian_word(diskStructure->sectorSize, (unsigned char *) - diskStructure.primaryDescriptor.logical_block_size); - cd9660_bothendian_dword(diskStructure.pathTableLength, - (unsigned char *)diskStructure.primaryDescriptor.path_table_size); + diskStructure->primaryDescriptor.logical_block_size); + cd9660_bothendian_dword(diskStructure->pathTableLength, + (unsigned char *)diskStructure->primaryDescriptor.path_table_size); - cd9660_731(diskStructure.primaryLittleEndianTableSector, - (u_char *)diskStructure.primaryDescriptor.type_l_path_table); - cd9660_732(diskStructure.primaryBigEndianTableSector, - (u_char *)diskStructure.primaryDescriptor.type_m_path_table); + cd9660_731(diskStructure->primaryLittleEndianTableSector, + (u_char *)diskStructure->primaryDescriptor.type_l_path_table); + cd9660_732(diskStructure->primaryBigEndianTableSector, + (u_char *)diskStructure->primaryDescriptor.type_m_path_table); - diskStructure.primaryDescriptor.file_structure_version[0] = 1; + diskStructure->primaryDescriptor.file_structure_version[0] = 1; /* Pad all strings with spaces instead of nulls */ - cd9660_pad_string_spaces(diskStructure.primaryDescriptor.volume_id, 32); - cd9660_pad_string_spaces(diskStructure.primaryDescriptor.system_id, 32); - cd9660_pad_string_spaces(diskStructure.primaryDescriptor.volume_set_id, + cd9660_pad_string_spaces(diskStructure->primaryDescriptor.volume_id, 32); + cd9660_pad_string_spaces(diskStructure->primaryDescriptor.system_id, 32); + cd9660_pad_string_spaces(diskStructure->primaryDescriptor.volume_set_id, 128); - cd9660_pad_string_spaces(diskStructure.primaryDescriptor.publisher_id, + cd9660_pad_string_spaces(diskStructure->primaryDescriptor.publisher_id, 128); - cd9660_pad_string_spaces(diskStructure.primaryDescriptor.preparer_id, + cd9660_pad_string_spaces(diskStructure->primaryDescriptor.preparer_id, 128); - cd9660_pad_string_spaces(diskStructure.primaryDescriptor.application_id, + cd9660_pad_string_spaces(diskStructure->primaryDescriptor.application_id, 128); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.copyright_file_id, 37); + diskStructure->primaryDescriptor.copyright_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.abstract_file_id, 37); + diskStructure->primaryDescriptor.abstract_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.bibliographic_file_id, 37); + diskStructure->primaryDescriptor.bibliographic_file_id, 37); /* Setup dates */ cd9660_time_8426( - (unsigned char *)diskStructure.primaryDescriptor.creation_date, + (unsigned char *)diskStructure->primaryDescriptor.creation_date, tstamp); cd9660_time_8426( - (unsigned char *)diskStructure.primaryDescriptor.modification_date, + (unsigned char *)diskStructure->primaryDescriptor.modification_date, tstamp); #if 0 - cd9660_set_date(diskStructure.primaryDescriptor.expiration_date, + cd9660_set_date(diskStructure->primaryDescriptor.expiration_date, tstamp); #endif - memset(diskStructure.primaryDescriptor.expiration_date, '0', 16); - diskStructure.primaryDescriptor.expiration_date[16] = 0; + memset(diskStructure->primaryDescriptor.expiration_date, '0', 16); + diskStructure->primaryDescriptor.expiration_date[16] = 0; + cd9660_time_8426( - (unsigned char *)diskStructure.primaryDescriptor.effective_date, + (unsigned char *)diskStructure->primaryDescriptor.effective_date, tstamp); /* make this sane */ - cd9660_time_915(diskStructure.rootNode->dot_record->isoDirRecord->date, + cd9660_time_915(diskStructure->rootNode->dot_record->isoDirRecord->date, tstamp); } @@ -712,16 +725,16 @@ cd9660_populate_iso_dir_record(struct _iso_directory_r } static void -cd9660_setup_root_node(void) +cd9660_setup_root_node(iso9660_disk *diskStructure) { - cd9660_populate_iso_dir_record(diskStructure.rootNode->isoDirRecord, + cd9660_populate_iso_dir_record(diskStructure->rootNode->isoDirRecord, 0, ISO_FLAG_DIRECTORY, 1, "\0"); } /*********** SUPPORT FUNCTIONS ***********/ static int -cd9660_setup_volume_descriptors(void) +cd9660_setup_volume_descriptors(iso9660_disk *diskStructure) { /* Boot volume descriptor should come second */ int sector = 16; @@ -735,17 +748,17 @@ cd9660_setup_volume_descriptors(void) } temp->volumeDescriptorData = - (unsigned char *)&diskStructure.primaryDescriptor; + (unsigned char *)&diskStructure->primaryDescriptor; temp->volumeDescriptorData[0] = ISO_VOLUME_DESCRIPTOR_PVD; temp->volumeDescriptorData[6] = 1; temp->sector = sector; memcpy(temp->volumeDescriptorData + 1, ISO_VOLUME_DESCRIPTOR_STANDARD_ID, 5); - diskStructure.firstVolumeDescriptor = temp; + diskStructure->firstVolumeDescriptor = temp; sector++; /* Set up boot support if enabled. BVD must reside in sector 17 */ - if (diskStructure.is_bootable) { + if (diskStructure->is_bootable) { if ((t = malloc(sizeof(volume_descriptor))) == NULL) { CD9660_MEM_ALLOC_ERROR( "cd9660_setup_volume_descriptors"); @@ -760,9 +773,9 @@ cd9660_setup_volume_descriptors(void) temp = t; memset(t->volumeDescriptorData, 0, 2048); t->sector = 17; - if (diskStructure.verbose_level > 0) + if (diskStructure->verbose_level > 0) printf("Setting up boot volume descriptor\n"); - cd9660_setup_boot_volume_descriptor(t); + cd9660_setup_boot_volume_descriptor(diskStructure, t); sector++; } @@ -808,7 +821,7 @@ cd9660_fill_extended_attribute_record(cd9660node *node #endif static int -cd9660_translate_node_common(cd9660node *newnode) +cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode) { time_t tstamp = stampst.st_ino ? stampst.st_mtime : time(NULL); int test; @@ -818,7 +831,7 @@ cd9660_translate_node_common(cd9660node *newnode) /* Now populate the isoDirRecord structure */ memset(temp, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); - test = cd9660_convert_filename(newnode->node->name, + test = cd9660_convert_filename(diskStructure, newnode->node->name, temp, !(S_ISDIR(newnode->node->type))); flag = ISO_FLAG_CLEAR; @@ -852,10 +865,11 @@ cd9660_translate_node_common(cd9660node *newnode) * @returns int 0 on failure, 1 on success */ static int -cd9660_translate_node(fsnode *node, cd9660node *newnode) +cd9660_translate_node(iso9660_disk *diskStructure, fsnode *node, + cd9660node *newnode) { if (node == NULL) { - if (diskStructure.verbose_level > 0) + if (diskStructure->verbose_level > 0) printf("cd9660_translate_node: NULL node passed, " "returning\n"); return 0; @@ -873,7 +887,7 @@ cd9660_translate_node(fsnode *node, cd9660node *newnod if (!(S_ISDIR(node->type))) newnode->fileDataLength = node->inode->st.st_size; - if (cd9660_translate_node_common(newnode) == 0) + if (cd9660_translate_node_common(diskStructure, newnode) == 0) return 0; /* Finally, overwrite some of the values that are set by default */ @@ -1007,7 +1021,8 @@ cd9660_sorted_child_insert(cd9660node *parent, cd9660n * where n represents the files respective place in the ordering */ static int -cd9660_handle_collisions(cd9660node *colliding, int past) +cd9660_handle_collisions(iso9660_disk *diskStructure, cd9660node *colliding, + int past) { cd9660node *iter, *next, *prev; int skip; @@ -1042,14 +1057,16 @@ cd9660_handle_collisions(cd9660node *colliding, int pa temp_past--; } skip += past; - iter = cd9660_rename_filename(iter, skip, delete_chars); + iter = cd9660_rename_filename(diskStructure, iter, skip, + delete_chars); } return flag; } static cd9660node * -cd9660_rename_filename(cd9660node *iter, int num, int delete_chars) +cd9660_rename_filename(iso9660_disk *diskStructure, cd9660node *iter, int num, + int delete_chars) { int i = 0; int numbts, digit, digits, temp, powers, count; @@ -1057,14 +1074,14 @@ cd9660_rename_filename(cd9660node *iter, int num, int int maxlength; char *tmp; - if (diskStructure.verbose_level > 0) + if (diskStructure->verbose_level > 0) printf("Rename_filename called\n"); - assert(1 <= diskStructure.isoLevel && diskStructure.isoLevel <= 2); + assert(1 <= diskStructure->isoLevel && diskStructure->isoLevel <= 2); /* TODO : A LOT of chanes regarding 8.3 filenames */ - if (diskStructure.isoLevel == 1) + if (diskStructure->isoLevel == 1) maxlength = 8; - else if (diskStructure.isoLevel == 2) + else if (diskStructure->isoLevel == 2) maxlength = 31; else maxlength = ISO_FILENAME_MAXLENGTH_BEFORE_VERSION; @@ -1110,7 +1127,7 @@ cd9660_rename_filename(cd9660node *iter, int num, int */ /* - if (diskStructure.isoLevel == 1) { + if (diskStructure->isoLevel == 1) { numbts = 8 - digits - delete_chars; if (dot < 0) { @@ -1162,7 +1179,7 @@ cd9660_rename_filename(cd9660node *iter, int num, int /* Todo: Figure out why these functions are nec. */ static void -cd9660_copy_filenames(cd9660node *node) +cd9660_copy_filenames(iso9660_disk *diskStructure, cd9660node *node) { cd9660node *cn; @@ -1170,12 +1187,12 @@ cd9660_copy_filenames(cd9660node *node) return; if (TAILQ_FIRST(&node->cn_children)->isoDirRecord == NULL) { - debug_print_tree(diskStructure.rootNode, 0); + debug_print_tree(diskStructure, diskStructure->rootNode, 0); exit(1); } TAILQ_FOREACH(cn, &node->cn_children, cn_next_child) { - cd9660_copy_filenames(cn); + cd9660_copy_filenames(diskStructure, cn); memcpy(cn->o_name, cn->isoDirRecord->name, ISO_FILENAME_MAXLENGTH_WITH_PADDING); } @@ -1242,7 +1259,7 @@ cd9660_count_collisions(cd9660node *copy) } static cd9660node * -cd9660_rrip_move_directory(cd9660node *dir) +cd9660_rrip_move_directory(iso9660_disk *diskStructure, cd9660node *dir) { char newname[9]; cd9660node *tfile; @@ -1253,28 +1270,29 @@ cd9660_rrip_move_directory(cd9660node *dir) * 2) Point the virtual file to the new directory * 3) Point the relocated directory to its old parent * 4) Move the directory specified by dir into rr_moved_dir, - * and rename it to "diskStructure.rock_ridge_move_count" (as a string) + * and rename it to "diskStructure->rock_ridge_move_count" (as a string) */ /* First see if the moved directory even exists */ - if (diskStructure.rr_moved_dir == NULL) { - diskStructure.rr_moved_dir = - cd9660_create_directory(ISO_RRIP_DEFAULT_MOVE_DIR_NAME, - diskStructure.rootNode, dir); - if (diskStructure.rr_moved_dir == NULL) + if (diskStructure->rr_moved_dir == NULL) { + diskStructure->rr_moved_dir = cd9660_create_directory( + diskStructure, ISO_RRIP_DEFAULT_MOVE_DIR_NAME, + diskStructure->rootNode, dir); + if (diskStructure->rr_moved_dir == NULL) return 0; - cd9660_time_915(diskStructure.rr_moved_dir->isoDirRecord->date, + cd9660_time_915(diskStructure->rr_moved_dir->isoDirRecord->date, stampst.st_ino ? stampst.st_mtime : start_time.tv_sec); } /* Create a file with the same ORIGINAL name */ - tfile = cd9660_create_file(dir->node->name, dir->parent, dir); + tfile = cd9660_create_file(diskStructure, dir->node->name, dir->parent, + dir); if (tfile == NULL) return NULL; - diskStructure.rock_ridge_move_count++; + diskStructure->rock_ridge_move_count++; snprintf(newname, sizeof(newname), "%08i", - diskStructure.rock_ridge_move_count); + diskStructure->rock_ridge_move_count); /* Point to old parent */ dir->rr_real_parent = dir->parent; @@ -1288,13 +1306,13 @@ cd9660_rrip_move_directory(cd9660node *dir) } /* Point to new parent */ - dir->parent = diskStructure.rr_moved_dir; + dir->parent = diskStructure->rr_moved_dir; /* Point the file to the moved directory */ tfile->rr_relocated = dir; /* Actually move the directory */ - cd9660_sorted_child_insert(diskStructure.rr_moved_dir, dir); + cd9660_sorted_child_insert(diskStructure->rr_moved_dir, dir); /* TODO: Inherit permissions / ownership (basically the entire inode) */ @@ -1308,7 +1326,7 @@ cd9660_rrip_move_directory(cd9660node *dir) } static int -cd9660_add_dot_records(cd9660node *root) +cd9660_add_dot_records(iso9660_disk *diskStructure, cd9660node *root) { struct cd9660_children_head *head = &root->cn_children; cd9660node *cn; @@ -1317,10 +1335,11 @@ cd9660_add_dot_records(cd9660node *root) if ((cn->type & CD9660_TYPE_DIR) == 0) continue; /* Recursion first */ - cd9660_add_dot_records(cn); + cd9660_add_dot_records(diskStructure, cn); } - cd9660_create_special_directory(CD9660_TYPE_DOT, root); - cd9660_create_special_directory(CD9660_TYPE_DOTDOT, root); + cd9660_create_special_directory(diskStructure, CD9660_TYPE_DOT, root); + cd9660_create_special_directory(diskStructure, CD9660_TYPE_DOTDOT, + root); return 1; } @@ -1335,8 +1354,8 @@ cd9660_add_dot_records(cd9660node *root) * @param int* Running count of the number of directories that are being created */ static void -cd9660_convert_structure(fsnode *root, cd9660node *parent_node, int level, - int *numDirectories, int *error) +cd9660_convert_structure(iso9660_disk *diskStructure, fsnode *root, + cd9660node *parent_node, int level, int *numDirectories, int *error) { fsnode *iterator = root; cd9660node *this_node; @@ -1379,7 +1398,8 @@ cd9660_convert_structure(fsnode *root, cd9660node *par /* Translate the node, including its filename */ this_node->parent = parent_node; - cd9660_translate_node(iterator, this_node); + cd9660_translate_node(diskStructure, iterator, + this_node); this_node->level = level; if (S_ISDIR(iterator->type)) { @@ -1393,14 +1413,14 @@ cd9660_convert_structure(fsnode *root, cd9660node *par * allowed as per ISO spec */ if (level == 8) { - if ((!diskStructure.allow_deep_trees) && - (!diskStructure.rock_ridge_enabled)) { + if ((!diskStructure->allow_deep_trees) && + (!diskStructure->rock_ridge_enabled)) { warnx("error: found entry " "with depth greater " "than 8."); (*error) = 1; return; - } else if (diskStructure. + } else if (diskStructure-> rock_ridge_enabled) { working_level = 3; /* @@ -1410,6 +1430,7 @@ cd9660_convert_structure(fsnode *root, cd9660node *par this_node->level = working_level - 1; if (cd9660_rrip_move_directory( + diskStructure, this_node) == NULL) { warnx("Failure in " "cd9660_rrip_" @@ -1424,8 +1445,8 @@ cd9660_convert_structure(fsnode *root, cd9660node *par /* Do the recursive call on the children */ if (iterator->child != NULL) { - cd9660_convert_structure( - iterator->child, this_node, + cd9660_convert_structure(diskStructure, + iterator->child, this_node, working_level, numDirectories, error); @@ -1464,10 +1485,11 @@ cd9660_convert_structure(fsnode *root, cd9660node *par /* cd9660_handle_collisions(first_node); */ /* TODO: need cleanup */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Apr 25 01:20:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90FF7FB9A08; Wed, 25 Apr 2018 01:20:26 +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 458CD744DF; Wed, 25 Apr 2018 01:20:26 +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 3B97F22634; Wed, 25 Apr 2018 01:20:26 +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 w3P1KQPW074611; Wed, 25 Apr 2018 01:20:26 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P1KPrR074606; Wed, 25 Apr 2018 01:20:25 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804250120.w3P1KPrR074606@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 01:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332978 - stable/11/usr.sbin/makefs X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/usr.sbin/makefs X-SVN-Commit-Revision: 332978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 01:20:26 -0000 Author: benno Date: Wed Apr 25 01:20:25 2018 New Revision: 332978 URL: https://svnweb.freebsd.org/changeset/base/332978 Log: MFC r315304 makefs: sync option parsing with NetBSD - add support for parsing different types; not just int - homogenize option parsing - fix single letter parsing - remove duplicated code NetBSD revisions: cd9660.c 1.36 1.37 1.38 1.41 1.42 1.43 ffs.c 1.50 1.51 1.52 1.53 1.56 1.57 makefs.c 1.36 1.37 1.38 1.39 1.40 1.42 1.43 1.44 1.46 makefs.h 1.28 1.29 1.31 1.32 Sponsored by: iXsystems, Inc. Modified: stable/11/usr.sbin/makefs/cd9660.c stable/11/usr.sbin/makefs/cd9660.h stable/11/usr.sbin/makefs/ffs.c stable/11/usr.sbin/makefs/makefs.c stable/11/usr.sbin/makefs/makefs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:12:40 2018 (r332977) +++ stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:20:25 2018 (r332978) @@ -257,7 +257,70 @@ cd9660_prep_opts(fsinfo_t *fsopts) if ((diskStructure = calloc(1, sizeof(*diskStructure))) == NULL) err(EXIT_FAILURE, "%s: calloc", __func__); +#define OPT_STR(letter, name, desc) \ + { letter, name, NULL, OPT_STRBUF, 0, 0, desc } + +#define OPT_NUM(letter, name, field, min, max, desc) \ + { letter, name, &diskStructure->field, \ + sizeof(diskStructure->field) == 8 ? OPT_INT64 : \ + (sizeof(diskStructure->field) == 4 ? OPT_INT32 : \ + (sizeof(diskStructure->field) == 2 ? OPT_INT16 : OPT_INT8)), \ + min, max, desc } + +#define OPT_BOOL(letter, name, field, desc) \ + OPT_NUM(letter, name, field, 0, 1, desc) + + const option_t cd9660_options[] = { + OPT_NUM('l', "isolevel", isoLevel, + 1, 2, "ISO Level"), + OPT_NUM('v', "verbose", verbose_level, + 0, 2, "Turns on verbose output"), + + OPT_BOOL('h', "help", displayHelp, + "Show help message"), + OPT_BOOL('S', "follow-symlinks", follow_sym_links, + "Resolve symlinks in pathnames"), + OPT_BOOL('R', "rockridge", rock_ridge_enabled, + "Enable Rock-Ridge extensions"), + OPT_BOOL('C', "chrp-boot", chrp_boot, + "Enable CHRP boot"), + OPT_BOOL('K', "keep-bad-images", keep_bad_images, + "Keep bad images"), + OPT_BOOL('D', "allow-deep-trees", allow_deep_trees, + "Allow trees more than 8 levels"), + OPT_BOOL('a', "allow-max-name", allow_max_name, + "Allow 37 char filenames (unimplemented)"), + OPT_BOOL('i', "allow-illegal-chars", allow_illegal_chars, + "Allow illegal characters in filenames"), + OPT_BOOL('d', "allow-multidot", allow_multidot, + "Allow multiple periods in filenames"), + OPT_BOOL('o', "omit-trailing-period", omit_trailing_period, + "Omit trailing periods in filenames"), + OPT_BOOL('\0', "allow-lowercase", allow_lowercase, + "Allow lowercase characters in filenames"), + OPT_BOOL('\0', "archimedes", archimedes_enabled, + "Enable Archimedes structure"), + OPT_BOOL('\0', "no-trailing-padding", include_padding_areas, + "Include padding areas"), + + OPT_STR('A', "applicationid", "Application Identifier"), + OPT_STR('P', "publisher", "Publisher Identifier"), + OPT_STR('p', "preparer", "Preparer Identifier"), + OPT_STR('L', "label", "Disk Label"), + OPT_STR('V', "volumeid", "Volume Set Identifier"), + OPT_STR('B', "bootimage", "Boot image parameter"), + OPT_STR('G', "generic-bootimage", "Generic boot image param"), + OPT_STR('\0', "bootimagedir", "Boot image directory"), + OPT_STR('\0', "no-emul-boot", "No boot emulation"), + OPT_STR('\0', "no-boot", "No boot support"), + OPT_STR('\0', "hard-disk-boot", "Boot from hard disk"), + OPT_STR('\0', "boot-load-segment", "Boot load segment"), + + { .name = NULL } + }; + fsopts->fs_specific = diskStructure; + fsopts->fs_options = copy_opts(cd9660_options); cd9660_set_defaults(diskStructure); } @@ -266,6 +329,7 @@ void cd9660_cleanup_opts(fsinfo_t *fsopts) { free(fsopts->fs_specific); + free(fsopts->fs_options); } static int @@ -302,144 +366,106 @@ cd9660_arguments_set_string(const char *val, const cha int cd9660_parse_opts(const char *option, fsinfo_t *fsopts) { - char *var, *val; - int rv; + int rv, i; iso9660_disk *diskStructure = fsopts->fs_specific; + option_t *cd9660_options = fsopts->fs_options; + char buf[1024]; + const char *name, *desc; - /* Set up allowed options - integer options ONLY */ - option_t cd9660_options[] = { - { "l", &diskStructure->isoLevel, 1, 2, "ISO Level" }, - { "isolevel", &diskStructure->isoLevel, 1, 2, "ISO Level" }, - { "verbose", &diskStructure->verbose_level, 0, 2, - "Turns on verbose output" }, - { "v", &diskStructure->verbose_level, 0 , 2, - "Turns on verbose output"}, - { .name = NULL } - }; - - /* - * Todo : finish implementing this, and make a function that - * parses them - */ - /* - string_option_t cd9660_string_options[] = { - { "L", "Label", &diskStructure.primaryDescriptor.volume_id, 1, 32, "Disk Label", ISO_STRING_FILTER_DCHARS }, - { NULL } - } - */ - assert(option != NULL); if (debug & DEBUG_FS_PARSE_OPTS) printf("cd9660_parse_opts: got `%s'\n", option); - if ((var = strdup(option)) == NULL) - err(1, "allocating memory for copy of option string"); - rv = 1; + i = set_option(cd9660_options, option, buf, sizeof(buf)); + if (i == -1) + return 0; - val = strchr(var, '='); - if (val != NULL) - *val++ = '\0'; + if (cd9660_options[i].name == NULL) + abort(); - /* First handle options with no parameters */ - if (strcmp(var, "h") == 0) { - diskStructure->displayHelp = 1; - rv = 1; - } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "S", "follow-symlinks")) { - /* this is not handled yet */ - diskStructure->follow_sym_links = 1; - rv = 1; - } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "L", "label")) { - rv = cd9660_arguments_set_string(val, "Disk Label", 32, 'd', - diskStructure->primaryDescriptor.volume_id); - } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "applicationid")) { - rv = cd9660_arguments_set_string(val, "Application Identifier", 128, 'a', - diskStructure->primaryDescriptor.application_id); - } else if(CD9660_IS_COMMAND_ARG_DUAL(var, "P", "publisher")) { - rv = cd9660_arguments_set_string(val, "Publisher Identifier", - 128, 'a', diskStructure->primaryDescriptor.publisher_id); - } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "p", "preparer")) { - rv = cd9660_arguments_set_string(val, "Preparer Identifier", - 128, 'a', diskStructure->primaryDescriptor.preparer_id); - } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "V", "volumeid")) { - rv = cd9660_arguments_set_string(val, "Volume Set Identifier", - 128, 'a', diskStructure->primaryDescriptor.volume_set_id); + name = cd9660_options[i].name; + desc = cd9660_options[i].desc; + switch (cd9660_options[i].letter) { + case 'h': + case 'S': + rv = 0; /* this is not handled yet */ + break; + case 'L': + rv = cd9660_arguments_set_string(buf, desc, 32, 'd', + diskStructure->primaryDescriptor.volume_id); + break; + case 'A': + rv = cd9660_arguments_set_string(buf, desc, 128, 'a', + diskStructure->primaryDescriptor.application_id); + break; + case 'P': + rv = cd9660_arguments_set_string(buf, desc, 128, 'a', + diskStructure->primaryDescriptor.publisher_id); + break; + case 'p': + rv = cd9660_arguments_set_string(buf, desc, 128, 'a', + diskStructure->primaryDescriptor.preparer_id); + break; + case 'V': + rv = cd9660_arguments_set_string(buf, desc, 128, 'a', + diskStructure->primaryDescriptor.volume_set_id); + break; /* Boot options */ - } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "B", "bootimage")) { - if (val == NULL) - warnx("error: The Boot Image parameter requires a valid boot information string"); - else - rv = cd9660_add_boot_disk(diskStructure, val); - } else if (CD9660_IS_COMMAND_ARG(var, "bootimagedir")) { - /* - * XXXfvdl this is unused. - */ - if (val == NULL) - errx(1, "error: The Boot Image Directory parameter" - " requires a directory name\n"); - else { - if ((diskStructure->boot_image_directory = - malloc(strlen(val) + 1)) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_parse_opts"); - exit(1); - } - - /* BIG TODO: Add the max length function here */ - cd9660_arguments_set_string(val, "Boot Image Directory", - 12 , 'd', diskStructure->boot_image_directory); - } - } else if (CD9660_IS_COMMAND_ARG_DUAL(var, "G", "generic-bootimage")) { - if (val == NULL) - warnx("error: The Boot Image parameter requires a valid boot information string"); - else - rv = cd9660_add_generic_bootimage(diskStructure, val); - } else if (CD9660_IS_COMMAND_ARG(var, "no-trailing-padding")) - diskStructure->include_padding_areas = 0; - /* RRIP */ - else if (CD9660_IS_COMMAND_ARG_DUAL(var, "R", "rockridge")) - diskStructure->rock_ridge_enabled = 1; - else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "archimedes")) - diskStructure->archimedes_enabled = 1; - else if (CD9660_IS_COMMAND_ARG(var, "chrp-boot")) - diskStructure->chrp_boot = 1; - else if (CD9660_IS_COMMAND_ARG_DUAL(var, "K", "keep-bad-images")) - diskStructure->keep_bad_images = 1; - else if (CD9660_IS_COMMAND_ARG(var, "allow-deep-trees")) - diskStructure->allow_deep_trees = 1; - else if (CD9660_IS_COMMAND_ARG(var, "allow-max-name")) - diskStructure->allow_max_name = 1; - else if (CD9660_IS_COMMAND_ARG(var, "allow-illegal-chars")) - diskStructure->allow_illegal_chars = 1; - else if (CD9660_IS_COMMAND_ARG(var, "allow-lowercase")) - diskStructure->allow_lowercase = 1; - else if (CD9660_IS_COMMAND_ARG(var,"allow-multidot")) - diskStructure->allow_multidot = 1; - else if (CD9660_IS_COMMAND_ARG(var, "omit-trailing-period")) - diskStructure->omit_trailing_period = 1; - else if (CD9660_IS_COMMAND_ARG(var, "no-emul-boot") || - CD9660_IS_COMMAND_ARG(var, "no-boot") || - CD9660_IS_COMMAND_ARG(var, "hard-disk-boot")) { - cd9660_eltorito_add_boot_option(diskStructure, var, 0); - - /* End of flag variables */ - } else if (CD9660_IS_COMMAND_ARG(var, "boot-load-segment")) { - if (val == NULL) { - warnx("Option `%s' doesn't contain a value", var); + case 'B': + if (buf[0] == '\0') { + warnx("The Boot Image parameter requires a valid boot" + "information string"); rv = 0; - } else { - cd9660_eltorito_add_boot_option(diskStructure, var, - val); - } - } else { - if (val == NULL) { - warnx("Option `%s' doesn't contain a value", var); + } else + rv = cd9660_add_boot_disk(diskStructure, buf); + break; + case 'G': + if (buf[0] == '\0') { + warnx("The Generic Boot Image parameter requires a" + " valid boot information string"); rv = 0; } else - rv = set_option(cd9660_options, var, val); + rv = cd9660_add_generic_bootimage(diskStructure, buf); + break; + default: + if (strcmp(name, "bootimagedir") == 0) { + /* + * XXXfvdl this is unused. + */ + if (buf[0] == '\0') { + warnx("The Boot Image Directory parameter" + " requires a directory name\n"); + rv = 0; + } else { + diskStructure->boot_image_directory = + malloc(strlen(buf) + 1); + if (diskStructure->boot_image_directory == NULL) + err(1, "malloc"); + /* BIG TODO: Add the max length function here */ + rv = cd9660_arguments_set_string(buf, desc, 12, + 'd', diskStructure->boot_image_directory); + } + } else if (strcmp(name, "no-emul-boot") == 0 || + strcmp(name, "no-boot") == 0 || + strcmp(name, "hard-disk-boot") == 0) { + /* RRIP */ + cd9660_eltorito_add_boot_option(diskStructure, name, 0); + rv = 1; + } else if (strcmp(name, "boot-load-segment") == 0) { + if (buf[0] == '\0') { + warnx("Option `%s' doesn't contain a value", + name); + rv = 0; + } else { + cd9660_eltorito_add_boot_option(diskStructure, + name, buf); + rv = 1; + } + } else + rv = 1; } - - free(var); - return (rv); + return rv; } /* Modified: stable/11/usr.sbin/makefs/cd9660.h ============================================================================== --- stable/11/usr.sbin/makefs/cd9660.h Wed Apr 25 01:12:40 2018 (r332977) +++ stable/11/usr.sbin/makefs/cd9660.h Wed Apr 25 01:20:25 2018 (r332978) @@ -122,12 +122,6 @@ typedef struct { #define CD9660_MEM_ALLOC_ERROR(_F) \ err(EXIT_FAILURE, "%s, %s l. %d", _F, __FILE__, __LINE__) -#define CD9660_IS_COMMAND_ARG_DUAL(var,short,long)\ - (strcmp((var),(short)) == 0) || (strcmp((var),(long))==0) - -#define CD9660_IS_COMMAND_ARG(var,arg)\ - (strcmp((var),(arg)) == 0) - #define CD9660_TYPE_FILE 0x01 #define CD9660_TYPE_DIR 0x02 #define CD9660_TYPE_DOT 0x04 Modified: stable/11/usr.sbin/makefs/ffs.c ============================================================================== --- stable/11/usr.sbin/makefs/ffs.c Wed Apr 25 01:12:40 2018 (r332977) +++ stable/11/usr.sbin/makefs/ffs.c Wed Apr 25 01:20:25 2018 (r332978) @@ -144,7 +144,6 @@ static void *ffs_build_dinode2(struct ufs2_dinode *, int sectorsize; /* XXX: for buf.c::getblk() */ - /* publicly visible functions */ void @@ -155,7 +154,33 @@ ffs_prep_opts(fsinfo_t *fsopts) if ((ffs_opts = calloc(1, sizeof(ffs_opt_t))) == NULL) err(1, "Allocating memory for ffs_options"); - fsopts->fs_specific = ffs_opts; + const option_t ffs_options[] = { + { 'b', "bsize", &ffs_opts->bsize, OPT_INT32, + 1, INT_MAX, "block size" }, + { 'f', "fsize", &ffs_opts->fsize, OPT_INT32, + 1, INT_MAX, "fragment size" }, + { 'd', "density", &ffs_opts->density, OPT_INT32, + 1, INT_MAX, "bytes per inode" }, + { 'm', "minfree", &ffs_opts->minfree, OPT_INT32, + 0, 99, "minfree" }, + { 'M', "maxbpg", &ffs_opts->maxbpg, OPT_INT32, + 1, INT_MAX, "max blocks per file in a cg" }, + { 'a', "avgfilesize", &ffs_opts->avgfilesize, OPT_INT32, + 1, INT_MAX, "expected average file size" }, + { 'n', "avgfpdir", &ffs_opts->avgfpdir, OPT_INT32, + 1, INT_MAX, "expected # of files per directory" }, + { 'x', "extent", &ffs_opts->maxbsize, OPT_INT32, + 1, INT_MAX, "maximum # extent size" }, + { 'g', "maxbpcg", &ffs_opts->maxblkspercg, OPT_INT32, + 1, INT_MAX, "max # of blocks per group" }, + { 'v', "version", &ffs_opts->version, OPT_INT32, + 1, 2, "UFS version" }, + { 'o', "optimization", NULL, OPT_STRBUF, + 0, 0, "Optimization (time|space)" }, + { 'l', "label", ffs_opts->label, OPT_STRARRAY, + 1, sizeof(ffs_opts->label), "UFS label" }, + { .name = NULL } + }; ffs_opts->bsize= -1; ffs_opts->fsize= -1; @@ -168,45 +193,25 @@ ffs_prep_opts(fsinfo_t *fsopts) ffs_opts->avgfilesize= -1; ffs_opts->avgfpdir= -1; ffs_opts->version = 1; + + fsopts->fs_specific = ffs_opts; + fsopts->fs_options = copy_opts(ffs_options); } void ffs_cleanup_opts(fsinfo_t *fsopts) { - if (fsopts->fs_specific) - free(fsopts->fs_specific); + free(fsopts->fs_specific); + free(fsopts->fs_options); } int ffs_parse_opts(const char *option, fsinfo_t *fsopts) { ffs_opt_t *ffs_opts = fsopts->fs_specific; + option_t *ffs_options = fsopts->fs_options; + char buf[1024]; - option_t ffs_options[] = { - { "bsize", &ffs_opts->bsize, 1, INT_MAX, - "block size" }, - { "fsize", &ffs_opts->fsize, 1, INT_MAX, - "fragment size" }, - { "density", &ffs_opts->density, 1, INT_MAX, - "bytes per inode" }, - { "minfree", &ffs_opts->minfree, 0, 99, - "minfree" }, - { "maxbpg", &ffs_opts->maxbpg, 1, INT_MAX, - "max blocks per file in a cg" }, - { "avgfilesize", &ffs_opts->avgfilesize,1, INT_MAX, - "expected average file size" }, - { "avgfpdir", &ffs_opts->avgfpdir, 1, INT_MAX, - "expected # of files per directory" }, - { "extent", &ffs_opts->maxbsize, 1, INT_MAX, - "maximum # extent size" }, - { "maxbpcg", &ffs_opts->maxblkspercg,1, INT_MAX, - "max # of blocks per group" }, - { "version", &ffs_opts->version, 1, 2, - "UFS version" }, - { .name = NULL } - }; - - char *var, *val; int rv; assert(option != NULL); @@ -216,36 +221,28 @@ ffs_parse_opts(const char *option, fsinfo_t *fsopts) if (debug & DEBUG_FS_PARSE_OPTS) printf("ffs_parse_opts: got `%s'\n", option); - if ((var = strdup(option)) == NULL) - err(1, "Allocating memory for copy of option string"); - rv = 0; + rv = set_option(ffs_options, option, buf, sizeof(buf)); + if (rv == -1) + return 0; - if ((val = strchr(var, '=')) == NULL) { - warnx("Option `%s' doesn't contain a value", var); - goto leave_ffs_parse_opts; - } - *val++ = '\0'; + if (ffs_options[rv].name == NULL) + abort(); - if (strcmp(var, "optimization") == 0) { - if (strcmp(val, "time") == 0) { + switch (ffs_options[rv].letter) { + case 'o': + if (strcmp(buf, "time") == 0) { ffs_opts->optimization = FS_OPTTIME; - } else if (strcmp(val, "space") == 0) { + } else if (strcmp(buf, "space") == 0) { ffs_opts->optimization = FS_OPTSPACE; } else { - warnx("Invalid optimization `%s'", val); - goto leave_ffs_parse_opts; + warnx("Invalid optimization `%s'", buf); + return 0; } - rv = 1; - } else if (strcmp(var, "label") == 0) { - strlcpy(ffs_opts->label, val, sizeof(ffs_opts->label)); - rv = 1; - } else - rv = set_option(ffs_options, var, val); - - leave_ffs_parse_opts: - if (var) - free(var); - return (rv); + break; + default: + break; + } + return 1; } Modified: stable/11/usr.sbin/makefs/makefs.c ============================================================================== --- stable/11/usr.sbin/makefs/makefs.c Wed Apr 25 01:12:40 2018 (r332977) +++ stable/11/usr.sbin/makefs/makefs.c Wed Apr 25 01:20:25 2018 (r332978) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "makefs.h" #include "mtree.h" @@ -84,7 +85,7 @@ struct stat stampst; static fstype_t *get_fstype(const char *); static int get_tstamp(const char *, struct stat *); -static void usage(void); +static void usage(fstype_t *, fsinfo_t *); int main(int, char *[]); int @@ -140,7 +141,7 @@ main(int argc, char *argv[]) #endif } else { warnx("Invalid endian `%s'.", optarg); - usage(); + usage(fstype, &fsoptions); } break; @@ -209,7 +210,7 @@ main(int argc, char *argv[]) if (*p == '\0') errx(1, "Empty option"); if (! fstype->parse_options(p, &fsoptions)) - usage(); + usage(fstype, &fsoptions); } break; } @@ -262,7 +263,7 @@ main(int argc, char *argv[]) case '?': default: - usage(); + usage(fstype, &fsoptions); /* NOTREACHED */ } @@ -277,7 +278,7 @@ main(int argc, char *argv[]) argv += optind; if (argc < 2) - usage(); + usage(fstype, &fsoptions); /* -x must be accompanied by -F */ if (fsoptions.onlyspec != 0 && specfile == NULL) @@ -343,21 +344,84 @@ main(int argc, char *argv[]) /* NOTREACHED */ } +int +set_option(const option_t *options, const char *option, char *buf, size_t len) +{ + char *var, *val; + int retval; + assert(option != NULL); + + if ((var = strdup(option)) == NULL) { + err(EXIT_FAILURE, "Allocating memory for copy of option string"); + } + + for (val = var; *val; val++) + if (*val == '=') { + *val++ = '\0'; + break; + } + retval = set_option_var(options, var, val, buf, len); + free(var); + return retval; +} + int -set_option(option_t *options, const char *var, const char *val) +set_option_var(const option_t *options, const char *var, const char *val, + char *buf, size_t len) { - int i; + char *s; + size_t i; +#define NUM(type) \ + if (!*val) { \ + *(type *)options[i].value = 1; \ + break; \ + } \ + *(type *)options[i].value = (type)strsuftoll(options[i].desc, val, \ + options[i].minimum, options[i].maximum); break + for (i = 0; options[i].name != NULL; i++) { - if (strcmp(options[i].name, var) != 0) + if (var[1] == '\0') { + if (options[i].letter != var[0]) + continue; + } else if (strcmp(options[i].name, var) != 0) continue; - *options[i].value = (int)strsuftoll(options[i].desc, val, - options[i].minimum, options[i].maximum); - return (1); + switch (options[i].type) { + case OPT_BOOL: + *(bool *)options[i].value = 1; + break; + case OPT_STRARRAY: + strlcpy((void *)options[i].value, val, (size_t) + options[i].maximum); + break; + case OPT_STRPTR: + if ((s = strdup(val)) == NULL) + err(1, NULL); + *(char **)options[i].value = s; + break; + case OPT_STRBUF: + if (buf == NULL) + abort(); + strlcpy(buf, val, len); + break; + case OPT_INT64: + NUM(uint64_t); + case OPT_INT32: + NUM(uint32_t); + case OPT_INT16: + NUM(uint16_t); + case OPT_INT8: + NUM(uint8_t); + default: + warnx("Unknown type %d in option %s", options[i].type, + val); + return 0; + } + return i; } warnx("Unknown option `%s'", var); - return (0); + return -1; } @@ -372,6 +436,20 @@ get_fstype(const char *type) return (NULL); } +option_t * +copy_opts(const option_t *o) +{ + size_t i; + void *rv; + + for (i = 0; o[i].name; i++) + continue; + i++; + if ((rv = calloc(i, sizeof(*o))) == NULL) + err(1, "calloc"); + return memcpy(rv, o, i * sizeof(*o)); +} + static int get_tstamp(const char *b, struct stat *st) { @@ -399,17 +477,29 @@ get_tstamp(const char *b, struct stat *st) } static void -usage(void) +usage(fstype_t *fstype, fsinfo_t *fsoptions) { const char *prog; prog = getprogname(); fprintf(stderr, -"usage: %s [-xZ] [-B endian] [-b free-blocks] [-d debug-mask]\n" +"Usage: %s [-xZ] [-B endian] [-b free-blocks] [-d debug-mask]\n" "\t[-F mtree-specfile] [-f free-files] [-M minimum-size] [-m maximum-size]\n" "\t[-N userdb-dir] [-o fs-options] [-R roundup-size] [-S sector-size]\n" "\t[-s image-size] [-T ] [-t fs-type]\n" "\timage-file directory | manifest [extra-directory ...]\n", prog); + + if (fstype) { + size_t i; + option_t *o = fsoptions->fs_options; + + fprintf(stderr, "\n%s specific options:\n", fstype->type); + for (i = 0; o[i].name != NULL; i++) + fprintf(stderr, "\t%c%c%20.20s\t%s\n", + o[i].letter ? o[i].letter : ' ', + o[i].letter ? ',' : ' ', + o[i].name, o[i].desc); + } exit(1); } Modified: stable/11/usr.sbin/makefs/makefs.h ============================================================================== --- stable/11/usr.sbin/makefs/makefs.h Wed Apr 25 01:12:40 2018 (r332977) +++ stable/11/usr.sbin/makefs/makefs.h Wed Apr 25 01:20:25 2018 (r332978) @@ -106,11 +106,37 @@ typedef struct _fsnode { #define FSNODE_F_OPTIONAL 0x02 /* fsnode is optional */ /* + * option_t - contains option name, description, pointer to location to store + * result, and range checks for the result. Used to simplify fs specific + * option setting + */ +typedef enum { + OPT_STRARRAY, + OPT_STRPTR, + OPT_STRBUF, + OPT_BOOL, + OPT_INT8, + OPT_INT16, + OPT_INT32, + OPT_INT64 +} opttype_t; + +typedef struct { + char letter; /* option letter NUL for none */ + const char *name; /* option name */ + void *value; /* where to stuff the value */ + opttype_t type; /* type of entry */ + long long minimum; /* minimum for value */ + long long maximum; /* maximum for value */ + const char *desc; /* option description */ +} option_t; + +/* * fsinfo_t - contains various settings and parameters pertaining to * the image, including current settings, global options, and fs * specific options */ -typedef struct { +typedef struct makefs_fsinfo { /* current settings */ off_t size; /* total size */ off_t inodes; /* number of inodes */ @@ -135,30 +161,20 @@ typedef struct { int sparse; /* sparse image, don't fill it with zeros */ void *fs_specific; /* File system specific additions. */ + option_t *fs_options; /* File system specific options */ } fsinfo_t; -/* - * option_t - contains option name, description, pointer to location to store - * result, and range checks for the result. Used to simplify fs specific - * option setting - */ -typedef struct { - const char *name; /* option name */ - int *value; /* where to stuff the value */ - int minimum; /* minimum for value */ - int maximum; /* maximum for value */ - const char *desc; /* option description */ -} option_t; - - void apply_specfile(const char *, const char *, fsnode *, int); void dump_fsnodes(fsnode *); const char * inode_type(mode_t); fsnode * read_mtree(const char *, fsnode *); -int set_option(option_t *, const char *, const char *); +int set_option(const option_t *, const char *, char *, size_t); +int set_option_var(const option_t *, const char *, const char *, + char *, size_t); fsnode * walk_dir(const char *, const char *, fsnode *, fsnode *); void free_fsnodes(fsnode *); +option_t * copy_opts(const option_t *); void ffs_prep_opts(fsinfo_t *); int ffs_parse_opts(const char *, fsinfo_t *); From owner-svn-src-all@freebsd.org Wed Apr 25 01:30:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD855FB9DED; Wed, 25 Apr 2018 01:30:30 +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 6D76574A25; Wed, 25 Apr 2018 01:30:30 +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 683FF227BD; Wed, 25 Apr 2018 01:30:30 +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 w3P1UUZZ079819; Wed, 25 Apr 2018 01:30:30 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P1UTEh079816; Wed, 25 Apr 2018 01:30:29 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804250130.w3P1UTEh079816@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 01:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332979 - stable/11/lib/libnetbsd X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/lib/libnetbsd X-SVN-Commit-Revision: 332979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 01:30:31 -0000 Author: benno Date: Wed Apr 25 01:30:29 2018 New Revision: 332979 URL: https://svnweb.freebsd.org/changeset/base/332979 Log: MFC r316572 libnetbsd: add emalloc and friends These are error-checked versions of memory allocation routines used by NetBSD code, and are being added to facilitate updates to makefs. Sponsored by: iXsystems, Inc. Added: stable/11/lib/libnetbsd/efun.c - copied unchanged from r316572, head/lib/libnetbsd/efun.c Modified: stable/11/lib/libnetbsd/Makefile stable/11/lib/libnetbsd/util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libnetbsd/Makefile ============================================================================== --- stable/11/lib/libnetbsd/Makefile Wed Apr 25 01:20:25 2018 (r332978) +++ stable/11/lib/libnetbsd/Makefile Wed Apr 25 01:30:29 2018 (r332979) @@ -7,7 +7,7 @@ LIB= netbsd CFLAGS+= -I${.CURDIR} -SRCS+= sockaddr_snprintf.c strsuftoll.c util.c util.h +SRCS+= efun.c sockaddr_snprintf.c strsuftoll.c util.c util.h INTERNALLIB= Copied: stable/11/lib/libnetbsd/efun.c (from r316572, head/lib/libnetbsd/efun.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libnetbsd/efun.c Wed Apr 25 01:30:29 2018 (r332979, copy of r316572, head/lib/libnetbsd/efun.c) @@ -0,0 +1,160 @@ +/* $NetBSD: efun.c,v 1.10 2015/07/26 02:20:30 kamil Exp $ */ +/* $FreeBSD$ */ + +/*- + * Copyright (c) 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Christos Zoulas. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +#include +#ifdef __RCSID +__RCSID("$NetBSD: efun.c,v 1.10 2015/07/26 02:20:30 kamil Exp $"); +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +static void (*efunc)(int, const char *, ...) = err; + +void (* +esetfunc(void (*ef)(int, const char *, ...)))(int, const char *, ...) +{ + void (*of)(int, const char *, ...) = efunc; + efunc = ef == NULL ? (void (*)(int, const char *, ...))exit : ef; + return of; +} + +size_t +estrlcpy(char *dst, const char *src, size_t len) +{ + size_t rv; + if ((rv = strlcpy(dst, src, len)) >= len) { + errno = ENAMETOOLONG; + (*efunc)(1, + "Cannot copy string; %zu chars needed %zu provided", + rv, len); + } + return rv; +} + +size_t +estrlcat(char *dst, const char *src, size_t len) +{ + size_t rv; + if ((rv = strlcat(dst, src, len)) >= len) { + errno = ENAMETOOLONG; + (*efunc)(1, + "Cannot append to string; %zu chars needed %zu provided", + rv, len); + } + return rv; +} + +char * +estrdup(const char *s) +{ + char *d = strdup(s); + if (d == NULL) + (*efunc)(1, "Cannot copy string"); + return d; +} + +char * +estrndup(const char *s, size_t len) +{ + char *d = strndup(s, len); + if (d == NULL) + (*efunc)(1, "Cannot copy string"); + return d; +} + +void * +emalloc(size_t n) +{ + void *p = malloc(n); + if (p == NULL && n != 0) + (*efunc)(1, "Cannot allocate %zu bytes", n); + return p; +} + +void * +ecalloc(size_t n, size_t s) +{ + void *p = calloc(n, s); + if (p == NULL && n != 0 && s != 0) + (*efunc)(1, "Cannot allocate %zu blocks of size %zu", n, s); + return p; +} + +void * +erealloc(void *p, size_t n) +{ + void *q = realloc(p, n); + if (q == NULL && n != 0) + (*efunc)(1, "Cannot re-allocate %zu bytes", n); + return q; +} + +FILE * +efopen(const char *p, const char *m) +{ + FILE *fp = fopen(p, m); + if (fp == NULL) + (*efunc)(1, "Cannot open `%s'", p); + return fp; +} + +int +easprintf(char ** __restrict ret, const char * __restrict format, ...) +{ + int rv; + va_list ap; + va_start(ap, format); + if ((rv = vasprintf(ret, format, ap)) == -1) + (*efunc)(1, "Cannot format string"); + va_end(ap); + return rv; +} + +int +evasprintf(char ** __restrict ret, const char * __restrict format, va_list ap) +{ + int rv; + if ((rv = vasprintf(ret, format, ap)) == -1) + (*efunc)(1, "Cannot format string"); + return rv; +} Modified: stable/11/lib/libnetbsd/util.h ============================================================================== --- stable/11/lib/libnetbsd/util.h Wed Apr 25 01:20:25 2018 (r332978) +++ stable/11/lib/libnetbsd/util.h Wed Apr 25 01:30:29 2018 (r332979) @@ -36,6 +36,19 @@ #include #include +void (*esetfunc(void (*)(int, const char *, ...)))(int, const char *, ...); +size_t estrlcpy(char *, const char *, size_t); +size_t estrlcat(char *, const char *, size_t); +char *estrdup(const char *); +char *estrndup(const char *, size_t); +void *emalloc(size_t); +void *ecalloc(size_t, size_t); +void *erealloc(void *, size_t); +struct __sFILE *efopen(const char *, const char *); +int easprintf(char ** __restrict, const char * __restrict, ...) + __printflike(2, 3); +int evasprintf(char ** __restrict, const char * __restrict, __va_list) + __printflike(2, 0); char *flags_to_string(u_long flags, const char *def); int sockaddr_snprintf(char *, size_t, const char *, const struct sockaddr *); From owner-svn-src-all@freebsd.org Wed Apr 25 01:35:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BFB4FB9FEE; Wed, 25 Apr 2018 01:35:07 +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 47DCB774F7; Wed, 25 Apr 2018 01:35:07 +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 4284E22958; Wed, 25 Apr 2018 01:35:07 +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 w3P1Z7J6084507; Wed, 25 Apr 2018 01:35:07 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P1Z6Xt084500; Wed, 25 Apr 2018 01:35:06 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804250135.w3P1Z6Xt084500@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 01:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332980 - in stable/11/usr.sbin/makefs: . cd9660 ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: in stable/11/usr.sbin/makefs: . cd9660 ffs X-SVN-Commit-Revision: 332980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 01:35:07 -0000 Author: benno Date: Wed Apr 25 01:35:06 2018 New Revision: 332980 URL: https://svnweb.freebsd.org/changeset/base/332980 Log: MFC r307927 Be more precise when including headers so that we're less likely to depend on namespace pollution and as such become more portable. This means including headers like or , but also making sure we include system/host headers before local headers. While here: define ENOATTR as ENOMSG in mtree.c. There is no ENOATTR on Linux. With this, makefs is ready for compilation on macOS and Linux. Sponsored by: iXsystems, Inc. Modified: stable/11/usr.sbin/makefs/cd9660.c stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c stable/11/usr.sbin/makefs/ffs/ffs_bswap.c stable/11/usr.sbin/makefs/ffs/ffs_subr.c stable/11/usr.sbin/makefs/mtree.c stable/11/usr.sbin/makefs/walk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:30:29 2018 (r332979) +++ stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:35:06 2018 (r332980) @@ -100,10 +100,11 @@ #include __FBSDID("$FreeBSD$"); -#include -#include #include #include +#include +#include +#include #include "makefs.h" #include "cd9660.h" Modified: stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c Wed Apr 25 01:30:29 2018 (r332979) +++ stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c Wed Apr 25 01:35:06 2018 (r332980) @@ -42,9 +42,11 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include +#include #include #include "makefs.h" Modified: stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c Wed Apr 25 01:30:29 2018 (r332979) +++ stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c Wed Apr 25 01:35:06 2018 (r332980) @@ -37,14 +37,16 @@ * defined in iso9660_rrip.h */ -#include "makefs.h" -#include "cd9660.h" -#include "iso9660_rrip.h" +#include +__FBSDID("$FreeBSD$"); + #include +#include #include -#include -__FBSDID("$FreeBSD$"); +#include "makefs.h" +#include "cd9660.h" +#include "iso9660_rrip.h" static void cd9660_rrip_initialize_inode(cd9660node *); static int cd9660_susp_handle_continuation(iso9660_disk *, cd9660node *); Modified: stable/11/usr.sbin/makefs/ffs/ffs_bswap.c ============================================================================== --- stable/11/usr.sbin/makefs/ffs/ffs_bswap.c Wed Apr 25 01:30:29 2018 (r332979) +++ stable/11/usr.sbin/makefs/ffs/ffs_bswap.c Wed Apr 25 01:35:06 2018 (r332980) @@ -40,17 +40,18 @@ __FBSDID("$FreeBSD$"); #include #endif -#include -#include "ffs/ufs_bswap.h" -#include - #if !defined(_KERNEL) #include +#include #include #include #include #define panic(x) printf("%s\n", (x)), abort() #endif + +#include +#include "ffs/ufs_bswap.h" +#include #define fs_old_postbloff fs_spare5[0] #define fs_old_rotbloff fs_spare5[1] Modified: stable/11/usr.sbin/makefs/ffs/ffs_subr.c ============================================================================== --- stable/11/usr.sbin/makefs/ffs/ffs_subr.c Wed Apr 25 01:30:29 2018 (r332979) +++ stable/11/usr.sbin/makefs/ffs/ffs_subr.c Wed Apr 25 01:35:06 2018 (r332980) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include Modified: stable/11/usr.sbin/makefs/mtree.c ============================================================================== --- stable/11/usr.sbin/makefs/mtree.c Wed Apr 25 01:30:29 2018 (r332979) +++ stable/11/usr.sbin/makefs/mtree.c Wed Apr 25 01:35:06 2018 (r332980) @@ -46,10 +46,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "makefs.h" + +#ifndef ENOATTR +#define ENOATTR ENOMSG +#endif #define IS_DOT(nm) ((nm)[0] == '.' && (nm)[1] == '\0') #define IS_DOTDOT(nm) ((nm)[0] == '.' && (nm)[1] == '.' && (nm)[2] == '\0') Modified: stable/11/usr.sbin/makefs/walk.c ============================================================================== --- stable/11/usr.sbin/makefs/walk.c Wed Apr 25 01:30:29 2018 (r332979) +++ stable/11/usr.sbin/makefs/walk.c Wed Apr 25 01:35:06 2018 (r332980) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include From owner-svn-src-all@freebsd.org Wed Apr 25 01:48:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BAC2FBA233; Wed, 25 Apr 2018 01:48:17 +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 18649790CA; Wed, 25 Apr 2018 01:48:17 +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 0EDD622AE1; Wed, 25 Apr 2018 01:48:17 +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 w3P1mGiH089412; Wed, 25 Apr 2018 01:48:16 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P1mFDg089401; Wed, 25 Apr 2018 01:48:15 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804250148.w3P1mFDg089401@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 01:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332981 - in stable/11/usr.sbin/makefs: . cd9660 ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: in stable/11/usr.sbin/makefs: . cd9660 ffs X-SVN-Commit-Revision: 332981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 01:48:17 -0000 Author: benno Date: Wed Apr 25 01:48:15 2018 New Revision: 332981 URL: https://svnweb.freebsd.org/changeset/base/332981 Log: MFC r316579 makefs: use emalloc and friends The emalloc set of error-checking memory allocation routines were added to libnetbsd in r316572. Use them in makefs to reduce differences with NetBSD. NetBSD revs: cd9660.c 1.39 ffs.c 1.56 makefs.c 1.42 walk.c 1.27 cd9660/cd9660_archimedes.c 1.2 cd9660/cd9660_eltorito.c 1.20 cd9660/cd9660_write.c 1.16 cd9660/iso9660_rrip.c 1.12 ffs/buf.c 1.17 ffs/mkfs.c 1.26 Sponsored by: iXsystems, Inc. Modified: stable/11/usr.sbin/makefs/cd9660.c stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/11/usr.sbin/makefs/cd9660/cd9660_write.c stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c stable/11/usr.sbin/makefs/ffs.c stable/11/usr.sbin/makefs/ffs/buf.c stable/11/usr.sbin/makefs/ffs/mkfs.c stable/11/usr.sbin/makefs/makefs.c stable/11/usr.sbin/makefs/mtree.c stable/11/usr.sbin/makefs/walk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:48:15 2018 (r332981) @@ -105,6 +105,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "makefs.h" #include "cd9660.h" @@ -173,10 +174,8 @@ static cd9660node *cd9660_create_special_directory(iso static cd9660node * cd9660_allocate_cd9660node(void) { - cd9660node *temp; + cd9660node *temp = ecalloc(1, sizeof(*temp)); - if ((temp = calloc(1, sizeof(cd9660node))) == NULL) - err(EXIT_FAILURE, "%s: calloc", __func__); TAILQ_INIT(&temp->cn_children); temp->parent = temp->dot_record = temp->dot_dot_record = NULL; temp->ptnext = temp->ptprev = temp->ptlast = NULL; @@ -253,11 +252,8 @@ cd9660_set_defaults(iso9660_disk *diskStructure) void cd9660_prep_opts(fsinfo_t *fsopts) { - iso9660_disk *diskStructure; + iso9660_disk *diskStructure = ecalloc(1, sizeof(*diskStructure)); - if ((diskStructure = calloc(1, sizeof(*diskStructure))) == NULL) - err(EXIT_FAILURE, "%s: calloc", __func__); - #define OPT_STR(letter, name, desc) \ { letter, name, NULL, OPT_STRBUF, 0, 0, desc } @@ -440,9 +436,7 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts rv = 0; } else { diskStructure->boot_image_directory = - malloc(strlen(buf) + 1); - if (diskStructure->boot_image_directory == NULL) - err(1, "malloc"); + emalloc(strlen(buf) + 1); /* BIG TODO: Add the max length function here */ rv = cd9660_arguments_set_string(buf, desc, 12, 'd', diskStructure->boot_image_directory); @@ -522,12 +516,7 @@ cd9660_makefs(const char *image, const char *dir, fsno /* Actually, we now need to add the REAL root node, at level 0 */ real_root = cd9660_allocate_cd9660node(); - if ((real_root->isoDirRecord = - malloc( sizeof(iso_directory_record_cd9660) )) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_makefs"); - exit(1); - } - + real_root->isoDirRecord = emalloc(sizeof(*real_root->isoDirRecord)); /* Leave filename blank for root */ memset(real_root->isoDirRecord->name, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); @@ -769,11 +758,7 @@ cd9660_setup_volume_descriptors(iso9660_disk *diskStru volume_descriptor *temp, *t; /* Set up the PVD */ - if ((temp = malloc(sizeof(volume_descriptor))) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_setup_volume_descriptors"); - exit(1); - } - + temp = emalloc(sizeof(*temp)); temp->volumeDescriptorData = (unsigned char *)&diskStructure->primaryDescriptor; temp->volumeDescriptorData[0] = ISO_VOLUME_DESCRIPTOR_PVD; @@ -786,19 +771,10 @@ cd9660_setup_volume_descriptors(iso9660_disk *diskStru sector++; /* Set up boot support if enabled. BVD must reside in sector 17 */ if (diskStructure->is_bootable) { - if ((t = malloc(sizeof(volume_descriptor))) == NULL) { - CD9660_MEM_ALLOC_ERROR( - "cd9660_setup_volume_descriptors"); - exit(1); - } - if ((t->volumeDescriptorData = malloc(2048)) == NULL) { - CD9660_MEM_ALLOC_ERROR( - "cd9660_setup_volume_descriptors"); - exit(1); - } + t = emalloc(sizeof(*t)); + t->volumeDescriptorData = ecalloc(1, 2048); temp->next = t; temp = t; - memset(t->volumeDescriptorData, 0, 2048); t->sector = 17; if (diskStructure->verbose_level > 0) printf("Setting up boot volume descriptor\n"); @@ -807,17 +783,9 @@ cd9660_setup_volume_descriptors(iso9660_disk *diskStru } /* Set up the terminator */ - if ((t = malloc(sizeof(volume_descriptor))) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_setup_volume_descriptors"); - exit(1); - } - if ((t->volumeDescriptorData = malloc(2048)) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_setup_volume_descriptors"); - exit(1); - } - + t = emalloc(sizeof(*t)); + t->volumeDescriptorData = ecalloc(1, 2048); temp->next = t; - memset(t->volumeDescriptorData, 0, 2048); t->volumeDescriptorData[0] = ISO_VOLUME_DESCRIPTOR_TERMINATOR; t->next = NULL; t->volumeDescriptorData[6] = 1; @@ -837,12 +805,7 @@ cd9660_setup_volume_descriptors(iso9660_disk *diskStru static int cd9660_fill_extended_attribute_record(cd9660node *node) { - if ((node->isoExtAttributes = - malloc(sizeof(struct iso_extended_attributes))) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_fill_extended_attribute_record"); - exit(1); - }; - + node->isoExtAttributes = emalloc(sizeof(*node->isoExtAttributes)); return 1; } #endif @@ -901,12 +864,7 @@ cd9660_translate_node(iso9660_disk *diskStructure, fsn "returning\n"); return 0; } - if ((newnode->isoDirRecord = - malloc(sizeof(iso_directory_record_cd9660))) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_translate_node"); - return 0; - } - + newnode->isoDirRecord = emalloc(sizeof(*newnode->isoDirRecord)); /* Set the node pointer */ newnode->node = node; @@ -1113,7 +1071,7 @@ cd9660_rename_filename(iso9660_disk *diskStructure, cd else maxlength = ISO_FILENAME_MAXLENGTH_BEFORE_VERSION; - tmp = malloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING); + tmp = emalloc(ISO_FILENAME_MAXLENGTH_WITH_PADDING); while (i < num && iter) { powers = 1; @@ -1552,9 +1510,7 @@ struct ptq_entry } *n; #define PTQUEUE_NEW(n,s,r,t){\ - n = malloc(sizeof(struct s)); \ - if (n == NULL) \ - return r; \ + n = emalloc(sizeof(struct s)); \ n->node = t;\ } @@ -2006,25 +1962,10 @@ cd9660_create_virtual_entry(iso9660_disk *diskStructur if (temp == NULL) return NULL; - if ((tfsnode = malloc(sizeof(fsnode))) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_create_virtual_entry"); - return NULL; - } + tfsnode = emalloc(sizeof(*tfsnode)); + tfsnode->name = estrdup(name); + temp->isoDirRecord = emalloc(sizeof(*temp->isoDirRecord)); - /* Assume for now name is a valid length */ - if ((tfsnode->name = malloc(strlen(name) + 1)) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_create_virtual_entry"); - return NULL; - } - - if ((temp->isoDirRecord = - malloc(sizeof(iso_directory_record_cd9660))) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660_create_virtual_entry"); - return NULL; - } - - strcpy(tfsnode->name, name); - cd9660_convert_filename(diskStructure, tfsnode->name, temp->isoDirRecord->name, file); @@ -2075,8 +2016,7 @@ cd9660_create_file(iso9660_disk *diskStructure, const temp->type = CD9660_TYPE_FILE | CD9660_TYPE_VIRTUAL; - if ((temp->node->inode = calloc(1, sizeof(fsinode))) == NULL) - return NULL; + temp->node->inode = ecalloc(1, sizeof(*temp->node->inode)); *temp->node->inode = *me->node->inode; if (cd9660_translate_node_common(diskStructure, temp) == 0) @@ -2103,8 +2043,7 @@ cd9660_create_directory(iso9660_disk *diskStructure, c temp->type = CD9660_TYPE_DIR | CD9660_TYPE_VIRTUAL; - if ((temp->node->inode = calloc(1, sizeof(fsinode))) == NULL) - return NULL; + temp->node->inode = ecalloc(1, sizeof(*temp->node->inode)); *temp->node->inode = *me->node->inode; if (cd9660_translate_node_common(diskStructure, temp) == 0) @@ -2172,10 +2111,7 @@ cd9660_add_generic_bootimage(iso9660_disk *diskStructu return 0; } - if ((diskStructure->generic_bootimage = strdup(bootimage)) == NULL) { - warn("%s: strdup", __func__); - return 0; - } + diskStructure->generic_bootimage = estrdup(bootimage); /* Get information about the file */ if (lstat(diskStructure->generic_bootimage, &stbuf) == -1) Modified: stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c Wed Apr 25 01:48:15 2018 (r332981) @@ -42,12 +42,11 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include -#include #include +#include #include "makefs.h" #include "cd9660.h" @@ -95,11 +94,8 @@ archimedes_convert_node(cd9660node *node) return; if (type == -1) type = 0; - assert(sizeof(struct ISO_ARCHIMEDES) == 32); - if ((arc = calloc(1, sizeof(struct ISO_ARCHIMEDES))) == NULL) { - CD9660_MEM_ALLOC_ERROR("archimedes_convert_node"); - exit(1); - } + assert(sizeof(*arc) == 32); + arc = ecalloc(1, sizeof(*arc)); stamp = riscos_date(node->node->inode->st.st_mtime); Modified: stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c Wed Apr 25 01:48:15 2018 (r332981) @@ -36,6 +36,7 @@ #include "cd9660.h" #include "cd9660_eltorito.h" +#include #include __FBSDID("$FreeBSD$"); @@ -75,10 +76,7 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, cons } /* First decode the boot information */ - if ((temp = strdup(boot_info)) == NULL) { - warn("%s: strdup", __func__); - return 0; - } + temp = estrdup(boot_info); sysname = temp; filename = strchr(sysname, ';'); @@ -95,12 +93,7 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, cons printf("Found bootdisk with system %s, and filename %s\n", sysname, filename); } - if ((new_image = malloc(sizeof(*new_image))) == NULL) { - warn("%s: malloc", __func__); - free(temp); - return 0; - } - (void)memset(new_image, 0, sizeof(*new_image)); + new_image = ecalloc(1, sizeof(*new_image)); new_image->loadSegment = 0; /* default for now */ /* Decode System */ @@ -120,12 +113,7 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, cons } - if ((new_image->filename = strdup(filename)) == NULL) { - warn("%s: strdup", __func__); - free(temp); - free(new_image); - return 0; - } + new_image->filename = estrdup(filename); free(temp); @@ -228,12 +216,7 @@ cd9660_eltorito_add_boot_option(iso9660_disk *diskStru static struct boot_catalog_entry * cd9660_init_boot_catalog_entry(void) { - struct boot_catalog_entry *temp; - - if ((temp = malloc(sizeof(*temp))) == NULL) - return NULL; - - return memset(temp, 0, sizeof(*temp)); + return ecalloc(1, sizeof(struct boot_catalog_entry)); } static struct boot_catalog_entry * @@ -246,11 +229,6 @@ cd9660_boot_setup_validation_entry(char sys) int i; entry = cd9660_init_boot_catalog_entry(); - if (entry == NULL) { - warnx("Error: memory allocation failed in " - "cd9660_boot_setup_validation_entry"); - return 0; - } ve = &entry->entry_data.VE; ve->header_id[0] = 1; Modified: stable/11/usr.sbin/makefs/cd9660/cd9660_write.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660/cd9660_write.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/cd9660/cd9660_write.c Wed Apr 25 01:48:15 2018 (r332981) @@ -40,6 +40,8 @@ #include __FBSDID("$FreeBSD$"); +#include + static int cd9660_write_volume_descriptors(iso9660_disk *, FILE *); static int cd9660_write_path_table(iso9660_disk *, FILE *, off_t, int); static int cd9660_write_path_tables(iso9660_disk *, FILE *); @@ -174,14 +176,8 @@ cd9660_write_path_table(iso9660_disk *diskStructure, F path_table_entry temp_entry; cd9660node *ptcur; - buffer = malloc(diskStructure->sectorSize * path_table_sectors); - if (buffer == NULL) { - warnx("%s: Memory allocation error allocating buffer", - __func__); - return 0; - } + buffer = ecalloc(path_table_sectors, diskStructure->sectorSize); buffer_head = buffer; - memset(buffer, 0, diskStructure->sectorSize * path_table_sectors); ptcur = diskStructure->rootNode; @@ -280,16 +276,8 @@ cd9660_write_file(iso9660_disk *diskStructure, FILE *f /* Todo : clean up variables */ - temp_file_name = malloc(CD9660MAXPATH + 1); - if (temp_file_name == NULL) - err(EXIT_FAILURE, "%s: malloc", __func__); - - memset(temp_file_name, 0, CD9660MAXPATH + 1); - - buf = malloc(diskStructure->sectorSize); - if (buf == NULL) - err(EXIT_FAILURE, "%s: malloc", __func__); - + temp_file_name = ecalloc(CD9660MAXPATH + 1, 1); + buf = emalloc(diskStructure->sectorSize); if ((writenode->level != 0) && !(writenode->node->type & S_IFDIR)) { fsinode *inode = writenode->node->inode; @@ -448,10 +436,7 @@ cd9660_copy_file(iso9660_disk *diskStructure, FILE *fd int buf_size = diskStructure->sectorSize; char *buf; - buf = malloc(buf_size); - if (buf == NULL) - err(EXIT_FAILURE, "%s: malloc", __func__); - + buf = emalloc(buf_size); if ((rf = fopen(filename, "rb")) == NULL) { warn("%s: cannot open %s", __func__, filename); free(buf); Modified: stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c Wed Apr 25 01:48:15 2018 (r332981) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include "makefs.h" #include "cd9660.h" #include "iso9660_rrip.h" +#include static void cd9660_rrip_initialize_inode(cd9660node *); static int cd9660_susp_handle_continuation(iso9660_disk *, cd9660node *); @@ -460,11 +461,7 @@ cd9660node_susp_create_node(int susp_type, int entry_t { struct ISO_SUSP_ATTRIBUTES* temp; - if ((temp = malloc(sizeof(struct ISO_SUSP_ATTRIBUTES))) == NULL) { - CD9660_MEM_ALLOC_ERROR("cd9660node_susp_create_node"); - exit(1); - } - + temp = emalloc(sizeof(*temp)); temp->susp_type = susp_type; temp->entry_type = entry_type; temp->last_in_suf = 0; Modified: stable/11/usr.sbin/makefs/ffs.c ============================================================================== --- stable/11/usr.sbin/makefs/ffs.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/ffs.c Wed Apr 25 01:48:15 2018 (r332981) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "makefs.h" #include "ffs.h" @@ -149,11 +150,8 @@ int sectorsize; /* XXX: for buf.c::getblk() */ void ffs_prep_opts(fsinfo_t *fsopts) { - ffs_opt_t *ffs_opts; + ffs_opt_t *ffs_opts = ecalloc(1, sizeof(*ffs_opts)); - if ((ffs_opts = calloc(1, sizeof(ffs_opt_t))) == NULL) - err(1, "Allocating memory for ffs_options"); - const option_t ffs_options[] = { { 'b', "bsize", &ffs_opts->bsize, OPT_INT32, 1, INT_MAX, "block size" }, @@ -518,10 +516,7 @@ ffs_create_image(const char *image, fsinfo_t *fsopts) printf("zero-ing image `%s', %lld sectors, " "using %d byte chunks\n", image, (long long)bufrem, bufsize); - if ((buf = calloc(1, bufsize)) == NULL) { - warn("Can't create buffer for sector"); - return (-1); - } + buf = ecalloc(1, bufsize); } while (bufrem > 0) { i = write(fsopts->fd, buf, MIN(bufsize, bufrem)); @@ -923,8 +918,7 @@ ffs_write_file(union dinode *din, uint32_t ino, void * goto write_inode_and_leave; /* mmm, cheating */ if (isfile) { - if ((fbuf = malloc(ffs_opts->bsize)) == NULL) - err(1, "Allocating memory for write buffer"); + fbuf = emalloc(ffs_opts->bsize); if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) { warn("Can't open `%s' for reading", (char *)buf); goto leave_ffs_write_file; @@ -1051,8 +1045,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const char *name, fsno if (debug & DEBUG_FS_MAKE_DIRBUF) printf("ffs_make_dirbuf: growing buf to %d\n", dbuf->size + DIRBLKSIZ); - if ((newbuf = realloc(dbuf->buf, dbuf->size + DIRBLKSIZ)) == NULL) - err(1, "Allocating memory for directory buffer"); + newbuf = erealloc(dbuf->buf, dbuf->size + DIRBLKSIZ); dbuf->buf = newbuf; dbuf->size += DIRBLKSIZ; memset(dbuf->buf + dbuf->size - DIRBLKSIZ, 0, DIRBLKSIZ); @@ -1103,10 +1096,7 @@ ffs_write_inode(union dinode *dp, uint32_t ino, const assert (isclr(cg_inosused_swap(cgp, fsopts->needswap), cgino)); - buf = malloc(fs->fs_bsize); - if (buf == NULL) - errx(1, "ffs_write_inode: cg %d: can't alloc inode block", cg); - + buf = emalloc(fs->fs_bsize); dp1 = (struct ufs1_dinode *)buf; dp2 = (struct ufs2_dinode *)buf; Modified: stable/11/usr.sbin/makefs/ffs/buf.c ============================================================================== --- stable/11/usr.sbin/makefs/ffs/buf.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/ffs/buf.c Wed Apr 25 01:48:15 2018 (r332981) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "makefs.h" @@ -207,9 +208,7 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int } } if (bp == NULL) { - if ((bp = calloc(1, sizeof(struct buf))) == NULL) - err(1, "getblk: calloc"); - + bp = ecalloc(1, sizeof(*bp)); bp->b_bufsize = 0; bp->b_blkno = bp->b_lblkno = blkno; bp->b_fd = fd; @@ -219,9 +218,7 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int } bp->b_bcount = size; if (bp->b_data == NULL || bp->b_bcount > bp->b_bufsize) { - n = realloc(bp->b_data, size); - if (n == NULL) - err(1, "getblk: realloc b_data %ld", bp->b_bcount); + n = erealloc(bp->b_data, size); bp->b_data = n; bp->b_bufsize = size; } Modified: stable/11/usr.sbin/makefs/ffs/mkfs.c ============================================================================== --- stable/11/usr.sbin/makefs/ffs/mkfs.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/ffs/mkfs.c Wed Apr 25 01:48:15 2018 (r332981) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "makefs.h" #include "ffs.h" @@ -403,8 +404,7 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, tim blks = howmany(size, sblock.fs_fsize); if (sblock.fs_contigsumsize > 0) size += sblock.fs_ncg * sizeof(int32_t); - if ((space = (char *)calloc(1, size)) == NULL) - err(1, "memory allocation error for cg summaries"); + space = ecalloc(1, size); sblock.fs_csp = space; space = (char *)space + sblock.fs_cssize; if (sblock.fs_contigsumsize > 0) { @@ -492,11 +492,7 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, tim iobufsize = SBLOCKSIZE + 3 * sblock.fs_bsize; else iobufsize = 4 * sblock.fs_bsize; - if ((iobuf = malloc(iobufsize)) == NULL) { - printf("Cannot allocate I/O buffer\n"); - exit(38); - } - memset(iobuf, 0, iobufsize); + iobuf = ecalloc(1, iobufsize); /* * Make a copy of the superblock into the buffer that we will be * writing out in each cylinder group. @@ -562,8 +558,7 @@ ffs_write_superblock(struct fs *fs, const fsinfo_t *fs size = fs->fs_cssize; blks = howmany(size, fs->fs_fsize); space = (void *)fs->fs_csp; - if ((wrbuf = malloc(size)) == NULL) - err(1, "ffs_write_superblock: malloc %d", size); + wrbuf = emalloc(size); for (i = 0; i < blks; i+= fs->fs_frag) { size = fs->fs_bsize; if (i + fs->fs_frag > blks) Modified: stable/11/usr.sbin/makefs/makefs.c ============================================================================== --- stable/11/usr.sbin/makefs/makefs.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/makefs.c Wed Apr 25 01:48:15 2018 (r332981) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "makefs.h" #include "mtree.h" @@ -352,10 +353,7 @@ set_option(const option_t *options, const char *option assert(option != NULL); - if ((var = strdup(option)) == NULL) { - err(EXIT_FAILURE, "Allocating memory for copy of option string"); - } - + var = estrdup(option); for (val = var; *val; val++) if (*val == '=') { *val++ = '\0'; @@ -396,8 +394,7 @@ set_option_var(const option_t *options, const char *va options[i].maximum); break; case OPT_STRPTR: - if ((s = strdup(val)) == NULL) - err(1, NULL); + s = estrdup(val); *(char **)options[i].value = s; break; case OPT_STRBUF: @@ -440,14 +437,11 @@ option_t * copy_opts(const option_t *o) { size_t i; - void *rv; for (i = 0; o[i].name; i++) continue; i++; - if ((rv = calloc(i, sizeof(*o))) == NULL) - err(1, "calloc"); - return memcpy(rv, o, i * sizeof(*o)); + return memcpy(ecalloc(i, sizeof(*o)), o, i * sizeof(*o)); } static int Modified: stable/11/usr.sbin/makefs/mtree.c ============================================================================== --- stable/11/usr.sbin/makefs/mtree.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/mtree.c Wed Apr 25 01:48:15 2018 (r332981) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "makefs.h" @@ -83,14 +84,11 @@ mtree_file_push(const char *name, FILE *fp) { struct mtree_fileinfo *fi; - fi = malloc(sizeof(*fi)); - if (fi == NULL) - return (ENOMEM); - + fi = emalloc(sizeof(*fi)); if (strcmp(name, "-") == 0) - fi->name = strdup("(stdin)"); + fi->name = estrdup("(stdin)"); else - fi->name = strdup(name); + fi->name = estrdup(name); if (fi->name == NULL) { free(fi); return (ENOMEM); @@ -176,7 +174,7 @@ mtree_file_path(fsnode *node) } sbuf_cat(sb, rp[depth]); sbuf_finish(sb); - res = strdup(sbuf_data(sb)); + res = estrdup(sbuf_data(sb)); sbuf_delete(sb); if (res == NULL) errno = ENOMEM; @@ -206,8 +204,8 @@ mtree_resolve(const char *spec, int *istemp) quoted = (subst || c == '\'') ? 1 : 0; if (!subst) { - res = strdup(spec + quoted); - if (res != NULL && quoted) + res = estrdup(spec + quoted); + if (quoted) res[len - 2] = '\0'; return (res); } @@ -263,25 +261,18 @@ mtree_resolve(const char *spec, int *istemp) } error = ENOMEM; - var = calloc(p - v, 1); - if (var == NULL) - break; - + var = ecalloc(p - v, 1); memcpy(var, v + 1, p - v - 1); if (strcmp(var, ".CURDIR") == 0) { res = getcwd(NULL, 0); if (res == NULL) break; } else if (strcmp(var, ".PROG") == 0) { - res = strdup(getprogname()); - if (res == NULL) - break; + res = estrdup(getprogname()); } else { v = getenv(var); if (v != NULL) { - res = strdup(v); - if (res == NULL) - break; + res = estrdup(v); } else res = NULL; } @@ -433,25 +424,12 @@ create_node(const char *name, u_int type, fsnode *pare { fsnode *n; - n = calloc(1, sizeof(*n)); - if (n == NULL) - return (NULL); - - n->name = strdup(name); - if (n->name == NULL) { - free(n); - return (NULL); - } - + n = ecalloc(1, sizeof(*n)); + n->name = estrdup(name); n->type = (type == 0) ? global->type : type; n->parent = parent; - n->inode = calloc(1, sizeof(*n->inode)); - if (n->inode == NULL) { - free(n->name); - free(n); - return (NULL); - } + n->inode = ecalloc(1, sizeof(*n->inode)); /* Assign global options/defaults. */ bcopy(global->inode, n->inode, sizeof(*n->inode)); @@ -542,7 +520,7 @@ read_mtree_keywords(FILE *fp, fsnode *node) error = ENOATTR; break; } - node->contents = strdup(value); + node->contents = estrdup(value); } else error = ENOSYS; break; @@ -589,7 +567,7 @@ read_mtree_keywords(FILE *fp, fsnode *node) error = ENOATTR; break; } - node->symlink = malloc(strlen(value) + 1); + node->symlink = emalloc(strlen(value) + 1); if (node->symlink == NULL) { error = errno; break; Modified: stable/11/usr.sbin/makefs/walk.c ============================================================================== --- stable/11/usr.sbin/makefs/walk.c Wed Apr 25 01:35:06 2018 (r332980) +++ stable/11/usr.sbin/makefs/walk.c Wed Apr 25 01:48:15 2018 (r332981) @@ -204,8 +204,7 @@ walk_dir(const char *root, const char *dir, fsnode *pa if (llen == -1) err(1, "Readlink `%s'", path); slink[llen] = '\0'; - if ((cur->symlink = strdup(slink)) == NULL) - err(1, "Memory allocation error"); + cur->symlink = estrdup(slink); } } assert(first != NULL); @@ -223,11 +222,10 @@ create_fsnode(const char *root, const char *path, cons { fsnode *cur; - if ((cur = calloc(1, sizeof(fsnode))) == NULL || - (cur->path = strdup(path)) == NULL || - (cur->name = strdup(name)) == NULL || - (cur->inode = calloc(1, sizeof(fsinode))) == NULL) - err(1, "Memory allocation error"); + cur = ecalloc(1, sizeof(*cur)); + cur->path = estrdup(path); + cur->name = estrdup(name); + cur->inode = ecalloc(1, sizeof(*cur->inode)); cur->root = root; cur->type = stbuf->st_mode & S_IFMT; cur->inode->nlink = 1; @@ -458,9 +456,7 @@ apply_specdir(const char *dir, NODE *specnode, fsnode if (curfsnode->type == S_IFLNK) { assert(curnode->slink != NULL); /* for symlinks, copy the target */ - if ((curfsnode->symlink = - strdup(curnode->slink)) == NULL) - err(1, "Memory allocation error"); + curfsnode->symlink = estrdup(curnode->slink); } } apply_specentry(dir, curnode, curfsnode); @@ -516,8 +512,7 @@ apply_specentry(const char *dir, NODE *specnode, fsnod assert(specnode->slink != NULL); ASEPRINT("symlink", "%s", dirnode->symlink, specnode->slink); free(dirnode->symlink); - if ((dirnode->symlink = strdup(specnode->slink)) == NULL) - err(1, "Memory allocation error"); + dirnode->symlink = estrdup(specnode->slink); } if (specnode->flags & F_TIME) { ASEPRINT("time", "%ld", @@ -666,10 +661,7 @@ link_check(fsinode *entry) htused = 0; ohtable = htable; - htable = calloc(htmask+1, sizeof(*htable)); - if (!htable) - err(1, "Memory allocation error"); - + htable = ecalloc(htmask+1, sizeof(*htable)); /* populate newly allocated hashtable */ if (ohtable) { int i; From owner-svn-src-all@freebsd.org Wed Apr 25 01:54:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B535BFBA48F; Wed, 25 Apr 2018 01:54:25 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60BBE7A567; Wed, 25 Apr 2018 01:54:25 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54D0622C6C; Wed, 25 Apr 2018 01:54:25 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3P1sPht094600; Wed, 25 Apr 2018 01:54:25 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P1sP8x094599; Wed, 25 Apr 2018 01:54:25 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201804250154.w3P1sP8x094599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Wed, 25 Apr 2018 01:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332982 - stable/11/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: stable/11/release/tools X-SVN-Commit-Revision: 332982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 01:54:25 -0000 Author: cperciva Date: Wed Apr 25 01:54:24 2018 New Revision: 332982 URL: https://svnweb.freebsd.org/changeset/base/332982 Log: MFC r332663: Move panic-related settings from sysctl.conf to loader.conf so that they apply if an EC2 instance panics while booting. Sponsored by: https://www.patreon.com/cperciva Modified: stable/11/release/tools/ec2.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/release/tools/ec2.conf ============================================================================== --- stable/11/release/tools/ec2.conf Wed Apr 25 01:48:15 2018 (r332981) +++ stable/11/release/tools/ec2.conf Wed Apr 25 01:54:24 2018 (r332982) @@ -60,9 +60,9 @@ vm_extra_pre_umount() { # The EC2 console is output-only, so while printing a backtrace can # be useful, there's no point dropping into a debugger or waiting # for a keypress. - echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf - echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf - echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf + echo 'debug.trace_on_panic=1' >> ${DESTDIR}/boot/loader.conf + echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/boot/loader.conf + echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/boot/loader.conf # The console is not interactive, so we might as well boot quickly. echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf From owner-svn-src-all@freebsd.org Wed Apr 25 01:59:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D889DFBA561; Wed, 25 Apr 2018 01:59:16 +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 854777A78D; Wed, 25 Apr 2018 01:59:16 +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 8026A22C6E; Wed, 25 Apr 2018 01:59:16 +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 w3P1xGl3094844; Wed, 25 Apr 2018 01:59:16 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P1xGNs094840; Wed, 25 Apr 2018 01:59:16 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804250159.w3P1xGNs094840@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 01:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332983 - in stable/11/usr.sbin/makefs: . cd9660 X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: in stable/11/usr.sbin/makefs: . cd9660 X-SVN-Commit-Revision: 332983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 01:59:17 -0000 Author: benno Date: Wed Apr 25 01:59:15 2018 New Revision: 332983 URL: https://svnweb.freebsd.org/changeset/base/332983 Log: MFC r331463 (partial), r331467, r331468, r331843 r331463, r331467, and r331468 are all replaced by r331843 but are included for completeness' sake. r331463 also contained a change to release/amd64/mkisoimages.sh which I've left out since those changes were also obsoleted by a later commit which will be merged later. r331843: Synchronise with NetBSD's version of EFI handling for El Torito images. Sponsored by: iXsystems, Inc. Modified: stable/11/usr.sbin/makefs/cd9660.c stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.h stable/11/usr.sbin/makefs/makefs.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:54:24 2018 (r332982) +++ stable/11/usr.sbin/makefs/cd9660.c Wed Apr 25 01:59:15 2018 (r332983) @@ -312,6 +312,7 @@ cd9660_prep_opts(fsinfo_t *fsopts) OPT_STR('\0', "no-boot", "No boot support"), OPT_STR('\0', "hard-disk-boot", "Boot from hard disk"), OPT_STR('\0', "boot-load-segment", "Boot load segment"), + OPT_STR('\0', "platformid", "Section Header Platform ID"), { .name = NULL } }; @@ -447,7 +448,8 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts /* RRIP */ cd9660_eltorito_add_boot_option(diskStructure, name, 0); rv = 1; - } else if (strcmp(name, "boot-load-segment") == 0) { + } else if (strcmp(name, "boot-load-segment") == 0 || + strcmp(name, "platformid") == 0) { if (buf[0] == '\0') { warnx("Option `%s' doesn't contain a value", name); Modified: stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c Wed Apr 25 01:54:24 2018 (r332982) +++ stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.c Wed Apr 25 01:59:15 2018 (r332983) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $ */ +/* $NetBSD: cd9660_eltorito.c,v 1.23 2018/03/28 06:48:55 nonaka Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD @@ -47,16 +47,19 @@ __FBSDID("$FreeBSD$"); #define ELTORITO_DPRINTF(__x) #endif +#include + static struct boot_catalog_entry *cd9660_init_boot_catalog_entry(void); static struct boot_catalog_entry *cd9660_boot_setup_validation_entry(char); static struct boot_catalog_entry *cd9660_boot_setup_default_entry( struct cd9660_boot_image *); static struct boot_catalog_entry *cd9660_boot_setup_section_head(char); -static struct boot_catalog_entry *cd9660_boot_setup_validation_entry(char); #if 0 static u_char cd9660_boot_get_system_type(struct cd9660_boot_image *); #endif +static struct cd9660_boot_image *default_boot_image; + int cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info) { @@ -171,9 +174,15 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, cons new_image->serialno = diskStructure->image_serialno++; + new_image->platform_id = new_image->system; + /* TODO : Need to do anything about the boot image in the tree? */ diskStructure->is_bootable = 1; + /* First boot image is initial/default entry. */ + if (default_boot_image == NULL) + default_boot_image = new_image; + return 1; } @@ -207,6 +216,13 @@ cd9660_eltorito_add_boot_option(iso9660_disk *diskStru warn("%s: strtoul", __func__); return 0; } + } else if (strcmp(option_string, "platformid") == 0) { + if (strcmp(value, "efi") == 0) + image->platform_id = ET_SYS_EFI; + else { + warn("%s: unknown platform: %s", __func__, value); + return 0; + } } else { return 0; } @@ -229,6 +245,7 @@ cd9660_boot_setup_validation_entry(char sys) int i; entry = cd9660_init_boot_catalog_entry(); + entry->entry_type = ET_ENTRY_VE; ve = &entry->entry_data.VE; ve->header_id[0] = 1; @@ -263,6 +280,7 @@ cd9660_boot_setup_default_entry(struct cd9660_boot_ima if (default_entry == NULL) return NULL; + default_entry->entry_type = ET_ENTRY_IE; ie = &default_entry->entry_data.IE; ie->boot_indicator[0] = disk->bootable; @@ -290,8 +308,12 @@ cd9660_boot_setup_section_head(char platform) if (entry == NULL) return NULL; + entry->entry_type = ET_ENTRY_SH; sh = &entry->entry_data.SH; - /* More by default. The last one will manually be set to 0x91 */ + /* + * More by default. + * The last one will manually be set to ET_SECTION_HEADER_LAST + */ sh->header_indicator[0] = ET_SECTION_HEADER_MORE; sh->platform_id[0] = platform; sh->num_section_entries[0] = 0; @@ -306,6 +328,7 @@ cd9660_boot_setup_section_entry(struct cd9660_boot_ima if ((entry = cd9660_init_boot_catalog_entry()) == NULL) return NULL; + entry->entry_type = ET_ENTRY_SE; se = &entry->entry_data.SE; se->boot_indicator[0] = ET_BOOTABLE; @@ -338,12 +361,12 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir int used_sectors; int num_entries = 0; int catalog_sectors; - struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, + struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, *efi_head, *valid_entry, *default_entry, *temp, *head, **headp, *next; struct cd9660_boot_image *tmp_disk; headp = NULL; - x86_head = mac_head = ppc_head = NULL; + x86_head = mac_head = ppc_head = efi_head = NULL; /* If there are no boot disks, don't bother building boot information */ if (TAILQ_EMPTY(&diskStructure->boot_images)) @@ -387,14 +410,25 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir sector = first_sector + catalog_sectors; TAILQ_FOREACH(tmp_disk, &diskStructure->boot_images, image_list) { tmp_disk->sector = sector; - sector += tmp_disk->num_sectors; + sector += tmp_disk->num_sectors / + (diskStructure->sectorSize / 512); } LIST_INSERT_HEAD(&diskStructure->boot_entries, valid_entry, ll_struct); /* Step 1b: Initial/default entry */ /* TODO : PARAM */ - tmp_disk = TAILQ_FIRST(&diskStructure->boot_images); + if (default_boot_image != NULL) { + struct cd9660_boot_image *tcbi; + TAILQ_FOREACH(tcbi, &diskStructure->boot_images, image_list) { + if (tcbi == default_boot_image) { + tmp_disk = tcbi; + break; + } + } + } + if (tmp_disk == NULL) + tmp_disk = TAILQ_FIRST(&diskStructure->boot_images); default_entry = cd9660_boot_setup_default_entry(tmp_disk); if (default_entry == NULL) { warnx("Error: memory allocation failed in cd9660_setup_boot"); @@ -405,14 +439,18 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir /* Todo: multiple default entries? */ - tmp_disk = TAILQ_NEXT(tmp_disk, image_list); + tmp_disk = TAILQ_FIRST(&diskStructure->boot_images); + head = NULL; temp = default_entry; /* If multiple boot images are given : */ - while (tmp_disk != NULL) { + for (; tmp_disk != NULL; tmp_disk = TAILQ_NEXT(tmp_disk, image_list)) { + if (tmp_disk == default_boot_image) + continue; + /* Step 2: Section header */ - switch (tmp_disk->system) { + switch (tmp_disk->platform_id) { case ET_SYS_X86: headp = &x86_head; break; @@ -422,6 +460,9 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir case ET_SYS_MAC: headp = &mac_head; break; + case ET_SYS_EFI: + headp = &efi_head; + break; default: warnx("%s: internal error: unknown system type", __func__); @@ -430,7 +471,7 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir if (*headp == NULL) { head = - cd9660_boot_setup_section_head(tmp_disk->system); + cd9660_boot_setup_section_head(tmp_disk->platform_id); if (head == NULL) { warnx("Error: memory allocation failed in " "cd9660_setup_boot"); @@ -455,9 +496,17 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir head = next; LIST_INSERT_AFTER(head, temp, ll_struct); - tmp_disk = TAILQ_NEXT(tmp_disk, image_list); } + /* Find the last Section Header entry and mark it as the last. */ + head = NULL; + LIST_FOREACH(next, &diskStructure->boot_entries, ll_struct) { + if (next->entry_type == ET_ENTRY_SH) + head = next; + } + if (head != NULL) + head->entry_data.SH.header_indicator[0] = ET_SECTION_HEADER_LAST; + /* TODO: Remaining boot disks when implemented */ return first_sector + used_sectors; @@ -558,13 +607,13 @@ cd9660_write_apm_partition_entry(FILE *fd, int idx, in apm32 = 0; /* pmLgDataStart */ - fwrite(&apm32, sizeof(apm32), 1, fd); + fwrite(&apm32, sizeof(apm32), 1, fd); /* pmDataCnt */ apm32 = htobe32(nsectors); - fwrite(&apm32, sizeof(apm32), 1, fd); + fwrite(&apm32, sizeof(apm32), 1, fd); /* pmPartStatus */ apm32 = htobe32(part_status); - fwrite(&apm32, sizeof(apm32), 1, fd); + fwrite(&apm32, sizeof(apm32), 1, fd); return 0; } @@ -681,8 +730,9 @@ cd9660_write_boot(iso9660_disk *diskStructure, FILE *f t->num_sectors * (diskStructure->sectorSize / 512), 512, "CD Boot", "Apple_Bootstrap"); } + /* Write ISO9660 descriptor, enclosing the whole disk */ - cd9660_write_apm_partition_entry(fd, 2 + apm_partitions, + cd9660_write_apm_partition_entry(fd, 2 + apm_partitions, total_parts, 0, diskStructure->totalSectors * (diskStructure->sectorSize / 512), 512, "ISO9660", "CD_ROM_Mode_1"); @@ -690,4 +740,3 @@ cd9660_write_boot(iso9660_disk *diskStructure, FILE *f return 0; } - Modified: stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.h ============================================================================== --- stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.h Wed Apr 25 01:54:24 2018 (r332982) +++ stable/11/usr.sbin/makefs/cd9660/cd9660_eltorito.h Wed Apr 25 01:59:15 2018 (r332983) @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_eltorito.h,v 1.5 2009/07/04 14:31:38 ahoka Exp $ */ +/* $NetBSD: cd9660_eltorito.h,v 1.6 2017/01/24 11:22:43 nonaka Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause-NetBSD @@ -44,6 +44,7 @@ #define ET_SYS_X86 0 #define ET_SYS_PPC 1 #define ET_SYS_MAC 2 +#define ET_SYS_EFI 0xef /* Platform ID at section header entry */ #define ET_BOOT_ENTRY_SIZE 0x20 @@ -149,6 +150,7 @@ struct cd9660_boot_image { u_char targetMode; u_char system; u_char bootable; + u_char platform_id; /* for section header entry */ /* * If the boot image exists in the filesystem * already, this is a pointer to that node. For the sake Modified: stable/11/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/11/usr.sbin/makefs/makefs.8 Wed Apr 25 01:54:24 2018 (r332982) +++ stable/11/usr.sbin/makefs/makefs.8 Wed Apr 25 01:59:15 2018 (r332983) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 6, 2017 +.Dd March 30, 2018 .Dt MAKEFS 8 .Os .Sh NAME @@ -386,6 +386,8 @@ ElTorito image. Do not pad the image (apparently Linux needs the padding). .It Sy omit-trailing-period Omit trailing periods in filenames. +.It Sy platformid +Set platform ID of section header entry of the boot image. .It Sy preparer Preparer ID of the image. .It Sy publisher From owner-svn-src-all@freebsd.org Wed Apr 25 02:11:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A21E5FBA7C5 for ; Wed, 25 Apr 2018 02:11:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic314-29.consmr.mail.bf2.yahoo.com (sonic314-29.consmr.mail.bf2.yahoo.com [74.6.132.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46B4D7D4B4 for ; Wed, 25 Apr 2018 02:11:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1524622269; bh=ltfgjc3bNoeFjhdd7FfeawZpEUUnqunN+EU9tZmKxd8=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=QMohCae9iabkBv8P+dj/9M6lrVc6lNjSy8RLWJjCxWAbjt1A7HQnGd2ws4iTQzxtZigUjIj7EteqSxDpHenwAjvovvqq0mFs2e8DONY2dYjJoXv9jZY7uXVCJ1xwl/SQOVRietgP1UYBrZ+koZFr/MvsDyLOP6rsvOp1p11r2yhbhkpd4+ZGNNz3JFeehtGOepSfPVNbGWkksyLs99eXHcveEYWUNr+cZKa2pt4qr/xD4T0Z7LhjyPkKRvFY3/6Bq/eMax9Zhmra/epueLmxE++h8to8qJYrEBY8Btx0X+g3Zeyb+h6o4mfOFXRf5iKnRQeWFLh4XygDK/6jEetl+g== X-YMail-OSG: 8EK.63sVM1m9vMJ.UHsVWJyIfngrG8f8iXVBf7MfimMc4XHhdCqR7NGYaW0xRra ev5p3bJP2H5uj.hU8f6NTDjgUfHy_f93CDnSSxgsBbbqh.iZG5rDj2e6bDMkmOE.pICMSKkFFqLx cKflIuDDpcpcEOosvTLltckTjaFW8mf0P4pSKDZ3eroFRGGFwvBDY_e1mnufNU8MCcy6ndVRZplY hT0BUhVw9f8qCtGYTexwUJgUeYJCcl8d8cV75bzFmQPCOhmlcemf0Z1wccou9PJzP3Yem9QGeMqk 5VXw5u6dBjb7fy4aX1iaxp2f.kBMDuurNvU.HjLaWZOkoFZo05Zk3QtpShKiq9GhAsCBtucYr812 GZQbf6qFhGO10CHR.cRm6BdFJ5DdTQSUAAX71CfLWnPsZxY7qbcK5E9R2465TVfGlOmcy_crH.Yd WgpuP_5UaWfDLZSHIfn32fkVfqjTbRxzacAjrXqhrBs24UaZN.GEkjNeAnpdggGq8Q7pvLUWAVtl uy2MtSVJbPP7Rc8BE.isf6_veMR7jnZmQjFTiF.apLjlmxdxr_ljUsu9qT.jf5zuDTiKpZR11eL8 1wp62A_wPw1.ShFRz0jZW9.24oM4_zjamX2_C Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.bf2.yahoo.com with HTTP; Wed, 25 Apr 2018 02:11:09 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp431.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5f62a8a795b61142a4fe2afd4fa50620; Wed, 25 Apr 2018 01:50:56 +0000 (UTC) Subject: Re: svn commit: r332980 - in stable/11/usr.sbin/makefs: . cd9660 ffs To: Benno Rice , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201804250135.w3P1Z6Xt084500@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Tue, 24 Apr 2018 20:50:55 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201804250135.w3P1Z6Xt084500@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 02:11:10 -0000 On 24/04/2018 20:35, Benno Rice wrote: > Author: benno > Date: Wed Apr 25 01:35:06 2018 > New Revision: 332980 > URL: https://svnweb.freebsd.org/changeset/base/332980 > > Log: > MFC r307927 > > Be more precise when including headers so that we're less likely to > depend on namespace pollution and as such become more portable. This > means including headers like or , but also > making sure we include system/host headers before local headers. > > While here: define ENOATTR as ENOMSG in mtree.c. There is no ENOATTR > on Linux. > Nope. ... > Modified: stable/11/usr.sbin/makefs/mtree.c > ============================================================================== > --- stable/11/usr.sbin/makefs/mtree.c Wed Apr 25 01:30:29 2018 (r332979) > +++ stable/11/usr.sbin/makefs/mtree.c Wed Apr 25 01:35:06 2018 (r332980) > @@ -46,10 +46,15 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > #include "makefs.h" > + > +#ifndef ENOATTR > +#define ENOATTR ENOMSG > +#endif > > #define IS_DOT(nm) ((nm)[0] == '.' && (nm)[1] == '\0') > #define IS_DOTDOT(nm) ((nm)[0] == '.' && (nm)[1] == '.' && (nm)[2] == '\0') This should be ENODATA, see r326282 for reference. Cheers, Pedro. From owner-svn-src-all@freebsd.org Wed Apr 25 02:15:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8815FFBA9B5; Wed, 25 Apr 2018 02:15:36 +0000 (UTC) (envelope-from benno@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 2E3787D8D6; Wed, 25 Apr 2018 02:15:36 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9CF5121B23; Tue, 24 Apr 2018 22:15:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 24 Apr 2018 22:15:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=/ZWLU/0cA/4uaW9pcNDBxeaqdMO8B 948nVKIYnIPugo=; b=LJW+I0vvHe58xBEo0AZyaEC5Ifc8yl7qBHM/kHlZG6WzN KG7TXV+AYmc1uQtImJwwntwMpQCTyHASovgGMJfI/UCK4wrStJtLzAuzNsFGrAwE muqQuiaNIh0k9CIkg+O0Tb2NadPYSHL6TarhHOKdJDbYp/LkDEcUQidypHNO3ZXb /q3Fb3qrUXco3EuXxHi+M2jJoYRYldUQfJDOAa9q5Fgh6QWZ2Cg0JVQoRKBGFzqL JRgBVUZUJkek79d4JADfHTN++/3i7BZk2xmcYTQXp56wued2iCQsCmlqTUVUFj6k EcqpPOEV2YVbaPHMVqsODNQWnR6Ld6VMFMotSXPoA== X-ME-Sender: Received: from [10.0.0.153] (c-73-121-138-58.hsd1.tn.comcast.net [73.121.138.58]) by mail.messagingengine.com (Postfix) with ESMTPA id AE11A1025E; Tue, 24 Apr 2018 22:15:34 -0400 (EDT) From: Benno Rice Message-Id: <4E691A4E-6391-4A7D-BD8E-C2773C564AC2@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r332980 - in stable/11/usr.sbin/makefs: . cd9660 ffs Date: Tue, 24 Apr 2018 22:15:33 -0400 In-Reply-To: Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org To: Pedro Giffuni References: <201804250135.w3P1Z6Xt084500@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.6.18) 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 02:15:36 -0000 > On Apr 24, 2018, at 9:50 PM, Pedro Giffuni wrote: >=20 >=20 >=20 > On 24/04/2018 20:35, Benno Rice wrote: >> Author: benno >> Date: Wed Apr 25 01:35:06 2018 >> New Revision: 332980 >> URL: https://svnweb.freebsd.org/changeset/base/332980 >>=20 >> Log: >> MFC r307927 >> Be more precise when including headers so that we're less = likely to >> depend on namespace pollution and as such become more portable. = This >> means including headers like or , but also >> making sure we include system/host headers before local headers. >> While here: define ENOATTR as ENOMSG in mtree.c. There is no = ENOATTR >> on Linux. >> =20 > Nope. > ... >=20 >> Modified: stable/11/usr.sbin/makefs/mtree.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- stable/11/usr.sbin/makefs/mtree.c Wed Apr 25 01:30:29 2018 = (r332979) >> +++ stable/11/usr.sbin/makefs/mtree.c Wed Apr 25 01:35:06 2018 = (r332980) >> @@ -46,10 +46,15 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> #include "makefs.h" >> + >> +#ifndef ENOATTR >> +#define ENOATTR ENOMSG >> +#endif >> #define IS_DOT(nm) ((nm)[0] =3D=3D '.' && (nm)[1] =3D=3D = '\0') >> #define IS_DOTDOT(nm) ((nm)[0] =3D=3D '.' && (nm)[1] =3D=3D = '.' && (nm)[2] =3D=3D '\0') >=20 > This should be ENODATA, see r326282 for reference. This is an old change I MFC=E2=80=99ed but did not originally author. = Merging it reduced conflicts with other changes I needed to merge in = order to merge the EFI changes for El Torito. I=E2=80=99m more than = happy if someone wants to fix this up in head. Thanks, Benno.= From owner-svn-src-all@freebsd.org Wed Apr 25 02:42:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 02:42:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B135FBB27F for ; Wed, 25 Apr 2018 02:42:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic303-35.consmr.mail.gq1.yahoo.com (sonic303-35.consmr.mail.gq1.yahoo.com [98.137.64.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1147B85BB0 for ; Wed, 25 Apr 2018 02:42:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1524624147; bh=CdqphuehXMbNsPN9zULhocC5NCViPvyvvNoby0wNSgw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=cTdiZLp/rqgxX4yylBUOm7dGhoZ3886r53P+q4JlC3hMJpVCWgEuGU3j5RRoykYRcXOZ7VDBt22lKAe6iVO4C8GBr0DbePFuyBuCnZbfNDOMmjB/hNYVhw7eyS5opnpRlj0aP8+9OW9K1fV0JVtRP9kMXiHLjO5ks2g+xAM3sLEORXXLOpaejUIgjX5VbPZaZe6IMk/HfOcqQOkYXoVy77mr3CadAe49KgKqF3o2iEKtgYGyqoT17PsJHo7mm1V9MFCZo9caQ2kh48JWt228EJ3aYvrxNk5KY3z5y/w4G7N88YO2xJ2XNLTEwsE/3Sp+CwKTKPLz9K0NXrhxeVqWFQ== X-YMail-OSG: HXeLUlMVM1nhj.cTiU2NSQZNKtUKlrkwzKJOj3QX65UFJF9UQxI8IMLpbcX6CN. e__PXFTgdH7a6KbfpMXealUMMwZa6_78odDNRraIPOoOrH6AMF26_Hv8fPAcTR6h_HJVMcGBdLCx WruUUHIO5Lw1VJRvy18J7o1WDi26tM1UfS3ZWHT.q57ksNoLLVuo6KqoEQgQPEI_g4RrlH8YQIsn EGi6fW1ZEJCLg00YWLXlEsmPk_5qVJuuSdxiHDLoe6bz9aiuHnbePnplxba0zH7Ws9EeU16pBtMd TSFJGotr2SM_AkAO5c7jXLQz3JHRbGMVOnr9eG1npS.Vr_wNQleJMLKeyBD0rftrwhVFRBOa.R_O RYyOpQvJm2rJBseHxBJjEXZl95kMiUVRzqvIDr6WzKdg5Gp40WbUehSn.V0hnUBs7lGH3u3xynLX MQGZAIS0U4lpN1hDQn.8wtJmdTyQ9xphVHjfvFihdBph_iCN4xEPRGhJ9PgPFqz0PlQsr0BRl65h IBlpO6GzgBfbVNYAluUNBfPSXvAkdoCpRwzgl8uQs7_JzUlyTOogOliOSJ6RlJGparPP01dv7xWI u1nESYTO41yW_rym4p89Rg50B8rwcvskM1nku Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Wed, 25 Apr 2018 02:42:27 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp403.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID b4b12013f2c7d866bef0253f43d72af1; Wed, 25 Apr 2018 02:42:23 +0000 (UTC) Subject: Re: svn commit: r332980 - in stable/11/usr.sbin/makefs: . cd9660 ffs To: Benno Rice Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201804250135.w3P1Z6Xt084500@repo.freebsd.org> <4E691A4E-6391-4A7D-BD8E-C2773C564AC2@FreeBSD.org> From: Pedro Giffuni Message-ID: Date: Tue, 24 Apr 2018 21:42:21 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <4E691A4E-6391-4A7D-BD8E-C2773C564AC2@FreeBSD.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 02:42:30 -0000 On 04/24/18 21:15, Benno Rice wrote: > > >> On Apr 24, 2018, at 9:50 PM, Pedro Giffuni > > wrote: >> >> >> >> On 24/04/2018 20:35, Benno Rice wrote: >>> Author: benno >>> Date: Wed Apr 25 01:35:06 2018 >>> New Revision: 332980 >>> URL: https://svnweb.freebsd.org/changeset/base/332980 >>> >>> Log: >>>   MFC r307927 >>>       Be more precise when including headers so that we're less >>> likely to >>>    depend on namespace pollution and as such become more portable. This >>>    means including headers like or , but also >>>    making sure we include system/host headers before local headers. >>>       While here: define ENOATTR as ENOMSG in mtree.c. There is no >>> ENOATTR >>>    on Linux. >>> >> Nope. >> ... >> >>> Modified: stable/11/usr.sbin/makefs/mtree.c >>> ============================================================================== >>> --- stable/11/usr.sbin/makefs/mtree.cWed Apr 25 01:30:29 2018(r332979) >>> +++ stable/11/usr.sbin/makefs/mtree.cWed Apr 25 01:35:06 2018(r332980) >>> @@ -46,10 +46,15 @@ __FBSDID("$FreeBSD$"); >>>  #include >>>  #include >>>  #include >>> +#include >>>  #include >>>  #include >>>    #include "makefs.h" >>> + >>> +#ifndef ENOATTR >>> +#defineENOATTRENOMSG >>> +#endif >>>    #defineIS_DOT(nm)((nm)[0] == '.' && (nm)[1] == '\0') >>>  #defineIS_DOTDOT(nm)((nm)[0] == '.' && (nm)[1] == '.' && (nm)[2] == >>> '\0') >> >> This should be ENODATA, see r326282 for reference. > > This is an old change I MFC’ed but did not originally author. Merging > it reduced conflicts with other changes I needed to merge in order to > merge the EFI changes for El Torito. I’m more than happy if someone > wants to fix this up in head. > I see, good find then ;). Thanks, Pedro. From owner-svn-src-all@freebsd.org Wed Apr 25 02:42:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 02:43:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 06:29:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84206FBE1FB; Wed, 25 Apr 2018 06:29:08 +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 3301B6B003; Wed, 25 Apr 2018 06:29:08 +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 299D725774; Wed, 25 Apr 2018 06:29:08 +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 w3P6T8qK029534; Wed, 25 Apr 2018 06:29:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3P6T879029533; Wed, 25 Apr 2018 06:29:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201804250629.w3P6T879029533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 25 Apr 2018 06:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332987 - stable/11/contrib/ofed/libibverbs X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/contrib/ofed/libibverbs X-SVN-Commit-Revision: 332987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 06:29:08 -0000 Author: hselasky Date: Wed Apr 25 06:29:07 2018 New Revision: 332987 URL: https://svnweb.freebsd.org/changeset/base/332987 Log: MFC r332869: Remove the "load drivers" logic from libibverbs. The "load drivers" logic in the libibverbs configuration file is relevant for Linux only. Sponsored by: Mellanox Technologies Modified: stable/11/contrib/ofed/libibverbs/init.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ofed/libibverbs/init.c ============================================================================== --- stable/11/contrib/ofed/libibverbs/init.c Wed Apr 25 02:43:53 2018 (r332986) +++ stable/11/contrib/ofed/libibverbs/init.c Wed Apr 25 06:29:07 2018 (r332987) @@ -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-all@freebsd.org Wed Apr 25 07:51:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 07:51:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 12:21:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 447C5FA470B; Wed, 25 Apr 2018 12:21:15 +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 E99CF789F7; Wed, 25 Apr 2018 12:21:14 +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 CB4FBF65; Wed, 25 Apr 2018 12:21:14 +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 w3PCLEoA004848; Wed, 25 Apr 2018 12:21:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PCLDbT004837; Wed, 25 Apr 2018 12:21:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804251221.w3PCLDbT004837@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 12:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332991 - in stable/11: sbin/ifconfig sys/net sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: sbin/ifconfig sys/net sys/sys X-SVN-Commit-Revision: 332991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 12:21:15 -0000 Author: kib Date: Wed Apr 25 12:21:13 2018 New Revision: 332991 URL: https://svnweb.freebsd.org/changeset/base/332991 Log: MFC r331622: Allow to specify PCP on packets not belonging to any VLAN. Sponsored by: Mellanox Technologies Modified: stable/11/sbin/ifconfig/af_link.c stable/11/sbin/ifconfig/ifconfig.c stable/11/sys/net/ethernet.h stable/11/sys/net/if.c stable/11/sys/net/if.h stable/11/sys/net/if_ethersubr.c stable/11/sys/net/if_var.h stable/11/sys/net/if_vlan.c stable/11/sys/net/if_vlan_var.h stable/11/sys/sys/priv.h stable/11/sys/sys/sockio.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ifconfig/af_link.c ============================================================================== --- stable/11/sbin/ifconfig/af_link.c Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sbin/ifconfig/af_link.c Wed Apr 25 12:21:13 2018 (r332991) @@ -58,70 +58,73 @@ static void link_status(int s __unused, const struct ifaddrs *ifa) { /* XXX no const 'cuz LLADDR is defined wrong */ - struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr; + struct sockaddr_dl *sdl; char *ether_format, *format_char; + struct ifreq ifr; + int n, rc, sock_hw; + static const u_char laggaddr[6] = {0}; - if (sdl != NULL && sdl->sdl_alen > 0) { - if ((sdl->sdl_type == IFT_ETHER || - sdl->sdl_type == IFT_L2VLAN || - sdl->sdl_type == IFT_BRIDGE) && - sdl->sdl_alen == ETHER_ADDR_LEN) { - ether_format = ether_ntoa((struct ether_addr *)LLADDR(sdl)); - if (f_ether != NULL && strcmp(f_ether, "dash") == 0) { - for (format_char = strchr(ether_format, ':'); - format_char != NULL; - format_char = strchr(ether_format, ':')) - *format_char = '-'; - } - printf("\tether %s\n", ether_format); - } else { - int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; + sdl = (struct sockaddr_dl *) ifa->ifa_addr; + if (sdl == NULL || sdl->sdl_alen == 0) + return; - printf("\tlladdr %s\n", link_ntoa(sdl) + n); + if ((sdl->sdl_type == IFT_ETHER || sdl->sdl_type == IFT_L2VLAN || + sdl->sdl_type == IFT_BRIDGE) && sdl->sdl_alen == ETHER_ADDR_LEN) { + ether_format = ether_ntoa((struct ether_addr *)LLADDR(sdl)); + if (f_ether != NULL && strcmp(f_ether, "dash") == 0) { + for (format_char = strchr(ether_format, ':'); + format_char != NULL; + format_char = strchr(ether_format, ':')) + *format_char = '-'; } - /* Best-effort (i.e. failures are silent) to get original - * hardware address, as read by NIC driver at attach time. Only - * applies to Ethernet NICs (IFT_ETHER). However, laggX - * interfaces claim to be IFT_ETHER, and re-type their component - * Ethernet NICs as IFT_IEEE8023ADLAG. So, check for both. If - * the MAC is zeroed, then it's actually a lagg. - */ - if ((sdl->sdl_type == IFT_ETHER || - sdl->sdl_type == IFT_IEEE8023ADLAG) && - sdl->sdl_alen == ETHER_ADDR_LEN) { - struct ifreq ifr; - int sock_hw; - int rc; - static const u_char laggaddr[6] = {0}; + printf("\tether %s\n", ether_format); + } else { + n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0; + printf("\tlladdr %s\n", link_ntoa(sdl) + n); + } - strncpy(ifr.ifr_name, ifa->ifa_name, - sizeof(ifr.ifr_name)); - memcpy(&ifr.ifr_addr, ifa->ifa_addr, - sizeof(ifa->ifa_addr->sa_len)); - ifr.ifr_addr.sa_family = AF_LOCAL; - if ((sock_hw = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) { - warn("socket(AF_LOCAL,SOCK_DGRAM)"); - return; - } - rc = ioctl(sock_hw, SIOCGHWADDR, &ifr); - close(sock_hw); - if (rc != 0) { - return; - } - if (memcmp(ifr.ifr_addr.sa_data, laggaddr, sdl->sdl_alen) == 0) { - return; - } - ether_format = ether_ntoa((const struct ether_addr *) - &ifr.ifr_addr.sa_data); - if (f_ether != NULL && strcmp(f_ether, "dash") == 0) { - for (format_char = strchr(ether_format, ':'); - format_char != NULL; - format_char = strchr(ether_format, ':')) - *format_char = '-'; - } - printf("\thwaddr %s\n", ether_format); - } + /* + * Best-effort (i.e. failures are silent) to get original + * hardware address, as read by NIC driver at attach time. Only + * applies to Ethernet NICs (IFT_ETHER). However, laggX + * interfaces claim to be IFT_ETHER, and re-type their component + * Ethernet NICs as IFT_IEEE8023ADLAG. So, check for both. If + * the MAC is zeroed, then it's actually a lagg. + */ + if ((sdl->sdl_type != IFT_ETHER && + sdl->sdl_type != IFT_IEEE8023ADLAG) || + sdl->sdl_alen != ETHER_ADDR_LEN) + return; + + strncpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name)); + memcpy(&ifr.ifr_addr, ifa->ifa_addr, sizeof(ifa->ifa_addr->sa_len)); + ifr.ifr_addr.sa_family = AF_LOCAL; + if ((sock_hw = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) { + warn("socket(AF_LOCAL,SOCK_DGRAM)"); + return; } + rc = ioctl(sock_hw, SIOCGHWADDR, &ifr); + close(sock_hw); + if (rc != 0) + return; + + if (memcmp(ifr.ifr_addr.sa_data, laggaddr, sdl->sdl_alen) == 0) + goto pcp; + + ether_format = ether_ntoa((const struct ether_addr *) + &ifr.ifr_addr.sa_data); + if (f_ether != NULL && strcmp(f_ether, "dash") == 0) { + for (format_char = strchr(ether_format, ':'); + format_char != NULL; + format_char = strchr(ether_format, ':')) + *format_char = '-'; + } + printf("\thwaddr %s\n", ether_format); + +pcp: + if (ioctl(s, SIOCGLANPCP, (caddr_t)&ifr) == 0 && + ifr.ifr_lan_pcp != IFNET_PCP_NONE) + printf("\tpcp %d\n", ifr.ifr_lan_pcp); } static void Modified: stable/11/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/11/sbin/ifconfig/ifconfig.c Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sbin/ifconfig/ifconfig.c Wed Apr 25 12:21:13 2018 (r332991) @@ -1078,6 +1078,32 @@ setifmtu(const char *val, int dummy __unused, int s, } static void +setifpcp(const char *val, int arg __unused, int s, const struct afswtch *afp) +{ + u_long ul; + char *endp; + + ul = strtoul(val, &endp, 0); + if (*endp != '\0') + errx(1, "invalid value for pcp"); + if (ul > 7) + errx(1, "value for pcp out of range"); + ifr.ifr_lan_pcp = ul; + if (ioctl(s, SIOCSLANPCP, (caddr_t)&ifr) == -1) + err(1, "SIOCSLANPCP"); +} + +static void +disableifpcp(const char *val, int arg __unused, int s, + const struct afswtch *afp) +{ + + ifr.ifr_lan_pcp = IFNET_PCP_NONE; + if (ioctl(s, SIOCSLANPCP, (caddr_t)&ifr) == -1) + err(1, "SIOCSLANPCP"); +} + +static void setifname(const char *val, int dummy __unused, int s, const struct afswtch *afp) { @@ -1434,6 +1460,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-txcsum", -IFCAP_TXCSUM, setifcap), DEF_CMD("netcons", IFCAP_NETCONS, setifcap), DEF_CMD("-netcons", -IFCAP_NETCONS, setifcap), + DEF_CMD_ARG("pcp", setifpcp), + DEF_CMD("-pcp", 0, disableifpcp), DEF_CMD("polling", IFCAP_POLLING, setifcap), DEF_CMD("-polling", -IFCAP_POLLING, setifcap), DEF_CMD("tso6", IFCAP_TSO6, setifcap), Modified: stable/11/sys/net/ethernet.h ============================================================================== --- stable/11/sys/net/ethernet.h Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/net/ethernet.h Wed Apr 25 12:21:13 2018 (r332991) @@ -382,6 +382,20 @@ struct ether_vlan_header { } \ } while (0) +/* + * Names for 802.1q priorities ("802.1p"). Notice that in this scheme, + * (0 < 1), allowing default 0-tagged traffic to take priority over background + * tagged traffic. + */ +#define IEEE8021Q_PCP_BK 1 /* Background (lowest) */ +#define IEEE8021Q_PCP_BE 0 /* Best effort (default) */ +#define IEEE8021Q_PCP_EE 2 /* Excellent effort */ +#define IEEE8021Q_PCP_CA 3 /* Critical applications */ +#define IEEE8021Q_PCP_VI 4 /* Video, < 100ms latency */ +#define IEEE8021Q_PCP_VO 5 /* Video, < 10ms latency */ +#define IEEE8021Q_PCP_IC 6 /* Internetwork control */ +#define IEEE8021Q_PCP_NC 7 /* Network control (highest) */ + #ifdef _KERNEL struct ifnet; @@ -403,6 +417,8 @@ extern char *ether_sprintf(const u_int8_t *); void ether_vlan_mtap(struct bpf_if *, struct mbuf *, void *, u_int); struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); +bool ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, + uint16_t vid, uint8_t pcp); #ifdef _SYS_EVENTHANDLER_H_ /* new ethernet interface attached event */ Modified: stable/11/sys/net/if.c ============================================================================== --- stable/11/sys/net/if.c Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/net/if.c Wed Apr 25 12:21:13 2018 (r332991) @@ -550,6 +550,7 @@ if_alloc(u_char type) for (int i = 0; i < IFCOUNTERS; i++) ifp->if_counters[i] = counter_u64_alloc(M_WAITOK); ifp->if_get_counter = if_get_counter_default; + ifp->if_pcp = IFNET_PCP_NONE; ifnet_setbyindex(ifp->if_index, ifp); return (ifp); } Modified: stable/11/sys/net/if.h ============================================================================== --- stable/11/sys/net/if.h Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/net/if.h Wed Apr 25 12:21:13 2018 (r332991) @@ -416,6 +416,7 @@ struct ifreq { #define ifr_index ifr_ifru.ifru_index /* interface index */ #define ifr_fib ifr_ifru.ifru_fib /* interface fib */ #define ifr_vlan_pcp ifr_ifru.ifru_vlan_pcp /* VLAN priority */ +#define ifr_lan_pcp ifr_ifru.ifru_vlan_pcp /* VLAN priority */ }; #define _SIZEOF_ADDR_IFREQ(ifr) \ @@ -566,6 +567,8 @@ struct ifrsshash { uint16_t ifrh_spare1; uint32_t ifrh_types; /* RSS_TYPE_ */ }; + +#define IFNET_PCP_NONE 0xff /* PCP disabled */ #endif /* __BSD_VISIBLE */ Modified: stable/11/sys/net/if_ethersubr.c ============================================================================== --- stable/11/sys/net/if_ethersubr.c Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/net/if_ethersubr.c Wed Apr 25 12:21:13 2018 (r332991) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -433,6 +434,19 @@ bad: if (m != NULL) return ether_output_frame(ifp, m); } +static bool +ether_set_pcp(struct mbuf **mp, struct ifnet *ifp, uint8_t pcp) +{ + struct ether_header *eh; + + eh = mtod(*mp, struct ether_header *); + if (ntohs(eh->ether_type) == ETHERTYPE_VLAN || + ether_8021q_frame(mp, ifp, ifp, 0, pcp)) + return (true); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (false); +} + /* * Ethernet link layer output routine to send a raw frame to the device. * @@ -442,13 +456,17 @@ bad: if (m != NULL) int ether_output_frame(struct ifnet *ifp, struct mbuf *m) { - int i; + int error; + uint8_t pcp; - if (PFIL_HOOKED(&V_link_pfil_hook)) { - i = pfil_run_hooks(&V_link_pfil_hook, &m, ifp, PFIL_OUT, 0, - NULL); + pcp = ifp->if_pcp; + if (pcp != IFNET_PCP_NONE && !ether_set_pcp(&m, ifp, pcp)) + return (0); - if (i != 0) + if (PFIL_HOOKED(&V_link_pfil_hook)) { + error = pfil_run_hooks(&V_link_pfil_hook, &m, ifp, + PFIL_OUT, 0, NULL); + if (error != 0) return (EACCES); if (m == NULL) @@ -1100,6 +1118,22 @@ ether_ioctl(struct ifnet *ifp, u_long command, caddr_t ifp->if_mtu = ifr->ifr_mtu; } break; + + case SIOCSLANPCP: + error = priv_check(curthread, PRIV_NET_SETLANPCP); + if (error != 0) + break; + if (ifr->ifr_lan_pcp > 7 && + ifr->ifr_lan_pcp != IFNET_PCP_NONE) + error = EINVAL; + else + ifp->if_pcp = ifr->ifr_lan_pcp; + break; + + case SIOCGLANPCP: + ifr->ifr_lan_pcp = ifp->if_pcp; + break; + default: error = EINVAL; /* XXX netbsd has ENOTTY??? */ break; @@ -1246,6 +1280,87 @@ ether_vlanencap(struct mbuf *m, uint16_t tag) evl->evl_encap_proto = htons(ETHERTYPE_VLAN); evl->evl_tag = htons(tag); return (m); +} + +static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW, 0, + "IEEE 802.1Q VLAN"); +static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0, + "for consistency"); + +static VNET_DEFINE(int, soft_pad); +#define V_soft_pad VNET(soft_pad) +SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET, + &VNET_NAME(soft_pad), 0, + "pad short frames before tagging"); + +/* + * For now, make preserving PCP via an mbuf tag optional, as it increases + * per-packet memory allocations and frees. In the future, it would be + * preferable to reuse ether_vtag for this, or similar. + */ +int vlan_mtag_pcp = 0; +SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG_RW, + &vlan_mtag_pcp, 0, + "Retain VLAN PCP information as packets are passed up the stack"); + +bool +ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p, + uint16_t vid, uint8_t pcp) +{ + struct m_tag *mtag; + int n; + uint16_t tag; + static const char pad[8]; /* just zeros */ + + /* + * Pad the frame to the minimum size allowed if told to. + * This option is in accord with IEEE Std 802.1Q, 2003 Ed., + * paragraph C.4.4.3.b. It can help to work around buggy + * bridges that violate paragraph C.4.4.3.a from the same + * document, i.e., fail to pad short frames after untagging. + * E.g., a tagged frame 66 bytes long (incl. FCS) is OK, but + * untagging it will produce a 62-byte frame, which is a runt + * and requires padding. There are VLAN-enabled network + * devices that just discard such runts instead or mishandle + * them somehow. + */ + if (V_soft_pad && p->if_type == IFT_ETHER) { + for (n = ETHERMIN + ETHER_HDR_LEN - (*mp)->m_pkthdr.len; + n > 0; n -= sizeof(pad)) { + if (!m_append(*mp, min(n, sizeof(pad)), pad)) + break; + } + if (n > 0) { + m_freem(*mp); + *mp = NULL; + if_printf(ife, "cannot pad short frame"); + return (false); + } + } + + /* + * If underlying interface can do VLAN tag insertion itself, + * just pass the packet along. However, we need some way to + * tell the interface where the packet came from so that it + * knows how to find the VLAN tag to use, so we attach a + * packet tag that holds it. + */ + if (vlan_mtag_pcp && (mtag = m_tag_locate(*mp, MTAG_8021Q, + MTAG_8021Q_PCP_OUT, NULL)) != NULL) + tag = EVL_MAKETAG(vid, *(uint8_t *)(mtag + 1), 0); + else + tag = EVL_MAKETAG(vid, pcp, 0); + if (p->if_capenable & IFCAP_VLAN_HWTAGGING) { + (*mp)->m_pkthdr.ether_vtag = tag; + (*mp)->m_flags |= M_VLANTAG; + } else { + *mp = ether_vlanencap(*mp, tag); + if (*mp == NULL) { + if_printf(ife, "unable to prepend 802.1Q header"); + return (false); + } + } + return (true); } DECLARE_MODULE(ether, ether_mod, SI_SUB_INIT_IF, SI_ORDER_ANY); Modified: stable/11/sys/net/if_var.h ============================================================================== --- stable/11/sys/net/if_var.h Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/net/if_var.h Wed Apr 25 12:21:13 2018 (r332991) @@ -313,7 +313,12 @@ struct ifnet { */ void *if_pspare[3]; /* packet pacing / general use */ void *if_hw_addr; /* hardware link-level address */ - int if_ispare[4]; /* packet pacing / general use */ + + /* Ethernet PCP */ + uint8_t if_pcp; + + uint8_t if_bspare[3]; + int if_ispare[3]; /* packet pacing / general use */ }; /* for compatibility with other BSDs */ Modified: stable/11/sys/net/if_vlan.c ============================================================================== --- stable/11/sys/net/if_vlan.c Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/net/if_vlan.c Wed Apr 25 12:21:13 2018 (r332991) @@ -195,26 +195,8 @@ static struct { {0, NULL} }; -SYSCTL_DECL(_net_link); -static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW, 0, - "IEEE 802.1Q VLAN"); -static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0, - "for consistency"); +extern int vlan_mtag_pcp; -static VNET_DEFINE(int, soft_pad); -#define V_soft_pad VNET(soft_pad) -SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET, - &VNET_NAME(soft_pad), 0, "pad short frames before tagging"); - -/* - * For now, make preserving PCP via an mbuf tag optional, as it increases - * per-packet memory allocations and frees. In the future, it would be - * preferable to reuse ether_vtag for this, or similar. - */ -static int vlan_mtag_pcp = 0; -SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG_RW, &vlan_mtag_pcp, 0, - "Retain VLAN PCP information as packets are passed up the stack"); - static const char vlanname[] = "vlan"; static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface"); @@ -1163,8 +1145,6 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m) { struct ifvlan *ifv; struct ifnet *p; - struct m_tag *mtag; - uint16_t tag; int error, len, mcast; VLAN_LOCK_READER; @@ -1193,59 +1173,10 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m) return (ENETDOWN); } - /* - * Pad the frame to the minimum size allowed if told to. - * This option is in accord with IEEE Std 802.1Q, 2003 Ed., - * paragraph C.4.4.3.b. It can help to work around buggy - * bridges that violate paragraph C.4.4.3.a from the same - * document, i.e., fail to pad short frames after untagging. - * E.g., a tagged frame 66 bytes long (incl. FCS) is OK, but - * untagging it will produce a 62-byte frame, which is a runt - * and requires padding. There are VLAN-enabled network - * devices that just discard such runts instead or mishandle - * them somehow. - */ - if (V_soft_pad && p->if_type == IFT_ETHER) { - static char pad[8]; /* just zeros */ - int n; - - for (n = ETHERMIN + ETHER_HDR_LEN - m->m_pkthdr.len; - n > 0; n -= sizeof(pad)) - if (!m_append(m, min(n, sizeof(pad)), pad)) - break; - - if (n > 0) { - if_printf(ifp, "cannot pad short frame\n"); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - VLAN_RUNLOCK(); - m_freem(m); - return (0); - } - } - - /* - * If underlying interface can do VLAN tag insertion itself, - * just pass the packet along. However, we need some way to - * tell the interface where the packet came from so that it - * knows how to find the VLAN tag to use, so we attach a - * packet tag that holds it. - */ - if (vlan_mtag_pcp && (mtag = m_tag_locate(m, MTAG_8021Q, - MTAG_8021Q_PCP_OUT, NULL)) != NULL) - tag = EVL_MAKETAG(ifv->ifv_vid, *(uint8_t *)(mtag + 1), 0); - else - tag = ifv->ifv_tag; - if (p->if_capenable & IFCAP_VLAN_HWTAGGING) { - m->m_pkthdr.ether_vtag = tag; - m->m_flags |= M_VLANTAG; - } else { - m = ether_vlanencap(m, tag); - if (m == NULL) { - if_printf(ifp, "unable to prepend VLAN header\n"); - if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - VLAN_RUNLOCK(); - return (0); - } + if (!ether_8021q_frame(&m, ifp, p, ifv->ifv_vid, ifv->ifv_pcp)) { + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + VLAN_RUNLOCK(); + return (0); } /* Modified: stable/11/sys/net/if_vlan_var.h ============================================================================== --- stable/11/sys/net/if_vlan_var.h Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/net/if_vlan_var.h Wed Apr 25 12:21:13 2018 (r332991) @@ -73,22 +73,8 @@ struct vlanreq { #define SIOCSETVLAN SIOCSIFGENERIC #define SIOCGETVLAN SIOCGIFGENERIC -#define SIOCGVLANPCP _IOWR('i', 152, struct ifreq) /* Get VLAN PCP */ -#define SIOCSVLANPCP _IOW('i', 153, struct ifreq) /* Set VLAN PCP */ - -/* - * Names for 802.1q priorities ("802.1p"). Notice that in this scheme, - * (0 < 1), allowing default 0-tagged traffic to take priority over background - * tagged traffic. - */ -#define IEEE8021Q_PCP_BK 1 /* Background (lowest) */ -#define IEEE8021Q_PCP_BE 0 /* Best effort (default) */ -#define IEEE8021Q_PCP_EE 2 /* Excellent effort */ -#define IEEE8021Q_PCP_CA 3 /* Critical applications */ -#define IEEE8021Q_PCP_VI 4 /* Video, < 100ms latency */ -#define IEEE8021Q_PCP_VO 5 /* Video, < 10ms latency */ -#define IEEE8021Q_PCP_IC 6 /* Internetwork control */ -#define IEEE8021Q_PCP_NC 7 /* Network control (highest) */ +#define SIOCGVLANPCP SIOCGLANPCP /* Get VLAN PCP */ +#define SIOCSVLANPCP SIOCSLANPCP /* Set VLAN PCP */ #ifdef _KERNEL /* Modified: stable/11/sys/sys/priv.h ============================================================================== --- stable/11/sys/sys/priv.h Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/sys/priv.h Wed Apr 25 12:21:13 2018 (r332991) @@ -342,7 +342,8 @@ #define PRIV_NET_SETIFDESCR 418 /* Set interface description. */ #define PRIV_NET_SETIFFIB 419 /* Set interface fib. */ #define PRIV_NET_VXLAN 420 /* Administer vxlan. */ -#define PRIV_NET_SETVLANPCP 421 /* Set VLAN priority. */ +#define PRIV_NET_SETLANPCP 421 /* Set LAN priority. */ +#define PRIV_NET_SETVLANPCP PRIV_NET_SETLANPCP /* Alias Set VLAN priority */ /* * 802.11-related privileges. Modified: stable/11/sys/sys/sockio.h ============================================================================== --- stable/11/sys/sys/sockio.h Wed Apr 25 07:51:45 2018 (r332990) +++ stable/11/sys/sys/sockio.h Wed Apr 25 12:21:13 2018 (r332991) @@ -138,4 +138,7 @@ #define SIOCGIFRSSHASH _IOWR('i', 151, struct ifrsshash)/* get the current RSS type/func settings */ +#define SIOCGLANPCP _IOWR('i', 152, struct ifreq) /* Get (V)LAN PCP */ +#define SIOCSLANPCP _IOW('i', 153, struct ifreq) /* Set (V)LAN PCP */ + #endif /* !_SYS_SOCKIO_H_ */ From owner-svn-src-all@freebsd.org Wed Apr 25 12:23:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35EA7FA4A56; Wed, 25 Apr 2018 12:23:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C3FA678DA9; Wed, 25 Apr 2018 12:23:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BED1E10C5; Wed, 25 Apr 2018 12:23:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3PCNZTU008658; Wed, 25 Apr 2018 12:23:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PCNZnY008657; Wed, 25 Apr 2018 12:23:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804251223.w3PCNZnY008657@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 12:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332992 - stable/11/sys/i386/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/i386/i386 X-SVN-Commit-Revision: 332992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 12:23:36 -0000 Author: kib Date: Wed Apr 25 12:23:35 2018 New Revision: 332992 URL: https://svnweb.freebsd.org/changeset/base/332992 Log: MFC r332737: For fatal traps other than pagefaults, print raw fault error codes. Modified: stable/11/sys/i386/i386/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/trap.c ============================================================================== --- stable/11/sys/i386/i386/trap.c Wed Apr 25 12:21:13 2018 (r332991) +++ stable/11/sys/i386/i386/trap.c Wed Apr 25 12:23:35 2018 (r332992) @@ -909,6 +909,8 @@ trap_fatal(frame, eva) "", code & PGEX_RSV ? "reserved bits in PTE" : code & PGEX_P ? "protection violation" : "page not present"); + } else { + printf("error code = %#x\n", code); } printf("instruction pointer = 0x%x:0x%x\n", frame->tf_cs & 0xffff, frame->tf_eip); From owner-svn-src-all@freebsd.org Wed Apr 25 13:23:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 14:21:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 14:30:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53FA1FA7660 for ; Wed, 25 Apr 2018 14:30:24 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x232.google.com (mail-yb0-x232.google.com [IPv6:2607:f8b0:4002:c09::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 DBD9B72CB1 for ; Wed, 25 Apr 2018 14:30:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x232.google.com with SMTP id v63-v6so3077513ybi.11 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=TsvqXnY7Eynoseb5Kp17ufdBNGSYuiNwljqumXZc3Rakb/lZTesohnenuZjQznAdff cLg4SqLz9nRcPnnEulr2N+lqODcf2dnElNaZ55wN8Hi7ilFgwt3oF7OdSj8xJzxn9csk oDAV1yKL1tMrZ/7WPJL0ddVMh3s3+sXnnOdqT/fvpkcN2E6dA8xVbM9I8Z6RMs1KONrF s3D6Nry7wtR3WPylMSuc6ibk03YKhG1blM7zDLkCfIRMHQu6G17Ic9eV2BTI0RaR2JoI Kz/JfWTbRo72zo/pjOpPBnSGtBGr/+MMEKfQ6S+SReGL4WkrIHSZvO/eEWEHbjUjnEvE UoIQ== X-Gm-Message-State: ALQs6tDYU7uQeikdCVcS6KgxPJNRtMc5qrrx3NJqfChlLQRpGvq8cUOv yRxnizX5zQrbosmTY1fF5z3Lh8syoUAhPpSmr8p2qg== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 14:39:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 14:40:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 15:28:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 15:30:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 15:32:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 15:39:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 15:41:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 16:28:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 16:43:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 17:51:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 18:06:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 18:44:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 18:47:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 18:53:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B82AFFACB4D; Wed, 25 Apr 2018 18:53:03 +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 398936AF28; Wed, 25 Apr 2018 18:53:03 +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 3418D53ED; Wed, 25 Apr 2018 18:53:03 +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 w3PIr3QK014223; Wed, 25 Apr 2018 18:53:03 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PIr39A014222; Wed, 25 Apr 2018 18:53:03 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804251853.w3PIr39A014222@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:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333006 - stable/11/release/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/release/amd64 X-SVN-Commit-Revision: 333006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 18:53:04 -0000 Author: benno Date: Wed Apr 25 18:53:02 2018 New Revision: 333006 URL: https://svnweb.freebsd.org/changeset/base/333006 Log: MFC r332345, r332346, r332661, r333005 r332345: Fix makefs invocation after r331843. r332346: Fix the position of $bootable so that -o platformid=efi applies correctly. r332661: Generate hybrid ISO images for amd64. This keeps the existing El Torito entries for BIOS and UEFI boot code and adds a GPT in the ISO image's System Area containing boot code for BIOS that will load /boot/loader from the ISO filesystem and execute it. We then use etdump to find the EFI System Partition image in the El Torito catalog and add an entry to the GPT that allows EFI to find it. r333005: 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. Sponsored by: iXsystems, Inc. Modified: stable/11/release/amd64/mkisoimages.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/release/amd64/mkisoimages.sh ============================================================================== --- stable/11/release/amd64/mkisoimages.sh Wed Apr 25 18:47:52 2018 (r333005) +++ stable/11/release/amd64/mkisoimages.sh Wed Apr 25 18:53:02 2018 (r333006) @@ -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 [ "x$1" = "x-b" ]; then # This is highly x86-centric and will be used directly below. bootable="-o bootimage=i386;$4/boot/cdboot -o no-emul-boot" @@ -38,7 +50,7 @@ if [ "x$1" = "x-b" ]; then umount efi rmdir efi mdconfig -d -u $device - bootable="-o bootimage=i386;efiboot.img -o no-emul-boot $bootable" + bootable="$bootable -o bootimage=i386;efiboot.img -o no-emul-boot -o platformid=efi" shift else @@ -55,6 +67,32 @@ NAME="$1"; shift publisher="The FreeBSD Project. http://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 + eval $entry + if [ "$et_platform" = "efi" ]; then + espstart=`expr $et_lba \* 2048` + espsize=`expr $et_sectors \* 512` + espparam="-p efi::$espsize:$espstart" + break + fi + done + + # Create a GPT image containing the partitions we need for hybrid boot. + imgsize=`stat -f %z $NAME` + $MKIMG -s gpt \ + --capacity $imgsize \ + -b $4/boot/pmbr \ + $espparam \ + -p freebsd-boot:=$4/boot/isoboot \ + -o hybrid.img + + # Drop the PMBR, GPT, and boot code into the System Area of the ISO. + dd if=hybrid.img of=$NAME bs=32k count=1 conv=notrunc + rm -f hybrid.img +fi From owner-svn-src-all@freebsd.org Wed Apr 25 18:56:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 18:58:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2B57FACD19; Wed, 25 Apr 2018 18:58:38 +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 919DD6C4DA; Wed, 25 Apr 2018 18:58:38 +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 8C8D353FE; Wed, 25 Apr 2018 18:58:38 +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 w3PIwc4j014565; Wed, 25 Apr 2018 18:58:38 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3PIwcGp014564; Wed, 25 Apr 2018 18:58:38 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201804251858.w3PIwcGp014564@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:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333008 - stable/11/usr.bin/etdump X-SVN-Group: stable-11 X-SVN-Commit-Author: benno X-SVN-Commit-Paths: stable/11/usr.bin/etdump X-SVN-Commit-Revision: 333008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2018 18:58:39 -0000 Author: benno Date: Wed Apr 25 18:58:38 2018 New Revision: 333008 URL: https://svnweb.freebsd.org/changeset/base/333008 Log: MFC r333007 Update release version of FreeBSD. Sponsored by: iXsystems, Inc. Modified: stable/11/usr.bin/etdump/etdump.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/etdump/etdump.1 ============================================================================== --- stable/11/usr.bin/etdump/etdump.1 Wed Apr 25 18:56:27 2018 (r333007) +++ stable/11/usr.bin/etdump/etdump.1 Wed Apr 25 18:58:38 2018 (r333008) @@ -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-all@freebsd.org Wed Apr 25 18:59:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 19:46:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 20:52:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 20:55:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Wed Apr 25 21:01:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 00:00:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89098FB35A7 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 36ECD6AE02 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 08:58:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 11:01:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 12:23:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 13:18:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 13:47:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 15:30:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E08EFB0904 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 24D7F7EA77 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 15:30:46 -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-all@freebsd.org Thu Apr 26 16:00:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0110FFB14CC for ; Thu, 26 Apr 2018 16:00:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B2C385315 for ; Thu, 26 Apr 2018 16:00:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id d73-v6so6292094iog.3 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=S547fuyw7MVP8p0IqYjMcYThzb0SiaCLV0Bti4mHHjxzq1x93UmTq6rFTXx76klxkY 4jXE2I5aL5E+k+akbuhVBdJcyQTH4LxQbe73+Z0DFiAGt42+79f+NwTdymvG9L8PWX0e Z8ecQrAAFOvXHHpEEIXsERV9Uo0ll6DasCYov1qJmiGIVUUzdOH73yytNB/Q6Xl3ueNf uvQK2hQtRpjT/Q+ZgM28V9GWFqHw39dutIKX70A59Oi10Tsm1mJ+srBoLiUlq4FrIf5C kn/RczfJgQbqEXKFpTfqnvhUw/ozuPfxxxvCHkgMRANjE7a/n4uEanY+UkXOpip5D2px 6A3g== X-Gm-Message-State: ALQs6tALDboCYvU7cZGy4CCJIJFhT6SeEOsEVWC+uSPFp3Vy8Qe2VWQ/ m+1g+WpbslVuDVf+wO6jiOTocZm903P+m1GSst/i+g== 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 16:41:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B997FB25D5; Thu, 26 Apr 2018 16:41:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8DF76EB63; Thu, 26 Apr 2018 16:40:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDF511A97F; Thu, 26 Apr 2018 16:40:59 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3QGexkY069818; Thu, 26 Apr 2018 16:40:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3QGex1V069817; Thu, 26 Apr 2018 16:40:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804261640.w3QGex1V069817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 Apr 2018 16:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333018 - stable/11/sys/dev/gpio X-SVN-Group: stable-11 X-SVN-Commit-Author: ian X-SVN-Commit-Paths: stable/11/sys/dev/gpio X-SVN-Commit-Revision: 333018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Apr 2018 16:41:00 -0000 Author: ian Date: Thu Apr 26 16:40:59 2018 New Revision: 333018 URL: https://svnweb.freebsd.org/changeset/base/333018 Log: MFC r308767 by br: Make gpiobus early driver at BUS_PAS_BUS. The gpiobus driver is attached explicitly and generally should be at the same pass as its parent. Making it use BUS_PAS_BUS ensures that it attaches immediately after parent adds it (assuming the parent itself attached at BUS_PAS_BUS and above). Submitted by: kan Sponsored by: DARPA, AFRL Modified: stable/11/sys/dev/gpio/gpiobus.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/gpio/gpiobus.c ============================================================================== --- stable/11/sys/dev/gpio/gpiobus.c Thu Apr 26 13:18:24 2018 (r333017) +++ stable/11/sys/dev/gpio/gpiobus.c Thu Apr 26 16:40:59 2018 (r333018) @@ -855,5 +855,6 @@ driver_t gpiobus_driver = { devclass_t gpiobus_devclass; -DRIVER_MODULE(gpiobus, gpio, gpiobus_driver, gpiobus_devclass, 0, 0); +EARLY_DRIVER_MODULE(gpiobus, gpio, gpiobus_driver, gpiobus_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(gpiobus, 1); From owner-svn-src-all@freebsd.org Thu Apr 26 16:59:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 17:13:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 17:32:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 17:34:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 17:36:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 17:36:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 18:12:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 18:24:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 18:39:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 18:46:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 18:54:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 19:00:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 19:00:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 19:10:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 19:15:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 19:23:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 19:23:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 21:07:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 21:35:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 21:37:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 21:39:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 21:40:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 21:41:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 21:44:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 22:04:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 22:15:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Thu Apr 26 22:43:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@freebsd.org Fri Apr 27 00:12:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 01:21:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11B26FBD6E7; Fri, 27 Apr 2018 01:21:53 +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 B0AC4815FD; Fri, 27 Apr 2018 01:21:52 +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 AA4EF1FD04; Fri, 27 Apr 2018 01:21:52 +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 w3R1Lq7O037606; Fri, 27 Apr 2018 01:21:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R1Lqk5037605; Fri, 27 Apr 2018 01:21:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804270121.w3R1Lqk5037605@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 01:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333048 - stable/11/stand/i386 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/stand/i386 X-SVN-Commit-Revision: 333048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 01:21:53 -0000 Author: emaste Date: Fri Apr 27 01:21:52 2018 New Revision: 333048 URL: https://svnweb.freebsd.org/changeset/base/333048 Log: MFC r332090: stand: pass --no-rosegment for i386 bits when linking with lld btxld does not correctly handle input with other than 2 PT_LOAD segments. Passing --no-rosegment lets lld produce output eqivalent to ld.bfd: 2 PT_LOAD segments and no PT_GNU_RELRO. PR: 225775 Sponsored by: The FreeBSD Foundation Modified: stable/11/stand/i386/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/i386/Makefile.inc ============================================================================== --- stable/11/stand/i386/Makefile.inc Fri Apr 27 00:12:00 2018 (r333047) +++ stable/11/stand/i386/Makefile.inc Fri Apr 27 01:21:52 2018 (r333048) @@ -2,8 +2,13 @@ # # $FreeBSD$ +.sinclude + LOADER_ADDRESS?=0x200000 LDFLAGS+= -nostdlib +.if defined(LINKER_TYPE) && ${LINKER_TYPE} == "lld" +LDFLAGS+= -Wl,--no-rosegment +.endif # BTX components BTXDIR= ${BOOTOBJ}/i386/btx From owner-svn-src-all@freebsd.org Fri Apr 27 02:39:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C10A8FBEA18; Fri, 27 Apr 2018 02:39:36 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5B470BE6; Fri, 27 Apr 2018 02:39:36 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6146020915; Fri, 27 Apr 2018 02:39:36 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3R2daKD074136; Fri, 27 Apr 2018 02:39:36 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R2daCL074134; Fri, 27 Apr 2018 02:39:36 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201804270239.w3R2daCL074134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Fri, 27 Apr 2018 02:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333049 - in stable/11/stand/pc98: boot2 libpc98 X-SVN-Group: stable-11 X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: in stable/11/stand/pc98: boot2 libpc98 X-SVN-Commit-Revision: 333049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 02:39:37 -0000 Author: nyan Date: Fri Apr 27 02:39:36 2018 New Revision: 333049 URL: https://svnweb.freebsd.org/changeset/base/333049 Log: whitespace changes to reduce diffs from i386. still broken pc98 boot. Modified: stable/11/stand/pc98/boot2/boot2.c stable/11/stand/pc98/libpc98/bioscd.c stable/11/stand/pc98/libpc98/biosdisk.c Modified: stable/11/stand/pc98/boot2/boot2.c ============================================================================== --- stable/11/stand/pc98/boot2/boot2.c Fri Apr 27 01:21:52 2018 (r333048) +++ stable/11/stand/pc98/boot2/boot2.c Fri Apr 27 02:39:36 2018 (r333049) @@ -71,20 +71,20 @@ extern uint32_t _end; static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { - RBX_DUAL, - RBX_SERIAL, - RBX_ASKNAME, - RBX_CDROM, - RBX_CONFIG, - RBX_KDB, - RBX_GDB, - RBX_MUTE, - RBX_NOINTR, - RBX_PAUSE, - RBX_QUIET, - RBX_DFLTROOT, - RBX_SINGLE, - RBX_VERBOSE + RBX_DUAL, + RBX_SERIAL, + RBX_ASKNAME, + RBX_CDROM, + RBX_CONFIG, + RBX_KDB, + RBX_GDB, + RBX_MUTE, + RBX_NOINTR, + RBX_PAUSE, + RBX_QUIET, + RBX_DFLTROOT, + RBX_SINGLE, + RBX_VERBOSE }; static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; @@ -92,15 +92,15 @@ static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static const unsigned char dev_daua[NDEV] = {0x80, 0xa0, 0x90}; static struct dsk { - unsigned daua; - unsigned type; - unsigned disk; - unsigned unit; - unsigned head; - unsigned sec; - uint8_t slice; - uint8_t part; - unsigned start; + unsigned daua; + unsigned type; + unsigned disk; + unsigned unit; + unsigned head; + unsigned sec; + uint8_t slice; + uint8_t part; + unsigned start; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; static const char *kname; @@ -128,18 +128,19 @@ static void memcpy(void *, const void *, int); static void memcpy(void *dst, const void *src, int len) { - const char *s = src; - char *d = dst; + const char *s = src; + char *d = dst; - while (len--) - *d++ = *s++; + while (len--) + *d++ = *s++; } static inline int strcmp(const char *s1, const char *s2) { - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; + + for (; *s1 == *s2 && *s1; s1++, s2++); + return ((unsigned char)*s1 - (unsigned char)*s2); } #define UFS_SMALL_CGBASE @@ -148,52 +149,53 @@ strcmp(const char *s1, const char *s2) static inline int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { - if ((size_t)fsread(inode, buf, nbyte) != nbyte) { - printf("Invalid %s\n", "format"); - return -1; - } - return 0; + + if ((size_t)fsread(inode, buf, nbyte) != nbyte) { + printf("Invalid %s\n", "format"); + return (-1); + } + return (0); } static inline void getstr(void) { - char *s; - int c; + char *s; + int c; - s = cmd; - for (;;) { - switch (c = xgetc(0)) { - case 0: - break; - case '\177': - case '\b': - if (s > cmd) { - s--; - printf("\b \b"); - } - break; - case '\n': - case '\r': - *s = 0; - return; - default: - if (s - cmd < sizeof(cmd) - 1) - *s++ = c; - putchar(c); + s = cmd; + for (;;) { + switch (c = xgetc(0)) { + case 0: + break; + case '\177': + case '\b': + if (s > cmd) { + s--; + printf("\b \b"); + } + break; + case '\n': + case '\r': + *s = 0; + return; + default: + if (s - cmd < sizeof(cmd) - 1) + *s++ = c; + putchar(c); + } } - } } static inline void putc(int c) { - v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.addr = PUTCORG; /* call to putc in boot1 */ - v86.eax = c; - v86int(); - v86.ctl = V86_FLAGS; + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = PUTCORG; /* call to putc in boot1 */ + v86.eax = c; + v86int(); + v86.ctl = V86_FLAGS; } static inline int @@ -322,482 +324,491 @@ int main(void) { #ifdef GET_BIOSGEOM - int i; + int i; #endif - uint8_t autoboot; - ufs_ino_t ino; - size_t nbyte; + uint8_t autoboot; + ufs_ino_t ino; + size_t nbyte; - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - v86.efl = PSL_RESERVED_DEFAULT | PSL_I; - dsk.daua = *(uint8_t *)PTOV(0x584); - dsk.disk = dsk.daua & DRV_DISK; - dsk.unit = dsk.daua & DRV_UNIT; - if (dsk.disk == 0x80) - dsk.type = TYPE_AD; - else if (dsk.disk == 0xa0) - dsk.type = TYPE_DA; - else /* if (dsk.disk == 0x30 || dsk.disk == 0x90) */ - dsk.type = TYPE_FD; - dsk.slice = check_slice(); + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + v86.ctl = V86_FLAGS; + v86.efl = PSL_RESERVED_DEFAULT | PSL_I; + dsk.daua = *(uint8_t *)PTOV(0x584); + dsk.disk = dsk.daua & DRV_DISK; + dsk.unit = dsk.daua & DRV_UNIT; + if (dsk.disk == 0x80) + dsk.type = TYPE_AD; + else if (dsk.disk == 0xa0) + dsk.type = TYPE_DA; + else /* if (dsk.disk == 0x30 || dsk.disk == 0x90) */ + dsk.type = TYPE_FD; + dsk.slice = check_slice(); #ifdef GET_BIOSGEOM - for (i = 0; i < N_BIOS_GEOM; i++) - bootinfo.bi_bios_geom[i] = bd_getbigeom(i); + for (i = 0; i < N_BIOS_GEOM; i++) + bootinfo.bi_bios_geom[i] = bd_getbigeom(i); #endif - bootinfo.bi_version = BOOTINFO_VERSION; - bootinfo.bi_size = sizeof(bootinfo); + bootinfo.bi_version = BOOTINFO_VERSION; + bootinfo.bi_size = sizeof(bootinfo); - /* Process configuration file */ + /* Process configuration file */ - autoboot = 1; + autoboot = 1; - if ((ino = lookup(PATH_CONFIG)) || - (ino = lookup(PATH_DOTCONFIG))) { - nbyte = fsread(ino, cmd, sizeof(cmd) - 1); - cmd[nbyte] = '\0'; - } + if ((ino = lookup(PATH_CONFIG)) || + (ino = lookup(PATH_DOTCONFIG))) { + nbyte = fsread(ino, cmd, sizeof(cmd) - 1); + cmd[nbyte] = '\0'; + } - if (*cmd) { - memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) - autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmddup); - /* Do not process this command twice */ - *cmd = 0; - } + if (*cmd) { + memcpy(cmddup, cmd, sizeof(cmd)); + if (parse()) + autoboot = 0; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmddup); + /* Do not process this command twice */ + *cmd = 0; + } - /* - * Try to exec stage 3 boot loader. If interrupted by a keypress, - * or in case of failure, try to load a kernel directly instead. - */ + /* + * Try to exec stage 3 boot loader. If interrupted by a keypress, + * or in case of failure, try to load a kernel directly instead. + */ - if (!kname) { - kname = PATH_LOADER; - if (autoboot && !keyhit(3*SECOND)) { - load(); - kname = PATH_KERNEL; + if (!kname) { + kname = PATH_LOADER; + if (autoboot && !keyhit(3*SECOND)) { + load(); + kname = PATH_KERNEL; + } } - } - /* Present the user with the boot2 prompt. */ + /* Present the user with the boot2 prompt. */ - for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\nFreeBSD/pc98 boot\n" - "Default: %u:%s(%u,%c)%s\n" - "boot: ", - dsk.unit, dev_nm[dsk.type], dsk.unit, - 'a' + dsk.part, kname); - if (DO_SIO) - sio_flush(); - if (!autoboot || keyhit(3*SECOND)) - getstr(); - else if (!autoboot || !OPT_CHECK(RBX_QUIET)) - putchar('\n'); - autoboot = 0; - if (parse()) - putchar('\a'); - else - load(); - } + for (;;) { + if (!autoboot || !OPT_CHECK(RBX_QUIET)) + printf("\nFreeBSD/pc98 boot\n" + "Default: %u:%s(%u,%c)%s\n" + "boot: ", + dsk.unit, dev_nm[dsk.type], dsk.unit, + 'a' + dsk.part, kname); + if (DO_SIO) + sio_flush(); + if (!autoboot || keyhit(3*SECOND)) + getstr(); + else if (!autoboot || !OPT_CHECK(RBX_QUIET)) + putchar('\n'); + autoboot = 0; + if (parse()) + putchar('\a'); + else + load(); + } } /* XXX - Needed for btxld to link the boot2 binary; do not remove. */ void exit(int x) { + } static void load(void) { - union { - struct exec ex; - Elf32_Ehdr eh; - } hdr; - static Elf32_Phdr ep[2]; - static Elf32_Shdr es[2]; - caddr_t p; - ufs_ino_t ino; - uint32_t addr; - int k; - uint8_t i, j; + union { + struct exec ex; + Elf32_Ehdr eh; + } hdr; + static Elf32_Phdr ep[2]; + static Elf32_Shdr es[2]; + caddr_t p; + ufs_ino_t ino; + uint32_t addr; + int k; + uint8_t i, j; - if (!(ino = lookup(kname))) { - if (!ls) - printf("No %s\n", kname); - return; - } - if (xfsread(ino, &hdr, sizeof(hdr))) - return; - - if (N_GETMAGIC(hdr.ex) == ZMAGIC) { - addr = hdr.ex.a_entry & 0xffffff; - p = PTOV(addr); - fs_off = PAGE_SIZE; - if (xfsread(ino, p, hdr.ex.a_text)) - return; - p += roundup2(hdr.ex.a_text, PAGE_SIZE); - if (xfsread(ino, p, hdr.ex.a_data)) - return; - } else if (IS_ELF(hdr.eh)) { - fs_off = hdr.eh.e_phoff; - for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { - if (xfsread(ino, ep + j, sizeof(ep[0]))) + if (!(ino = lookup(kname))) { + if (!ls) + printf("No %s\n", kname); return; - if (ep[j].p_type == PT_LOAD) - j++; } - for (i = 0; i < 2; i++) { - p = PTOV(ep[i].p_paddr & 0xffffff); - fs_off = ep[i].p_offset; - if (xfsread(ino, p, ep[i].p_filesz)) + if (xfsread(ino, &hdr, sizeof(hdr))) return; - } - p += roundup2(ep[1].p_memsz, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { - fs_off = hdr.eh.e_shoff + sizeof(es[0]) * - (hdr.eh.e_shstrndx + 1); - if (xfsread(ino, &es, sizeof(es))) + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { + addr = hdr.ex.a_entry & 0xffffff; + p = PTOV(addr); + fs_off = PAGE_SIZE; + if (xfsread(ino, p, hdr.ex.a_text)) + return; + p += roundup2(hdr.ex.a_text, PAGE_SIZE); + if (xfsread(ino, p, hdr.ex.a_data)) + return; + } else if (IS_ELF(hdr.eh)) { + fs_off = hdr.eh.e_phoff; + for (j = k = 0; k < hdr.eh.e_phnum && j < 2; k++) { + if (xfsread(ino, ep + j, sizeof(ep[0]))) + return; + if (ep[j].p_type == PT_LOAD) + j++; + } + for (i = 0; i < 2; i++) { + p = PTOV(ep[i].p_paddr & 0xffffff); + fs_off = ep[i].p_offset; + if (xfsread(ino, p, ep[i].p_filesz)) + return; + } + p += roundup2(ep[1].p_memsz, PAGE_SIZE); + bootinfo.bi_symtab = VTOP(p); + if (hdr.eh.e_shnum == hdr.eh.e_shstrndx + 3) { + fs_off = hdr.eh.e_shoff + sizeof(es[0]) * + (hdr.eh.e_shstrndx + 1); + if (xfsread(ino, &es, sizeof(es))) + return; + for (i = 0; i < 2; i++) { + *(Elf32_Word *)p = es[i].sh_size; + p += sizeof(es[i].sh_size); + fs_off = es[i].sh_offset; + if (xfsread(ino, p, es[i].sh_size)) + return; + p += es[i].sh_size; + } + } + addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); return; - for (i = 0; i < 2; i++) { - *(Elf32_Word *)p = es[i].sh_size; - p += sizeof(es[i].sh_size); - fs_off = es[i].sh_offset; - if (xfsread(ino, p, es[i].sh_size)) - return; - p += es[i].sh_size; - } } - addr = hdr.eh.e_entry & 0xffffff; - bootinfo.bi_esymtab = VTOP(p); - } else { - printf("Invalid %s\n", "format"); - return; - } - bootinfo.bi_kernelname = VTOP(kname); - bootinfo.bi_bios_dev = dsk.daua; - __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), - MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), - 0, 0, 0, VTOP(&bootinfo)); + bootinfo.bi_kernelname = VTOP(kname); + bootinfo.bi_bios_dev = dsk.daua; + __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), + MAKEBOOTDEV(dev_maj[dsk.type], dsk.slice, dsk.unit, dsk.part), + 0, 0, 0, VTOP(&bootinfo)); } static int parse() { - char *arg = cmd; - char *ep, *p, *q; - const char *cp; - unsigned int drv; - int c, i, j; - size_t k; + char *arg = cmd; + char *ep, *p, *q; + const char *cp; + unsigned int drv; + int c, i, j; + size_t k; - while ((c = *arg++)) { - if (c == ' ' || c == '\t' || c == '\n') - continue; - for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); - ep = p; - if (*p) - *p++ = 0; - if (c == '-') { - while ((c = *arg++)) { - if (c == 'P') { - if (*(uint8_t *)PTOV(0x481) & 0x48) { - cp = "yes"; - } else { - opts |= OPT_SET(RBX_DUAL) | OPT_SET(RBX_SERIAL); - cp = "no"; - } - printf("Keyboard: %s\n", cp); - continue; + while ((c = *arg++)) { + if (c == ' ' || c == '\t' || c == '\n') + continue; + for (p = arg; *p && *p != '\n' && *p != ' ' && *p != '\t'; p++); + ep = p; + if (*p) + *p++ = 0; + if (c == '-') { + while ((c = *arg++)) { + if (c == 'P') { + if (*(uint8_t *)PTOV(0x481) & 0x48) { + cp = "yes"; + } else { + opts |= OPT_SET(RBX_DUAL) | + OPT_SET(RBX_SERIAL); + cp = "no"; + } + printf("Keyboard: %s\n", cp); + continue; #if SERIAL - } else if (c == 'S') { - j = 0; - while ((unsigned int)(i = *arg++ - '0') <= 9) - j = j * 10 + i; - if (j > 0 && i == -'0') { - comspeed = j; - break; - } - /* Fall through to error below ('S' not in optstr[]). */ + } else if (c == 'S') { + j = 0; + while ((unsigned int)(i = *arg++ - '0') <= 9) + j = j * 10 + i; + if (j > 0 && i == -'0') { + comspeed = j; + break; + } + /* + * Fall through to error below + * ('S' not in optstr[]). + */ #endif - } - for (i = 0; c != optstr[i]; i++) - if (i == NOPT - 1) - return -1; - opts ^= OPT_SET(flags[i]); - } + } + for (i = 0; c != optstr[i]; i++) + if (i == NOPT - 1) + return (-1); + opts ^= OPT_SET(flags[i]); + } #if SERIAL - ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : - OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (DO_SIO) { - if (sio_init(115200 / comspeed) != 0) - ioctrl &= ~IO_SERIAL; - } + ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : + OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; + if (DO_SIO) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } #endif - } else { - for (q = arg--; *q && *q != '('; q++); - if (*q) { - drv = -1; - if (arg[1] == ':') { - drv = *arg - '0'; - if (drv > 9) - return (-1); - arg += 2; + } else { + for (q = arg--; *q && *q != '('; q++); + if (*q) { + drv = -1; + if (arg[1] == ':') { + drv = *arg - '0'; + if (drv > 9) + return (-1); + arg += 2; + } + if (q - arg != 2) + return (-1); + for (i = 0; arg[0] != dev_nm[i][0] || + arg[1] != dev_nm[i][1]; i++) + if (i == NDEV - 1) + return (-1); + dsk.type = i; + arg += 3; + dsk.unit = *arg - '0'; + if (arg[1] != ',' || dsk.unit > 9) + return (-1); + arg += 2; + dsk.slice = WHOLE_DISK_SLICE; + if (arg[1] == ',') { + dsk.slice = *arg - '0' + 1; + if (dsk.slice > PC98_NPARTS + 1) + return (-1); + arg += 2; + } + if (arg[1] != ')') + return (-1); + dsk.part = *arg - 'a'; + if (dsk.part > 7) + return (-1); + arg += 2; + if (drv == -1) + drv = dsk.unit; + dsk.disk = dev_daua[dsk.type]; + dsk.daua = dsk.disk | dsk.unit; + dsk_meta = 0; + } + k = ep - arg; + if (k > 0) { + if (k >= sizeof(knamebuf)) + return (-1); + memcpy(knamebuf, arg, k + 1); + kname = knamebuf; + } } - if (q - arg != 2) - return -1; - for (i = 0; arg[0] != dev_nm[i][0] || - arg[1] != dev_nm[i][1]; i++) - if (i == NDEV - 1) - return -1; - dsk.type = i; - arg += 3; - dsk.unit = *arg - '0'; - if (arg[1] != ',' || dsk.unit > 9) - return -1; - arg += 2; - dsk.slice = WHOLE_DISK_SLICE; - if (arg[1] == ',') { - dsk.slice = *arg - '0' + 1; - if (dsk.slice > PC98_NPARTS + 1) - return -1; - arg += 2; - } - if (arg[1] != ')') - return -1; - dsk.part = *arg - 'a'; - if (dsk.part > 7) - return (-1); - arg += 2; - if (drv == -1) - drv = dsk.unit; - dsk.disk = dev_daua[dsk.type]; - dsk.daua = dsk.disk | dsk.unit; - dsk_meta = 0; - } - k = ep - arg; - if (k > 0) { - if (k >= sizeof(knamebuf)) - return -1; - memcpy(knamebuf, arg, k + 1); - kname = knamebuf; - } + arg = p; } - arg = p; - } - return 0; + return (0); } static int dskread(void *buf, unsigned lba, unsigned nblk) { - struct pc98_partition *dp; - struct disklabel *d; - char *sec; - unsigned i; - uint8_t sl; - u_char *p; - const char *reason; + struct pc98_partition *dp; + struct disklabel *d; + char *sec; + unsigned i; + uint8_t sl; + u_char *p; + const char *reason; - if (!dsk_meta) { - sec = dmadat->secbuf; - set_dsk(); - if (dsk.type == TYPE_FD) - goto unsliced; - if (drvread(sec, PC98_BBSECTOR)) - return -1; - dp = (void *)(sec + PC98_PARTOFF); - sl = dsk.slice; - if (sl < BASE_SLICE) { - for (i = 0; i < PC98_NPARTS; i++) - if (dp[i].dp_mid == DOSMID_386BSD) { - sl = BASE_SLICE + i; - break; + if (!dsk_meta) { + sec = dmadat->secbuf; + set_dsk(); + if (dsk.type == TYPE_FD) + goto unsliced; + if (drvread(sec, PC98_BBSECTOR)) + return -1; + dp = (void *)(sec + PC98_PARTOFF); + sl = dsk.slice; + if (sl < BASE_SLICE) { + for (i = 0; i < PC98_NPARTS; i++) + if (dp[i].dp_mid == DOSMID_386BSD) { + sl = BASE_SLICE + i; + break; + } + dsk.slice = sl; } - dsk.slice = sl; + if (sl != WHOLE_DISK_SLICE) { + dp += sl - BASE_SLICE; + if (dp->dp_mid != DOSMID_386BSD) { + reason = "slice"; + goto error; + } + dsk.start = dp->dp_scyl * dsk.head * dsk.sec + + dp->dp_shd * dsk.sec + dp->dp_ssect; + } + if (drvread(sec, dsk.start + LABELSECTOR)) + return -1; + d = (void *)(sec + LABELOFFSET); + if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { + if (dsk.part != RAW_PART) { + reason = "label"; + goto error; + } + } else { + if (dsk.part >= d->d_npartitions || + !d->d_partitions[dsk.part].p_size) { + reason = "partition"; + goto error; + } + dsk.start += d->d_partitions[dsk.part].p_offset; + dsk.start -= d->d_partitions[RAW_PART].p_offset; + } + unsliced: ; } - if (sl != WHOLE_DISK_SLICE) { - dp += sl - BASE_SLICE; - if (dp->dp_mid != DOSMID_386BSD) { - reason = "slice"; - goto error; - } - dsk.start = dp->dp_scyl * dsk.head * dsk.sec + - dp->dp_shd * dsk.sec + dp->dp_ssect; + for (p = buf; nblk; p += 512, lba++, nblk--) { + if ((i = drvread(p, dsk.start + lba))) + return (i); } - if (drvread(sec, dsk.start + LABELSECTOR)) - return -1; - d = (void *)(sec + LABELOFFSET); - if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { - if (dsk.part != RAW_PART) { - reason = "label"; - goto error; - } - } else { - if (dsk.part >= d->d_npartitions || - !d->d_partitions[dsk.part].p_size) { - reason = "partition"; - goto error; - } - dsk.start += d->d_partitions[dsk.part].p_offset; - dsk.start -= d->d_partitions[RAW_PART].p_offset; - } - unsliced: ; - } - for (p = buf; nblk; p += 512, lba++, nblk--) { - if ((i = drvread(p, dsk.start + lba))) - return i; - } - return 0; + return (0); error: - printf("Invalid %s\n", reason); - return -1; + printf("Invalid %s\n", reason); + return (-1); } static void printf(const char *fmt,...) { - va_list ap; - static char buf[10]; - char *s; - unsigned u; - int c; + va_list ap; + static char buf[10]; + char *s; + unsigned u; + int c; - va_start(ap, fmt); - while ((c = *fmt++)) { - if (c == '%') { - c = *fmt++; - switch (c) { - case 'c': - putchar(va_arg(ap, int)); - continue; - case 's': - for (s = va_arg(ap, char *); *s; s++) - putchar(*s); - continue; - case 'u': - u = va_arg(ap, unsigned); - s = buf; - do - *s++ = '0' + u % 10U; - while (u /= 10U); - while (--s >= buf) - putchar(*s); - continue; - } + va_start(ap, fmt); + while ((c = *fmt++)) { + if (c == '%') { + c = *fmt++; + switch (c) { + case 'c': + putchar(va_arg(ap, int)); + continue; + case 's': + for (s = va_arg(ap, char *); *s; s++) + putchar(*s); + continue; + case 'u': + u = va_arg(ap, unsigned); + s = buf; + do + *s++ = '0' + u % 10U; + while (u /= 10U); + while (--s >= buf) + putchar(*s); + continue; + } + } + putchar(c); } - putchar(c); - } - va_end(ap); - return; + va_end(ap); + return; } static void putchar(int c) { - if (c == '\n') - xputc('\r'); - xputc(c); + + if (c == '\n') + xputc('\r'); + xputc(c); } static int drvread(void *buf, unsigned lba) { - static unsigned c = 0x2d5c7c2f; - unsigned bpc, x, cyl, head, sec; + static unsigned c = 0x2d5c7c2f; + unsigned bpc, x, cyl, head, sec; - bpc = dsk.sec * dsk.head; - cyl = lba / bpc; - x = lba % bpc; - head = x / dsk.sec; - sec = x % dsk.sec; - - if (!OPT_CHECK(RBX_QUIET)) { - xputc(c = c << 8 | c >> 24); - xputc('\b'); - } - v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.addr = READORG; /* call to read in boot1 */ - v86.ecx = cyl; - v86.edx = (head << 8) | sec; - v86.edi = lba; - v86.ebx = 512; - v86.es = VTOPSEG(buf); - v86.ebp = VTOPOFF(buf); - v86int(); - v86.ctl = V86_FLAGS; - if (V86_CY(v86.efl)) { - printf("error %u c/h/s %u/%u/%u lba %u\n", v86.eax >> 8 & 0xff, - cyl, head, sec, lba); - return -1; - } - return 0; + bpc = dsk.sec * dsk.head; + cyl = lba / bpc; + x = lba % bpc; + head = x / dsk.sec; + sec = x % dsk.sec; + + if (!OPT_CHECK(RBX_QUIET)) { + xputc(c = c << 8 | c >> 24); + xputc('\b'); + } + v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; + v86.addr = READORG; /* call to read in boot1 */ + v86.ecx = cyl; + v86.edx = (head << 8) | sec; + v86.edi = lba; + v86.ebx = 512; + v86.es = VTOPSEG(buf); + v86.ebp = VTOPOFF(buf); + v86int(); + v86.ctl = V86_FLAGS; + if (V86_CY(v86.efl)) { + printf("error %u c/h/s %u/%u/%u lba %u\n", v86.eax >> 8 & 0xff, + cyl, head, sec, lba); + return (-1); + } + return (0); } static inline void delay(void) { - int i; + int i; - i = 800; - do { - outb(0x5f, 0); /* about 600ns */ - } while (--i >= 0); + i = 800; + do { + outb(0x5f, 0); /* about 600ns */ + } while (--i >= 0); } static int keyhit(unsigned sec) { - unsigned i; + unsigned i; - if (OPT_CHECK(RBX_NOINTR)) - return 0; - for (i = 0; i < sec * 1000; i++) { - if (xgetc(1)) - return 1; - delay(); - } - return 0; + if (OPT_CHECK(RBX_NOINTR)) + return (0); + for (i = 0; i < sec * 1000; i++) { + if (xgetc(1)) + return (1); + delay(); + } + return (0); } static int xputc(int c) { - if (DO_KBD) - putc(c); - if (DO_SIO) - sio_putc(c); - return c; + + if (DO_KBD) + putc(c); + if (DO_SIO) + sio_putc(c); + return (c); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 27 03:52:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1079FBFB7A; Fri, 27 Apr 2018 03:52:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77D2B815F5; Fri, 27 Apr 2018 03:52:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 307E022513; Fri, 27 Apr 2018 03:52:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f43.google.com with SMTP id y14-v6so309215lfy.12; Thu, 26 Apr 2018 20:52:51 -0700 (PDT) X-Gm-Message-State: ALQs6tBfv8qp9WMjktGy8R/FwRECnCethyL3vWMCS+7r5KB6s8OxkY9w 05j5baIVkdYmSfUtfkKaLfF3LFGRCPFhyszIf8I= X-Google-Smtp-Source: AB8JxZogld8MYnAPexBE6UnKGHKZMZtl0otKOSU1t1V9s/60ZxsCaPvM1J/VCQbhZhTZnVswFs4s0pJ/pZX5r/2wEPA= X-Received: by 2002:a19:2902:: with SMTP id p2-v6mr288188lfp.99.1524801169498; Thu, 26 Apr 2018 20:52:49 -0700 (PDT) MIME-Version: 1.0 References: <201804270239.w3R2daCL074134@repo.freebsd.org> In-Reply-To: <201804270239.w3R2daCL074134@repo.freebsd.org> Reply-To: BYOND.Lenox@gmail.com From: Kyle Evans Date: Fri, 27 Apr 2018 03:52:38 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333049 - in stable/11/stand/pc98: boot2 libpc98 To: Takahashi Yoshihiro Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 03:52:52 -0000 On Thu, Apr 26, 2018 at 9:39 PM, Takahashi Yoshihiro wrote: > Author: nyan > Date: Fri Apr 27 02:39:36 2018 > New Revision: 333049 > URL: https://svnweb.freebsd.org/changeset/base/333049 > > Log: > whitespace changes to reduce diffs from i386. > still broken pc98 boot. Hi Takahashi, Sorry about this. =( I tried to at least get it back into a buildable state, but I don't have the hardware to test it unfortunately. I realize now that I should have coordinated with you before-hand to step pc98 through the stand/ mess gracefully. What kind of breakage does it exhibit? Thanks, Kyle Evans > > Modified: > stable/11/stand/pc98/boot2/boot2.c > stable/11/stand/pc98/libpc98/bioscd.c > stable/11/stand/pc98/libpc98/biosdisk.c > From owner-svn-src-all@freebsd.org Fri Apr 27 04:11:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 388D9FBFF85 for ; Fri, 27 Apr 2018 04:11:30 +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 4B603845B2 for ; Fri, 27 Apr 2018 04:11:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id e12-v6so1011988iob.8 for ; Thu, 26 Apr 2018 21:11:29 -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=0/wdZ2OxVBfpezOdfMVxbMejs87+wISfX7hX39K0++M=; b=BKoi3rmE4g7dHZ2n3thTWq0fv+AxrBRw+PiSeACIA6+/DxLoRm8uK0u9Z1E6noM3RO M8v+7GeezDZV0y8zkRWrkdD9D6AR2RYHdO5AL/G83jwaKt1KFIWh3t4C4EiO1aoa/iG9 /c/B5xTyTee3AOVILGRyueuGfCQbisCyGuR3LF7GvweDeRgSBz6R7OalZJWP2D++NZWG nYHhcl6V3yE/OnfJPgXJKg0oIuBJ8NT200cWWxONsjJAmxgDkjLgjOQejQ8BWCbF0apw rV27j+jFOYBbOY8CgNJ8Y4bEwEhzjT/RozZU1B4FUmH9cTHBolYGymqI2LgNeGCIJLHY +FdQ== 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=0/wdZ2OxVBfpezOdfMVxbMejs87+wISfX7hX39K0++M=; b=I07ju71ovltq2Av/hPX9KU/BNtf6UYWVUUixUkA2jCbCTdAPMOHpfO7tYIK/CHay2S w8k06D+Q1aiEgP/7ohLzRTOO1hBcr4OvvCzEOYq550yLVlO81E/gdu0+E93hRV9/+4NI ryewWNouHB2PUuTVtGcTnBB9DTdiNbFNdFklEJkNvKUYjsx9FDRRXDT+wJrr/J0sZT4O 6DOVK3vGRf2MtqTJC0o8sjNOFVTZ4beFT/x4Z6D7qg2+Ns2tuviRxATPEHME4BGiz1L4 /cSQkhKJzUJq1nqxhK4QTtkPuZM3aCMgo6XLTS+7zyd7+hiRsI2qX8UuHJ1B87YKD0eF uq1w== X-Gm-Message-State: ALQs6tA5MISwSkv6rb/HagaMqCUQL5ltJFKrf/XnskVmbNdMZZzLYWsb U90MD9/Z+ud1LApHr7az66v3H3aSW5yqgxtjtT68gQ== X-Google-Smtp-Source: AB8JxZpAD4h5XYqTZI0fhU4gF3KeapWtUMvIS6Jyh+IGTN2VqVSJ4Xsz4aavQnU76vgCeT8n77fpojj6acU24PPnpTw= X-Received: by 2002:a6b:be01:: with SMTP id o1-v6mr601945iof.299.1524802288492; Thu, 26 Apr 2018 21:11:28 -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 21:11:27 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201804270239.w3R2daCL074134@repo.freebsd.org> From: Warner Losh Date: Thu, 26 Apr 2018 22:11:27 -0600 X-Google-Sender-Auth: 5QKUW7GLlkUtyupuoo4zvwSZRIc Message-ID: Subject: Re: svn commit: r333049 - in stable/11/stand/pc98: boot2 libpc98 To: Kyle Evans Cc: Takahashi Yoshihiro , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 04:11:30 -0000 On Thu, Apr 26, 2018 at 9:52 PM, Kyle Evans wrote: > On Thu, Apr 26, 2018 at 9:39 PM, Takahashi Yoshihiro > wrote: > > Author: nyan > > Date: Fri Apr 27 02:39:36 2018 > > New Revision: 333049 > > URL: https://svnweb.freebsd.org/changeset/base/333049 > > > > Log: > > whitespace changes to reduce diffs from i386. > > still broken pc98 boot. > > Hi Takahashi, > > Sorry about this. =( I tried to at least get it back into a buildable > state, but I don't have the hardware to test it unfortunately. I realize > now that I should have coordinated with you before-hand to step pc98 > through the stand/ mess gracefully. > > What kind of breakage does it exhibit? > I still haven't gotten rid of my pc98 gear, though FreeBSD 8 or 9 is the last version I updated to. Warner > Thanks, > > Kyle Evans > > > > > Modified: > > stable/11/stand/pc98/boot2/boot2.c > > stable/11/stand/pc98/libpc98/bioscd.c > > stable/11/stand/pc98/libpc98/biosdisk.c > > > > From owner-svn-src-all@freebsd.org Fri Apr 27 04:49:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 05:19:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00441FC0EA7; Fri, 27 Apr 2018 05:19:30 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "sakura.ccs.furiru.org", Issuer "sakura.ccs.furiru.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D22E719E0; Fri, 27 Apr 2018 05:19:29 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Authentication-Results: ccs.furiru.org; spf=softfail smtp.mailfrom=nyan@FreeBSD.org; sender-id=softfail header.From=nyan@FreeBSD.org; dkim=none; dkim-adsp=none header.From=nyan@FreeBSD.org Received: from localhost (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060:0:0:0:1]) by sakura.ccs.furiru.org (unknown) with ESMTP id w3R5JOlj083100; Fri, 27 Apr 2018 14:19:25 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Fri, 27 Apr 2018 14:19:18 +0900 (JST) Message-Id: <20180427.141918.1816180817680740069.nyan@FreeBSD.org> To: BYOND.Lenox@gmail.com Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r333049 - in stable/11/stand/pc98: boot2 libpc98 From: TAKAHASHI Yoshihiro In-Reply-To: References: <201804270239.w3R2daCL074134@repo.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 05:19:30 -0000 In article Kyle Evans writes: > On Thu, Apr 26, 2018 at 9:39 PM, Takahashi Yoshihiro > wrote: >> Author: nyan >> Date: Fri Apr 27 02:39:36 2018 >> New Revision: 333049 >> URL: https://svnweb.freebsd.org/changeset/base/333049 >> >> Log: >> whitespace changes to reduce diffs from i386. >> still broken pc98 boot. > > Hi Takahashi, > > Sorry about this. =( I tried to at least get it back into a buildable > state, but I don't have the hardware to test it unfortunately. I realize > now that I should have coordinated with you before-hand to step pc98 > through the stand/ mess gracefully. > > What kind of breakage does it exhibit? No problem. I also don't test stable/11 on pc98 for a long time. Please run build-test for pc98 if possible. I got the following error. cc -O2 -pipe -nostdinc -I/usr/obj/pc98.i386/home/nyan/FreeBSD/11/stand/libsa -I/home/nyan/FreeBSD/11/stand/libsa -D_STANDALONE -I/home/nyan/FreeBSD/11/sys -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface -DLOADER_DISK_SUPPORT -ffreestanding -mno-mmx -mno-sse -mno-avx -msoft-float -march=i386 -I. -DCOMPORT=0x238 -DCOMSPEED=9600 -DTERM_EMU -Dalloca=__builtin_alloca -I/home/nyan/FreeBSD/11/stand/ficl -I/home/nyan/FreeBSD/11/stand/ficl/i386 -I/home/nyan/FreeBSD/11/stand/common -I/home/nyan/FreeBSD/11/stand/common -I/home/nyan/FreeBSD/11/stand/pc98/btx/lib -I/home/nyan/FreeBSD/11/stand/i386/libi386 -I/home/nyan/FreeBSD/11/sys -D__printf__=__freebsd_kprintf__ -MD -MF.depend.biosdisk.o -MTbiosdisk.o -std=gnu99 -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments -c /home/nyan/FreeBSD/11/stand/pc98/libpc98/biosdisk.c -o biosdisk.o /home/nyan/FreeBSD/11/stand/pc98/libpc98/biosdisk.c:467:62: error: no member named 'data' in 'struct i386_devdesc::(anonymous at /home/nyan/FreeBSD/11/stand/i386/libi386/libi386.h:39:2)' ((struct i386_devdesc *)(f->f_devdata))->d_kind.biosdisk.data = od; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ /home/nyan/FreeBSD/11/stand/pc98/libpc98/biosdisk.c:734:70: error: no member named 'data' in 'struct i386_devdesc::(anonymous at /home/nyan/FreeBSD/11/stand/i386/libi386/libi386.h:39:2)' struct open_disk *od = (struct open_disk *)(dev->d_kind.biosdisk.data); ~~~~~~~~~~~~~~~~~~~~ ^ /home/nyan/FreeBSD/11/stand/pc98/libpc98/biosdisk.c:764:70: error: no member named 'data' in 'struct i386_devdesc::(anonymous at /home/nyan/FreeBSD/11/stand/i386/libi386/libi386.h:39:2)' struct open_disk *od = (struct open_disk *)(dev->d_kind.biosdisk.data); ~~~~~~~~~~~~~~~~~~~~ ^ /home/nyan/FreeBSD/11/stand/pc98/libpc98/biosdisk.c:776:99: error: no member named 'data' in 'struct i386_devdesc::(anonymous at /home/nyan/FreeBSD/11/stand/i386/libi386/libi386.h:39:2)' ...open_disk *)(((struct i386_devdesc *)devdata)->d_kind.biosdisk.data); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ 4 errors generated. *** Error code 1 Stop. make[5]: stopped in /home/nyan/FreeBSD/11/stand/pc98/libpc98 *** Error code 1 Stop. make[4]: stopped in /home/nyan/FreeBSD/11/stand/pc98 *** Error code 1 Stop. make[3]: stopped in /home/nyan/FreeBSD/11/stand *** Error code 1 Stop. make[2]: stopped in /home/nyan/FreeBSD/11 *** Error code 1 Stop. make[1]: stopped in /home/nyan/FreeBSD/11 *** Error code 1 Stop. make: stopped in /home/nyan/FreeBSD/11 --- Takahashi Yoshihiro From owner-svn-src-all@freebsd.org Fri Apr 27 05:32:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 05:36:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 05:37:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 08:56:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4925DFC5005; Fri, 27 Apr 2018 08:56:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E75CE7D827; Fri, 27 Apr 2018 08:56: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 DCBDB24532; Fri, 27 Apr 2018 08:56: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 w3R8uHFt064706; Fri, 27 Apr 2018 08:56:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3R8uH8j064704; Fri, 27 Apr 2018 08:56:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201804270856.w3R8uH8j064704@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 08:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333053 - in stable/11/sys: i386/include x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: i386/include x86/x86 X-SVN-Commit-Revision: 333053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 08:56:18 -0000 Author: kib Date: Fri Apr 27 08:56:17 2018 New Revision: 333053 URL: https://svnweb.freebsd.org/changeset/base/333053 Log: MFC r332970: Use IS_BSP() macro. MFC r332989 (by lwhsu): Add i386 IS_BSP(). Modified: stable/11/sys/i386/include/pcpu.h stable/11/sys/x86/x86/mca.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/include/pcpu.h ============================================================================== --- stable/11/sys/i386/include/pcpu.h Fri Apr 27 05:37:35 2018 (r333052) +++ stable/11/sys/i386/include/pcpu.h Fri Apr 27 08:56:17 2018 (r333053) @@ -242,6 +242,8 @@ __curpcb(void) } #define curpcb (__curpcb()) +#define IS_BSP() (PCPU_GET(cpuid) == 0) + #else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ #error "this file needs to be ported to your compiler" Modified: stable/11/sys/x86/x86/mca.c ============================================================================== --- stable/11/sys/x86/x86/mca.c Fri Apr 27 05:37:35 2018 (r333052) +++ stable/11/sys/x86/x86/mca.c Fri Apr 27 08:56:17 2018 (r333053) @@ -1040,7 +1040,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-all@freebsd.org Fri Apr 27 09:23:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 09:25:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 11:00:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49AF6FA4E48; Fri, 27 Apr 2018 11:00:13 +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 ED00277681; Fri, 27 Apr 2018 11:00:12 +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 E3DC725843; Fri, 27 Apr 2018 11:00:12 +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 w3RB0CSL025418; Fri, 27 Apr 2018 11:00:12 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RB0Cdk025417; Fri, 27 Apr 2018 11:00:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804271100.w3RB0Cdk025417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 27 Apr 2018 11:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333056 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 333056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 11:00:13 -0000 Author: ae Date: Fri Apr 27 11:00:12 2018 New Revision: 333056 URL: https://svnweb.freebsd.org/changeset/base/333056 Log: MFC r332812: Add dead_bpf_if structure, that should be used as fake bpf_if during ifnet detach. Since destroying interface is not atomic operation and due to the lack of synhronization during destroy, it is possible, that in the time between bpfdetach() and if_free() some queued on destroying interface mbuf will be used by ether_input_internal() and bpf_peers_present() can dereference NULL bpf_if pointer. To protect from this, assign pointer to empty bpf_if_ext structure instead of NULL pointer after bpfdetach(). MFC r332949 (by markj): 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. Modified: stable/11/sys/net/bpf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/bpf.c ============================================================================== --- stable/11/sys/net/bpf.c Fri Apr 27 09:25:27 2018 (r333055) +++ stable/11/sys/net/bpf.c Fri Apr 27 11:00:12 2018 (r333056) @@ -96,6 +96,10 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_BPF, "BPF", "BPF data"); +static struct bpf_if_ext dead_bpf_if = { + .bif_dlist = LIST_HEAD_INITIALIZER() +}; + struct bpf_if { #define bif_next bif_ext.bif_next #define bif_dlist bif_ext.bif_dlist @@ -2638,7 +2642,7 @@ bpfdetach(struct ifnet *ifp) */ BPFIF_WLOCK(bp); bp->bif_flags |= BPFIF_FLAG_DYING; - *bp->bif_bpf = NULL; + *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", @@ -2957,13 +2961,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) @@ -2991,7 +2995,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-all@freebsd.org Fri Apr 27 12:02:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 135F2FA6662; Fri, 27 Apr 2018 12:02:14 +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 B16F581876; Fri, 27 Apr 2018 12:02:13 +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 ABAD326319; Fri, 27 Apr 2018 12:02:13 +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 w3RC2DFl060391; Fri, 27 Apr 2018 12:02:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RC2BFc060365; Fri, 27 Apr 2018 12:02:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804271202.w3RC2BFc060365@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 12:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333057 - in vendor/elftoolchain/dist: . ar as common documentation/libelf-by-example elfcopy elfdump ld libdwarf libelf libelftc libpe mk nm readelf strings test/ar/plugin test/elfcopy... X-SVN-Group: vendor X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in vendor/elftoolchain/dist: . ar as common documentation/libelf-by-example elfcopy elfdump ld libdwarf libelf libelftc libpe mk nm readelf strings test/ar/plugin test/elfcopy/plugin test/libdwarf/ts/... X-SVN-Commit-Revision: 333057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 12:02:14 -0000 Author: emaste Date: Fri Apr 27 12:02:11 2018 New Revision: 333057 URL: https://svnweb.freebsd.org/changeset/base/333057 Log: Import ELF Tool Chain snapshot at r3614 From http://svn.code.sf.net/p/elftoolchain/code/ Added: vendor/elftoolchain/dist/tools/build-automation/cli/ vendor/elftoolchain/dist/tools/build-automation/cli/yabs.1 (contents, props changed) vendor/elftoolchain/dist/tools/build-automation/executor/ vendor/elftoolchain/dist/tools/build-automation/executor/yabs-executor.1 (contents, props changed) Deleted: vendor/elftoolchain/dist/tools/build-automation/Makefile.documentation vendor/elftoolchain/dist/tools/build-automation/Makefile.manuals vendor/elftoolchain/dist/tools/build-automation/Makefile.program vendor/elftoolchain/dist/tools/build-automation/build-system.post.nw vendor/elftoolchain/dist/tools/build-automation/build-system.pre.nw vendor/elftoolchain/dist/tools/build-automation/implementation.nw vendor/elftoolchain/dist/tools/build-automation/introduction.nw vendor/elftoolchain/dist/tools/build-automation/master.nw vendor/elftoolchain/dist/tools/build-automation/slave.nw vendor/elftoolchain/dist/tools/build-automation/userguide.nw vendor/elftoolchain/dist/tools/build-automation/utilities.nw vendor/elftoolchain/dist/tools/build-automation/yabs-slave.1 vendor/elftoolchain/dist/tools/build-automation/yabs.1 Modified: vendor/elftoolchain/dist/INSTALL vendor/elftoolchain/dist/Makefile vendor/elftoolchain/dist/ar/Makefile vendor/elftoolchain/dist/as/as.c vendor/elftoolchain/dist/common/Makefile vendor/elftoolchain/dist/common/os.Linux.mk vendor/elftoolchain/dist/documentation/libelf-by-example/Makefile vendor/elftoolchain/dist/elfcopy/Makefile vendor/elftoolchain/dist/elfcopy/binary.c vendor/elftoolchain/dist/elfcopy/elfcopy.1 vendor/elftoolchain/dist/elfcopy/main.c vendor/elftoolchain/dist/elfdump/elfdump.c vendor/elftoolchain/dist/ld/Makefile vendor/elftoolchain/dist/ld/ld_script.awk vendor/elftoolchain/dist/libdwarf/Makefile vendor/elftoolchain/dist/libdwarf/libdwarf.h vendor/elftoolchain/dist/libdwarf/libdwarf_frame.c vendor/elftoolchain/dist/libdwarf/libdwarf_reloc.c vendor/elftoolchain/dist/libelf/Makefile vendor/elftoolchain/dist/libelf/_libelf_config.h vendor/elftoolchain/dist/libelf/gelf_phdr.c vendor/elftoolchain/dist/libelf/libelf_ehdr.c vendor/elftoolchain/dist/libelftc/Makefile vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.c vendor/elftoolchain/dist/libelftc/libelftc_dem_gnu3.c vendor/elftoolchain/dist/libpe/Makefile vendor/elftoolchain/dist/mk/elftoolchain.components.mk vendor/elftoolchain/dist/mk/elftoolchain.inc.mk vendor/elftoolchain/dist/mk/elftoolchain.lib.mk vendor/elftoolchain/dist/mk/elftoolchain.prog.mk vendor/elftoolchain/dist/mk/elftoolchain.subdir.mk vendor/elftoolchain/dist/mk/elftoolchain.tex.mk vendor/elftoolchain/dist/nm/nm.1 vendor/elftoolchain/dist/readelf/readelf.c vendor/elftoolchain/dist/strings/strings.c vendor/elftoolchain/dist/test/ar/plugin/Makefile.ardiff vendor/elftoolchain/dist/test/elfcopy/plugin/Makefile.ardiff vendor/elftoolchain/dist/test/libdwarf/ts/common/driver.c vendor/elftoolchain/dist/test/libelf/tset/bin/elf-hash vendor/elftoolchain/dist/test/libelf/tset/bin/elfc vendor/elftoolchain/dist/test/tet/Makefile vendor/elftoolchain/dist/tools/build-automation/Makefile vendor/elftoolchain/dist/tools/build-automation/README Modified: vendor/elftoolchain/dist/INSTALL ============================================================================== --- vendor/elftoolchain/dist/INSTALL Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/INSTALL Fri Apr 27 12:02:11 2018 (r333057) @@ -13,12 +13,12 @@ operating systems. ================= ======== ======================= Operating System Version Supported Architectures ----------------- -------- ----------------------- - `DragonFly BSD`_ 2.10.1 i386 - FreeBSD_ 10.2 amd64 & i386 + `DragonFly BSD`_ 5.2 amd64 + FreeBSD_ 11.1 amd64 & i386 Minix_ 3.0.2 i386 - NetBSD_ 7.0 i386 - OpenBSD_ v5.0 i386 - Ubuntu_ GNU/Linux 14.04LTS x86_64 + NetBSD_ 7.1.2 i386 + OpenBSD_ 6.3 amd64 + Ubuntu_ GNU/Linux 17.10 x86_64 ================= ======== ======================= .. _DragonFly BSD: http://www.dragonflybsd.org/ @@ -40,7 +40,7 @@ directories are present. Prerequisites ------------- -:DragonFly BSD 2.10.1: +:DragonFly BSD 5.2: - The core libraries and utilities should build out of the box on a stock install of DragonFly BSD. @@ -49,14 +49,14 @@ Prerequisites #. The current release of the `Test Execution Toolkit`_ needs to be downloaded and unpacked into the ``test/tet/`` directory. - #. The ``py26-yaml`` package needs to be installed:: + #. The ``py27-yaml`` package needs to be installed:: - % sudo pkgin install py26-yaml + % sudo pkg install py27-yaml - Building additional documentation is not currently supported under DragonFly BSD. -:FreeBSD 10.2: +:FreeBSD 11.1: - The core libraries and utilities should build out of the box on a stock install of FreeBSD. @@ -73,7 +73,7 @@ Prerequisites % sudo pkg install python py27-yaml - Building additional documentation is not currently supported under - FreeBSD 10.2. + FreeBSD 11.1. :Minix 3.2.0: - The following packages are pre-requisites for building the @@ -95,9 +95,9 @@ Prerequisites - Building additional documentation is not currently supported under Minix. -:OpenBSD 5.0: +:OpenBSD 6.3: - The following packages are pre-requisites for building the - sources on OpenBSD 5.0: + sources on OpenBSD 6.3: =================== ===================================== **Package** **Description** @@ -108,26 +108,6 @@ Prerequisites The following command line may be used to install the necessary pre-requisites:: - # pkg_add libarchive-2.8.4p0 - - - The test suites cannot currently be built under OpenBSD. - - - Building additional documentation is not currently supported - under OpenBSD. - -:OpenBSD 5.4: - - The following packages are pre-requisites for building the - sources on OpenBSD 5.4: - - =================== ===================================== - **Package** **Description** - =================== ===================================== - ``libarchive`` An archive access library. - =================== ===================================== - - The following command line may be used to install the necessary - pre-requisites:: - # pkg_add libarchive - The test suites cannot currently be built under OpenBSD. @@ -135,21 +115,10 @@ Prerequisites - Building additional documentation is not currently supported under OpenBSD. -:NetBSD 7.0: - - The following packages are pre-requisites for building the - sources on NetBSD 7.0: +:NetBSD 7.1.2: + - The core libraries and utilities should build out of the box on + a stock install of NetBSD 7.1.2. - =================== ===================================== - **Package** **Description** - =================== ===================================== - ``libarchive`` An archive access library. - =================== ===================================== - - The following command line may be used to install the necessary - pre-requisites:: - - # pkg_add libarchive - - To build and run the test suite: #. The current release of the `Test Execution Toolkit`_, needs @@ -159,14 +128,14 @@ Prerequisites #. The following additional package needs to be installed, as listed in the example command line below :: - % sudo pkg_add py27-yaml + % sudo pkgin install py27-yaml - Building additional documentation is not currently supported under NetBSD. -:Ubuntu GNU/Linux 10.04: +:Ubuntu GNU/Linux 17.10: - The following packages are pre-requisites for building the - sources on Ubuntu GNU/Linux 10.04: + sources on Ubuntu GNU/Linux 17.10: =================== ===================================== **Package** **Description** @@ -176,10 +145,11 @@ Prerequisites ``flex`` Lexical analyser. ``gcc`` C compiler. ``libarchive-dev`` Archive access library. + ``libbsd-dev`` BSD headers and libraries. ``libc6-dev`` Files for C language development. ``libexpat1-dev`` An XML processing library. ``m4`` Macro processor. - ``pmake`` A ``make`` that uses BSD-make syntax. + ``bmake`` NetBSD ``make``. ``python-yaml`` A YAML library for Python. ``sharutils`` For ``uudecode``. ``zlib1g-dev`` Compression library. @@ -189,7 +159,7 @@ Prerequisites pre-requisites:: % sudo apt-get install binutils bison flex gcc libarchive-dev \ - libc6-dev m4 pmake zlib1g-dev + libc6-dev m4 bmake zlib1g-dev - To build and run the test suite: @@ -202,50 +172,12 @@ Prerequisites % sudo apt-get install libexpat1-dev python-yaml sharutils - - To build additional documentation, the ``pgf`` package is - needed:: + - To build additional documentation, the packages listed in the + example command line below are needed:: - % sudo apt-get install pgf + % sudo apt-get install texlive-latex-recommended texlive-pictures \ + libbsd-dev -:Ubuntu GNU/Linux 14.04: - - The following packages are pre-requisites for building the - sources on Ubuntu GNU/Linux 14.04: - - =================== ===================================== - **Package** **Description** - =================== ===================================== - ``bison`` Parser generator. - ``build-essential`` Basic build tools. - ``flex`` Lexical analyser. - ``libarchive-dev`` Archive access library. - ``libexpat1-dev`` An XML processing library. - ``m4`` Macro processor. - ``bmake`` NetBSD ``make``. - ``python-yaml`` A YAML library for Python. - ``sharutils`` For ``uudecode``. - ``zlib1g-dev`` Compression library. - =================== ===================================== - - The following command line may be used to install the necessary - pre-requisites:: - - % sudo apt-get install bison build-essential flex libarchive-dev \ - m4 bmake zlib1g-dev - - - To build and run the test suite: - - #. The current release of the `Test Execution Toolkit`_, needs - to be downloaded and unpacked into the ``test/tet/`` - directory. - - #. The following additional packages need to be installed, as - listed in the example command line below:: - - % sudo apt-get install libexpat1-dev python-yaml sharutils - - - Builds of additional documentation are not currently supported - under Ubuntu GNU/Linux 14.04. - .. _Test Execution Toolkit: http://tetworks.opengroup.org/ .. _OpenGroup: http://www.opengroup.org/ @@ -259,9 +191,9 @@ On `DragonFly BSD`_, FreeBSD_, Minix_, NetBSD_ and Op % make -On Ubuntu GNU/Linux with the **pmake** package installed, use:: +On Ubuntu GNU/Linux with the **bmake** package installed, use:: - % pmake + % bmake Testing the software @@ -274,9 +206,9 @@ On `DragonFly BSD`_, FreeBSD_ and NetBSD_, use:: % make run-tests -On Ubuntu GNU/Linux with the **pmake** package installed, use:: +On Ubuntu GNU/Linux with the **bmake** package installed, use:: - % pmake run-tests + % bmake run-tests Installing the Software ======================= @@ -287,9 +219,9 @@ On `DragonFly BSD`_, FreeBSD_, Minix_, NetBSD_ and Ope % make install -On Ubuntu GNU/Linux with the **pmake** package installed, use:: +On Ubuntu GNU/Linux with the **bmake** package installed, use:: - % pmake install + % bmake install By default the ``install`` target will install utilities into @@ -299,7 +231,7 @@ By default the ``install`` target will install utiliti The installation directory may be changed using the ``DESTDIR`` variable. For example:: - % pmake DESTDIR=$HOME/local install + % bmake DESTDIR=$HOME/local install Additional Information @@ -310,7 +242,7 @@ website`_. .. _project website: http://elftoolchain.sourceforge.net/ -.. $Id: INSTALL 3353 2016-01-18 21:50:13Z jkoshy $ +.. $Id: INSTALL 3613 2018-04-21 19:34:37Z jkoshy $ .. Local Variables: .. mode: rst Modified: vendor/elftoolchain/dist/Makefile ============================================================================== --- vendor/elftoolchain/dist/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -1,4 +1,4 @@ -# $Id: Makefile 3382 2016-01-31 12:31:08Z jkoshy $ +# $Id: Makefile 3605 2018-04-13 18:15:09Z jkoshy $ TOP= . @@ -14,12 +14,12 @@ SUBDIR += libdwarf # Build additional APIs. SUBDIR += libelftc -.if defined(WITH_PE) && ${WITH_PE:tl} == "yes" +.if defined(WITH_PE) && ${WITH_PE} == "yes" SUBDIR += libpe .endif # The instruction set analyser. -.if defined(WITH_ISA) && ${WITH_ISA:tl} == "yes" +.if defined(WITH_ISA) && ${WITH_ISA} == "yes" SUBDIR += isa # ('isa' does not build on all platforms yet). .endif @@ -39,18 +39,19 @@ SUBDIR += strings SUBDIR += tools # Build the test suites. -.if exists(${.CURDIR}/test) && defined(WITH_TESTS) && ${WITH_TESTS:tl} == "yes" +.if exists(${.CURDIR}/test) && defined(WITH_TESTS) && ${WITH_TESTS} == "yes" SUBDIR += test .endif # Build additional build tooling. -.if defined(WITH_BUILD_TOOLS) && ${WITH_BUILD_TOOLS:tl} == "yes" +.if defined(WITH_BUILD_TOOLS) && ${WITH_BUILD_TOOLS} == "yes" SUBDIR += tools .endif # Build documentation at the end. -.if exists(${.CURDIR}/documentation) && defined(WITH_DOCUMENTATION) && \ - ${WITH_DOCUMENTATION:tl} == "yes" +.if exists(${.CURDIR}/documentation) && \ + defined(WITH_ADDITIONAL_DOCUMENTATION) && \ + ${WITH_ADDITIONAL_DOCUMENTATION} == "yes" SUBDIR += documentation .endif @@ -61,7 +62,7 @@ SUBDIR += documentation # # Run the test suites. -.if exists(${.CURDIR}/test) && defined(WITH_TESTS) && ${WITH_TESTS:tl} == "yes" +.if exists(${.CURDIR}/test) && defined(WITH_TESTS) && ${WITH_TESTS} == "yes" run-tests: all .PHONY (cd ${.CURDIR}/test; ${MAKE} test) .endif Modified: vendor/elftoolchain/dist/ar/Makefile ============================================================================== --- vendor/elftoolchain/dist/ar/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/ar/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/as/as.c ============================================================================== --- vendor/elftoolchain/dist/as/as.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/as/as.c Fri Apr 27 12:02:11 2018 (r333057) @@ -24,6 +24,7 @@ * SUCH DAMAGE. */ +#include #include #include #include @@ -34,7 +35,7 @@ #include -ELFTC_VCSID("$Id: as.c 2799 2012-12-22 09:03:29Z jkoshy $"); +ELFTC_VCSID("$Id: as.c 3581 2017-10-13 23:27:45Z emaste $"); enum as_long_option_index { AS_OPT_DEFSYM, @@ -204,7 +205,7 @@ main(int argc, char **argv) if (option_index >= 0) errx(1, "ERROR: option \"--%s\" is unimplemented.", - as_option_long_options[option_index]); + as_option_long_options[option_index].name); else errx(1, "ERROR: option '-%c' is unimplemented.", Modified: vendor/elftoolchain/dist/common/Makefile ============================================================================== --- vendor/elftoolchain/dist/common/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/common/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/common/os.Linux.mk ============================================================================== --- vendor/elftoolchain/dist/common/os.Linux.mk Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/common/os.Linux.mk Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/documentation/libelf-by-example/Makefile ============================================================================== --- vendor/elftoolchain/dist/documentation/libelf-by-example/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/documentation/libelf-by-example/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -1,7 +1,7 @@ # # Libelf by Example # -# $Id: Makefile 2441 2012-02-21 05:46:43Z jkoshy $ +# $Id: Makefile 3600 2018-04-12 06:45:40Z jkoshy $ TOP = ../.. @@ -10,19 +10,30 @@ DOC= libelf-by-example SRCS= libelf-by-example.tex prog1.txt prog2.txt prog3.txt \ prog4.txt prog5.txt prog6.txt +CLEANFILES+= ${SRCS:Mprog*:S/.txt/.c/} + .include "${TOP}/mk/elftoolchain.tex.mk" .if ${OS_HOST} == "Linux" +EXTRA_FLAGS= -I/usr/include/bsd -DLIBBSD_OVERLAY EXTRA_LIBS= -lbsd .endif check-example-syntax: .PHONY -.for f in ${SRCS:Mprog*} - @c=$$(basename ${f} .txt).c; sed -e 's/@[^@]*@//' \ - ${.CURDIR}/${f} > ${.OBJDIR}/$${c}; \ - echo -n $${c} ' '; cc -I${.CURDIR}/${TOP}/common \ - -I${.CURDIR}/${TOP}/libelf ${.OBJDIR}/$${c} \ - -L${.CURDIR}/${TOP}/libelf -lelf ${EXTRA_LIBS} && \ - rm ${.OBJDIR}/$${c} a.out +.for f in ${SRCS:Mprog*:S/.txt//} + @sed -e 's/@[^@]*@//' \ + ${.CURDIR}/${f}.txt > ${.OBJDIR}/${f}.c; \ + echo -n ${f} ' '; \ + libelf="${.OBJDIR}/${TOP}/libelf"; \ + if [ ! -d $${libelf} -a "${.CURDIR}" != "${.OBJDIR}" ]; then \ + suffix="${.OBJDIR:S,${.CURDIR}/,,}"; \ + libelf="${.CURDIR}/${TOP}/libelf/$${suffix}"; \ + fi; \ + cc -I${.CURDIR}/${TOP}/common \ + -I${.CURDIR}/${TOP}/libelf \ + ${EXTRA_FLAGS} \ + ${.OBJDIR}/${f}.c \ + -L"$${libelf}" -lelf ${EXTRA_LIBS} && \ + rm ${.OBJDIR}/a.out .endfor @echo Modified: vendor/elftoolchain/dist/elfcopy/Makefile ============================================================================== --- vendor/elftoolchain/dist/elfcopy/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/elfcopy/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/elfcopy/binary.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/binary.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/elfcopy/binary.c Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/elfcopy/elfcopy.1 ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.1 Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.1 Fri Apr 27 12:02:11 2018 (r333057) @@ -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 March 5, 2016 +.Dd August 30, 2017 .Os .Dt ELFCOPY 1 .Sh NAME @@ -83,6 +83,7 @@ .Op Fl -srec-forceS3 .Op Fl -srec-len Ns = Ns Ar val .Op Fl -strip-dwo +.Op Fl -strip-symbols= Ns Ar filename .Op Fl -strip-unneeded .Ar infile .Op Ar outfile @@ -339,6 +340,10 @@ This option is only meaningful when the output target .Dq srec . .It Fl -strip-dwo Do not copy .dwo debug sections to the output file. +.It Fl -strip-symbols= Ns Ar filename +Do not copy any of the symbols specified by +.Ar filename +to the output. .It Fl -strip-unneeded Do not copy symbols that are not needed for relocation processing. .El Modified: vendor/elftoolchain/dist/elfcopy/main.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/main.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/elfcopy/main.c Fri Apr 27 12:02:11 2018 (r333057) @@ -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 { @@ -679,6 +679,8 @@ create_file(struct elfcopy *ecp, const char *src, cons if ((ifd = open(elftemp, O_RDONLY)) == -1) err(EXIT_FAILURE, "open %s failed", src); close(efd); + if (unlink(elftemp) < 0) + err(EXIT_FAILURE, "unlink %s failed", elftemp); free(elftemp); } @@ -1283,8 +1285,9 @@ parse_symlist_file(struct elfcopy *ecp, const char *fn err(EXIT_FAILURE, "can not open %s", fn); if ((data = malloc(sb.st_size + 1)) == NULL) err(EXIT_FAILURE, "malloc failed"); - if (fread(data, 1, sb.st_size, fp) == 0 || ferror(fp)) - err(EXIT_FAILURE, "fread failed"); + if (sb.st_size > 0) + if (fread(data, sb.st_size, 1, fp) != 1) + err(EXIT_FAILURE, "fread failed"); fclose(fp); data[sb.st_size] = '\0'; @@ -1534,6 +1537,22 @@ print_version(void) exit(EXIT_SUCCESS); } +/* + * Compare the ending of s with end. + */ +static int +strrcmp(const char *s, const char *end) +{ + size_t endlen, slen; + + slen = strlen(s); + endlen = strlen(end); + + if (slen >= endlen) + s += slen - endlen; + return (strcmp(s, end)); +} + int main(int argc, char **argv) { @@ -1567,12 +1586,16 @@ main(int argc, char **argv) if ((ecp->progname = ELFTC_GETPROGNAME()) == NULL) ecp->progname = "elfcopy"; - if (strcmp(ecp->progname, "strip") == 0) + if (strrcmp(ecp->progname, "strip") == 0) strip_main(ecp, argc, argv); - else if (strcmp(ecp->progname, "mcs") == 0) + else if (strrcmp(ecp->progname, "mcs") == 0) mcs_main(ecp, argc, argv); - else + else { + if (strrcmp(ecp->progname, "elfcopy") != 0 && + strrcmp(ecp->progname, "objcopy") != 0) + warnx("program mode not known, defaulting to elfcopy"); elfcopy_main(ecp, argc, argv); + } free_sec_add(ecp); free_sec_act(ecp); Modified: vendor/elftoolchain/dist/elfdump/elfdump.c ============================================================================== --- vendor/elftoolchain/dist/elfdump/elfdump.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/elfdump/elfdump.c Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/ld/Makefile ============================================================================== --- vendor/elftoolchain/dist/ld/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/ld/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -1,4 +1,4 @@ -# $Id: Makefile 3407 2016-02-14 17:47:23Z jkoshy $ +# $Id: Makefile 3594 2018-04-11 18:26:50Z jkoshy $ TOP= .. @@ -47,6 +47,6 @@ YFLAGS= -d .SUFFIXES: .ld .c .ld.c: - awk -f ld_script.awk ${.ALLSRC} > ${.TARGET} + awk -f ${.CURDIR}/ld_script.awk ${.ALLSRC} > ${.TARGET} .include "${TOP}/mk/elftoolchain.prog.mk" Modified: vendor/elftoolchain/dist/ld/ld_script.awk ============================================================================== --- vendor/elftoolchain/dist/ld/ld_script.awk Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/ld/ld_script.awk Fri Apr 27 12:02:11 2018 (r333057) @@ -1,10 +1,19 @@ -# $Id: ld_script.awk 2493 2012-04-15 18:59:09Z kaiwang27 $ +# Transform text file contents into a string literal. +# +# Usage: awk -f THIS-SCRIPT INPUT > OUTPUT +# +# $Id: ld_script.awk 3593 2018-04-11 18:26:20Z jkoshy $ BEGIN { + # Generate a symbol name based on the last component + # of the input file name. split(ARGV[1], s, "."); + sub(".*/", "", s[1]); printf "const char *%s = ", s[1]; } +# Enclose each line of text with a preceding and trailing '"', +# escaping any '"' characters that are present. { printf "\""; gsub("\"", "\\\""); Modified: vendor/elftoolchain/dist/libdwarf/Makefile ============================================================================== --- vendor/elftoolchain/dist/libdwarf/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libdwarf/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/libdwarf/libdwarf.h ============================================================================== --- vendor/elftoolchain/dist/libdwarf/libdwarf.h Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libdwarf/libdwarf.h Fri Apr 27 12:02:11 2018 (r333057) @@ -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_ @@ -440,6 +440,7 @@ enum Dwarf_ISA { DW_ISA_X86, DW_ISA_X86_64, DW_ISA_AARCH64, + DW_ISA_RISCV, DW_ISA_MAX }; Modified: vendor/elftoolchain/dist/libdwarf/libdwarf_frame.c ============================================================================== --- vendor/elftoolchain/dist/libdwarf/libdwarf_frame.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libdwarf/libdwarf_frame.c Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/libdwarf/libdwarf_reloc.c ============================================================================== --- vendor/elftoolchain/dist/libdwarf/libdwarf_reloc.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libdwarf/libdwarf_reloc.c Fri Apr 27 12:02:11 2018 (r333057) @@ -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) @@ -49,6 +49,8 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) return (R_ARM_ABS32); case DW_ISA_MIPS: return (is64 ? R_MIPS_64 : R_MIPS_32); + case DW_ISA_RISCV: + return (is64 ? R_RISCV_64 : R_RISCV_32); case DW_ISA_IA64: return (is64 ? R_IA_64_DIR64LSB : R_IA_64_DIR32LSB); default: @@ -99,6 +101,12 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, Dwarf_Unsigned if (rel_type == R_MIPS_32) return (4); else if (rel_type == R_MIPS_64) + return (8); + break; + case EM_RISCV: + if (rel_type == R_RISCV_32) + return (4); + else if (rel_type == R_RISCV_64) return (8); break; case EM_IA_64: Modified: vendor/elftoolchain/dist/libelf/Makefile ============================================================================== --- vendor/elftoolchain/dist/libelf/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libelf/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/libelf/_libelf_config.h ============================================================================== --- vendor/elftoolchain/dist/libelf/_libelf_config.h Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libelf/_libelf_config.h Fri Apr 27 12:02:11 2018 (r333057) @@ -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__) @@ -97,7 +97,7 @@ #define LIBELF_BYTEORDER ELFDATA2MSB #define LIBELF_CLASS ELFCLASS32 -#elif defined(__riscv64) +#elif defined(__riscv) && (__riscv_xlen == 64) #define LIBELF_ARCH EM_RISCV #define LIBELF_BYTEORDER ELFDATA2LSB Modified: vendor/elftoolchain/dist/libelf/gelf_phdr.c ============================================================================== --- vendor/elftoolchain/dist/libelf/gelf_phdr.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libelf/gelf_phdr.c Fri Apr 27 12:02:11 2018 (r333057) @@ -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) @@ -53,24 +53,26 @@ gelf_getphdr(Elf *e, int index, GElf_Phdr *d) Elf64_Ehdr *eh64; Elf32_Phdr *ep32; Elf64_Phdr *ep64; + size_t phnum; if (d == NULL || e == NULL || ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64) || - (e->e_kind != ELF_K_ELF) || index < 0) { + (e->e_kind != ELF_K_ELF) || index < 0 || + elf_getphdrnum(e, &phnum) < 0) { LIBELF_SET_ERROR(ARGUMENT, 0); return (NULL); } + if ((size_t)index >= phnum) { + LIBELF_SET_ERROR(ARGUMENT, 0); + return (NULL); + } + if (ec == ELFCLASS32) { if ((eh32 = _libelf_ehdr(e, ELFCLASS32, 0)) == NULL || ((ep32 = _libelf_getphdr(e, ELFCLASS32)) == NULL)) return (NULL); - if (index >= eh32->e_phnum) { - LIBELF_SET_ERROR(ARGUMENT, 0); - return (NULL); - } - ep32 += index; d->p_type = ep32->p_type; @@ -87,11 +89,6 @@ gelf_getphdr(Elf *e, int index, GElf_Phdr *d) (ep64 = _libelf_getphdr(e, ELFCLASS64)) == NULL) return (NULL); - if (index >= eh64->e_phnum) { - LIBELF_SET_ERROR(ARGUMENT, 0); - return (NULL); - } - ep64 += index; *d = *ep64; @@ -125,13 +122,15 @@ gelf_newphdr(Elf *e, size_t count) int gelf_update_phdr(Elf *e, int ndx, GElf_Phdr *s) { - int ec, phnum; + int ec; + size_t phnum; void *ehdr; Elf32_Phdr *ph32; Elf64_Phdr *ph64; if (s == NULL || e == NULL || e->e_kind != ELF_K_ELF || - ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64)) { + ((ec = e->e_class) != ELFCLASS32 && ec != ELFCLASS64) || + elf_getphdrnum(e, &phnum) < 0) { LIBELF_SET_ERROR(ARGUMENT, 0); return (0); } @@ -144,12 +143,7 @@ gelf_update_phdr(Elf *e, int ndx, GElf_Phdr *s) if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL) return (0); - if (ec == ELFCLASS32) - phnum = ((Elf32_Ehdr *) ehdr)->e_phnum; - else - phnum = ((Elf64_Ehdr *) ehdr)->e_phnum; - - if (ndx < 0 || ndx > phnum) { + if (ndx < 0 || (size_t)ndx > phnum) { LIBELF_SET_ERROR(ARGUMENT, 0); return (0); } Modified: vendor/elftoolchain/dist/libelf/libelf_ehdr.c ============================================================================== --- vendor/elftoolchain/dist/libelf/libelf_ehdr.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libelf/libelf_ehdr.c Fri Apr 27 12:02:11 2018 (r333057) @@ -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 @@ -170,10 +170,6 @@ _libelf_ehdr(Elf *e, int ec, int allocate) (*xlator)((unsigned char*) ehdr, msz, e->e_rawfile, (size_t) 1, e->e_byteorder != LIBELF_PRIVATE(byteorder)); - /* - * If extended numbering is being used, read the correct - * number of sections and program header entries. - */ if (ec == ELFCLASS32) { phnum = ((Elf32_Ehdr *) ehdr)->e_phnum; shnum = ((Elf32_Ehdr *) ehdr)->e_shnum; @@ -193,12 +189,19 @@ _libelf_ehdr(Elf *e, int ec, int allocate) return (NULL); } - if (shnum != 0 || shoff == 0LL) { /* not using extended numbering */ + /* + * If extended numbering is being used, read the correct + * number of sections and program header entries. + */ + if ((shnum == 0 && shoff != 0) || phnum == PN_XNUM || strndx == SHN_XINDEX) { + if (_libelf_load_extended(e, ec, shoff, phnum, strndx) == 0) + return (NULL); + } else { + /* not using extended numbering */ e->e_u.e_elf.e_nphdr = phnum; e->e_u.e_elf.e_nscn = shnum; e->e_u.e_elf.e_strndx = strndx; - } else if (_libelf_load_extended(e, ec, shoff, phnum, strndx) == 0) - return (NULL); + } return (ehdr); } Modified: vendor/elftoolchain/dist/libelftc/Makefile ============================================================================== --- vendor/elftoolchain/dist/libelftc/Makefile Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libelftc/Makefile Fri Apr 27 12:02:11 2018 (r333057) @@ -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: vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.c ============================================================================== --- vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.c Fri Apr 27 11:00:12 2018 (r333056) +++ vendor/elftoolchain/dist/libelftc/elftc_reloc_type_str.c Fri Apr 27 12:02:11 2018 (r333057) @@ -501,6 +501,120 @@ elftc_reloc_type_str(unsigned int mach, unsigned int t case 116: return "R_PPC_EMB_RELSDA"; } break; + case EM_PPC64: + switch(type) { + case 0: return "R_PPC64_NONE"; + case 1: return "R_PPC64_ADDR32"; + case 2: return "R_PPC64_ADDR24"; + case 3: return "R_PPC64_ADDR16"; + case 4: return "R_PPC64_ADDR16_LO"; + case 5: return "R_PPC64_ADDR16_HI"; + case 6: return "R_PPC64_ADDR16_HA"; + case 7: return "R_PPC64_ADDR14"; + case 8: return "R_PPC64_ADDR14_BRTAKEN"; + case 9: return "R_PPC64_ADDR14_BRNTAKEN"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 27 12:03:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AD0CFA67E0; Fri, 27 Apr 2018 12:03:28 +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 EB7B9824E8; Fri, 27 Apr 2018 12:03: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 CC25E2632F; Fri, 27 Apr 2018 12:03: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 w3RC3RVE060484; Fri, 27 Apr 2018 12:03:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RC3RZ8060483; Fri, 27 Apr 2018 12:03:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201804271203.w3RC3RZ8060483@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 12:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333058 - vendor/elftoolchain/elftoolchain-r3614 X-SVN-Group: vendor X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: vendor/elftoolchain/elftoolchain-r3614 X-SVN-Commit-Revision: 333058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 12:03:28 -0000 Author: emaste Date: Fri Apr 27 12:03:27 2018 New Revision: 333058 URL: https://svnweb.freebsd.org/changeset/base/333058 Log: Tag ELF Tool Chain r3614 Added: vendor/elftoolchain/elftoolchain-r3614/ - copied from r333057, vendor/elftoolchain/dist/ From owner-svn-src-all@freebsd.org Fri Apr 27 12:44:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 12:50:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18E69FA7449; Fri, 27 Apr 2018 12:50:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA6B76D260; Fri, 27 Apr 2018 12:50:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0B702697E; Fri, 27 Apr 2018 12:50:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RCoH5p080397; Fri, 27 Apr 2018 12:50:17 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RCoHKu080396; Fri, 27 Apr 2018 12:50:17 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201804271250.w3RCoHKu080396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 27 Apr 2018 12:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333060 - stable/11/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsserver X-SVN-Commit-Revision: 333060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 12:50:18 -0000 Author: rmacklem Date: Fri Apr 27 12:50:17 2018 New Revision: 333060 URL: https://svnweb.freebsd.org/changeset/base/333060 Log: MFC: r332790 Fix OpenDowngrade for NFSv4.1 if a client sets the OPEN_SHARE_ACCESS_WANT* bits. The NFSv4.1 RFC specifies that the OPEN_SHARE_ACCESS_WANT bits can be set in the OpenDowngrade share_access argument and are basically ignored. I do not know of a extant NFSv4.1 client that does this, but this little patch fixes it just in case. It also changes the error from NFSERR_BADXDR to NFSERR_INVAL since the NFSv4.1 RFC specifies this as the error to be returned if bogus bits are set. (The NFSv4.0 RFC didn't specify any error for this, so the error reply can be changed for NFSv4.0 as well.) Found by inspection while looking at a problem with OpenDowngrade reported for the ESXi 6.5 NFSv4.1 client. Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri Apr 27 12:44:20 2018 (r333059) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri Apr 27 12:50:17 2018 (r333060) @@ -3235,6 +3235,8 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unus tl += (NFSX_STATEIDOTHER / NFSX_UNSIGNED); stp->ls_seq = fxdr_unsigned(u_int32_t, *tl++); i = fxdr_unsigned(int, *tl++); + if ((nd->nd_flag & ND_NFSV41) != 0) + i &= ~NFSV4OPEN_WANTDELEGMASK; switch (i) { case NFSV4OPEN_ACCESSREAD: stp->ls_flags = (NFSLCK_READACCESS | NFSLCK_DOWNGRADE); @@ -3247,7 +3249,7 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unus NFSLCK_DOWNGRADE); break; default: - nd->nd_repstat = NFSERR_BADXDR; + nd->nd_repstat = NFSERR_INVAL; } i = fxdr_unsigned(int, *tl); switch (i) { @@ -3263,7 +3265,7 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unus stp->ls_flags |= (NFSLCK_READDENY | NFSLCK_WRITEDENY); break; default: - nd->nd_repstat = NFSERR_BADXDR; + nd->nd_repstat = NFSERR_INVAL; } clientid.lval[0] = stp->ls_stateid.other[0]; From owner-svn-src-all@freebsd.org Fri Apr 27 12:57:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E98DFA7773; Fri, 27 Apr 2018 12:57:40 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC6516E769; Fri, 27 Apr 2018 12:57:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D12F426B1A; Fri, 27 Apr 2018 12:57:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RCvdRP085595; Fri, 27 Apr 2018 12:57:39 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RCvd30085594; Fri, 27 Apr 2018 12:57:39 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201804271257.w3RCvd30085594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 27 Apr 2018 12:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333061 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/11/sys/fs/nfsclient X-SVN-Commit-Revision: 333061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 12:57:40 -0000 Author: rmacklem Date: Fri Apr 27 12:57:39 2018 New Revision: 333061 URL: https://svnweb.freebsd.org/changeset/base/333061 Log: MFC: r332813 Fix use of pointer after being set NULL. Using a pointer after setting it NULL is probably not a good plan. Spotted by inspection during changes for Flexible File Layout Ioerr handling. This code path obviously isn't normally executed. Modified: stable/11/sys/fs/nfsclient/nfs_clport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clport.c Fri Apr 27 12:50:17 2018 (r333060) +++ stable/11/sys/fs/nfsclient/nfs_clport.c Fri Apr 27 12:57:39 2018 (r333061) @@ -1391,8 +1391,8 @@ nfssvc_nfscl(struct thread *td, struct nfssvc_args *ua NFSMNTP_CANCELRPCS); mtx_unlock(&nmp->nm_mtx); } else { - nmp = NULL; mtx_unlock(&nmp->nm_mtx); + nmp = NULL; } break; } From owner-svn-src-all@freebsd.org Fri Apr 27 13:55:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 13:59:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 14:29:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 14:35:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 15:16:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 15:25:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 15:26:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 15:50:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 16:01:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 16:02:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 16:34:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 17:20:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 18:07:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F8BDFAEC76; Fri, 27 Apr 2018 18:07:32 +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 CF64B7618C; Fri, 27 Apr 2018 18:07:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C95CD1E79; Fri, 27 Apr 2018 18:07:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RI7V5v046293; Fri, 27 Apr 2018 18:07:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RI7Vd8046289; Fri, 27 Apr 2018 18:07:31 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804271807.w3RI7Vd8046289@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 18:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333069 - in stable/11: etc/mtree sys/kern sys/sys tests/sys tests/sys/capsicum X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/11: etc/mtree sys/kern sys/sys tests/sys tests/sys/capsicum X-SVN-Commit-Revision: 333069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 18:07:32 -0000 Author: jhb Date: Fri Apr 27 18:07:31 2018 New Revision: 333069 URL: https://svnweb.freebsd.org/changeset/base/333069 Log: MFC 332657: Properly do a deep copy of the ioctls capability array for fget_cap(). fget_cap() tries to do a cheaper snapshot of a file descriptor without holding the file descriptor lock. This snapshot does not do a deep copy of the ioctls capability array, but instead uses a different return value to inform the caller to retry the copy with the lock held. However, filecaps_copy() was returning 1 to indicate that a retry was required, and fget_cap() was checking for 0 (actually '!filecaps_copy()'). As a result, fget_cap() did not do a deep copy of the ioctls array and just reused the original pointer. This cause multiple file descriptor entries to think they owned the same pointer and eventually resulted in duplicate frees. The only code path that I'm aware of that triggers this is to create a listen socket that has a restricted list of ioctls and then call accept() which calls fget_cap() with a valid filecaps structure from getsock_cap(). To fix, change the return value of filecaps_copy() to return true if it succeeds in copying the caps and false if it fails because the lock is required. I find this more intuitive than fixing the caller in this case. While here, change the return type from 'int' to 'bool'. Finally, make filecaps_copy() more robust in the failure case by not copying any of the source filecaps structure over. This avoids the possibility of leaking a pointer into a structure if a similar future caller doesn't properly handle the return value from filecaps_copy() at the expense of one more branch. I also added a test case that panics before this change and now passes. Added: stable/11/tests/sys/capsicum/ - copied from r332657, head/tests/sys/capsicum/ Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/sys/kern/kern_descrip.c stable/11/sys/sys/filedesc.h stable/11/tests/sys/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Fri Apr 27 17:20:23 2018 (r333068) +++ stable/11/etc/mtree/BSD.tests.dist Fri Apr 27 18:07:31 2018 (r333069) @@ -420,6 +420,8 @@ .. aio .. + capsicum + .. fifo .. file Modified: stable/11/sys/kern/kern_descrip.c ============================================================================== --- stable/11/sys/kern/kern_descrip.c Fri Apr 27 17:20:23 2018 (r333068) +++ stable/11/sys/kern/kern_descrip.c Fri Apr 27 18:07:31 2018 (r333069) @@ -1446,16 +1446,16 @@ filecaps_init(struct filecaps *fcaps) * Note that if the table was not locked, the caller has to check the relevant * sequence counter to determine whether the operation was successful. */ -int +bool filecaps_copy(const struct filecaps *src, struct filecaps *dst, bool locked) { size_t size; + if (src->fc_ioctls != NULL && !locked) + return (false); *dst = *src; if (src->fc_ioctls == NULL) - return (0); - if (!locked) - return (1); + return (true); KASSERT(src->fc_nioctls > 0, ("fc_ioctls != NULL, but fc_nioctls=%hd", src->fc_nioctls)); @@ -1463,7 +1463,7 @@ filecaps_copy(const struct filecaps *src, struct filec size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls; dst->fc_ioctls = malloc(size, M_FILECAPS, M_WAITOK); bcopy(src->fc_ioctls, dst->fc_ioctls, size); - return (0); + return (true); } /* Modified: stable/11/sys/sys/filedesc.h ============================================================================== --- stable/11/sys/sys/filedesc.h Fri Apr 27 17:20:23 2018 (r333068) +++ stable/11/sys/sys/filedesc.h Fri Apr 27 18:07:31 2018 (r333069) @@ -153,7 +153,7 @@ enum { struct thread; void filecaps_init(struct filecaps *fcaps); -int filecaps_copy(const struct filecaps *src, struct filecaps *dst, +bool filecaps_copy(const struct filecaps *src, struct filecaps *dst, bool locked); void filecaps_move(struct filecaps *src, struct filecaps *dst); void filecaps_free(struct filecaps *fcaps); Modified: stable/11/tests/sys/Makefile ============================================================================== --- stable/11/tests/sys/Makefile Fri Apr 27 17:20:23 2018 (r333068) +++ stable/11/tests/sys/Makefile Fri Apr 27 18:07:31 2018 (r333069) @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys TESTS_SUBDIRS+= acl TESTS_SUBDIRS+= aio +TESTS_SUBDIRS+= capsicum TESTS_SUBDIRS+= fifo TESTS_SUBDIRS+= file TESTS_SUBDIRS+= fs From owner-svn-src-all@freebsd.org Fri Apr 27 19:21:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C28DFB0120; Fri, 27 Apr 2018 19:21:42 +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 A5BA487A1E; Fri, 27 Apr 2018 19:21:41 +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 A03E92B1F; Fri, 27 Apr 2018 19:21:41 +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 w3RJLft0083370; Fri, 27 Apr 2018 19:21:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RJLdp6083349; Fri, 27 Apr 2018 19:21:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201804271921.w3RJLdp6083349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 27 Apr 2018 19:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333070 - in stable/11: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/... X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: contrib/llvm/include/llvm/CodeGen contrib/llvm/lib/CodeGen contrib/llvm/lib/Target/X86 contrib/llvm/lib/Target/X86/Disassembler contrib/llvm/tools/clang/include/clang/Driver contrib/llvm... X-SVN-Commit-Revision: 333070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 19:21:42 -0000 Author: dim Date: Fri Apr 27 19:21:39 2018 New Revision: 333070 URL: https://svnweb.freebsd.org/changeset/base/333070 Log: MFC r332833: Recommit r332501, with an additional upstream fix for "Cannot lower EFLAGS copy that lives out of a basic block!" errors on i386. Pull in r325446 from upstream clang trunk (by me): [X86] Add 'sahf' CPU feature to frontend Summary: Make clang accept `-msahf` (and `-mno-sahf`) flags to activate the `+sahf` feature for the backend, for bug 36028 (Incorrect use of pushf/popf enables/disables interrupts on amd64 kernels). This was originally submitted in bug 36037 by Jonathan Looney . As described there, GCC also uses `-msahf` for this feature, and the backend already recognizes the `+sahf` feature. All that is needed is to teach clang to pass this on to the backend. The mapping of feature support onto CPUs may not be complete; rather, it was chosen to match LLVM's idea of which CPUs support this feature (see lib/Target/X86/X86.td). I also updated the affected test case (CodeGen/attr-target-x86.c) to match the emitted output. Reviewers: craig.topper, coby, efriedma, rsmith Reviewed By: craig.topper Subscribers: emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D43394 Pull in r328944 from upstream llvm trunk (by Chandler Carruth): [x86] Expose more of the condition conversion routines in the public API for X86's instruction information. I've now got a second patch under review that needs these same APIs. This bit is nicely orthogonal and obvious, so landing it. NFC. Pull in r329414 from upstream llvm trunk (by Craig Topper): [X86] Merge itineraries for CLC, CMC, and STC. These are very simple flag setting instructions that appear to only be a single uop. They're unlikely to need this separation. Pull in r329657 from upstream llvm trunk (by Chandler Carruth): [x86] Introduce a pass to begin more systematically fixing PR36028 and similar issues. The key idea is to lower COPY nodes populating EFLAGS by scanning the uses of EFLAGS and introducing dedicated code to preserve the necessary state in a GPR. In the vast majority of cases, these uses are cmovCC and jCC instructions. For such cases, we can very easily save and restore the necessary information by simply inserting a setCC into a GPR where the original flags are live, and then testing that GPR directly to feed the cmov or conditional branch. However, things are a bit more tricky if arithmetic is using the flags. This patch handles the vast majority of cases that seem to come up in practice: adc, adcx, adox, rcl, and rcr; all without taking advantage of partially preserved EFLAGS as LLVM doesn't currently model that at all. There are a large number of operations that techinaclly observe EFLAGS currently but shouldn't in this case -- they typically are using DF. Currently, they will not be handled by this approach. However, I have never seen this issue come up in practice. It is already pretty rare to have these patterns come up in practical code with LLVM. I had to resort to writing MIR tests to cover most of the logic in this pass already. I suspect even with its current amount of coverage of arithmetic users of EFLAGS it will be a significant improvement over the current use of pushf/popf. It will also produce substantially faster code in most of the common patterns. This patch also removes all of the old lowering for EFLAGS copies, and the hack that forced us to use a frame pointer when EFLAGS copies were found anywhere in a function so that the dynamic stack adjustment wasn't a problem. None of this is needed as we now lower all of these copies directly in MI and without require stack adjustments. Lots of thanks to Reid who came up with several aspects of this approach, and Craig who helped me work out a couple of things tripping me up while working on this. Differential Revision: https://reviews.llvm.org/D45146 Pull in r329673 from upstream llvm trunk (by Chandler Carruth): [x86] Model the direction flag (DF) separately from the rest of EFLAGS. This cleans up a number of operations that only claimed te use EFLAGS due to using DF. But no instructions which we think of us setting EFLAGS actually modify DF (other than things like popf) and so this needlessly creates uses of EFLAGS that aren't really there. In fact, DF is so restrictive it is pretty easy to model. Only STD, CLD, and the whole-flags writes (WRFLAGS and POPF) need to model this. I've also somewhat cleaned up some of the flag management instruction definitions to be in the correct .td file. Adding this extra register also uncovered a failure to use the correct datatype to hold X86 registers, and I've corrected that as necessary here. Differential Revision: https://reviews.llvm.org/D45154 Pull in r330264 from upstream llvm trunk (by Chandler Carruth): [x86] Fix PR37100 by teaching the EFLAGS copy lowering to rewrite uses across basic blocks in the limited cases where it is very straight forward to do so. This will also be useful for other places where we do some limited EFLAGS propagation across CFG edges and need to handle copy rewrites afterward. I think this is rapidly approaching the maximum we can and should be doing here. Everything else begins to require either heroic analysis to prove how to do PHI insertion manually, or somehow managing arbitrary PHI-ing of EFLAGS with general PHI insertion. Neither of these seem at all promising so if those cases come up, we'll almost certainly need to rewrite the parts of LLVM that produce those patterns. We do now require dominator trees in order to reliably diagnose patterns that would require PHI nodes. This is a bit unfortunate but it seems better than the completely mysterious crash we would get otherwise. Differential Revision: https://reviews.llvm.org/D45673 Together, these should ensure clang does not use pushf/popf sequences to save and restore flags, avoiding problems with unrelated flags (such as the interrupt flag) being restored unexpectedly. Requested by: jtl PR: 225330 MFC r332898: 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 Added: stable/11/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp - copied, changed from r332833, head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Modified: stable/11/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h stable/11/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp stable/11/contrib/llvm/lib/Target/X86/X86.h stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.h stable/11/contrib/llvm/lib/Target/X86/X86InstrCompiler.td stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.h stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.td stable/11/contrib/llvm/lib/Target/X86/X86InstrSystem.td stable/11/contrib/llvm/lib/Target/X86/X86RegisterInfo.td stable/11/contrib/llvm/lib/Target/X86/X86Schedule.td stable/11/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td stable/11/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp stable/11/contrib/llvm/tools/clang/include/clang/Driver/Options.td stable/11/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp stable/11/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h stable/11/lib/clang/freebsd_cc_version.h stable/11/lib/clang/libllvm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- stable/11/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Fri Apr 27 19:21:39 2018 (r333070) @@ -449,6 +449,13 @@ class MachineBasicBlock (public) /// Replace successor OLD with NEW and update probability info. void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New); + /// Copy a successor (and any probability info) from original block to this + /// block's. Uses an iterator into the original blocks successors. + /// + /// This is useful when doing a partial clone of successors. Afterward, the + /// probabilities may need to be normalized. + void copySuccessor(MachineBasicBlock *Orig, succ_iterator I); + /// Transfers all the successors from MBB to this machine basic block (i.e., /// copies all the successors FromMBB and remove all the successors from /// FromMBB). Modified: stable/11/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp ============================================================================== --- stable/11/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Fri Apr 27 19:21:39 2018 (r333070) @@ -646,6 +646,14 @@ void MachineBasicBlock::replaceSuccessor(MachineBasicB removeSuccessor(OldI); } +void MachineBasicBlock::copySuccessor(MachineBasicBlock *Orig, + succ_iterator I) { + if (Orig->Probs.empty()) + addSuccessor(*I, Orig->getSuccProbability(I)); + else + addSuccessorWithoutProb(*I); +} + void MachineBasicBlock::addPredecessor(MachineBasicBlock *Pred) { Predecessors.push_back(Pred); } Modified: stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp Fri Apr 27 19:21:39 2018 (r333070) @@ -265,13 +265,10 @@ MCDisassembler::DecodeStatus X86GenericDisassembler::g /// @param reg - The Reg to append. static void translateRegister(MCInst &mcInst, Reg reg) { #define ENTRY(x) X86::x, - uint8_t llvmRegnums[] = { - ALL_REGS - 0 - }; + static constexpr MCPhysReg llvmRegnums[] = {ALL_REGS}; #undef ENTRY - uint8_t llvmRegnum = llvmRegnums[reg]; + MCPhysReg llvmRegnum = llvmRegnums[reg]; mcInst.addOperand(MCOperand::createReg(llvmRegnum)); } Modified: stable/11/contrib/llvm/lib/Target/X86/X86.h ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86.h Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86.h Fri Apr 27 19:21:39 2018 (r333070) @@ -66,6 +66,9 @@ FunctionPass *createX86OptimizeLEAs(); /// Return a pass that transforms setcc + movzx pairs into xor + setcc. FunctionPass *createX86FixupSetCC(); +/// Return a pass that lowers EFLAGS copy pseudo instructions. +FunctionPass *createX86FlagsCopyLoweringPass(); + /// Return a pass that expands WinAlloca pseudo-instructions. FunctionPass *createX86WinAllocaExpander(); Copied and modified: stable/11/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp (from r332833, head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp) ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Fri Apr 20 18:20:55 2018 (r332833, copy source) +++ stable/11/contrib/llvm/lib/Target/X86/X86FlagsCopyLowering.cpp Fri Apr 27 19:21:39 2018 (r333070) @@ -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; } Modified: stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Fri Apr 27 19:21:39 2018 (r333070) @@ -27781,11 +27781,16 @@ X86TargetLowering::EmitInstrWithCustomInserter(Machine MI.getOpcode() == X86::RDFLAGS32 ? X86::PUSHF32 : X86::PUSHF64; unsigned Pop = MI.getOpcode() == X86::RDFLAGS32 ? X86::POP32r : X86::POP64r; MachineInstr *Push = BuildMI(*BB, MI, DL, TII->get(PushF)); - // Permit reads of the FLAGS register without it being defined. + // Permit reads of the EFLAGS and DF registers without them being defined. // This intrinsic exists to read external processor state in flags, such as // the trap flag, interrupt flag, and direction flag, none of which are // modeled by the backend. + assert(Push->getOperand(2).getReg() == X86::EFLAGS && + "Unexpected register in operand!"); Push->getOperand(2).setIsUndef(); + assert(Push->getOperand(3).getReg() == X86::DF && + "Unexpected register in operand!"); + Push->getOperand(3).setIsUndef(); BuildMI(*BB, MI, DL, TII->get(Pop), MI.getOperand(0).getReg()); MI.eraseFromParent(); // The pseudo is gone now. @@ -37827,25 +37832,6 @@ bool X86TargetLowering::isTypeDesirableForOp(unsigned case ISD::XOR: return false; } -} - -/// This function checks if any of the users of EFLAGS copies the EFLAGS. We -/// know that the code that lowers COPY of EFLAGS has to use the stack, and if -/// we don't adjust the stack we clobber the first frame index. -/// See X86InstrInfo::copyPhysReg. -static bool hasCopyImplyingStackAdjustment(const MachineFunction &MF) { - const MachineRegisterInfo &MRI = MF.getRegInfo(); - return any_of(MRI.reg_instructions(X86::EFLAGS), - [](const MachineInstr &RI) { return RI.isCopy(); }); -} - -void X86TargetLowering::finalizeLowering(MachineFunction &MF) const { - if (hasCopyImplyingStackAdjustment(MF)) { - MachineFrameInfo &MFI = MF.getFrameInfo(); - MFI.setHasCopyImplyingStackAdjustment(true); - } - - TargetLoweringBase::finalizeLowering(MF); } /// This method query the target whether it is beneficial for dag combiner to Modified: stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.h ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.h Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86ISelLowering.h Fri Apr 27 19:21:39 2018 (r333070) @@ -1099,9 +1099,6 @@ namespace llvm { bool lowerInterleavedStore(StoreInst *SI, ShuffleVectorInst *SVI, unsigned Factor) const override; - - void finalizeLowering(MachineFunction &MF) const override; - protected: std::pair findRepresentativeClass(const TargetRegisterInfo *TRI, Modified: stable/11/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Fri Apr 27 19:21:39 2018 (r333070) @@ -473,7 +473,7 @@ let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS, DF], usesCustomInserter = 1, Uses = [ESP, SSP] in { def TLS_addr32 : I<0, Pseudo, (outs), (ins i32mem:$sym), "# TLS_addr32", @@ -493,7 +493,7 @@ let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11, ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS], + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS, DF], usesCustomInserter = 1, Uses = [RSP, SSP] in { def TLS_addr64 : I<0, Pseudo, (outs), (ins i64mem:$sym), "# TLS_addr64", @@ -509,7 +509,7 @@ def TLS_base_addr64 : I<0, Pseudo, (outs), (ins i64mem // For i386, the address of the thunk is passed on the stack, on return the // address of the variable is in %eax. %ecx is trashed during the function // call. All other registers are preserved. -let Defs = [EAX, ECX, EFLAGS], +let Defs = [EAX, ECX, EFLAGS, DF], Uses = [ESP, SSP], usesCustomInserter = 1 in def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym), @@ -522,7 +522,7 @@ def TLSCall_32 : I<0, Pseudo, (outs), (ins i32mem:$sym // %rdi. The lowering will do the right thing with RDI. // On return the address of the variable is in %rax. All other // registers are preserved. -let Defs = [RAX, EFLAGS], +let Defs = [RAX, EFLAGS, DF], Uses = [RSP, SSP], usesCustomInserter = 1 in def TLSCall_64 : I<0, Pseudo, (outs), (ins i64mem:$sym), Modified: stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp Fri Apr 27 19:21:39 2018 (r333070) @@ -5782,7 +5782,7 @@ bool X86InstrInfo::findCommutedOpIndices(MachineInstr return false; } -static X86::CondCode getCondFromBranchOpc(unsigned BrOpc) { +X86::CondCode X86::getCondFromBranchOpc(unsigned BrOpc) { switch (BrOpc) { default: return X86::COND_INVALID; case X86::JE_1: return X86::COND_E; @@ -5805,7 +5805,7 @@ static X86::CondCode getCondFromBranchOpc(unsigned BrO } /// Return condition code of a SET opcode. -static X86::CondCode getCondFromSETOpc(unsigned Opc) { +X86::CondCode X86::getCondFromSETOpc(unsigned Opc) { switch (Opc) { default: return X86::COND_INVALID; case X86::SETAr: case X86::SETAm: return X86::COND_A; @@ -6130,7 +6130,7 @@ void X86InstrInfo::replaceBranchWithTailCall( if (!I->isBranch()) assert(0 && "Can't find the branch to replace!"); - X86::CondCode CC = getCondFromBranchOpc(I->getOpcode()); + X86::CondCode CC = X86::getCondFromBranchOpc(I->getOpcode()); assert(BranchCond.size() == 1); if (CC != BranchCond[0].getImm()) continue; @@ -6237,7 +6237,7 @@ bool X86InstrInfo::AnalyzeBranchImpl( } // Handle conditional branches. - X86::CondCode BranchCode = getCondFromBranchOpc(I->getOpcode()); + X86::CondCode BranchCode = X86::getCondFromBranchOpc(I->getOpcode()); if (BranchCode == X86::COND_INVALID) return true; // Can't handle indirect branch. @@ -6433,7 +6433,7 @@ unsigned X86InstrInfo::removeBranch(MachineBasicBlock if (I->isDebugValue()) continue; if (I->getOpcode() != X86::JMP_1 && - getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) + X86::getCondFromBranchOpc(I->getOpcode()) == X86::COND_INVALID) break; // Remove the branch. I->eraseFromParent(); @@ -6710,102 +6710,12 @@ void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB, return; } - bool FromEFLAGS = SrcReg == X86::EFLAGS; - bool ToEFLAGS = DestReg == X86::EFLAGS; - int Reg = FromEFLAGS ? DestReg : SrcReg; - bool is32 = X86::GR32RegClass.contains(Reg); - bool is64 = X86::GR64RegClass.contains(Reg); - - if ((FromEFLAGS || ToEFLAGS) && (is32 || is64)) { - int Mov = is64 ? X86::MOV64rr : X86::MOV32rr; - int Push = is64 ? X86::PUSH64r : X86::PUSH32r; - int PushF = is64 ? X86::PUSHF64 : X86::PUSHF32; - int Pop = is64 ? X86::POP64r : X86::POP32r; - int PopF = is64 ? X86::POPF64 : X86::POPF32; - int AX = is64 ? X86::RAX : X86::EAX; - - if (!Subtarget.hasLAHFSAHF()) { - assert(Subtarget.is64Bit() && - "Not having LAHF/SAHF only happens on 64-bit."); - // Moving EFLAGS to / from another register requires a push and a pop. - // Notice that we have to adjust the stack if we don't want to clobber the - // first frame index. See X86FrameLowering.cpp - usesTheStack. - if (FromEFLAGS) { - BuildMI(MBB, MI, DL, get(PushF)); - BuildMI(MBB, MI, DL, get(Pop), DestReg); - } - if (ToEFLAGS) { - BuildMI(MBB, MI, DL, get(Push)) - .addReg(SrcReg, getKillRegState(KillSrc)); - BuildMI(MBB, MI, DL, get(PopF)); - } - return; - } - - // The flags need to be saved, but saving EFLAGS with PUSHF/POPF is - // inefficient. Instead: - // - Save the overflow flag OF into AL using SETO, and restore it using a - // signed 8-bit addition of AL and INT8_MAX. - // - Save/restore the bottom 8 EFLAGS bits (CF, PF, AF, ZF, SF) to/from AH - // using LAHF/SAHF. - // - When RAX/EAX is live and isn't the destination register, make sure it - // isn't clobbered by PUSH/POP'ing it before and after saving/restoring - // the flags. - // This approach is ~2.25x faster than using PUSHF/POPF. - // - // This is still somewhat inefficient because we don't know which flags are - // actually live inside EFLAGS. Were we able to do a single SETcc instead of - // SETO+LAHF / ADDB+SAHF the code could be 1.02x faster. - // - // PUSHF/POPF is also potentially incorrect because it affects other flags - // such as TF/IF/DF, which LLVM doesn't model. - // - // Notice that we have to adjust the stack if we don't want to clobber the - // first frame index. - // See X86ISelLowering.cpp - X86::hasCopyImplyingStackAdjustment. - - const TargetRegisterInfo &TRI = getRegisterInfo(); - MachineBasicBlock::LivenessQueryResult LQR = - MBB.computeRegisterLiveness(&TRI, AX, MI); - // We do not want to save and restore AX if we do not have to. - // Moreover, if we do so whereas AX is dead, we would need to set - // an undef flag on the use of AX, otherwise the verifier will - // complain that we read an undef value. - // We do not want to change the behavior of the machine verifier - // as this is usually wrong to read an undef value. - if (MachineBasicBlock::LQR_Unknown == LQR) { - LivePhysRegs LPR(TRI); - LPR.addLiveOuts(MBB); - MachineBasicBlock::iterator I = MBB.end(); - while (I != MI) { - --I; - LPR.stepBackward(*I); - } - // AX contains the top most register in the aliasing hierarchy. - // It may not be live, but one of its aliases may be. - for (MCRegAliasIterator AI(AX, &TRI, true); - AI.isValid() && LQR != MachineBasicBlock::LQR_Live; ++AI) - LQR = LPR.contains(*AI) ? MachineBasicBlock::LQR_Live - : MachineBasicBlock::LQR_Dead; - } - bool AXDead = (Reg == AX) || (MachineBasicBlock::LQR_Dead == LQR); - if (!AXDead) - BuildMI(MBB, MI, DL, get(Push)).addReg(AX, getKillRegState(true)); - if (FromEFLAGS) { - BuildMI(MBB, MI, DL, get(X86::SETOr), X86::AL); - BuildMI(MBB, MI, DL, get(X86::LAHF)); - BuildMI(MBB, MI, DL, get(Mov), Reg).addReg(AX); - } - if (ToEFLAGS) { - BuildMI(MBB, MI, DL, get(Mov), AX).addReg(Reg, getKillRegState(KillSrc)); - BuildMI(MBB, MI, DL, get(X86::ADD8ri), X86::AL) - .addReg(X86::AL) - .addImm(INT8_MAX); - BuildMI(MBB, MI, DL, get(X86::SAHF)); - } - if (!AXDead) - BuildMI(MBB, MI, DL, get(Pop), AX); - return; + if (SrcReg == X86::EFLAGS || DestReg == X86::EFLAGS) { + // FIXME: We use a fatal error here because historically LLVM has tried + // lower some of these physreg copies and we want to ensure we get + // reasonable bug reports if someone encounters a case no other testing + // found. This path should be removed after the LLVM 7 release. + report_fatal_error("Unable to copy EFLAGS physical register!"); } DEBUG(dbgs() << "Cannot copy " << RI.getName(SrcReg) @@ -7465,9 +7375,9 @@ bool X86InstrInfo::optimizeCompareInstr(MachineInstr & if (IsCmpZero || IsSwapped) { // We decode the condition code from opcode. if (Instr.isBranch()) - OldCC = getCondFromBranchOpc(Instr.getOpcode()); + OldCC = X86::getCondFromBranchOpc(Instr.getOpcode()); else { - OldCC = getCondFromSETOpc(Instr.getOpcode()); + OldCC = X86::getCondFromSETOpc(Instr.getOpcode()); if (OldCC != X86::COND_INVALID) OpcIsSET = true; else @@ -9413,8 +9323,9 @@ bool X86InstrInfo:: isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const { // FIXME: Return false for x87 stack register classes for now. We can't // allow any loads of these registers before FpGet_ST0_80. - return !(RC == &X86::CCRRegClass || RC == &X86::RFP32RegClass || - RC == &X86::RFP64RegClass || RC == &X86::RFP80RegClass); + return !(RC == &X86::CCRRegClass || RC == &X86::DFCCRRegClass || + RC == &X86::RFP32RegClass || RC == &X86::RFP64RegClass || + RC == &X86::RFP80RegClass); } /// Return a virtual register initialized with the Modified: stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.h ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.h Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.h Fri Apr 27 19:21:39 2018 (r333070) @@ -77,6 +77,12 @@ unsigned getSETFromCond(CondCode CC, bool HasMemoryOpe unsigned getCMovFromCond(CondCode CC, unsigned RegBytes, bool HasMemoryOperand = false); +// Turn jCC opcode into condition code. +CondCode getCondFromBranchOpc(unsigned Opc); + +// Turn setCC opcode into condition code. +CondCode getCondFromSETOpc(unsigned Opc); + // Turn CMov opcode into condition code. CondCode getCondFromCMovOpc(unsigned Opc); Modified: stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.td Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86InstrInfo.td Fri Apr 27 19:21:39 2018 (r333070) @@ -1235,18 +1235,18 @@ let mayLoad = 1, mayStore = 1, usesCustomInserter = 1, let mayLoad = 1, mayStore = 1, usesCustomInserter = 1, SchedRW = [WriteRMW] in { - let Defs = [ESP, EFLAGS], Uses = [ESP] in + let Defs = [ESP, EFLAGS, DF], Uses = [ESP] in def WRFLAGS32 : PseudoI<(outs), (ins GR32:$src), [(int_x86_flags_write_u32 GR32:$src)]>, Requires<[Not64BitMode]>; - let Defs = [RSP, EFLAGS], Uses = [RSP] in + let Defs = [RSP, EFLAGS, DF], Uses = [RSP] in def WRFLAGS64 : PseudoI<(outs), (ins GR64:$src), [(int_x86_flags_write_u64 GR64:$src)]>, Requires<[In64BitMode]>; } -let Defs = [ESP, EFLAGS], Uses = [ESP], mayLoad = 1, hasSideEffects=0, +let Defs = [ESP, EFLAGS, DF], Uses = [ESP], mayLoad = 1, hasSideEffects=0, SchedRW = [WriteLoad] in { def POPF16 : I<0x9D, RawFrm, (outs), (ins), "popf{w}", [], IIC_POP_F>, OpSize16; @@ -1254,7 +1254,7 @@ def POPF32 : I<0x9D, RawFrm, (outs), (ins), "popf{l| OpSize32, Requires<[Not64BitMode]>; } -let Defs = [ESP], Uses = [ESP, EFLAGS], mayStore = 1, hasSideEffects=0, +let Defs = [ESP], Uses = [ESP, EFLAGS, DF], mayStore = 1, hasSideEffects=0, SchedRW = [WriteStore] in { def PUSHF16 : I<0x9C, RawFrm, (outs), (ins), "pushf{w}", [], IIC_PUSH_F>, OpSize16; @@ -1294,10 +1294,10 @@ def PUSH64i32 : Ii32S<0x68, RawFrm, (outs), (ins i64i Requires<[In64BitMode]>; } -let Defs = [RSP, EFLAGS], Uses = [RSP], mayLoad = 1, hasSideEffects=0 in +let Defs = [RSP, EFLAGS, DF], Uses = [RSP], mayLoad = 1, hasSideEffects=0 in def POPF64 : I<0x9D, RawFrm, (outs), (ins), "popfq", [], IIC_POP_FD>, OpSize32, Requires<[In64BitMode]>, Sched<[WriteLoad]>; -let Defs = [RSP], Uses = [RSP, EFLAGS], mayStore = 1, hasSideEffects=0 in +let Defs = [RSP], Uses = [RSP, EFLAGS, DF], mayStore = 1, hasSideEffects=0 in def PUSHF64 : I<0x9C, RawFrm, (outs), (ins), "pushfq", [], IIC_PUSH_F>, OpSize32, Requires<[In64BitMode]>, Sched<[WriteStore]>; @@ -1382,8 +1382,7 @@ def BSR64rm : RI<0xBD, MRMSrcMem, (outs GR64:$dst), ( } // Defs = [EFLAGS] let SchedRW = [WriteMicrocoded] in { -// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI -let Defs = [EDI,ESI], Uses = [EDI,ESI,EFLAGS] in { +let Defs = [EDI,ESI], Uses = [EDI,ESI,DF] in { def MOVSB : I<0xA4, RawFrmDstSrc, (outs), (ins dstidx8:$dst, srcidx8:$src), "movsb\t{$src, $dst|$dst, $src}", [], IIC_MOVS>; def MOVSW : I<0xA5, RawFrmDstSrc, (outs), (ins dstidx16:$dst, srcidx16:$src), @@ -1394,36 +1393,33 @@ def MOVSQ : RI<0xA5, RawFrmDstSrc, (outs), (ins dstidx "movsq\t{$src, $dst|$dst, $src}", [], IIC_MOVS>; } -// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI -let Defs = [EDI], Uses = [AL,EDI,EFLAGS] in +let Defs = [EDI], Uses = [AL,EDI,DF] in def STOSB : I<0xAA, RawFrmDst, (outs), (ins dstidx8:$dst), "stosb\t{%al, $dst|$dst, al}", [], IIC_STOS>; -let Defs = [EDI], Uses = [AX,EDI,EFLAGS] in +let Defs = [EDI], Uses = [AX,EDI,DF] in def STOSW : I<0xAB, RawFrmDst, (outs), (ins dstidx16:$dst), "stosw\t{%ax, $dst|$dst, ax}", [], IIC_STOS>, OpSize16; -let Defs = [EDI], Uses = [EAX,EDI,EFLAGS] in +let Defs = [EDI], Uses = [EAX,EDI,DF] in def STOSL : I<0xAB, RawFrmDst, (outs), (ins dstidx32:$dst), "stos{l|d}\t{%eax, $dst|$dst, eax}", [], IIC_STOS>, OpSize32; -let Defs = [RDI], Uses = [RAX,RDI,EFLAGS] in +let Defs = [RDI], Uses = [RAX,RDI,DF] in def STOSQ : RI<0xAB, RawFrmDst, (outs), (ins dstidx64:$dst), "stosq\t{%rax, $dst|$dst, rax}", [], IIC_STOS>; -// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI -let Defs = [EDI,EFLAGS], Uses = [AL,EDI,EFLAGS] in +let Defs = [EDI,EFLAGS], Uses = [AL,EDI,DF] in def SCASB : I<0xAE, RawFrmDst, (outs), (ins dstidx8:$dst), "scasb\t{$dst, %al|al, $dst}", [], IIC_SCAS>; -let Defs = [EDI,EFLAGS], Uses = [AX,EDI,EFLAGS] in +let Defs = [EDI,EFLAGS], Uses = [AX,EDI,DF] in def SCASW : I<0xAF, RawFrmDst, (outs), (ins dstidx16:$dst), "scasw\t{$dst, %ax|ax, $dst}", [], IIC_SCAS>, OpSize16; -let Defs = [EDI,EFLAGS], Uses = [EAX,EDI,EFLAGS] in +let Defs = [EDI,EFLAGS], Uses = [EAX,EDI,DF] in def SCASL : I<0xAF, RawFrmDst, (outs), (ins dstidx32:$dst), "scas{l|d}\t{$dst, %eax|eax, $dst}", [], IIC_SCAS>, OpSize32; -let Defs = [EDI,EFLAGS], Uses = [RAX,EDI,EFLAGS] in +let Defs = [EDI,EFLAGS], Uses = [RAX,EDI,DF] in def SCASQ : RI<0xAF, RawFrmDst, (outs), (ins dstidx64:$dst), "scasq\t{$dst, %rax|rax, $dst}", [], IIC_SCAS>; -// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI -let Defs = [EDI,ESI,EFLAGS], Uses = [EDI,ESI,EFLAGS] in { +let Defs = [EDI,ESI,EFLAGS], Uses = [EDI,ESI,DF] in { def CMPSB : I<0xA6, RawFrmDstSrc, (outs), (ins dstidx8:$dst, srcidx8:$src), "cmpsb\t{$dst, $src|$src, $dst}", [], IIC_CMPS>; def CMPSW : I<0xA7, RawFrmDstSrc, (outs), (ins dstidx16:$dst, srcidx16:$src), @@ -2070,8 +2066,7 @@ def DATA32_PREFIX : I<0x66, RawFrm, (outs), (ins), "d } // SchedRW // Repeat string operation instruction prefixes -// These use the DF flag in the EFLAGS register to inc or dec ECX -let Defs = [ECX], Uses = [ECX,EFLAGS], SchedRW = [WriteMicrocoded] in { +let Defs = [ECX], Uses = [ECX,DF], SchedRW = [WriteMicrocoded] in { // Repeat (used with INS, OUTS, MOVS, LODS and STOS) def REP_PREFIX : I<0xF3, RawFrm, (outs), (ins), "rep", []>; // Repeat while not equal (used with CMPS and SCAS) @@ -2080,24 +2075,22 @@ def REPNE_PREFIX : I<0xF2, RawFrm, (outs), (ins), "re // String manipulation instructions let SchedRW = [WriteMicrocoded] in { -// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI -let Defs = [AL,ESI], Uses = [ESI,EFLAGS] in +let Defs = [AL,ESI], Uses = [ESI,DF] in def LODSB : I<0xAC, RawFrmSrc, (outs), (ins srcidx8:$src), "lodsb\t{$src, %al|al, $src}", [], IIC_LODS>; -let Defs = [AX,ESI], Uses = [ESI,EFLAGS] in +let Defs = [AX,ESI], Uses = [ESI,DF] in def LODSW : I<0xAD, RawFrmSrc, (outs), (ins srcidx16:$src), "lodsw\t{$src, %ax|ax, $src}", [], IIC_LODS>, OpSize16; -let Defs = [EAX,ESI], Uses = [ESI,EFLAGS] in +let Defs = [EAX,ESI], Uses = [ESI,DF] in def LODSL : I<0xAD, RawFrmSrc, (outs), (ins srcidx32:$src), "lods{l|d}\t{$src, %eax|eax, $src}", [], IIC_LODS>, OpSize32; -let Defs = [RAX,ESI], Uses = [ESI,EFLAGS] in +let Defs = [RAX,ESI], Uses = [ESI,DF] in def LODSQ : RI<0xAD, RawFrmSrc, (outs), (ins srcidx64:$src), "lodsq\t{$src, %rax|rax, $src}", [], IIC_LODS>; } let SchedRW = [WriteSystem] in { -// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI -let Defs = [ESI], Uses = [DX,ESI,EFLAGS] in { +let Defs = [ESI], Uses = [DX,ESI,DF] in { def OUTSB : I<0x6E, RawFrmSrc, (outs), (ins srcidx8:$src), "outsb\t{$src, %dx|dx, $src}", [], IIC_OUTS>; def OUTSW : I<0x6F, RawFrmSrc, (outs), (ins srcidx16:$src), @@ -2106,8 +2099,7 @@ def OUTSL : I<0x6F, RawFrmSrc, (outs), (ins srcidx32:$ "outs{l|d}\t{$src, %dx|dx, $src}", [], IIC_OUTS>, OpSize32; } -// These uses the DF flag in the EFLAGS register to inc or dec EDI and ESI -let Defs = [EDI], Uses = [DX,EDI,EFLAGS] in { +let Defs = [EDI], Uses = [DX,EDI,DF] in { def INSB : I<0x6C, RawFrmDst, (outs), (ins dstidx8:$dst), "insb\t{%dx, $dst|$dst, dx}", [], IIC_INS>; def INSW : I<0x6D, RawFrmDst, (outs), (ins dstidx16:$dst), @@ -2117,18 +2109,21 @@ def INSL : I<0x6D, RawFrmDst, (outs), (ins dstidx32:$d } } -// Flag instructions -let SchedRW = [WriteALU] in { -def CLC : I<0xF8, RawFrm, (outs), (ins), "clc", [], IIC_CLC>; -def STC : I<0xF9, RawFrm, (outs), (ins), "stc", [], IIC_STC>; -def CLI : I<0xFA, RawFrm, (outs), (ins), "cli", [], IIC_CLI>; -def STI : I<0xFB, RawFrm, (outs), (ins), "sti", [], IIC_STI>; +// EFLAGS management instructions. +let SchedRW = [WriteALU], Defs = [EFLAGS], Uses = [EFLAGS] in { +def CLC : I<0xF8, RawFrm, (outs), (ins), "clc", [], IIC_CLC_CMC_STC>; +def STC : I<0xF9, RawFrm, (outs), (ins), "stc", [], IIC_CLC_CMC_STC>; +def CMC : I<0xF5, RawFrm, (outs), (ins), "cmc", [], IIC_CLC_CMC_STC>; +} + +// DF management instructions. +// FIXME: These are a bit more expensive than CLC and STC. We should consider +// adjusting their schedule bucket. +let SchedRW = [WriteALU], Defs = [DF] in { def CLD : I<0xFC, RawFrm, (outs), (ins), "cld", [], IIC_CLD>; def STD : I<0xFD, RawFrm, (outs), (ins), "std", [], IIC_STD>; -def CMC : I<0xF5, RawFrm, (outs), (ins), "cmc", [], IIC_CMC>; - -def CLTS : I<0x06, RawFrm, (outs), (ins), "clts", [], IIC_CLTS>, TB; } + // Table lookup instructions let Uses = [AL,EBX], Defs = [AL], hasSideEffects = 0, mayLoad = 1 in Modified: stable/11/contrib/llvm/lib/Target/X86/X86InstrSystem.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86InstrSystem.td Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86InstrSystem.td Fri Apr 27 19:21:39 2018 (r333070) @@ -693,6 +693,19 @@ let Uses = [RAX, RBX, RCX, RDX], Defs = [RAX, RBX, RCX } // SchedRW //===----------------------------------------------------------------------===// +// TS flag control instruction. +let SchedRW = [WriteSystem] in { +def CLTS : I<0x06, RawFrm, (outs), (ins), "clts", [], IIC_CLTS>, TB; +} + +//===----------------------------------------------------------------------===// +// IF (inside EFLAGS) management instructions. +let SchedRW = [WriteSystem], Uses = [EFLAGS], Defs = [EFLAGS] in { +def CLI : I<0xFA, RawFrm, (outs), (ins), "cli", [], IIC_CLI>; +def STI : I<0xFB, RawFrm, (outs), (ins), "sti", [], IIC_STI>; +} + +//===----------------------------------------------------------------------===// // RDPID Instruction let SchedRW = [WriteSystem] in { def RDPID32 : I<0xC7, MRM7r, (outs GR32:$src), (ins), Modified: stable/11/contrib/llvm/lib/Target/X86/X86RegisterInfo.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Fri Apr 27 19:21:39 2018 (r333070) @@ -251,9 +251,19 @@ def ST7 : X86Reg<"st(7)", 7>, DwarfRegNum<[40, 19, 18] // Floating-point status word def FPSW : X86Reg<"fpsw", 0>; -// Status flags register +// Status flags register. +// +// Note that some flags that are commonly thought of as part of the status +// flags register are modeled separately. Typically this is due to instructions +// reading and updating those flags independently of all the others. We don't +// want to create false dependencies between these instructions and so we use +// a separate register to model them. def EFLAGS : X86Reg<"flags", 0>; +// The direction flag. +def DF : X86Reg<"DF", 0>; + + // Segment registers def CS : X86Reg<"cs", 1>; def DS : X86Reg<"ds", 3>; @@ -494,6 +504,10 @@ def CCR : RegisterClass<"X86", [i32], 32, (add EFLAGS) let isAllocatable = 0; } def FPCCR : RegisterClass<"X86", [i16], 16, (add FPSW)> { + let CopyCost = -1; // Don't allow copying of status registers. + let isAllocatable = 0; +} +def DFCCR : RegisterClass<"X86", [i32], 32, (add DF)> { let CopyCost = -1; // Don't allow copying of status registers. let isAllocatable = 0; } Modified: stable/11/contrib/llvm/lib/Target/X86/X86Schedule.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86Schedule.td Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86Schedule.td Fri Apr 27 19:21:39 2018 (r333070) @@ -608,12 +608,10 @@ def IIC_CMPXCHG_8B : InstrItinClass; def IIC_CMPXCHG_16B : InstrItinClass; def IIC_LODS : InstrItinClass; def IIC_OUTS : InstrItinClass; -def IIC_CLC : InstrItinClass; +def IIC_CLC_CMC_STC : InstrItinClass; def IIC_CLD : InstrItinClass; def IIC_CLI : InstrItinClass; -def IIC_CMC : InstrItinClass; def IIC_CLTS : InstrItinClass; -def IIC_STC : InstrItinClass; def IIC_STI : InstrItinClass; def IIC_STD : InstrItinClass; def IIC_XLAT : InstrItinClass; Modified: stable/11/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td Fri Apr 27 19:21:39 2018 (r333070) @@ -514,12 +514,10 @@ def AtomItineraries : ProcessorItineraries< InstrItinData] >, InstrItinData] >, InstrItinData] >, - InstrItinData] >, + InstrItinData] >, InstrItinData] >, InstrItinData] >, - InstrItinData] >, InstrItinData] >, - InstrItinData] >, InstrItinData] >, InstrItinData] >, InstrItinData] >, Modified: stable/11/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp Fri Apr 27 19:21:39 2018 (r333070) @@ -62,6 +62,7 @@ void initializeX86CallFrameOptimizationPass(PassRegist void initializeX86CmovConverterPassPass(PassRegistry &); void initializeX86ExecutionDepsFixPass(PassRegistry &); void initializeX86DomainReassignmentPass(PassRegistry &); +void initializeX86FlagsCopyLoweringPassPass(PassRegistry &); } // end namespace llvm @@ -80,6 +81,7 @@ extern "C" void LLVMInitializeX86Target() { initializeX86CmovConverterPassPass(PR); initializeX86ExecutionDepsFixPass(PR); initializeX86DomainReassignmentPass(PR); + initializeX86FlagsCopyLoweringPassPass(PR); } static std::unique_ptr createTLOF(const Triple &TT) { @@ -415,6 +417,7 @@ void X86PassConfig::addPreRegAlloc() { addPass(createX86CallFrameOptimization()); } + addPass(createX86FlagsCopyLoweringPass()); addPass(createX86WinAllocaExpander()); } void X86PassConfig::addMachineSSAOptimization() { Modified: stable/11/contrib/llvm/tools/clang/include/clang/Driver/Options.td ============================================================================== --- stable/11/contrib/llvm/tools/clang/include/clang/Driver/Options.td Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/tools/clang/include/clang/Driver/Options.td Fri Apr 27 19:21:39 2018 (r333070) @@ -2559,6 +2559,8 @@ def mrtm : Flag<["-"], "mrtm">, Group, Group; def mrdseed : Flag<["-"], "mrdseed">, Group; def mno_rdseed : Flag<["-"], "mno-rdseed">, Group; +def msahf : Flag<["-"], "msahf">, Group; +def mno_sahf : Flag<["-"], "mno-sahf">, Group; def msgx : Flag<["-"], "msgx">, Group; def mno_sgx : Flag<["-"], "mno-sgx">, Group; def msha : Flag<["-"], "msha">, Group; Modified: stable/11/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp ============================================================================== --- stable/11/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/tools/clang/lib/Basic/Targets/X86.cpp Fri Apr 27 19:21:39 2018 (r333070) @@ -198,6 +198,7 @@ bool X86TargetInfo::initFeatureMap( LLVM_FALLTHROUGH; case CK_Core2: setFeatureEnabledImpl(Features, "ssse3", true); + setFeatureEnabledImpl(Features, "sahf", true); LLVM_FALLTHROUGH; case CK_Yonah: case CK_Prescott: @@ -239,6 +240,7 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "ssse3", true); setFeatureEnabledImpl(Features, "fxsr", true); setFeatureEnabledImpl(Features, "cx16", true); + setFeatureEnabledImpl(Features, "sahf", true); break; case CK_KNM: @@ -269,6 +271,7 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "xsaveopt", true); setFeatureEnabledImpl(Features, "xsave", true); setFeatureEnabledImpl(Features, "movbe", true); + setFeatureEnabledImpl(Features, "sahf", true); break; case CK_K6_2: @@ -282,6 +285,7 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "sse4a", true); setFeatureEnabledImpl(Features, "lzcnt", true); setFeatureEnabledImpl(Features, "popcnt", true); + setFeatureEnabledImpl(Features, "sahf", true); LLVM_FALLTHROUGH; case CK_K8SSE3: setFeatureEnabledImpl(Features, "sse3", true); @@ -315,6 +319,7 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); + setFeatureEnabledImpl(Features, "sahf", true); break; case CK_ZNVER1: @@ -338,6 +343,7 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "rdrnd", true); setFeatureEnabledImpl(Features, "rdseed", true); + setFeatureEnabledImpl(Features, "sahf", true); setFeatureEnabledImpl(Features, "sha", true); setFeatureEnabledImpl(Features, "sse4a", true); setFeatureEnabledImpl(Features, "xsave", true); @@ -372,6 +378,7 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); setFeatureEnabledImpl(Features, "xsave", true); + setFeatureEnabledImpl(Features, "sahf", true); break; } if (!TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec)) @@ -768,6 +775,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector(Feature) @@ -1240,6 +1249,7 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) .Case("rdrnd", true) .Case("rdseed", true) .Case("rtm", true) + .Case("sahf", true) .Case("sgx", true) .Case("sha", true) .Case("shstk", true) @@ -1313,6 +1323,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons .Case("retpoline", HasRetpoline) .Case("retpoline-external-thunk", HasRetpolineExternalThunk) .Case("rtm", HasRTM) + .Case("sahf", HasLAHFSAHF) .Case("sgx", HasSGX) .Case("sha", HasSHA) .Case("shstk", HasSHSTK) Modified: stable/11/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h ============================================================================== --- stable/11/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/contrib/llvm/tools/clang/lib/Basic/Targets/X86.h Fri Apr 27 19:21:39 2018 (r333070) @@ -98,6 +98,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T bool HasPREFETCHWT1 = false; bool HasRetpoline = false; bool HasRetpolineExternalThunk = false; + bool HasLAHFSAHF = false; /// \brief Enumeration of all of the X86 CPUs supported by Clang. /// Modified: stable/11/lib/clang/freebsd_cc_version.h ============================================================================== --- stable/11/lib/clang/freebsd_cc_version.h Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/lib/clang/freebsd_cc_version.h Fri Apr 27 19:21:39 2018 (r333070) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1100507 +#define FREEBSD_CC_VERSION 1100508 Modified: stable/11/lib/clang/libllvm/Makefile ============================================================================== --- stable/11/lib/clang/libllvm/Makefile Fri Apr 27 18:07:31 2018 (r333069) +++ stable/11/lib/clang/libllvm/Makefile Fri Apr 27 19:21:39 2018 (r333070) @@ -1042,6 +1042,7 @@ SRCS_MIN+= Target/X86/X86FastISel.cpp SRCS_MIN+= Target/X86/X86FixupBWInsts.cpp SRCS_MIN+= Target/X86/X86FixupLEAs.cpp SRCS_MIN+= Target/X86/X86FixupSetCC.cpp +SRCS_MIN+= Target/X86/X86FlagsCopyLowering.cpp SRCS_MIN+= Target/X86/X86FloatingPoint.cpp SRCS_MIN+= Target/X86/X86FrameLowering.cpp SRCS_MIN+= Target/X86/X86ISelDAGToDAG.cpp From owner-svn-src-all@freebsd.org Fri Apr 27 19:50:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 20:20:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 21:05:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 21:05:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 21:15:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 21:22:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 21:25:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Fri Apr 27 21:30:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6314FB2541; Fri, 27 Apr 2018 21:30:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46D6B8037C; Fri, 27 Apr 2018 21:30:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 237C1430F; Fri, 27 Apr 2018 21:30:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RLU3cC052218; Fri, 27 Apr 2018 21:30:03 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RLU1GD052201; Fri, 27 Apr 2018 21:30:01 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201804272130.w3RLU1GD052201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 27 Apr 2018 21:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333077 - in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/dispatcher source/components/resources source/components/tables source/... X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-sys/acpica/dist: . source/common source/compiler source/components/debugger source/components/dispatcher source/components/resources source/components/tables source/components/utilities sour... X-SVN-Commit-Revision: 333077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 21:30:04 -0000 Author: jkim Date: Fri Apr 27 21:30:01 2018 New Revision: 333077 URL: https://svnweb.freebsd.org/changeset/base/333077 Log: Import ACPICA 20180427. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/source/common/adfile.c vendor-sys/acpica/dist/source/common/dmtbinfo2.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslhex.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/debugger/dbtest.c vendor-sys/acpica/dist/source/components/dispatcher/dswscope.c vendor-sys/acpica/dist/source/components/resources/rsdump.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/utilities/utprint.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/include/acapps.h vendor-sys/acpica/dist/source/include/acnames.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aeexception.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/changes.txt Fri Apr 27 21:30:01 2018 (r333077) @@ -1,4 +1,47 @@ ---------------------------------------- +27 April 2018. Summary of changes for version 20180427: + + +1) ACPICA kernel-resident subsystem: + +Debugger: Added support for Package objects in the "Test Objects" +command. This command walks the entire namespace and evaluates all named +data objects (Integers, Strings, Buffers, and now Packages). + +Improved error messages for the namespace root node. Originally, the root +was referred to by the confusing string "\___". This has been replaced by +"Namespace Root" for clarification. + +Fixed a potential infinite loop in the AcpiRsDumpByteList function. Colin +Ian King . + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented support to detect and flag illegal forward references. +For compatibility with other ACPI implementations, these references are +now illegal at the root level of the DSDT or SSDTs. Forward references +have always been illegal within control methods. This change should not +affect existing ASL/AML code because of the fact that these references +have always been illegal in the other ACPI implementation. + +iASL: Added error messages for the case where a table OEM ID and OEM +TABLE ID strings are longer than the ACPI-defined length. Previously, +these strings were simply silently truncated. + +iASL: Enhanced the -tc option (which creates an AML hex file in C, +suitable for import into a firmware project): + 1) Create a unique name for the table, to simplify use of multiple +SSDTs. + 2) Add a protection #ifdef in the file, similar to a .h header file. +With assistance from Sami Mujawar, sami.mujawar@arm.com and Evan Lloyd, +evan.lloyd@arm.com + +AcpiExec: Added a new option, -df, to disable the local fault handler. +This is useful during debugging, where it may be desired to drop into a +debugger on a fault. + +---------------------------------------- 13 March 2018. Summary of changes for version 20180313: Modified: vendor-sys/acpica/dist/source/common/adfile.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adfile.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/common/adfile.c Fri Apr 27 21:30:01 2018 (r333077) @@ -454,3 +454,59 @@ FlSplitInputPathname ( return (AE_OK); } + + +/******************************************************************************* + * + * FUNCTION: FlGetFileBasename + * + * PARAMETERS: FilePathname - File path to be split + * + * RETURN: The extracted base name of the file, in upper case + * + * DESCRIPTION: Extract the file base name (the file name with no extension) + * from the input pathname. + * + * Note: Any backslashes in the pathname should be previously + * converted to forward slashes before calling this function. + * + ******************************************************************************/ + +char * +FlGetFileBasename ( + char *FilePathname) +{ + char *FileBasename; + char *Substring; + + + /* Backup to last slash or colon */ + + Substring = strrchr (FilePathname, '/'); + if (!Substring) + { + Substring = strrchr (FilePathname, ':'); + } + + /* Extract the full filename (base + extension) */ + + if (Substring) + { + FileBasename = FlStrdup (Substring + 1); + } + else + { + FileBasename = FlStrdup (FilePathname); + } + + /* Remove the filename extension if present */ + + Substring = strchr (FileBasename, '.'); + if (Substring) + { + *Substring = 0; + } + + AcpiUtStrupr (FileBasename); + return (FileBasename); +} Modified: vendor-sys/acpica/dist/source/common/dmtbinfo2.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo2.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/common/dmtbinfo2.c Fri Apr 27 21:30:01 2018 (r333077) @@ -1063,7 +1063,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoNfit7[] = {ACPI_DMT_UINT24, ACPI_NFIT7_OFFSET (Reserved[0]), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Capabilities), "Capabilities (decoded below)", DT_FLAG}, {ACPI_DMT_FLAG0, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Cache Flush to NVDIMM", 0}, - {ACPI_DMT_FLAG1, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Flush to MVDIMM", 0}, + {ACPI_DMT_FLAG1, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Flush to NVDIMM", 0}, {ACPI_DMT_FLAG2, ACPI_NFIT7_FLAG_OFFSET (Capabilities,0), "Memory Mirroring", 0}, {ACPI_DMT_UINT32, ACPI_NFIT7_OFFSET (Reserved2), "Reserved", 0}, ACPI_DMT_TERMINATOR Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Fri Apr 27 21:30:01 2018 (r333077) @@ -1187,6 +1187,15 @@ UtDumpBasicOp ( ACPI_PARSE_OBJECT *Op, UINT32 Level); +void * +UtGetParentMethod ( + ACPI_NAMESPACE_NODE *Node); + +BOOLEAN +UtNodeIsDescendantOf ( + ACPI_NAMESPACE_NODE *Node1, + ACPI_NAMESPACE_NODE *Node2); + void UtDisplaySupportedTables ( void); Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Fri Apr 27 21:30:01 2018 (r333077) @@ -220,7 +220,8 @@ const char *Gbl_OpFlagNames[A "OP_COMPILER_EMITTED", "OP_IS_DUPLICATE", "OP_IS_RESOURCE_DATA", - "OP_IS_NULL_RETURN" + "OP_IS_NULL_RETURN", + "OP_NOT_FOUND_DURING_LOAD" }; #else Modified: vendor-sys/acpica/dist/source/compiler/aslhex.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslhex.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/aslhex.c Fri Apr 27 21:30:01 2018 (r333077) @@ -150,6 +150,7 @@ *****************************************************************************/ #include "aslcompiler.h" +#include "acapps.h" #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("ashex") @@ -265,6 +266,9 @@ HxReadAmlOutputFile ( * output file, but formatted into hex/ascii bytes suitable for * inclusion into a C source file. * + * Note: the base name of the hex output file is prepended to + * all symbols as they are output to the file. + * ******************************************************************************/ static void @@ -276,18 +280,30 @@ HxDoHexOutputC ( UINT32 Offset = 0; UINT32 AmlFileSize; UINT32 i; + char *FileBasename; + /* Obtain the file basename (filename with no extension) */ + + FileBasename = FlGetFileBasename (Gbl_Files [ASL_FILE_HEX_OUTPUT].Filename); + /* Get AML size, seek back to start */ AmlFileSize = FlGetFileSize (ASL_FILE_AML_OUTPUT); FlSeekFile (ASL_FILE_AML_OUTPUT, 0); + /* Finish the file header and emit the non-data symbols */ + FlPrintFile (ASL_FILE_HEX_OUTPUT, " * C source code output\n"); FlPrintFile (ASL_FILE_HEX_OUTPUT, " * AML code block contains 0x%X bytes\n *\n */\n", AmlFileSize); - FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char AmlCode[] =\n{\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "#ifndef __%s_HEX__\n", FileBasename); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "#define __%s_HEX__\n\n", FileBasename); + + AcpiUtStrlwr (FileBasename); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "unsigned char %s_aml_code[] =\n{\n", FileBasename); + while (Offset < AmlFileSize) { /* Read enough bytes needed for one output line */ @@ -303,7 +319,7 @@ HxDoHexOutputC ( for (i = 0; i < LineLength; i++) { /* - * Print each hex byte. + * Output each hex byte in the form: "0xnn," * Add a comma until the very last byte of the AML file * (Some C compilers complain about a trailing comma) */ @@ -337,7 +353,8 @@ HxDoHexOutputC ( Offset += LineLength; } - FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "};\n\n"); + FlPrintFile (ASL_FILE_HEX_OUTPUT, "#endif\n"); } Modified: vendor-sys/acpica/dist/source/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslload.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/aslload.c Fri Apr 27 21:30:01 2018 (r333077) @@ -153,9 +153,10 @@ #include "amlcode.h" #include "acdispat.h" #include "acnamesp.h" - +#include "acparser.h" #include "aslcompiler.y.h" + #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslload") @@ -470,9 +471,13 @@ LdNamespace1Begin ( UINT32 i; BOOLEAN ForceNewScope = FALSE; ACPI_OWNER_ID OwnerId = 0; + const ACPI_OPCODE_INFO *OpInfo; + ACPI_PARSE_OBJECT *ParentOp; ACPI_FUNCTION_NAME (LdNamespace1Begin); + + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n", Op, Op->Asl.ParseOpName)); @@ -548,6 +553,69 @@ LdNamespace1Begin ( return (AE_OK); } + /* Check for a possible illegal forward reference */ + + if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) || + (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING)) + { + /* + * Op->Asl.Namepath will be NULL for these opcodes. + * These opcodes are guaranteed to have a parent. + * Examine the parent opcode. + */ + Status = AE_OK; + ParentOp = Op->Asl.Parent; + OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Asl.AmlOpcode); + + /* + * Exclude all operators that actually declare a new name: + * Name (ABCD, 1) -> Ignore (AML_CLASS_NAMED_OBJECT) + * We only want references to named objects: + * Store (2, WXYZ) -> Attempt to resolve the name + */ + if (OpInfo->Class == AML_CLASS_NAMED_OBJECT) + { + return (AE_OK); + } + + /* + * Check if the referenced object exists at this point during + * the load: + * 1) If it exists, then this cannot be a forward reference. + * 2) If it does not exist, it could be a forward reference or + * it truly does not exist (and no external declaration). + */ + Status = AcpiNsLookup (WalkState->ScopeInfo, + Op->Asl.Value.Name, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, + ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, + WalkState, &Node); + if (Status == AE_NOT_FOUND) + { + /* + * This is either a foward reference or the object truly + * does not exist. The two cases can only be differentiated + * during the cross-reference stage later. Mark the Op/Name + * as not-found for now to indicate the need for further + * processing. + * + * Special case: Allow forward references from elements of + * Package objects. This provides compatibility with other + * ACPI implementations. To correctly implement this, the + * ACPICA table load defers package resolution until the entire + * namespace has been loaded. + */ + if ((ParentOp->Asl.ParseOpcode != PARSEOP_PACKAGE) && + (ParentOp->Asl.ParseOpcode != PARSEOP_VAR_PACKAGE)) + { + Op->Asl.CompileFlags |= OP_NOT_FOUND_DURING_LOAD; + } + + return (AE_OK); + } + + return (Status); + } + Path = Op->Asl.Namepath; if (!Path) { @@ -584,7 +652,6 @@ LdNamespace1Begin ( } break; - case PARSEOP_EXTERNAL: /* * "External" simply enters a name and type into the namespace. @@ -765,7 +832,6 @@ LdNamespace1Begin ( Status = AE_OK; goto FinishNode; - default: Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.c Fri Apr 27 21:30:01 2018 (r333077) @@ -342,8 +342,8 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_RANGE */ "Constant out of range", /* ASL_MSG_BUFFER_ALLOCATION */ "Could not allocate line buffer", /* ASL_MSG_MISSING_DEPENDENCY */ "Missing dependency", -/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference within a method", -/* ASL_MSG_ILLEGAL_METHOD_REF */ "Illegal reference across two methods", +/* ASL_MSG_ILLEGAL_FORWARD_REF */ "Illegal forward reference", +/* ASL_MSG_ILLEGAL_METHOD_REF */ "Object is declared in a different method", /* ASL_MSG_LOCAL_NOT_USED */ "Method Local is set but never used", /* ASL_MSG_ARG_AS_LOCAL_NOT_USED */ "Method Argument (as a local) is set but never used", /* ASL_MSG_ARG_NOT_USED */ "Method Argument is never used", @@ -354,7 +354,9 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_FOUND_HERE */ "Original name creation/declaration below: ", /* ASL_MSG_ILLEGAL_RECURSION */ "Illegal recursive call to method that creates named objects", /* ASL_MSG_EXTERN_COLLISION */ "A name cannot be defined and declared external in the same table", -/* ASL_MSG_FOUND_HERE_EXTERN*/ "Remove one of the declarations indicated above or below:" +/* ASL_MSG_FOUND_HERE_EXTERN */ "Remove one of the declarations indicated above or below:", +/* ASL_MSG_OEM_TABLE_ID */ "Invalid OEM Table ID", +/* ASL_MSG_OEM_ID */ "Invalid OEM ID" }; /* Table compiler */ Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Fri Apr 27 21:30:01 2018 (r333077) @@ -357,6 +357,8 @@ typedef enum ASL_MSG_ILLEGAL_RECURSION, ASL_MSG_EXTERN_COLLISION, ASL_MSG_EXTERN_FOUND_HERE, + ASL_MSG_OEM_TABLE_ID, + ASL_MSG_OEM_ID, /* These messages are used by the Data Table compiler only */ Modified: vendor-sys/acpica/dist/source/compiler/asloperands.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloperands.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/asloperands.c Fri Apr 27 21:30:01 2018 (r333077) @@ -1061,7 +1061,7 @@ OpnDoDefinitionBlock ( if (strlen (Gbl_TableSignature) != ACPI_NAME_SIZE) { AslError (ASL_ERROR, ASL_MSG_TABLE_SIGNATURE, Child, - "Length is not exactly 4"); + "Length must be exactly 4 characters"); } for (i = 0; i < ACPI_NAME_SIZE; i++) @@ -1078,6 +1078,7 @@ OpnDoDefinitionBlock ( Child = Child->Asl.Next; Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; + /* * We used the revision to set the integer width earlier */ @@ -1086,6 +1087,12 @@ OpnDoDefinitionBlock ( Child = Child->Asl.Next; Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; + if (Child->Asl.Value.String && + strlen (Child->Asl.Value.String) > ACPI_OEM_ID_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_OEM_ID, Child, + "Length cannot exceed 6 characters"); + } /* OEM TableID */ @@ -1094,6 +1101,12 @@ OpnDoDefinitionBlock ( if (Child->Asl.Value.String) { Length = strlen (Child->Asl.Value.String); + if (Length > ACPI_OEM_TABLE_ID_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_OEM_TABLE_ID, Child, + "Length cannot exceed 8 characters"); + } + Gbl_TableId = UtLocalCacheCalloc (Length + 1); strcpy (Gbl_TableId, Child->Asl.Value.String); Modified: vendor-sys/acpica/dist/source/compiler/asltypes.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asltypes.h Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/asltypes.h Fri Apr 27 21:30:01 2018 (r333077) @@ -183,8 +183,9 @@ #define OP_IS_DUPLICATE 0x00040000 #define OP_IS_RESOURCE_DATA 0x00080000 #define OP_IS_NULL_RETURN 0x00100000 +#define OP_NOT_FOUND_DURING_LOAD 0x00200000 -#define ACPI_NUM_OP_FLAGS 0x21 +#define ACPI_NUM_OP_FLAGS 0x22 /* Keeps information about individual control methods */ Modified: vendor-sys/acpica/dist/source/compiler/aslutils.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslutils.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/aslutils.c Fri Apr 27 21:30:01 2018 (r333077) @@ -238,6 +238,97 @@ UtQueryForOverwrite ( /******************************************************************************* * + * FUNCTION: UtNodeIsDescendantOf + * + * PARAMETERS: Node1 - Child node + * Node2 - Possible parent node + * + * RETURN: Boolean + * + * DESCRIPTION: Returns TRUE if Node1 is a descendant of Node2. Otherwise, + * return FALSE. Note, we assume a NULL Node2 element to be the + * topmost (root) scope. All nodes are descendants of the root. + * Note: Nodes at the same level (siblings) are not considered + * descendants. + * + ******************************************************************************/ + +BOOLEAN +UtNodeIsDescendantOf ( + ACPI_NAMESPACE_NODE *Node1, + ACPI_NAMESPACE_NODE *Node2) +{ + + if (Node1 == Node2) + { + return (FALSE); + } + + if (!Node2) + { + return (TRUE); /* All nodes descend from the root */ + } + + /* Walk upward until the root is reached or parent is found */ + + while (Node1) + { + if (Node1 == Node2) + { + return (TRUE); + } + + Node1 = Node1->Parent; + } + + return (FALSE); +} + + +/******************************************************************************* + * + * FUNCTION: UtGetParentMethod + * + * PARAMETERS: Node - Namespace node for any object + * + * RETURN: Namespace node for the parent method + * NULL - object is not within a method + * + * DESCRIPTION: Find the parent (owning) method node for a namespace object + * + ******************************************************************************/ + +void * +UtGetParentMethod ( + ACPI_NAMESPACE_NODE *Node) +{ + ACPI_NAMESPACE_NODE *ParentNode; + + + if (!Node) + { + return (NULL); + } + + /* Walk upward until a method is found, or the root is reached */ + + ParentNode = Node->Parent; + while (ParentNode) + { + if (ParentNode->Type == ACPI_TYPE_METHOD) + { + return (ParentNode); + } + + ParentNode = ParentNode->Parent; + } + + return (NULL); /* Object is not within a control method */ +} + + +/******************************************************************************* + * * FUNCTION: UtDisplaySupportedTables * * PARAMETERS: None Modified: vendor-sys/acpica/dist/source/compiler/aslxref.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslxref.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/compiler/aslxref.c Fri Apr 27 21:30:01 2018 (r333077) @@ -197,23 +197,7 @@ XfCheckFieldRange ( UINT32 FieldBitLength, UINT32 AccessBitWidth); -#ifdef __UNDER_DEVELOPMENT -static ACPI_PARSE_OBJECT * -XfGetParentMethod ( - ACPI_PARSE_OBJECT *Op); -static void -XfCheckIllegalReference ( - ACPI_PARSE_OBJECT *Op, - ACPI_NAMESPACE_NODE *Node); - -static BOOLEAN -XfIsObjectParental ( - ACPI_PARSE_OBJECT *MethodOp1, - ACPI_PARSE_OBJECT *MethodOp2); -#endif - - /******************************************************************************* * * FUNCTION: XfCrossReferenceNamespace @@ -702,7 +686,7 @@ XfNamespaceLocateBegin ( Gbl_NsLookupCount++; Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, - ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node)); + ACPI_IMODE_EXECUTE, Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) @@ -760,6 +744,26 @@ XfNamespaceLocateBegin ( return_ACPI_STATUS (Status); } + /* Object was found above, check for an illegal forward reference */ + + if (Op->Asl.CompileFlags & OP_NOT_FOUND_DURING_LOAD) + { + /* + * During the load phase, this Op was flagged as a possible + * illegal forward reference + * + * Note: Allow "forward references" from within a method to an + * object that is not within any method (module-level code) + */ + if (!WalkState->ScopeInfo || (UtGetParentMethod (Node) && + !UtNodeIsDescendantOf (WalkState->ScopeInfo->Scope.Node, + UtGetParentMethod (Node)))) + { + AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, + Op->Asl.ExternalName); + } + } + /* Check for a reference vs. name declaration */ if (!(OpInfo->Flags & AML_NAMED) && @@ -768,13 +772,6 @@ XfNamespaceLocateBegin ( /* This node has been referenced, mark it for reference check */ Node->Flags |= ANOBJ_IS_REFERENCED; - -#ifdef __UNDER_DEVELOPMENT - - /* Check for an illegal reference */ - - XfCheckIllegalReference (Op, Node); -#endif } /* Attempt to optimize the NamePath */ @@ -1205,178 +1202,3 @@ XfNamespaceLocateEnd ( return_ACPI_STATUS (AE_OK); } - - -#ifdef __UNDER_DEVELOPMENT -/******************************************************************************* - * - * FUNCTION: XfIsObjectParental - * - * PARAMETERS: ChildOp - Op to be checked - * PossibleParentOp - Determine if this op is in the family - * - * RETURN: TRUE if ChildOp is a descendent of PossibleParentOp - * - * DESCRIPTION: Determine if an Op is a descendent of another Op. Used to - * detect if a method is declared within another method. - * - ******************************************************************************/ - -static BOOLEAN -XfIsObjectParental ( - ACPI_PARSE_OBJECT *ChildOp, - ACPI_PARSE_OBJECT *PossibleParentOp) -{ - ACPI_PARSE_OBJECT *ParentOp; - - - /* Search upwards through the tree for possible parent */ - - ParentOp = ChildOp; - while (ParentOp) - { - if (ParentOp == PossibleParentOp) - { - return (TRUE); - } - - ParentOp = ParentOp->Asl.Parent; - } - - return (FALSE); -} - - -/******************************************************************************* - * - * FUNCTION: XfGetParentMethod - * - * PARAMETERS: Op - Op to be checked - * - * RETURN: Op for parent method. NULL if object is not within a method. - * - * DESCRIPTION: Determine if an object is within a control method. Used to - * implement special rules for named references from within a - * control method. - * - * NOTE: It would be better to have the parser set a flag in the Op if possible. - * - ******************************************************************************/ - -static ACPI_PARSE_OBJECT * -XfGetParentMethod ( - ACPI_PARSE_OBJECT *Op) -{ - ACPI_PARSE_OBJECT *ParentOp; - - - if (!Op) - { - return (NULL); - } - - if (Op->Asl.ParseOpcode == PARSEOP_METHOD) - { - return (NULL); - } - - /* Walk upwards through the parse tree, up to the root if necessary */ - - ParentOp = Op; - while (ParentOp) - { - if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD) - { - return (ParentOp); - } - - ParentOp = ParentOp->Asl.Parent; - } - - /* Object is not within a method */ - - return (NULL); -} - - -/******************************************************************************* - * - * FUNCTION: XfCheckIllegalReference - * - * PARAMETERS: Op - Op referring to the target - * TargetNode - Target of the reference - * - * RETURN: None. Emits error message for an illegal reference - * - * DESCRIPTION: Determine if a named reference is legal. A "named" reference - * is something like: Store(ABCD, ...), where ABCD is an AML - * Nameseg or Namepath. - * - * NOTE: Caller must ensure that the name Op is in fact a reference, and not - * an actual name declaration (creation of a named object). - * - ******************************************************************************/ - -static void -XfCheckIllegalReference ( - ACPI_PARSE_OBJECT *Op, - ACPI_NAMESPACE_NODE *TargetNode) -{ - ACPI_PARSE_OBJECT *MethodOp1; - ACPI_PARSE_OBJECT *MethodOp2; - ACPI_PARSE_OBJECT *TargetOp; - - - /* - * Check for an illegal reference to a named object: - * - * 1) References from one control method to another, non-parent - * method are not allowed, they will fail at runtime. - * - * 2) Forward references within a control method are not allowed. - * AML interpreters use a one-pass parse of control methods - * so these forward references will fail at runtime. - */ - TargetOp = TargetNode->Op; - - MethodOp1 = XfGetParentMethod (Op); - MethodOp2 = XfGetParentMethod (TargetOp); - - /* Are both objects within control method(s)? */ - - if (!MethodOp1 || !MethodOp2) - { - return; - } - - /* Objects not in the same method? */ - - if (MethodOp1 != MethodOp2) - { - /* - * 1) Cross-method named reference - * - * This is OK if and only if the target reference is within in a - * method that is a parent of current method - */ - if (!XfIsObjectParental (MethodOp1, MethodOp2)) - { - AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op, - Op->Asl.ExternalName); - } - } - - /* - * 2) Both reference and target are in the same method. Check if this is - * an (illegal) forward reference by examining the exact source code - * location of each (the referenced object and the object declaration). - * This is a bit nasty, yet effective. - */ - else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset) - { - AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, - Op->Asl.ExternalName); - } - -} -#endif Modified: vendor-sys/acpica/dist/source/components/debugger/dbnames.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbnames.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/components/debugger/dbnames.c Fri Apr 27 21:30:01 2018 (r333077) @@ -372,8 +372,17 @@ AcpiDbDumpNamespace ( } AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); - AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n", - ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry); + + if (((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Parent) + { + AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n", + ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry); + } + else + { + AcpiOsPrintf ("ACPI Namespace (from %s):\n", + ACPI_NAMESPACE_ROOT); + } /* Display the subtree */ Modified: vendor-sys/acpica/dist/source/components/debugger/dbtest.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbtest.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/components/debugger/dbtest.c Fri Apr 27 21:30:01 2018 (r333077) @@ -189,6 +189,10 @@ AcpiDbTestStringType ( UINT32 ByteLength); static ACPI_STATUS +AcpiDbTestPackageType ( + ACPI_NAMESPACE_NODE *Node); + +static ACPI_STATUS AcpiDbReadFromObject ( ACPI_NAMESPACE_NODE *Node, ACPI_OBJECT_TYPE ExpectedType, @@ -456,6 +460,11 @@ AcpiDbTestOneObject ( BitLength = ByteLength * 8; break; + case ACPI_TYPE_PACKAGE: + + LocalType = ACPI_TYPE_PACKAGE; + break; + case ACPI_TYPE_FIELD_UNIT: case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD: @@ -490,6 +499,7 @@ AcpiDbTestOneObject ( AcpiOsPrintf ("%14s: %4.4s", AcpiUtGetTypeName (Node->Type), Node->Name.Ascii); + if (!ObjDesc) { AcpiOsPrintf (" Ignoring, no attached object\n"); @@ -510,13 +520,12 @@ AcpiDbTestOneObject ( case ACPI_ADR_SPACE_SYSTEM_MEMORY: case ACPI_ADR_SPACE_SYSTEM_IO: case ACPI_ADR_SPACE_PCI_CONFIG: - case ACPI_ADR_SPACE_EC: break; default: - AcpiOsPrintf (" %s space is not supported [%4.4s]\n", + AcpiOsPrintf (" %s space is not supported in this command [%4.4s]\n", AcpiUtGetRegionName (RegionObj->Region.SpaceId), RegionObj->Region.Node->Name.Ascii); return (AE_OK); @@ -546,6 +555,11 @@ AcpiDbTestOneObject ( Status = AcpiDbTestBufferType (Node, BitLength); break; + case ACPI_TYPE_PACKAGE: + + Status = AcpiDbTestPackageType (Node); + break; + default: AcpiOsPrintf (" Ignoring, type not implemented (%2.2X)", @@ -553,6 +567,14 @@ AcpiDbTestOneObject ( break; } + /* Exit on error, but don't abort the namespace walk */ + + if (ACPI_FAILURE (Status)) + { + Status = AE_OK; + goto Exit; + } + switch (Node->Type) { case ACPI_TYPE_LOCAL_REGION_FIELD: @@ -560,12 +582,14 @@ AcpiDbTestOneObject ( RegionObj = ObjDesc->Field.RegionObj; AcpiOsPrintf (" (%s)", AcpiUtGetRegionName (RegionObj->Region.SpaceId)); + break; default: break; } +Exit: AcpiOsPrintf ("\n"); return (Status); } @@ -624,7 +648,6 @@ AcpiDbTestIntegerType ( { ValueToWrite = 0; } - /* Write a new value */ WriteValue.Type = ACPI_TYPE_INTEGER; @@ -917,6 +940,40 @@ Exit: /******************************************************************************* * + * FUNCTION: AcpiDbTestPackageType + * + * PARAMETERS: Node - Parent NS node for the object + * + * RETURN: Status + * + * DESCRIPTION: Test read for a Package object. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbTestPackageType ( + ACPI_NAMESPACE_NODE *Node) +{ + ACPI_OBJECT *Temp1 = NULL; + ACPI_STATUS Status; + + + /* Read the original value */ + + Status = AcpiDbReadFromObject (Node, ACPI_TYPE_PACKAGE, &Temp1); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + AcpiOsPrintf (" %8.8X Elements", Temp1->Package.Count); + AcpiOsFree (Temp1); + return (Status); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbReadFromObject * * PARAMETERS: Node - Parent NS node for the object @@ -957,8 +1014,8 @@ AcpiDbReadFromObject ( AcpiGbl_MethodExecuting = TRUE; Status = AcpiEvaluateObject (ReadHandle, NULL, &ParamObjects, &ReturnObj); - AcpiGbl_MethodExecuting = FALSE; + AcpiGbl_MethodExecuting = FALSE; if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not read from object, %s", @@ -973,6 +1030,7 @@ AcpiDbReadFromObject ( case ACPI_TYPE_INTEGER: case ACPI_TYPE_BUFFER: case ACPI_TYPE_STRING: + case ACPI_TYPE_PACKAGE: /* * Did we receive the type we wanted? Most important for the * Integer/Buffer case (when a field is larger than an Integer, @@ -984,6 +1042,7 @@ AcpiDbReadFromObject ( AcpiUtGetTypeName (ExpectedType), AcpiUtGetTypeName (RetValue->Type)); + AcpiOsFree (ReturnObj.Pointer); return (AE_TYPE); } Modified: vendor-sys/acpica/dist/source/components/dispatcher/dswscope.c ============================================================================== --- vendor-sys/acpica/dist/source/components/dispatcher/dswscope.c Fri Apr 27 21:22:32 2018 (r333076) +++ vendor-sys/acpica/dist/source/components/dispatcher/dswscope.c Fri Apr 27 21:30:01 2018 (r333077) @@ -269,8 +269,7 @@ AcpiDsScopeStackPush ( } else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, - "[\\___] (%s)", "ROOT")); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, ACPI_NAMESPACE_ROOT)); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, @@ -328,15 +327,13 @@ AcpiDsScopeStackPop ( NewScopeInfo = WalkState->ScopeInfo; if (NewScopeInfo) { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, - "[%4.4s] (%s)\n", + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "[%4.4s] (%s)\n", AcpiUtGetNodeName (NewScopeInfo->Scope.Node), AcpiUtGetTypeName (NewScopeInfo->Common.Value))); } else { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, - "[\\___] (ROOT)\n")); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "%s\n", ACPI_NAMESPACE_ROOT)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Apr 27 21:30:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABE21FB2576; Fri, 27 Apr 2018 21:30:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 561DA80654; Fri, 27 Apr 2018 21:30:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 387F1441B; Fri, 27 Apr 2018 21:30:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3RLUnjw053246; Fri, 27 Apr 2018 21:30:49 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3RLUnPD053233; Fri, 27 Apr 2018 21:30:49 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201804272130.w3RLUnPD053233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 27 Apr 2018 21:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333078 - vendor-sys/acpica/20180427 X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/20180427 X-SVN-Commit-Revision: 333078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 21:30:49 -0000 Author: jkim Date: Fri Apr 27 21:30:48 2018 New Revision: 333078 URL: https://svnweb.freebsd.org/changeset/base/333078 Log: Tag ACPICA 20180427. Added: vendor-sys/acpica/20180427/ - copied from r333077, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Fri Apr 27 22:15:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-all@freebsd.org Sat Apr 28 00:16:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2EA6FB52EE; Sat, 28 Apr 2018 00:16:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80860824DB; Sat, 28 Apr 2018 00:16:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B4CC5E44; Sat, 28 Apr 2018 00:16:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3S0Gta3038386; Sat, 28 Apr 2018 00:16:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3S0GtkU038385; Sat, 28 Apr 2018 00:16:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804280016.w3S0GtkU038385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 28 Apr 2018 00:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333080 - in stable: 10/sys/dev/acpica 11/sys/dev/acpica X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/acpica 11/sys/dev/acpica X-SVN-Commit-Revision: 333080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 00:16:56 -0000 Author: jhb Date: Sat Apr 28 00:16:54 2018 New Revision: 333080 URL: https://svnweb.freebsd.org/changeset/base/333080 Log: MFC 332733: Workaround fixed I/O port resources encoded as I/O port ranges in _CRS. ACPI I/O port descriptors use _MIN and _MAX fields to specify the set of allowable base (start) addresses for an I/O port resource along with a _LEN field specifying the length. A fixed resource is supposed to be encoded with _MIN == _MAX, but some buggy firmwares instead set _MAX to the end of the fixed range. Relocating I/O ranges only make sense in _PRS (possible resource settings), not in _CRS (current resource settings), so if an I/O port range with _MAX set set to the end of the range is present in _CRS, treat it as a fixed I/O port resource starting at _MIN. PR: 224096 Modified: stable/11/sys/dev/acpica/acpi_resource.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/acpica/acpi_resource.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/acpica/acpi_resource.c ============================================================================== --- stable/11/sys/dev/acpica/acpi_resource.c Fri Apr 27 22:15:18 2018 (r333079) +++ stable/11/sys/dev/acpica/acpi_resource.c Sat Apr 28 00:16:54 2018 (r333080) @@ -525,6 +525,24 @@ acpi_res_set_iorange(device_t dev, void *context, uint if (cp == NULL) return; + + /* + * XXX: Some BIOSes contain buggy _CRS entries where fixed I/O + * ranges have the maximum base address (_MAX) to the end of the + * I/O range instead of the start. These are then treated as a + * relocatable I/O range rather than a fixed I/O resource. As a + * workaround, treat I/O resources encoded this way as fixed I/O + * ports. + */ + if (high == (low + length)) { + if (bootverbose) + device_printf(dev, + "_CRS has fixed I/O port range defined as relocatable\n"); + + bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, low, length); + return; + } + device_printf(dev, "I/O range not supported\n"); } From owner-svn-src-all@freebsd.org Sat Apr 28 00:16:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97F0FFB52EA; Sat, 28 Apr 2018 00:16:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37872824DA; Sat, 28 Apr 2018 00:16:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BC925E43; Sat, 28 Apr 2018 00:16:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3S0Gt9e038380; Sat, 28 Apr 2018 00:16:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3S0GtXH038379; Sat, 28 Apr 2018 00:16:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201804280016.w3S0GtXH038379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 28 Apr 2018 00:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r333080 - in stable: 10/sys/dev/acpica 11/sys/dev/acpica X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/acpica 11/sys/dev/acpica X-SVN-Commit-Revision: 333080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 00:16:55 -0000 Author: jhb Date: Sat Apr 28 00:16:54 2018 New Revision: 333080 URL: https://svnweb.freebsd.org/changeset/base/333080 Log: MFC 332733: Workaround fixed I/O port resources encoded as I/O port ranges in _CRS. ACPI I/O port descriptors use _MIN and _MAX fields to specify the set of allowable base (start) addresses for an I/O port resource along with a _LEN field specifying the length. A fixed resource is supposed to be encoded with _MIN == _MAX, but some buggy firmwares instead set _MAX to the end of the fixed range. Relocating I/O ranges only make sense in _PRS (possible resource settings), not in _CRS (current resource settings), so if an I/O port range with _MAX set set to the end of the range is present in _CRS, treat it as a fixed I/O port resource starting at _MIN. PR: 224096 Modified: stable/10/sys/dev/acpica/acpi_resource.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/acpica/acpi_resource.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/acpica/acpi_resource.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_resource.c Fri Apr 27 22:15:18 2018 (r333079) +++ stable/10/sys/dev/acpica/acpi_resource.c Sat Apr 28 00:16:54 2018 (r333080) @@ -515,6 +515,24 @@ acpi_res_set_iorange(device_t dev, void *context, uint if (cp == NULL) return; + + /* + * XXX: Some BIOSes contain buggy _CRS entries where fixed I/O + * ranges have the maximum base address (_MAX) to the end of the + * I/O range instead of the start. These are then treated as a + * relocatable I/O range rather than a fixed I/O resource. As a + * workaround, treat I/O resources encoded this way as fixed I/O + * ports. + */ + if (high == (low + length)) { + if (bootverbose) + device_printf(dev, + "_CRS has fixed I/O port range defined as relocatable\n"); + + bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, low, length); + return; + } + device_printf(dev, "I/O range not supported\n"); } From owner-svn-src-all@freebsd.org Sat Apr 28 00:35:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Apr 28 01:14:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Apr 28 02:32:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B2CCFBA090; Sat, 28 Apr 2018 02:32:06 +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 288F77D5E2; Sat, 28 Apr 2018 02:32:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 235A47656; Sat, 28 Apr 2018 02:32:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3S2W6CP008042; Sat, 28 Apr 2018 02:32:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3S2W6At008041; Sat, 28 Apr 2018 02:32:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201804280232.w3S2W6At008041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 28 Apr 2018 02:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333082 - stable/11/usr.sbin/makefs X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/usr.sbin/makefs X-SVN-Commit-Revision: 333082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Apr 2018 02:32:06 -0000 Author: pfg Date: Sat Apr 28 02:32:05 2018 New Revision: 333082 URL: https://svnweb.freebsd.org/changeset/base/333082 Log: MFC r332986: 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. Modified: stable/11/usr.sbin/makefs/mtree.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/makefs/mtree.c ============================================================================== --- stable/11/usr.sbin/makefs/mtree.c Sat Apr 28 01:14:16 2018 (r333081) +++ stable/11/usr.sbin/makefs/mtree.c Sat Apr 28 02:32:05 2018 (r333082) @@ -54,7 +54,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-all@freebsd.org Sat Apr 28 12:24:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Apr 28 13:16:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Apr 28 15:46:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Apr 28 17:43:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Apr 28 17:43:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-all@freebsd.org Sat Apr 28 17:55:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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];