From owner-svn-src-head@freebsd.org Sun Apr 28 04:05:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF2701570C59; Sun, 28 Apr 2019 04:05:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD0C82C9E; Sun, 28 Apr 2019 04:05:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E1A154BD; Sun, 28 Apr 2019 04:05:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3S45h7U021235; Sun, 28 Apr 2019 04:05:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3S45hBG021234; Sun, 28 Apr 2019 04:05:43 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201904280405.x3S45hBG021234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 28 Apr 2019 04:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346804 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 346804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AD0C82C9E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.91)[-0.912,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 04:05:45 -0000 Author: cy Date: Sun Apr 28 04:05:43 2019 New Revision: 346804 URL: https://svnweb.freebsd.org/changeset/base/346804 Log: Left justify a function header brace as it should be. No functional change. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Apr 28 03:51:08 2019 (r346803) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Apr 28 04:05:43 2019 (r346804) @@ -1169,7 +1169,7 @@ ipf_checkv6sum(fin) size_t mbufchainlen(m0) struct mbuf *m0; - { +{ size_t len; if ((m0->m_flags & M_PKTHDR) != 0) { From owner-svn-src-head@freebsd.org Sun Apr 28 13:07:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CD4A157DA33; Sun, 28 Apr 2019 13:07:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCDC891EB6; Sun, 28 Apr 2019 13:07:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A11D4AFAD; Sun, 28 Apr 2019 13:07:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SD7dsm006712; Sun, 28 Apr 2019 13:07:39 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SD7dei006710; Sun, 28 Apr 2019 13:07:39 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201904281307.x3SD7dei006710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 28 Apr 2019 13:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346814 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CCDC891EB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 13:07:40 -0000 Author: rwatson Date: Sun Apr 28 13:07:38 2019 New Revision: 346814 URL: https://svnweb.freebsd.org/changeset/base/346814 Log: Add a man page for the DTrace Audit Provider, since we are now growing a set of provider man pages. MFC after: 3 days Sponsored by: DARPA, AFRL Added: head/share/man/man4/dtrace_audit.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Apr 28 09:54:50 2019 (r346813) +++ head/share/man/man4/Makefile Sun Apr 28 13:07:38 2019 (r346814) @@ -887,7 +887,8 @@ _ccd.4= ccd.4 .endif .if ${MK_CDDL} != "no" -_dtrace_provs= dtrace_io.4 \ +_dtrace_provs= dtrace_audit.4 \ + dtrace_io.4 \ dtrace_ip.4 \ dtrace_lockstat.4 \ dtrace_proc.4 \ @@ -896,6 +897,8 @@ _dtrace_provs= dtrace_io.4 \ dtrace_tcp.4 \ dtrace_udp.4 \ dtrace_udplite.4 + +MLINKS+= dtrace_audit.4 dtaudit.4 .endif .if ${MK_EFI} != "no" Added: head/share/man/man4/dtrace_audit.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/dtrace_audit.4 Sun Apr 28 13:07:38 2019 (r346814) @@ -0,0 +1,178 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2019 Robert N. M. Watson +.\" +.\" This software was developed by BAE Systems, the University of Cambridge +.\" Computer Laboratory, and Memorial University under DARPA/AFRL contract +.\" FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing +.\" (TC) research program. +.\" +.\" 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 28, 2019 +.Dt DTRACE_AUDIT 4 +.Os +.Sh NAME +.Nm dtrace_audit +.Nd A DTrace provider for tracing +.Xr audit 4 +events +.Sh SYNOPSIS +.Pp +.Fn audit:event:aue_*:commit "char *eventname" "struct audit_record *ar" +.Fn audit:event:aue_*:bsm "char *eventname" "struct audit_record *ar" "const void *" "size_t" +.Pp +To compile this module into the kernel, place the following in your kernel +configuration file: +.Pp +.Bd -literal -offset indent +.Cd "options DTAUDIT" +.Ed +.Pp +Alternatively, to load the module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dtaudit_load="YES" +.Ed +.Sh DESCRIPTION +The DTrace +.Nm dtaudit +provider allows users to trace events in the kernel security auditing +subsystem, +.Xr audit 4 . +.Xr audit 4 +provides detailed logging of a configurable set of security-relevant system +calls, including key arguments (such as file paths) and return values that are +copied race-free as the system call proceeds. +The +.Nm dtaudit +provider allows DTrace scripts to selectively enable in-kernel audit-record +capture for system calls, and then access those records in either the +in-kernel format or BSM format (\c +.Xr audit.log 5 ) +when the system call completes. +While the in-kernel audit record data structure is subject to change as the +kernel changes over time, it is a much more friendly interface for use in D +scripts than either those available via the DTrace system-call provider or the +BSM trail itself. +.Ss Configuration +The +.Nm dtaudit +provider relies on +.Xr audit 4 +being compiled into the kernel. +.Nm dtaudit +probes become available only once there is an event-to-name mapping installed +in the kernel, normally done by +.Xr auditd 8 +during the boot process, if audit is enabled in +.Xr rc.conf 5 : +.Bd -literal -offset indent +auditd_enable="YES" +.Ed +.Pp +If +.Nm dtaudit +probes are required earlier in boot -- for example, in single-user mode -- or +without enabling +.Xr audit 4 , +they can be preloaded in the boot loader by adding this line to +.Xr loader.conf 5 . +.Bd -literal -offset indent +audit_event_load="YES" +.Ed +.Ss Probes +The +.Fn audit:event:aue_*:commit +probes fire synchronously during system-call return, giving access to two +arguments: a +.Vt char * +audit event name, and +the +.Vt struct audit_record * +in-kernel audit record. +Because the probe fires in system-call return, the user thread has not yet +regained control, and additional information from the thread and process +remains available for capture by the script. +.Pp +The +.Fn audit:event:aue_*:bsm +probes fire asynchonously from system-call return, following BSM conversion +and just prior to being written to disk, giving access to four arguments: a +.Vt char * +audit event name, the +.Vt struct audit_record * +in-kernel audit record, a +.Vt const void * +pointer to the converted BSM record, and a +.Vt size_t +for the length of the BSM record. +.Sh IMPLEMENTATION NOTES +When a set of +.Nm dtaudit +probes are registered, corresponding in-kernel audit records will be captured +and their probes will fire regardless of whether the +.Xr audit 4 +subsystem itself would have captured the record for the purposes of writing it +to the audit trail, or for delivery to a +.Xr auditpipe 4 . +In-kernel audit records allocated only because of enabled +.Xr dtaudit 4 +probes will not be unnecessarily written to the audit trail or enabled pipes. +.Sh SEE ALSO +.Xr dtrace 1 , +.Xr audit 4 , +.Xr audit.log 5 , +.Xr loader.conf 5 , +.Xr rc.conf 5 , +.Xr auditd 8 +.Sh HISTORY +The +.Nm dtaudit +provider first appeared in +.Fx 12.0 . +.Sh AUTHORS +This software and this manual page were developed by BAE Systems, the +University of Cambridge Computer Laboratory, and Memorial University under +DARPA/AFRL contract +.Pq FA8650-15-C-7558 +.Pq Do CADETS Dc , +as part of the DARPA Transparent Computing (TC) research program. +The +.Nm dtaudit +provider and this manual page were written by +.An Robert Watson Aq Mt rwatson@FreeBSD.org . +.Sh BUGS +Because +.Xr audit 4 +maintains its primary event-to-name mapping database in userspace, that +database must be loaded into the kernel before +.Nm dtaudit +probes become available. +.Pp +.Nm dtaudit +is only able to provide access to system-call audit events, not the full +scope of userspace events, such as those relating to login, password change, +and so on. From owner-svn-src-head@freebsd.org Sun Apr 28 15:08:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 811ED1580CBA; Sun, 28 Apr 2019 15:08:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2551E970FD; Sun, 28 Apr 2019 15:08:58 +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 F1533C5C1; Sun, 28 Apr 2019 15:08:57 +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 x3SF8vEF072134; Sun, 28 Apr 2019 15:08:57 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SF8vJQ072133; Sun, 28 Apr 2019 15:08:57 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201904281508.x3SF8vJQ072133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 28 Apr 2019 15:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346845 - head/sys/dev/isp X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/isp X-SVN-Commit-Revision: 346845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2551E970FD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 15:08:58 -0000 Author: trasz Date: Sun Apr 28 15:08:57 2019 New Revision: 346845 URL: https://svnweb.freebsd.org/changeset/base/346845 Log: Make isp(4) suggest loading ispfw(4) when it fails to attach. It cannot load it automatically at boot, because the root filesystem is not there yet. An alternative would be adding ispfw(4) to GENERIC, but it's an additional 1MB. Reviewed by: mav MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D19369 Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Sun Apr 28 14:38:21 2019 (r346844) +++ head/sys/dev/isp/isp_pci.c Sun Apr 28 15:08:57 2019 (r346845) @@ -931,6 +931,15 @@ isp_pci_attach(device_t dev) return (0); bad: + if (isp->isp_osinfo.fw == NULL && !IS_26XX(isp)) { + /* + * Failure to attach at boot time might have been caused + * by a missing ispfw(4). Except for for 16Gb adapters, + * there's no loadable firmware for them. + */ + isp_prt(isp, ISP_LOGWARN, "See the ispfw(4) man page on " + "how to load known good firmware at boot time"); + } for (i = 0; i < isp->isp_nirq; i++) { (void) bus_teardown_intr(dev, pcs->irq[i].irq, pcs->irq[i].ih); (void) bus_release_resource(dev, SYS_RES_IRQ, pcs->irq[i].iqd, From owner-svn-src-head@freebsd.org Sun Apr 28 16:28:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563451582AB0; Sun, 28 Apr 2019 16:28:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED6A06ABF1; Sun, 28 Apr 2019 16:28:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C42F4D32B; Sun, 28 Apr 2019 16:28:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SGSaAg014550; Sun, 28 Apr 2019 16:28:36 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SGSaZU014548; Sun, 28 Apr 2019 16:28:36 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201904281628.x3SGSaZU014548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 28 Apr 2019 16:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346846 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ED6A06ABF1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 16:28:37 -0000 Author: rwatson Date: Sun Apr 28 16:28:36 2019 New Revision: 346846 URL: https://svnweb.freebsd.org/changeset/base/346846 Log: Update the audit(4) man page to talk about dtaudit(4), and also add a dtaudit(4) cross reference to auditpipe(4). MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/share/man/man4/audit.4 head/share/man/man4/auditpipe.4 Modified: head/share/man/man4/audit.4 ============================================================================== --- head/share/man/man4/audit.4 Sun Apr 28 15:08:57 2019 (r346845) +++ head/share/man/man4/audit.4 Sun Apr 28 16:28:36 2019 (r346846) @@ -1,6 +1,11 @@ -.\" Copyright (c) 2006 Robert N. M. Watson +.\" Copyright (c) 2006, 2019 Robert N. M. Watson .\" All rights reserved. .\" +.\" This software was developed in part by BAE Systems, the University of +.\" Cambridge Computer Laboratory, and Memorial University under DARPA/AFRL +.\" contract FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent +.\" Computing (TC) research program. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -24,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2009 +.Dd April 28, 2019 .Dt AUDIT 4 .Os .Sh NAME @@ -74,6 +79,12 @@ Audit pipe special devices, discussed in provide a configurable live tracking mechanism to allow applications to tee the audit trail, as well as to configure custom preselection parameters to track users and events in a fine-grained manner. +.Ss DTrace Audit Provider +The DTrace Audit Provider, +.Xr dtaudit 4 , +allows D scripts to enable capture of in-kernel audit records for kernel audit +event types, and then process their contents during audit commit or BSM +generation. .Sh SEE ALSO .Xr auditreduce 1 , .Xr praudit 1 , @@ -88,6 +99,7 @@ to track users and events in a fine-grained manner. .Xr setauid 2 , .Xr libbsm 3 , .Xr auditpipe 4 , +.Xr dtaudit 4 , .Xr audit.log 5 , .Xr audit_class 5 , .Xr audit_control 5 , Modified: head/share/man/man4/auditpipe.4 ============================================================================== --- head/share/man/man4/auditpipe.4 Sun Apr 28 15:08:57 2019 (r346845) +++ head/share/man/man4/auditpipe.4 Sun Apr 28 16:28:36 2019 (r346846) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2018 +.Dd April 28, 2019 .Dt AUDITPIPE 4 .Os .Sh NAME @@ -221,6 +221,7 @@ to review the default audit trail. .Xr poll 2 , .Xr select 2 , .Xr audit 4 , +.Xr dtaudit 4 , .Xr audit_control 5 , .Xr audit 8 , .Xr auditd 8 From owner-svn-src-head@freebsd.org Sun Apr 28 17:27:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B639F158421A; Sun, 28 Apr 2019 17:27:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5339D6CB03; Sun, 28 Apr 2019 17:27:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06038DD59; Sun, 28 Apr 2019 17:27:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SHR6lU046202; Sun, 28 Apr 2019 17:27:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SHR64w046201; Sun, 28 Apr 2019 17:27:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201904281727.x3SHR64w046201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 28 Apr 2019 17:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346847 - head/tools/regression/fsx X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tools/regression/fsx X-SVN-Commit-Revision: 346847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5339D6CB03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 17:27:07 -0000 Author: asomers Date: Sun Apr 28 17:27:06 2019 New Revision: 346847 URL: https://svnweb.freebsd.org/changeset/base/346847 Log: fsx: seed more randomly with the -S0 option When using -S0, seed the PRNG with the current time in nanoseconds, not seconds, so consecutive runs don't accidentally use the same seed. Also, rename some variables for clarity. Reviewed by: ngie MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20078 Modified: head/tools/regression/fsx/fsx.c Modified: head/tools/regression/fsx/fsx.c ============================================================================== --- head/tools/regression/fsx/fsx.c Sun Apr 28 16:28:36 2019 (r346846) +++ head/tools/regression/fsx/fsx.c Sun Apr 28 17:27:06 2019 (r346847) @@ -48,6 +48,7 @@ # include # include #endif +#include #include #include #ifndef MAP_FILE @@ -274,16 +275,22 @@ logdump(void) prt("\t***RRRR***"); break; case OP_WRITE: - prt("WRITE\t0x%x thru 0x%x\t(0x%x bytes)", - lp->args[0], lp->args[0] + lp->args[1] - 1, - lp->args[1]); - if (lp->args[0] > lp->args[2]) - prt(" HOLE"); - else if (lp->args[0] + lp->args[1] > lp->args[2]) - prt(" EXTEND"); - if ((badoff >= lp->args[0] || badoff >=lp->args[2]) && - badoff < lp->args[0] + lp->args[1]) - prt("\t***WWWW"); + { + int offset = lp->args[0]; + int len = lp->args[1]; + int oldlen = lp->args[2]; + + prt("WRITE\t0x%x thru 0x%x\t(0x%x bytes)", + offset, offset + len - 1, + len); + if (offset > oldlen) + prt(" HOLE"); + else if (offset + len > oldlen) + prt(" EXTEND"); + if ((badoff >= offset || badoff >=oldlen) && + badoff < offset + len) + prt("\t***WWWW"); + } break; case OP_TRUNCATE: down = lp->args[0] < lp->args[1]; @@ -993,6 +1000,7 @@ main(int argc, char **argv) char *endp; char goodfile[1024]; char logfile[1024]; + struct timespec now; goodfile[0] = 0; logfile[0] = 0; @@ -1115,8 +1123,11 @@ main(int argc, char **argv) break; case 'S': seed = getnum(optarg, &endp); - if (seed == 0) - seed = time(0) % 10000; + if (seed == 0) { + if (clock_gettime(CLOCK_REALTIME, &now) != 0) + err(1, "clock_gettime"); + seed = now.tv_nsec % 10000; + } if (!quiet) fprintf(stdout, "Seed set to %d\n", seed); if (seed < 0) @@ -1206,7 +1217,7 @@ main(int argc, char **argv) prterr(fname); warn("main: error on write"); } else - warn("main: short write, 0x%x bytes instead of 0x%x\n", + warn("main: short write, 0x%x bytes instead of 0x%lx\n", (unsigned)written, maxfilelen); exit(98); } From owner-svn-src-head@freebsd.org Sun Apr 28 18:45:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFBA9158665B; Sun, 28 Apr 2019 18:45:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 543DE70C34; Sun, 28 Apr 2019 18:45: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 2CFF0EB02; Sun, 28 Apr 2019 18:45: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 x3SIjj58092009; Sun, 28 Apr 2019 18:45:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SIjjWN092008; Sun, 28 Apr 2019 18:45:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201904281845.x3SIjjWN092008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 28 Apr 2019 18:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346851 - 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: 346851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 543DE70C34 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 18:45:45 -0000 Author: kib Date: Sun Apr 28 18:45:44 2019 New Revision: 346851 URL: https://svnweb.freebsd.org/changeset/base/346851 Log: Remove witness warning, same as r346351 for busdma_dmar. bounce_bus_dmamap_create() does not sleep either. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/x86/x86/busdma_bounce.c Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Sun Apr 28 18:44:29 2019 (r346850) +++ head/sys/x86/x86/busdma_bounce.c Sun Apr 28 18:45:44 2019 (r346851) @@ -286,8 +286,6 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags struct bounce_zone *bz; int error, maxpages, pages; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s", __func__); - error = 0; if (dmat->segments == NULL) { From owner-svn-src-head@freebsd.org Sun Apr 28 19:07:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 447531586D79; Sun, 28 Apr 2019 19:07:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDC63718C1; Sun, 28 Apr 2019 19:07:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9951AEE8B; Sun, 28 Apr 2019 19:07:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3SJ7WG7003067; Sun, 28 Apr 2019 19:07:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SJ7WFA003066; Sun, 28 Apr 2019 19:07:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201904281907.x3SJ7WFA003066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 28 Apr 2019 19:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346854 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Commit-Revision: 346854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDC63718C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 19:07:33 -0000 Author: tuexen Date: Sun Apr 28 19:07:31 2019 New Revision: 346854 URL: https://svnweb.freebsd.org/changeset/base/346854 Log: Some test scripts use ncat --sctp --listen port to run an SCTP discard server in the background. However, when running in the background, stdin is closed and ncat initiates a graceful shutdown of the SCTP association. This is not expected by the client. Therefore, the ncat-based discard server is replaced by a perl-based one. In addition, to remove the dependency from ncat, which needs to be installed via the nmap port, also the code testing for a free SCTP port is changed to use the perl-based client. Finally, remove some debug output from the report generated. Reviewed by: lwhsu@ Differential Revision: https://reviews.freebsd.org/D20086 Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Sun Apr 28 19:02:34 2019 (r346853) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh Sun Apr 28 19:07:31 2019 (r346854) @@ -58,36 +58,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin <= 7 ? "yes" : "no"); - printf("ip:::receive (%d) - %s\n", ipreceive, ipreceive >= 7 ? "yes" : "no"); - printf("sctp:::send (%d) - %s\n", sctpsend, sctpsend >= 7 ? "yes" : "no"); - printf("sctp:::receive (%d) - %s\n", sctpreceive, sctpreceive >= 7 ? "yes" : "no"); + printf("ip:::send - %s\n", ipsend >= 7 ? "yes" : "no"); + printf("ip:::receive - %s\n", ipreceive >= 7 ? "yes" : "no"); + printf("sctp:::send - %s\n", sctpsend >= 7 ? "yes" : "no"); + printf("sctp:::receive - %s\n", sctpreceive >= 7 ? "yes" : "no"); } EODTRACE Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Sun Apr 28 19:02:34 2019 (r346853) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh Sun Apr 28 19:07:31 2019 (r346854) @@ -61,36 +61,52 @@ DIR=/var/tmp/dtest.$$ sctpport=1024 bound=5000 -while [ $sctpport -lt $bound ]; do - ncat --sctp -z $local $sctpport > /dev/null || break - sctpport=$(($sctpport + 1)) -done -if [ $sctpport -eq $bound ]; then - echo "couldn't find an available SCTP port" - exit 1 -fi mkdir $DIR cd $DIR -# ncat will exit when the association is closed. -ncat --sctp --listen $local $sctpport & - -cat > test.pl <<-EOPERL +cat > client.pl <<-EOPERL use IO::Socket; my \$s = IO::Socket::INET->new( Type => SOCK_STREAM, Proto => "sctp", LocalAddr => "$local", PeerAddr => "$local", - PeerPort => $sctpport, + PeerPort => \$ARGV[0], Timeout => 3); - die "Could not connect to host $local port $sctpport \$@" unless \$s; + die "Could not connect to host $local port \$ARGV[0] \$@" unless \$s; close \$s; - sleep(2); + sleep(\$ARGV[1]); EOPERL -$dtrace -c 'perl test.pl' -qs /dev/stdin <&- || break + sctpport=$(($sctpport + 1)) +done +if [ $sctpport -eq $bound ]; then + echo "couldn't find an available SCTP port" + exit 1 +fi + +cat > server.pl <<-EOPERL + use IO::Socket; + my \$l = IO::Socket::INET->new( + Type => SOCK_STREAM, + Proto => "sctp", + LocalAddr => "$local", + LocalPort => $sctpport, + Listen => 1, + Reuse => 1); + die "Could not listen on $local port $sctpport \$@" unless \$l; + my \$c = \$l->accept(); + close \$l; + while (<\$c>) {}; + close \$c; +EOPERL + +perl server.pl & + +$dtrace -c "perl client.pl $sctpport 2" -qs /dev/stdin < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F921158C1CF; Sun, 28 Apr 2019 22:38:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D649980701; Sun, 28 Apr 2019 22:37:59 +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 BA17C1926C; Sun, 28 Apr 2019 22:37:59 +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 x3SMbx85014197; Sun, 28 Apr 2019 22:37:59 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3SMbxIE014196; Sun, 28 Apr 2019 22:37:59 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201904282237.x3SMbxIE014196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 28 Apr 2019 22:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346856 - head/usr.sbin/nfsdumpstate X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/nfsdumpstate X-SVN-Commit-Revision: 346856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D649980701 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Apr 2019 22:38:00 -0000 Author: rmacklem Date: Sun Apr 28 22:37:59 2019 New Revision: 346856 URL: https://svnweb.freebsd.org/changeset/base/346856 Log: Add #ifdef INET6 around declaration of nbuf. It was reported that without #ifdef INET6 around the declaration of "nbuf", a build would report an unused variable. For some reason, I didn't see that warning when I did a build, but it seems reasonable to add these #ifdef INET6's. Submitted by: dmitryluhtionov@gmail.com MFC after: 1 week Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c Modified: head/usr.sbin/nfsdumpstate/nfsdumpstate.c ============================================================================== --- head/usr.sbin/nfsdumpstate/nfsdumpstate.c Sun Apr 28 19:52:48 2019 (r346855) +++ head/usr.sbin/nfsdumpstate/nfsdumpstate.c Sun Apr 28 22:37:59 2019 (r346856) @@ -121,7 +121,9 @@ dump_openstate(void) { struct nfsd_dumplist dumplist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplist.ndl_size = DUMPSIZE; dumplist.ndl_list = (void *)dp; @@ -176,7 +178,9 @@ dump_lockstate(char *fname) { struct nfsd_dumplocklist dumplocklist; int cnt, i; +#ifdef INET6 char nbuf[INET6_ADDRSTRLEN]; +#endif dumplocklist.ndllck_size = DUMPSIZE; dumplocklist.ndllck_list = (void *)lp; From owner-svn-src-head@freebsd.org Mon Apr 29 01:10:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2341158F3B1; Mon, 29 Apr 2019 01:10:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7494784DB6; Mon, 29 Apr 2019 01:10:58 +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 4F31F1AC01; Mon, 29 Apr 2019 01:10:58 +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 x3T1AwF0095578; Mon, 29 Apr 2019 01:10:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T1Aw2T095577; Mon, 29 Apr 2019 01:10:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904290110.x3T1Aw2T095577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 29 Apr 2019 01:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346865 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 346865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7494784DB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 01:10:59 -0000 Author: jhibbits Date: Mon Apr 29 01:10:57 2019 New Revision: 346865 URL: https://svnweb.freebsd.org/changeset/base/346865 Log: powerpc: Make OPAL root node probe at bus pass This way its children can attach earlier if needed, and some subsystems are attached earlier, like the asynchronous token management. MFC after: 2 weeks Modified: head/sys/powerpc/powernv/opal_dev.c Modified: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- head/sys/powerpc/powernv/opal_dev.c Mon Apr 29 00:57:47 2019 (r346864) +++ head/sys/powerpc/powernv/opal_dev.c Mon Apr 29 01:10:57 2019 (r346865) @@ -95,7 +95,8 @@ static driver_t opaldev_driver = { static devclass_t opaldev_devclass; -DRIVER_MODULE(opaldev, ofwbus, opaldev_driver, opaldev_devclass, 0, 0); +EARLY_DRIVER_MODULE(opaldev, ofwbus, opaldev_driver, opaldev_devclass, 0, 0, + BUS_PASS_BUS); static void opal_heartbeat(void); static void opal_handle_messages(void); From owner-svn-src-head@freebsd.org Mon Apr 29 03:50:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 542111592016; Mon, 29 Apr 2019 03:50:22 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EABB289676; Mon, 29 Apr 2019 03:50:21 +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 C52DD1C760; Mon, 29 Apr 2019 03:50:21 +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 x3T3oL6j077048; Mon, 29 Apr 2019 03:50:21 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T3oLXV077047; Mon, 29 Apr 2019 03:50:21 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201904290350.x3T3oLXV077047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 29 Apr 2019 03:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346873 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip X-SVN-Commit-Revision: 346873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EABB289676 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 03:50:22 -0000 Author: lwhsu Date: Mon Apr 29 03:50:21 2019 New Revision: 346873 URL: https://svnweb.freebsd.org/changeset/base/346873 Log: Add a trailing empty line to match the test code output This is added for letting these long failing test case pass, and for consistency. The test code should be fixed later to not output this extra empty line. Sponsored by: The FreeBSD Foundation Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out Mon Apr 29 03:31:20 2019 (r346872) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out Mon Apr 29 03:50:21 2019 (r346873) @@ -10,3 +10,4 @@ sctp:::state-change to established - yes sctp:::state-change to shutdown-sent - yes sctp:::state-change to shutdown-received - yes sctp:::state-change to shutdown-ack-sent - yes + From owner-svn-src-head@freebsd.org Mon Apr 29 05:02:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF2771580621; Mon, 29 Apr 2019 05:02:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86AF38B829; Mon, 29 Apr 2019 05:02:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 791AD1D4B9; Mon, 29 Apr 2019 05:02:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3T52PiZ018248; Mon, 29 Apr 2019 05:02:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T52PFD018247; Mon, 29 Apr 2019 05:02:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904290502.x3T52PFD018247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 29 Apr 2019 05:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346879 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86AF38B829 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:02:26 -0000 Author: imp Date: Mon Apr 29 05:02:25 2019 New Revision: 346879 URL: https://svnweb.freebsd.org/changeset/base/346879 Log: Read in and parse /efi/freebsd/loader.env from the boot device's partition as if it were on the command line. Fetch FreeBSD-LoaderEnv UEFI enviornment variable. If set, read in loader environment variables from it. Otherwise read in /efi/freebsd/loader.env. Both are read relative to the device loader.efi loaded from (they aren't full UEFI device paths) Next fetch FreeBSD-NextLoaderEnv UEFI environment variable. If present, read the file it points to in as above and delete the UEFI environment variable so it only happens once. This lets one set environment variables in the bootloader. Unfortunately, we don't have all the mechanisms in place to parse the file, nor do we have the magic pattern matching in place that loader.conf has. Variables are of the form foo=bar. No quotes are supported, so spaces aren't allowed, for example. Also, variables like foo_load=yes are intercepted when we parse the loader.conf file and things are done based on that. Since those aren't done here, variables that cause an action to happen won't work. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20016 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Apr 29 05:01:34 2019 (r346878) +++ head/stand/efi/loader/main.c Mon Apr 29 05:02:25 2019 (r346879) @@ -742,6 +742,80 @@ out: return (how); } +void +parse_loader_efi_config(EFI_HANDLE h, const char *env_fn) +{ + pdinfo_t *dp; + struct stat st; + int fd = -1; + char *env = NULL; + + dp = efiblk_get_pdinfo_by_handle(h); + if (dp == NULL) + return; + set_currdev_pdinfo(dp); + if (stat(env_fn, &st) != 0) + return; + fd = open(env_fn, O_RDONLY); + if (fd == -1) + return; + env = malloc(st.st_size + 1); + if (env == NULL) + goto out; + if (read(fd, env, st.st_size) != st.st_size) + goto out; + env[st.st_size] = '\0'; + boot_parse_cmdline(env); +out: + free(env); + close(fd); +} + +static void +read_loader_env(const char *name, char *def_fn, bool once) +{ + UINTN len; + char *fn, *freeme = NULL; + + len = 0; + fn = def_fn; + if (efi_freebsd_getenv(name, NULL, &len) == EFI_BUFFER_TOO_SMALL) { + freeme = fn = malloc(len + 1); + if (fn != NULL) { + if (efi_freebsd_getenv(name, fn, &len) != EFI_SUCCESS) { + free(fn); + fn = NULL; + printf( + "Can't fetch FreeBSD::%s we know is there\n", name); + } else { + /* + * if tagged as 'once' delete the env variable so we + * only use it once. + */ + if (once) + efi_freebsd_delenv(name); + /* + * We malloced 1 more than len above, then redid the call. + * so now we have room at the end of the string to NUL terminate + * it here, even if the typical idium would have '- 1' here to + * not overflow. len should be the same on return both times. + */ + fn[len] = '\0'; + } + } else { + printf( + "Can't allocate %d bytes to fetch FreeBSD::%s env var\n", + len, name); + } + } + if (fn) { + printf(" Reading loader env vars from %s\n", fn); + parse_loader_efi_config(boot_img->DeviceHandle, fn); + } +} + + + EFI_STATUS main(int argc, CHAR16 *argv[]) { @@ -812,6 +886,38 @@ main(int argc, CHAR16 *argv[]) howto |= RB_SERIAL | RB_MULTIPLE; howto &= ~RB_PROBE; uhowto = parse_uefi_con_out(); + + /* + * Scan the BLOCK IO MEDIA handles then + * march through the device switch probing for things. + */ + i = efipart_inithandles(); + if (i != 0 && i != ENOENT) { + printf("efipart_inithandles failed with ERRNO %d, expect " + "failures\n", i); + } + + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); + + /* + * Read additional environment variables from the boot device's + * "LoaderEnv" file. Any boot loader environment variable may be set + * there, which are subtly different than loader.conf variables. Only + * the 'simple' ones may be set so things like foo_load="YES" won't work + * for two reasons. First, the parser is simplistic and doesn't grok + * quotes. Second, because the variables that cause an action to happen + * are parsed by the lua, 4th or whatever code that's not yet + * loaded. This is relative to the root directory when loader.efi is + * loaded off the UFS root drive (when chain booted), or from the ESP + * when directly loaded by the BIOS. + * + * We also read in NextLoaderEnv if it was specified. This allows next boot + * functionality to be implemented and to override anything in LoaderEnv. + */ + read_loader_env("LoaderEnv", "/efi/freebsd/loader.env", false); + read_loader_env("NextLoaderEnv", NULL, true); /* * We now have two notions of console. howto should be viewed as From owner-svn-src-head@freebsd.org Mon Apr 29 05:02:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B30815806B1; Mon, 29 Apr 2019 05:02:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5F888B96D; Mon, 29 Apr 2019 05:02:50 +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 C00381D4C9; Mon, 29 Apr 2019 05:02:50 +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 x3T52oRa018320; Mon, 29 Apr 2019 05:02:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T52o9H018319; Mon, 29 Apr 2019 05:02:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904290502.x3T52o9H018319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 29 Apr 2019 05:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346880 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5F888B96D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:02:51 -0000 Author: imp Date: Mon Apr 29 05:02:50 2019 New Revision: 346880 URL: https://svnweb.freebsd.org/changeset/base/346880 Log: Implement uefi_rootdev If uefi_rootdev is set in the environment, then treat it like a device path. Convert the string to a device path and see if we can find a device that matches. If so, use that device at our root dev no matter what. If it's bad in any way, the boot will fail. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20016 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Apr 29 05:02:25 2019 (r346879) +++ head/stand/efi/loader/main.c Mon Apr 29 05:02:50 2019 (r346880) @@ -472,13 +472,35 @@ find_currdev(bool do_bootmgr, bool is_last, */ rootdev = getenv("rootdev"); if (rootdev != NULL) { - printf("Setting currdev to configured rootdev %s\n", rootdev); + printf(" Setting currdev to configured rootdev %s\n", + rootdev); set_currdev(rootdev); return (0); } /* - * Second choice: If we can find out image boot_info, and there's + * Second choice: If uefi_rootdev is set, translate that UEFI device + * path to the loader's internal name and use that. + */ + do { + rootdev = getenv("uefi_rootdev"); + if (rootdev == NULL) + break; + devpath = efi_name_to_devpath(rootdev); + if (devpath == NULL) + break; + dp = efiblk_get_pdinfo_by_device_path(devpath); + efi_devpath_free(devpath); + if (dp == NULL) + break; + printf(" Setting currdev to UEFI path %s\n", + rootdev); + set_currdev_pdinfo(dp); + return (0); + } while (0); + + /* + * Third choice: If we can find out image boot_info, and there's * a follow-on boot image in that boot_info, use that. In this * case root will be the partition specified in that image and * we'll load the kernel specified by the file path. Should there From owner-svn-src-head@freebsd.org Mon Apr 29 05:02:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10A8715806E1; Mon, 29 Apr 2019 05:02:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A41FA8B996; Mon, 29 Apr 2019 05:02:55 +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 3A4731D4CA; Mon, 29 Apr 2019 05:02:55 +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 x3T52tIu018371; Mon, 29 Apr 2019 05:02:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T52tYo018370; Mon, 29 Apr 2019 05:02:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201904290502.x3T52tYo018370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 29 Apr 2019 05:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346881 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 346881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A41FA8B996 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 05:02:56 -0000 Author: imp Date: Mon Apr 29 05:02:54 2019 New Revision: 346881 URL: https://svnweb.freebsd.org/changeset/base/346881 Log: Implement uefi_ignore_boot_mgr env variable. When set, we ignore all the hints that the UEFI boot manager has set for us. We also always fail back to the OK prompt when we can't find the right thing to boot rather than failing back to the UEFI boot manager. This has the side effect of also expanding the cases where we fail back to the OK prompt to include when we're booted under UEFI, but UEFI::BootCurrent isn't set in the environment and we can't find a proper place to boot from. Reviewed by: bcran Differential Revision: https://reviews.freebsd.org/D20016 Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Apr 29 05:02:50 2019 (r346880) +++ head/stand/efi/loader/main.c Mon Apr 29 05:02:54 2019 (r346881) @@ -1027,36 +1027,41 @@ main(int argc, CHAR16 *argv[]) } } - uefi_boot_mgr = true; - boot_current = 0; - sz = sizeof(boot_current); - rv = efi_global_getenv("BootCurrent", &boot_current, &sz); - if (rv == EFI_SUCCESS) - printf(" BootCurrent: %04x\n", boot_current); - else { - boot_current = 0xffff; + if (getenv("uefi_ignore_boot_mgr") != NULL) { + printf(" Ignoring UEFI boot manager\n"); uefi_boot_mgr = false; - } + } else { + uefi_boot_mgr = true; + boot_current = 0; + sz = sizeof(boot_current); + rv = efi_global_getenv("BootCurrent", &boot_current, &sz); + if (rv == EFI_SUCCESS) + printf(" BootCurrent: %04x\n", boot_current); + else { + boot_current = 0xffff; + uefi_boot_mgr = false; + } - sz = sizeof(boot_order); - rv = efi_global_getenv("BootOrder", &boot_order, &sz); - if (rv == EFI_SUCCESS) { - printf(" BootOrder:"); - for (i = 0; i < sz / sizeof(boot_order[0]); i++) - printf(" %04x%s", boot_order[i], - boot_order[i] == boot_current ? "[*]" : ""); - printf("\n"); - is_last = boot_order[(sz / sizeof(boot_order[0])) - 1] == boot_current; - bosz = sz; - } else if (uefi_boot_mgr) { - /* - * u-boot doesn't set BootOrder, but otherwise participates in the - * boot manager protocol. So we fake it here and don't consider it - * a failure. - */ - bosz = sizeof(boot_order[0]); - boot_order[0] = boot_current; - is_last = true; + sz = sizeof(boot_order); + rv = efi_global_getenv("BootOrder", &boot_order, &sz); + if (rv == EFI_SUCCESS) { + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); + printf("\n"); + is_last = boot_order[(sz / sizeof(boot_order[0])) - 1] == boot_current; + bosz = sz; + } else if (uefi_boot_mgr) { + /* + * u-boot doesn't set BootOrder, but otherwise participates in the + * boot manager protocol. So we fake it here and don't consider it + * a failure. + */ + bosz = sizeof(boot_order[0]); + boot_order[0] = boot_current; + is_last = true; + } } /* @@ -1105,7 +1110,8 @@ main(int argc, CHAR16 *argv[]) * to try something different. */ if (find_currdev(uefi_boot_mgr, is_last, boot_info, bisz) != 0) - if (!interactive_interrupt("Failed to find bootable partition")) + if (uefi_boot_mgr && + !interactive_interrupt("Failed to find bootable partition")) return (EFI_NOT_FOUND); efi_init_environment(); From owner-svn-src-head@freebsd.org Mon Apr 29 09:33:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48B4815861D6; Mon, 29 Apr 2019 09:33:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE5B06D13B; Mon, 29 Apr 2019 09:33:16 +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 C5000201F0; Mon, 29 Apr 2019 09:33:16 +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 x3T9XG2X061998; Mon, 29 Apr 2019 09:33:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T9XGDE061997; Mon, 29 Apr 2019 09:33:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904290933.x3T9XGDE061997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 29 Apr 2019 09:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346884 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 346884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE5B06D13B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 09:33:17 -0000 Author: ae Date: Mon Apr 29 09:33:16 2019 New Revision: 346884 URL: https://svnweb.freebsd.org/changeset/base/346884 Log: Add IPv6 support for O_IPLEN opcode. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Mon Apr 29 05:35:52 2019 (r346883) +++ head/sys/netpfil/ipfw/ip_fw2.c Mon Apr 29 09:33:16 2019 (r346884) @@ -2191,9 +2191,11 @@ do { \ break; case O_IPID: - case O_IPLEN: case O_IPTTL: - if (is_ipv4) { /* only for IP packets */ + if (!is_ipv4) + break; + case O_IPLEN: + { /* only for IP packets */ uint16_t x; uint16_t *p; int i; From owner-svn-src-head@freebsd.org Mon Apr 29 09:52:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A770615865B9; Mon, 29 Apr 2019 09:52:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42F686D911; Mon, 29 Apr 2019 09:52:54 +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 37C9920553; Mon, 29 Apr 2019 09:52:54 +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 x3T9qseh072037; Mon, 29 Apr 2019 09:52:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3T9qsTG072036; Mon, 29 Apr 2019 09:52:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201904290952.x3T9qsTG072036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 29 Apr 2019 09:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346885 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 346885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42F686D911 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 09:52:54 -0000 Author: ae Date: Mon Apr 29 09:52:53 2019 New Revision: 346885 URL: https://svnweb.freebsd.org/changeset/base/346885 Log: Handle HAVE_PROTO flag and print "proto" keyword for O_IP4 and O_IP6 opcodes when it is needed. This should fix the problem, when printed by `ipfw show` rule could not be added due to missing "proto" keyword. MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Apr 29 09:33:16 2019 (r346884) +++ head/sbin/ipfw/ipfw2.c Mon Apr 29 09:52:53 2019 (r346885) @@ -1701,9 +1701,13 @@ print_instruction(struct buf_pr *bp, const struct form IPFW_TLV_STATE_NAME)); break; case O_IP6: + if (state->flags & HAVE_PROTO) + bprintf(bp, " proto"); bprintf(bp, " ip6"); break; case O_IP4: + if (state->flags & HAVE_PROTO) + bprintf(bp, " proto"); bprintf(bp, " ip4"); break; case O_ICMP6TYPE: From owner-svn-src-head@freebsd.org Mon Apr 29 13:23:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5400A158CC58; Mon, 29 Apr 2019 13:23:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAE63775BD; Mon, 29 Apr 2019 13:23:32 +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 BAA6D22911; Mon, 29 Apr 2019 13:23:32 +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 x3TDNWF1082518; Mon, 29 Apr 2019 13:23:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TDNWdX082517; Mon, 29 Apr 2019 13:23:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904291323.x3TDNWdX082517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Apr 2019 13:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346888 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 346888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EAE63775BD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 13:23:33 -0000 Author: markj Date: Mon Apr 29 13:23:32 2019 New Revision: 346888 URL: https://svnweb.freebsd.org/changeset/base/346888 Log: Stop checking TD_IDLETHREAD() in buffer cache routines. These predicates are vestigal and cannot be true today. For example, idle threads are not allowed to acquire locks. Also cache curthread in breada(). No functional change intended. Reviewed by: kib, mckusick MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20066 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Apr 29 13:20:55 2019 (r346887) +++ head/sys/kern/vfs_bio.c Mon Apr 29 13:23:32 2019 (r346888) @@ -2073,8 +2073,11 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab struct ucred * cred, int flags, void (*ckhashfunc)(struct buf *)) { struct buf *rabp; + struct thread *td; int i; + td = curthread; + for (i = 0; i < cnt; i++, rablkno++, rabsize++) { if (inmem(vp, *rablkno)) continue; @@ -2083,16 +2086,14 @@ breada(struct vnode * vp, daddr_t * rablkno, int * rab brelse(rabp); continue; } - if (!TD_IS_IDLETHREAD(curthread)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, rabp, 0); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_inblock++; + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, rabp, 0); + PROC_UNLOCK(curproc); } +#endif /* RACCT */ + td->td_ru.ru_inblock++; rabp->b_flags |= B_ASYNC; rabp->b_flags &= ~B_INVAL; if ((flags & GB_CKHASH) != 0) { @@ -2148,16 +2149,14 @@ breadn_flags(struct vnode *vp, daddr_t blkno, int size */ readwait = 0; if ((bp->b_flags & B_CACHE) == 0) { - if (!TD_IS_IDLETHREAD(td)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(td->td_proc); - racct_add_buf(td->td_proc, bp, 0); - PROC_UNLOCK(td->td_proc); - } -#endif /* RACCT */ - td->td_ru.ru_inblock++; + if (racct_enable) { + PROC_LOCK(td->td_proc); + racct_add_buf(td->td_proc, bp, 0); + PROC_UNLOCK(td->td_proc); } +#endif /* RACCT */ + td->td_ru.ru_inblock++; bp->b_iocmd = BIO_READ; bp->b_flags &= ~B_INVAL; if ((flags & GB_CKHASH) != 0) { @@ -2258,16 +2257,14 @@ bufwrite(struct buf *bp) bp->b_runningbufspace = bp->b_bufsize; space = atomic_fetchadd_long(&runningbufspace, bp->b_runningbufspace); - if (!TD_IS_IDLETHREAD(curthread)) { #ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, bp, 1); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_oublock++; + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, bp, 1); + PROC_UNLOCK(curproc); } +#endif /* RACCT */ + curthread->td_ru.ru_oublock++; if (oldflags & B_ASYNC) BUF_KERNPROC(bp); bp->b_iooffset = dbtob(bp->b_blkno); @@ -4019,9 +4016,6 @@ loop: */ if (flags & GB_NOCREAT) return (EEXIST); - if (bdomain[bo->bo_domain].bd_freebuffers == 0 && - TD_IS_IDLETHREAD(curthread)) - return (EBUSY); bsize = vn_isdisk(vp, NULL) ? DEV_BSIZE : bo->bo_bsize; KASSERT(bsize != 0, ("bsize == 0, check bo->bo_bsize")); From owner-svn-src-head@freebsd.org Mon Apr 29 14:09:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA535158F81B; Mon, 29 Apr 2019 14:09:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it1-f171.google.com (mail-it1-f171.google.com [209.85.166.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD3D82E34; Mon, 29 Apr 2019 14:09:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it1-f171.google.com with SMTP id w15so16555499itc.0; Mon, 29 Apr 2019 07:09:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QPwGYWXU16wZNzDtnXnS3hjjcAOlOeQCvJJ385/EKEg=; b=lN7CBTjqRketr/imVjX7byImG0JHIPLLPEM5e21+7TtYmMZTxqc9I1V72vuXKdrSd+ ocNs7+/EsNulJyY2NKrAqnHO+c9YX1Ok0gRsx+QKj92N08dlcAfdRfhyb10kpmvADgDg vYVgj3Ikx2kd4wa8zpq22yMlkM7eY+8tKfJltIV5ptNmn40k5jjiaKi8ejyxcoq56bHA l2rSQrQazsECdTXdGE6j1IXbSTvTcSZ4AHiqvQ1WFwYn0jywYOSkTRJP5JixGrL2SwKa 9MR6RVvXQ+Txd7ZhzokB2sp43S3pe6WBOwLDUzKpZhxk3OdnFjL6HkedirLmTCvomeNR BcGw== X-Gm-Message-State: APjAAAXhzcAgGl7ZDMCoeWvAQaUymwigT+mNJ9+IfKWSfdSxRJ9Eo6XH SIC0wIKbekWPXkLz9QX1qe4y4HR69qk8gJCHREywDA== X-Google-Smtp-Source: APXvYqzkga1+BBtjAnHskTfch1IREYRiBmSwkGebft0iY5VVluCMdWnFizIArZ5UCgzqQgFd7Id3KPpKNV0mFa/045g= X-Received: by 2002:a05:660c:12d2:: with SMTP id k18mr18566601itd.33.1556546947247; Mon, 29 Apr 2019 07:09:07 -0700 (PDT) MIME-Version: 1.0 References: <201904231511.x3NFB1tR032938@repo.freebsd.org> <201904231725.x3NHPqCt038790@gndrsh.dnsmgr.net> In-Reply-To: <201904231725.x3NHPqCt038790@gndrsh.dnsmgr.net> From: Ed Maste Date: Mon, 29 Apr 2019 10:08:55 -0400 Message-ID: Subject: Re: svn commit: r346598 - head/sys/modules To: "Rodney W. Grimes" Cc: src-committers , svn-src-all , svn-src-head , Greg V Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 1AD3D82E34 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.171 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-5.52 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.88)[-0.875,0]; RCVD_IN_DNSWL_NONE(0.00)[171.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.63)[ip: (-6.99), ipnet: 209.85.128.0/17(-3.86), asn: 15169(-2.24), country: US(-0.06)]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:09:16 -0000 On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes wrote: > > Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) I know you're joking but the comment does highlight an issue in the AArch64 world - there's a lack of good mid-range developer platforms. FreeBSD runs on Cavium/Marvell ThunderX and ThunderX2 and now on Ampere eMAG with the WIP discussed in PR 237055. These platforms have room for lots of memory, very high core/thread counts (32 to 256), and a good complement of PCIe interfaces. The specs go far beyond those of a typical desktop software development platform, and the price does too. We also run on small embedded boards like the RPi, Pine64, etc. just fine, but there's not much in the middle. What we really need is something like a Mini-ITX form factor 4 to 8 core system that can take 8 to 32GB of RAM, has a PCIe slot or two, and is readily available selling for well below $1000 US. > I am hopeing some of that PCIe WIP might include some of the > bits needed or do we already have PCIe slot on RockPro64 code that works? I don't think this will do anything for RockPro64, it's just a workaround for limitations in our current arm64 PCI code for some functionality unused by ThunderX* but required for eMAG. From owner-svn-src-head@freebsd.org Mon Apr 29 14:13:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F07EC158FF8E; Mon, 29 Apr 2019 14:13:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98C4D83810; Mon, 29 Apr 2019 14:13:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7373D231DC; Mon, 29 Apr 2019 14:13:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TEDs5m008473; Mon, 29 Apr 2019 14:13:54 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TEDrYi008469; Mon, 29 Apr 2019 14:13:53 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904291413.x3TEDrYi008469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Apr 2019 14:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346889 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 98C4D83810 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:13:55 -0000 Author: bde Date: Mon Apr 29 14:13:53 2019 New Revision: 346889 URL: https://svnweb.freebsd.org/changeset/base/346889 Log: Refactor and simplify hiding the mouse cursor and fix bugs caused by complications in the previous methods. r346761 broke showing the mouse cursor after changing its state from off to on (including initially), since showing the cursor uses the state to decide whether to actually show and the state variable was not changed until after null showing. Moving the mouse or copying under the cursor fixed the problem. Fix this and similar problems for the on to off transition by changing the state variable before drawing the cursor. r346641 failed to turn off the mouse cursor on exit from vgl. It hid the cursor only temporarily for clearing. This doesn't change the state variable, so unhiding the cursor after clearing restored the cursor if its state was on. Fix this by changing its state to VGL_MOUSEHIDE using the application API for changing the state. Remove the VGLMouseVisible state variable and the extra states given by it. This was an optimization that was just an obfuscation in at least the previous version. Staticize VGLMouseAction(). Remove VGLMousePointerShow/Hide() except as internals in __VGLMouseMode(). __VGLMouseMouseMode() is the same as the application API VGLMouseMouseMode() except it returns the previous mode which callers need to know to restore it after hiding the cursor. Use the refactoring to make minor improvements in a simpler way than was possible: - in VGLMouseAction(), only hide and and unhide the mouse cursor if the mouse moved - in VGLClear(), only hide and and unhide the mouse cursor if the clearing method would otherwise clear the cursor. Modified: head/lib/libvgl/main.c head/lib/libvgl/mouse.c head/lib/libvgl/simple.c head/lib/libvgl/vgl.h Modified: head/lib/libvgl/main.c ============================================================================== --- head/lib/libvgl/main.c Mon Apr 29 13:23:32 2019 (r346888) +++ head/lib/libvgl/main.c Mon Apr 29 14:13:53 2019 (r346889) @@ -77,7 +77,7 @@ struct vt_mode smode; signal(SIGUSR2, SIG_IGN); VGLSwitchPending = 0; VGLAbortPending = 0; - VGLMousePointerHide(); + VGLMouseMode(VGL_MOUSEHIDE); if (VGLMem != MAP_FAILED) { VGLClear(VGLDisplay, 0); Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Mon Apr 29 13:23:32 2019 (r346888) +++ head/lib/libvgl/mouse.c Mon Apr 29 14:13:53 2019 (r346889) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include "vgl.h" +static void VGLMouseAction(int dummy); + #define BORDER 0xff /* default border -- light white in rgb 3:3:2 */ #define INTERIOR 0xa0 /* default interior -- red in rgb 3:3:2 */ #define X 0xff /* any nonzero in And mask means part of cursor */ @@ -88,7 +90,6 @@ static VGLBitmap VGLMouseStdAndMask = static VGLBitmap VGLMouseStdOrMask = VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask); static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask; -static int VGLMouseVisible = 0; static int VGLMouseShown = VGL_MOUSEHIDE; static int VGLMouseXpos = 0; static int VGLMouseYpos = 0; @@ -102,51 +103,44 @@ static volatile sig_atomic_t VGLMsuppressint; VGLMouseAction(0); \ } while (0) -void -VGLMousePointerShow() +int +__VGLMouseMode(int mode) { - if (!VGLMouseVisible) { - INTOFF(); - VGLMouseVisible = 1; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); - INTON(); - } -} + int oldmode; -void -VGLMousePointerHide() -{ - if (VGLMouseVisible) { - INTOFF(); - VGLMouseVisible = 0; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); - INTON(); - } -} - -void -VGLMouseMode(int mode) -{ + INTOFF(); + oldmode = VGLMouseShown; if (mode == VGL_MOUSESHOW) { if (VGLMouseShown == VGL_MOUSEHIDE) { - VGLMousePointerShow(); VGLMouseShown = VGL_MOUSESHOW; + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, + VGLMouseXpos, VGLMouseYpos, + MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); } } else { if (VGLMouseShown == VGL_MOUSESHOW) { - VGLMousePointerHide(); VGLMouseShown = VGL_MOUSEHIDE; + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, + VGLMouseXpos, VGLMouseYpos, + MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); } } + INTON(); + return oldmode; } void +VGLMouseMode(int mode) +{ + __VGLMouseMode(mode); +} + +static void VGLMouseAction(int dummy) { struct mouse_info mouseinfo; + int mousemode; if (VGLMsuppressint) { VGLMintpending = 1; @@ -157,13 +151,14 @@ again: VGLMintpending = 0; mouseinfo.operation = MOUSE_GETINFO; ioctl(0, CONS_MOUSECTL, &mouseinfo); - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerHide(); - VGLMouseXpos = mouseinfo.u.data.x; - VGLMouseYpos = mouseinfo.u.data.y; + if (VGLMouseXpos != mouseinfo.u.data.x || + VGLMouseYpos != mouseinfo.u.data.y) { + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); + VGLMouseXpos = mouseinfo.u.data.x; + VGLMouseYpos = mouseinfo.u.data.y; + __VGLMouseMode(mousemode); + } VGLMouseButtons = mouseinfo.u.data.buttons; - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerShow(); /* * Loop to handle any new (suppressed) signals. This is INTON() without @@ -178,9 +173,10 @@ again: void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask) { - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerHide(); + int mousemode; + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); + VGLMouseAndMask = AndMask; if (VGLMouseOrMask != NULL) { @@ -191,8 +187,7 @@ VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask VGLBitmapAllocateBits(VGLMouseOrMask); VGLBitmapCvt(OrMask, VGLMouseOrMask); - if (VGLMouseShown == VGL_MOUSESHOW) - VGLMousePointerShow(); + __VGLMouseMode(mousemode); } void Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Mon Apr 29 13:23:32 2019 (r346888) +++ head/lib/libvgl/simple.c Mon Apr 29 14:13:53 2019 (r346889) @@ -465,14 +465,11 @@ void VGLClear(VGLBitmap *object, u_long color) { VGLBitmap src; - int i, len, mouseoverlap, offset; + int i, len, mousemode, offset; VGLCheckSwitch(); if (object == VGLDisplay) { VGLMouseFreeze(); - mouseoverlap = VGLMouseOverlap(0, 0, object->VXsize, object->VYsize); - if (mouseoverlap) - VGLMousePointerHide(); VGLClear(&VGLVDisplay, color); } else if (object->Type != MEMBUF) return; /* invalid */ @@ -503,14 +500,17 @@ VGLClear(VGLBitmap *object, u_long color) break; case VIDBUF8X: + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); /* XXX works only for Xsize % 4 = 0 */ outb(0x3c6, 0xff); outb(0x3c4, 0x02); outb(0x3c5, 0x0f); memset(object->Bitmap, (byte)color, VGLAdpInfo.va_line_width*object->VYsize); + __VGLMouseMode(mousemode); break; case VIDBUF4: case VIDBUF4S: + mousemode = __VGLMouseMode(VGL_MOUSEHIDE); /* XXX works only for Xsize % 8 = 0 */ outb(0x3c4, 0x02); outb(0x3c5, 0x0f); outb(0x3ce, 0x05); outb(0x3cf, 0x02); /* mode 2 */ @@ -524,13 +524,11 @@ VGLClear(VGLBitmap *object, u_long color) offset += len; } outb(0x3ce, 0x05); outb(0x3cf, 0x00); + __VGLMouseMode(mousemode); break; } - if (object == VGLDisplay) { - if (mouseoverlap) - VGLMousePointerShow(); + if (object == VGLDisplay) VGLMouseUnFreeze(); - } } static inline u_long Modified: head/lib/libvgl/vgl.h ============================================================================== --- head/lib/libvgl/vgl.h Mon Apr 29 13:23:32 2019 (r346888) +++ head/lib/libvgl/vgl.h Mon Apr 29 14:13:53 2019 (r346889) @@ -125,10 +125,8 @@ int VGLSetVScreenSize(VGLBitmap *object, int VXsize, i int VGLPanScreen(VGLBitmap *object, int x, int y); int VGLSetSegment(unsigned int offset); /* mouse.c */ -void VGLMousePointerShow(void); -void VGLMousePointerHide(void); +int __VGLMouseMode(int mode); void VGLMouseMode(int mode); -void VGLMouseAction(int dummy); void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask); void VGLMouseSetStdImage(void); int VGLMouseInit(int mode); From owner-svn-src-head@freebsd.org Mon Apr 29 14:21:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B62151590704; Mon, 29 Apr 2019 14:21:03 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E7C9841C1; Mon, 29 Apr 2019 14:21:02 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x3TEL0sk072639; Mon, 29 Apr 2019 07:21:00 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x3TEL00P072638; Mon, 29 Apr 2019 07:21:00 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> Subject: Re: svn commit: r346598 - head/sys/modules In-Reply-To: To: Ed Maste Date: Mon, 29 Apr 2019 07:21:00 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head , Greg V Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 2E7C9841C1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:21:03 -0000 > On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes > wrote: > > > > Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) > > I know you're joking but the comment does highlight an issue in the > AArch64 world - there's a lack of good mid-range developer platforms. I may of been joking with respect to the RPI3, but at the same time I do know that the RockPro64 exists and does have that PCIe slot I want, I also know that Michael Dexter has one he would loan me should I wish to investigate our state of support. > FreeBSD runs on Cavium/Marvell ThunderX and ThunderX2 and now on > Ampere eMAG with the WIP discussed in PR 237055. These platforms have > room for lots of memory, very high core/thread counts (32 to 256), and > a good complement of PCIe interfaces. The specs go far beyond those of > a typical desktop software development platform, and the price does > too. We also run on small embedded boards like the RPi, Pine64, etc. > just fine, but there's not much in the middle. What we really need is > something like a Mini-ITX form factor 4 to 8 core system that can take > 8 to 32GB of RAM, has a PCIe slot or two, and is readily available > selling for well below $1000 US. > > > I am hopeing some of that PCIe WIP might include some of the > > bits needed or do we already have PCIe slot on RockPro64 code that works? > > I don't think this will do anything for RockPro64, it's just a > workaround for limitations in our current arm64 PCI code for some > functionality unused by ThunderX* but required for eMAG. Ok -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Apr 29 14:49:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D497715925CE; Mon, 29 Apr 2019 14:49:09 +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 7A42B862FA; Mon, 29 Apr 2019 14:49:09 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 624642700187; Mon, 29 Apr 2019 10:49:02 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 624642700187 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1556549342; bh=Zw9qhMiEn959FQEMRjRuPSLIaJ4Rh2sHVYZiEmgmtIs=; h=Subject:To:From:Date:From; b=aVdwuRLiMDyWBwCgAfFOfJhkHVQjbSwuJj+RO5c8CJSmogiDB3pO9GJ951gwlJU1K gZzlN4qdHM4dKZ5lFXrxevO+TAvm1PtaGIPWEpBh6e5V4NqXHDAz2WWoOHfky/PlDk Q/yG1T8Ce4rmJfujMdGCEr3Dh8oT7D3EjmrDWgZMY6pVxfnCJNfQSGF7dDNV7JdVq2 tEeLCaihjPpTsQer+8VCZjJnV5rWlb2JQe3DKPD0yiuQljQhUyz610aUoJPht7vKjd wBQ10p9TmwHvr7Qqa4IrPgQGXedpTq6Lm0vUYRI5iVqcU1Axy2hYYvxinF9JBCM1Xe AUEi2jUPbt4qg== Subject: Re: svn commit: r346598 - head/sys/modules To: rgrimes@freebsd.org, Ed Maste Cc: src-committers , svn-src-all , svn-src-head , Greg V References: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> From: Andrew Gallatin Message-ID: <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> Date: Mon, 29 Apr 2019 10:49:01 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7A42B862FA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.969,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:49:10 -0000 On 2019-04-29 10:21, Rodney W. Grimes wrote: >> On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes >> wrote: >>> >>> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) >> >> I know you're joking but the comment does highlight an issue in the >> AArch64 world - there's a lack of good mid-range developer platforms. > > I may of been joking with respect to the RPI3, but at the same > time I do know that the RockPro64 exists and does have that > PCIe slot I want, I also know that Michael Dexter has one he would > loan me should I wish to investigate our state of support. Does anybody know what PCIe Generation / speed that slot runs at? All I can find them saying is "PCIe x4", which implies Gen 1, 2.5GT/s speeds, which is not terribly useful. Gen2 or better would be enough to run 10GbE, which would be fun :) Drew From owner-svn-src-head@freebsd.org Mon Apr 29 14:54:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3DFB1592D01; Mon, 29 Apr 2019 14:54:10 +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 0229B86C3C; Mon, 29 Apr 2019 14:54:09 +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 fba4e1b6; Mon, 29 Apr 2019 16:54:08 +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=T8fzYwXQ7zBykdt8KrRFM8suk5M=; b=Sshu6Ww0i/CJxVJgts/BSQ1HA4Hm BlQID+Sg4NcKnkc2uQpCoLBZ1EK5bz+ZNOl/UhZDwDX2YZ2bAkP2JCmlcI1erpOE 53mu+C+/YM3/T6k0964/XjlQujy0C9fd7tfVRJKptIcvDnxRh8fe4/QdVoo+2o+5 9JlBFtnILMI9Tl4= 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=QafXxe3+J+cGEIVeJpuURQH+6Z5vNAluvYAn5He3tyzboBRu32WiWFbF H70qwVVIIwiFb/csNNhXftR4My4FUUYWCuZBeJ1Cs6XpuJmdlUXu5jj7z+Sy99CG iqgHKb63cn/EBwvRhovSxXmjBz6rWGJzoJNV2A7V8Y4YKiTTw7E= 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 50c657ae TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Mon, 29 Apr 2019 16:54:08 +0200 (CEST) Date: Mon, 29 Apr 2019 16:54:07 +0200 From: Emmanuel Vadot To: Andrew Gallatin Cc: rgrimes@freebsd.org, Ed Maste , src-committers , svn-src-all , svn-src-head , Greg V Subject: Re: svn commit: r346598 - head/sys/modules Message-Id: <20190429165407.d18ef446d8adf141ee7f8c5a@bidouilliste.com> In-Reply-To: <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> References: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0229B86C3C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 14:54:11 -0000 On Mon, 29 Apr 2019 10:49:01 -0400 Andrew Gallatin wrote: > On 2019-04-29 10:21, Rodney W. Grimes wrote: > >> On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes > >> wrote: > >>> > >>> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) > >> > >> I know you're joking but the comment does highlight an issue in the > >> AArch64 world - there's a lack of good mid-range developer platforms. > > > > I may of been joking with respect to the RPI3, but at the same > > time I do know that the RockPro64 exists and does have that > > PCIe slot I want, I also know that Michael Dexter has one he would > > loan me should I wish to investigate our state of support. > > Does anybody know what PCIe Generation / speed that slot runs at? > All I can find them saying is "PCIe x4", which implies Gen 1, 2.5GT/s > speeds, which is not terribly useful. Gen2 or better would be enough > to run 10GbE, which would be fun :) > > Drew It/s PCIe 2.1 compatible. See http://rockchip.fr/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf for more info. -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Mon Apr 29 15:15:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1A6E1593C97; Mon, 29 Apr 2019 15:15:59 +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 75F438848E; Mon, 29 Apr 2019 15:15:59 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.4] (c-71-56-186-158.hsd1.va.comcast.net [71.56.186.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 1EE7027003A6; Mon, 29 Apr 2019 11:15:58 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 1EE7027003A6 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1556550958; bh=FhupId9ORf+u1iJWT4R0F3crLN6N/iBwD1iWCjijdHU=; h=Subject:To:From:Date:From; b=O1TsFyY6CYkF5IAdrWsVyR1CTqgduc3CQ9H6RBx5x43Dvvaml6BzHeE+uaOP5iLDi VBlqK6JgHmeXt54aeM/X7BTOmXPZOmzRbOmIYZbvueKgnTzvOcE7n4ZUJcEan7wGE7 1BzKntOXUjb75mWHdf4BVIZii6Sd/TkWwchiDGaI1UcSNcYld0++UWfl7HOfJYtcTm gYKli6kEok1cmcZM32cF/kuwmvBiO3mzQ/eeTASl9j/O9lNgisupEB+bzopmSusXw6 rcBbcLe9BC4iQzZlc0UE4cEqBZYNZvERJs8NSsIQEgEzR/Gm/Gfr8KNTh9RjjEN0cp 8+sXe6iORKFcA== Subject: Re: svn commit: r346598 - head/sys/modules To: Emmanuel Vadot Cc: rgrimes@freebsd.org, Ed Maste , src-committers , svn-src-all , svn-src-head , Greg V References: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> <20190429165407.d18ef446d8adf141ee7f8c5a@bidouilliste.com> From: Andrew Gallatin Message-ID: <48634242-4bb6-2d74-570c-4093179d9639@cs.duke.edu> Date: Mon, 29 Apr 2019 11:15:57 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190429165407.d18ef446d8adf141ee7f8c5a@bidouilliste.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 75F438848E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:16:00 -0000 On 2019-04-29 10:54, Emmanuel Vadot wrote: > On Mon, 29 Apr 2019 10:49:01 -0400 > Andrew Gallatin wrote: > >> On 2019-04-29 10:21, Rodney W. Grimes wrote: >>>> On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes >>>> wrote: >>>>> >>>>> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) >>>> >>>> I know you're joking but the comment does highlight an issue in the >>>> AArch64 world - there's a lack of good mid-range developer platforms. >>> >>> I may of been joking with respect to the RPI3, but at the same >>> time I do know that the RockPro64 exists and does have that >>> PCIe slot I want, I also know that Michael Dexter has one he would >>> loan me should I wish to investigate our state of support. >> >> Does anybody know what PCIe Generation / speed that slot runs at? >> All I can find them saying is "PCIe x4", which implies Gen 1, 2.5GT/s >> speeds, which is not terribly useful. Gen2 or better would be enough >> to run 10GbE, which would be fun :) >> >> Drew > > It/s PCIe 2.1 compatible. See > http://rockchip.fr/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf > Everything I'm seeing there says Gen1 vs Gen2 depends on "PCIE_GENERATION_SEL", and that if its set to 0, you get Gen1 2.5Gt/s and if it is set to 1, you get Gen2, 5.0Gt/s. But I don't see anything specifying this value for the RockPro64 board. Drew From owner-svn-src-head@freebsd.org Mon Apr 29 15:20:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 291B81593E73; Mon, 29 Apr 2019 15:20:40 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB98288750; Mon, 29 Apr 2019 15:20:39 +0000 (UTC) (envelope-from ganbold@gmail.com) Received: by mail-qk1-x72a.google.com with SMTP id n68so6171265qka.1; Mon, 29 Apr 2019 08:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e7KOnfgo4sp3cbEtlMTyVkgu2v6H1WqBZjKrZscUHJs=; b=RGvf/SaDAeXsBicIbMGkMzMpp5D08u6ZSTa/ChwHZSRY8s3jbCu4lOANDbSSYL3IM8 JvKd4voB60XHYYjlTsq8VNATRQkDEJvGVPaBqB8jgdfJzei7AqB6nsK5u8c7Nhg9CVaT amIPTn2yBZVOVfBymqfERjMn/jiteXxw/LdlGuE1JIjBgpHdJh7wDCBZxziaioOgeyiL p3yiyb9vksr+05kj4TOBBuI2WsmZKI0PskzK0sz8rs/Q1pNLsoOA518JyzrNXx34WwHn KldneWXnBcGgHuk6FXJWy5l77UnHdmc4/RaLobdIOfmCvMgtGrqFx5iq7XERR41ZO9Ft zCew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e7KOnfgo4sp3cbEtlMTyVkgu2v6H1WqBZjKrZscUHJs=; b=h2ZrumS53FZ1Jbghb2RLF4SCba2sVcRT08uZxpL7csZcAHdkPd9+1C6TDRfVomRWAL cRjGnl3aKleuNFEvy3RjLG6WXCh8uMNXxzQX8DFvfS8zjx/tYZOFfhok81o+xmSGM7ZJ PveAZQN6+LzFcDdBVhquwMhQsbwiW4iDEN/QHMEM1MxFWAHVFmrk8rpAyrHiR6ZlLgcS qjyTmtBApF0QQpDOrDSLuT3mqgQLY+s7MIHMy4ohnlnHBzymJiDudnhAByd4CXQ0Y1ki Z+FYY3/m7Fz7Wi2QzplhphHF5Nf7MM+jymKtWrHqgboZnVuCalz2t7oSC1+csX3CfHiG ZSpw== X-Gm-Message-State: APjAAAWuvIxB81kYGQx+I8vV6vASW9wpOgi7LKrSo+lQlW9uZn3CTthD uHnzMWmuwLCt/kSAB/EKercenNVSkMwIOrgo2YTUBrzO1uA= X-Google-Smtp-Source: APXvYqyQGGoKY6TrEE1kbr4sXfJcRMGeY4tuIly+iJhpcwCOsMGgFbj4AqADslUr6qLrEiVKjIhap+RrbfonNMiLmFY= X-Received: by 2002:a37:7401:: with SMTP id p1mr7512228qkc.172.1556551239185; Mon, 29 Apr 2019 08:20:39 -0700 (PDT) MIME-Version: 1.0 References: <201904291421.x3TEL00P072638@gndrsh.dnsmgr.net> <6e19943d-d680-9b83-dd8a-0da58a5f5d37@cs.duke.edu> <20190429165407.d18ef446d8adf141ee7f8c5a@bidouilliste.com> <48634242-4bb6-2d74-570c-4093179d9639@cs.duke.edu> In-Reply-To: <48634242-4bb6-2d74-570c-4093179d9639@cs.duke.edu> From: Ganbold Tsagaankhuu Date: Mon, 29 Apr 2019 23:20:28 +0800 Message-ID: Subject: Re: svn commit: r346598 - head/sys/modules To: Andrew Gallatin Cc: Emmanuel Vadot , rgrimes@freebsd.org, Ed Maste , src-committers , svn-src-all , svn-src-head , Greg V X-Rspamd-Queue-Id: BB98288750 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:20:40 -0000 On Mon, Apr 29, 2019 at 11:16 PM Andrew Gallatin wrote: > On 2019-04-29 10:54, Emmanuel Vadot wrote: > > On Mon, 29 Apr 2019 10:49:01 -0400 > > Andrew Gallatin wrote: > > > >> On 2019-04-29 10:21, Rodney W. Grimes wrote: > >>>> On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes > >>>> wrote: > >>>>> > >>>>> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) > >>>> > >>>> I know you're joking but the comment does highlight an issue in the > >>>> AArch64 world - there's a lack of good mid-range developer platforms. > >>> > >>> I may of been joking with respect to the RPI3, but at the same > >>> time I do know that the RockPro64 exists and does have that > >>> PCIe slot I want, I also know that Michael Dexter has one he would > >>> loan me should I wish to investigate our state of support. > >> > >> Does anybody know what PCIe Generation / speed that slot runs at? > >> All I can find them saying is "PCIe x4", which implies Gen 1, 2.5GT/s > >> speeds, which is not terribly useful. Gen2 or better would be enough > >> to run 10GbE, which would be fun :) > >> > >> Drew > > > > It/s PCIe 2.1 compatible. See > > http://rockchip.fr/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf > > > > Everything I'm seeing there says Gen1 vs Gen2 depends on > "PCIE_GENERATION_SEL", and that if its set to 0, you get > Gen1 2.5Gt/s and if it is set to 1, you get Gen2, 5.0Gt/s. > But I don't see anything specifying this value for the > RockPro64 board. > If you check Rockchip RK3399 TRM V1.3 Part1.pdf you can see PCIe 2.1 in block diagram (Fig 1-1) Ganbold > > Drew > > From owner-svn-src-head@freebsd.org Mon Apr 29 15:23:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A43C1594053 for ; Mon, 29 Apr 2019 15:23:10 +0000 (UTC) (envelope-from greg@unrelenting.technology) Received: from out.migadu.com (out.migadu.com [91.121.223.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.migadu.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07D4288B7C for ; Mon, 29 Apr 2019 15:23:09 +0000 (UTC) (envelope-from greg@unrelenting.technology) Received: (Migadu outbound); Mon, 29 Apr 2019 15:21:56 +0000 Received: from [192.168.1.141] ([62.122.208.146]) by out.migadu.com (Haraka/2.8.16) with ESMTPSA id DE48E6A2-35B1-4CA1-BF67-A0AFD6FB875C.1 envelope-from (authenticated bits=0) (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 verify=FAIL); Mon, 29 Apr 2019 15:21:55 +0000 Date: Mon, 29 Apr 2019 18:21:55 +0300 From: Greg V Subject: Re: svn commit: r346598 - head/sys/modules To: Ed Maste Cc: "Rodney W. Grimes" , src-committers , svn-src-all , svn-src-head Message-Id: <1556551315.5165.0@unrelenting.technology> In-Reply-To: References: <201904231511.x3NFB1tR032938@repo.freebsd.org> <201904231725.x3NHPqCt038790@gndrsh.dnsmgr.net> X-Mailer: geary/master~gaf931ab3 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; bh=J22WwXPhv8rlcXxrH1Szb1/CQH8VVwWYPFH6M6qtAYY=; c=relaxed/simple; d=unrelenting.technology; h=from:subject:date:to; s=default; b=cn+HUI5DEB/kYkpuUaKiYWax28cHGSswHWUOXDkIFBhF9JzkbD3p07dL8UOVYa2Lwfpg/swFPcFaQSIoW+0gikLpt02BY4QC2hiG7gII5Tb5Ux4HH4uzyCO9GnhzFH9crJpPi1bpqpcpRXyR1j6MK0yqRZtkOugWeddeKWgaSoM= X-Rspamd-Queue-Id: 07D4288B7C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:23:10 -0000 On Mon, Apr 29, 2019 at 10:08, Ed Maste wrote: > On Tue, 23 Apr 2019 at 13:26, Rodney W. Grimes > wrote: >>=20 >> Very cool, now how do I get a PCIe slot into a RPI3!!! lol :-) >=20 > I know you're joking but the comment does highlight an issue in the > AArch64 world - there's a lack of good mid-range developer platforms. > FreeBSD runs on Cavium/Marvell ThunderX and ThunderX2 and now on > Ampere eMAG with the WIP discussed in PR 237055. These platforms have > room for lots of memory, very high core/thread counts (32 to 256), and > a good complement of PCIe interfaces. The specs go far beyond those of > a typical desktop software development platform, and the price does > too. We also run on small embedded boards like the RPi, Pine64, etc. > just fine, but there's not much in the middle. What we really need is > something like a Mini-ITX form factor 4 to 8 core system that can take > 8 to 32GB of RAM, has a PCIe slot or two, and is readily available > selling for well below $1000 US. SolidRun/Marvell MACCHIATObin is probably the best option available=20 now, but SolidRun is working on new stuff: https://www.solid-run.com/nxp-lx2160a-family/clearfog-itx/ NXP LX2160A =97 SoC with 16 Cortex-A72 cores, dual-channel DDR4 (MCbin=20 is single channel), 18 lanes of PCIe Gen 4, and as usual a huge=20 built-in network card we don't have a driver for. Though NXP advertises=20 that it's possible to reconfigure the SFP+ ports to turn them into more=20 PCIe. They even confirmed that overclocking is possible for both CPU and RAM: https://www.phoronix.com/forums/forum/hardware/motherboards-chipsets/109010= 2-solidrun-clearfog-a-16-core-arm-itx-workstation-board-aiming-for-500~750-= usd?p=3D1090905#post1090905 Let's hope they implement ACPI fully and correctly :) >> I am hopeing some of that PCIe WIP might include some of the >> bits needed or do we already have PCIe slot on RockPro64 code that=20 >> works? >=20 > I don't think this will do anything for RockPro64, it's just a > workaround for limitations in our current arm64 PCI code for some > functionality unused by ThunderX* but required for eMAG. RK3399 seems to need a custom driver, OpenBSD has one: https://github.com/openbsd/src/blob/master/sys/dev/fdt/rkpcie.c And I've heard bad things about the controller, apparently no one has=20 got a GPU working on Linux because the controller doesn't support=20 enough address space or some other features. = From owner-svn-src-head@freebsd.org Mon Apr 29 15:58:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3CCA1594FAE; Mon, 29 Apr 2019 15:58:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55CB189F40; Mon, 29 Apr 2019 15:58:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BFFA242ED; Mon, 29 Apr 2019 15:58:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TFw5wr060651; Mon, 29 Apr 2019 15:58:05 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TFw5Zc060650; Mon, 29 Apr 2019 15:58:05 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904291558.x3TFw5Zc060650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Apr 2019 15:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346890 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55CB189F40 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 15:58:06 -0000 Author: bde Date: Mon Apr 29 15:58:05 2019 New Revision: 346890 URL: https://svnweb.freebsd.org/changeset/base/346890 Log: Oops, r346889 broke showing of the mouse cursor after clearing, by forgetting to tell the bitmap-copying clearing method to preserve the cursor. Modified: head/lib/libvgl/simple.c Modified: head/lib/libvgl/simple.c ============================================================================== --- head/lib/libvgl/simple.c Mon Apr 29 14:13:53 2019 (r346889) +++ head/lib/libvgl/simple.c Mon Apr 29 15:58:05 2019 (r346890) @@ -496,7 +496,7 @@ VGLClear(VGLBitmap *object, u_long color) for (i = 0; i < object->VXsize; i++) bcopy(&color, src.Bitmap + i * object->PixelBytes, object->PixelBytes); for (i = 0; i < object->VYsize; i++) - __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VXsize, 1); + __VGLBitmapCopy(&src, 0, 0, object, 0, i, object->VXsize, -1); break; case VIDBUF8X: From owner-svn-src-head@freebsd.org Mon Apr 29 16:26:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8599D1595C0E; Mon, 29 Apr 2019 16:26:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 296B58B51D; Mon, 29 Apr 2019 16:26:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05F6D2485D; Mon, 29 Apr 2019 16:26:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGQTlx076465; Mon, 29 Apr 2019 16:26:29 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGQTgY076464; Mon, 29 Apr 2019 16:26:29 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201904291626.x3TGQTgY076464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 29 Apr 2019 16:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346895 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 346895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 296B58B51D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:26:30 -0000 Author: bde Date: Mon Apr 29 16:26:29 2019 New Revision: 346895 URL: https://svnweb.freebsd.org/changeset/base/346895 Log: Support all reasonable cursor sizes. Reduce the size of the standard cursor from 16x16 (with 6 columns unused) to 10x16 and rename it to the "small" cursor. Add a "large" 19x32 cursor and use it for screen widths larger than 800 pixels. Use libvgl's too-small indentation for the large data declarations. MOUSE_IMG_SIZE = 16 is still part of the API. If an application supplies invalid bitmaps for the cursor, then the results may be different from before. Modified: head/lib/libvgl/mouse.c Modified: head/lib/libvgl/mouse.c ============================================================================== --- head/lib/libvgl/mouse.c Mon Apr 29 16:24:51 2019 (r346894) +++ head/lib/libvgl/mouse.c Mon Apr 29 16:26:29 2019 (r346895) @@ -43,52 +43,132 @@ static void VGLMouseAction(int dummy); #define BORDER 0xff /* default border -- light white in rgb 3:3:2 */ #define INTERIOR 0xa0 /* default interior -- red in rgb 3:3:2 */ +#define LARGE_MOUSE_IMG_XSIZE 19 +#define LARGE_MOUSE_IMG_YSIZE 32 +#define SMALL_MOUSE_IMG_XSIZE 10 +#define SMALL_MOUSE_IMG_YSIZE 16 #define X 0xff /* any nonzero in And mask means part of cursor */ #define B BORDER #define I INTERIOR -static byte StdAndMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = { - X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, - X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, - X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, - X,X,X,0,X,X,X,X,0,0,0,0,0,0,0,0, - X,X,0,0,X,X,X,X,0,0,0,0,0,0,0,0, - 0,0,0,0,0,X,X,X,X,0,0,0,0,0,0,0, - 0,0,0,0,0,X,X,X,X,0,0,0,0,0,0,0, - 0,0,0,0,0,0,X,X,0,0,0,0,0,0,0,0, +static byte LargeAndMask[] = { + X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,0, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,X,X,X,X,X,X,0,0,0,0,0,0,0, + X,X,X,X,X,X,0,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,0,0,X,X,X,X,X,X,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,X,X,X,X,X,X,0,0,0,0,0, + X,X,X,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0,0, + X,X,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0, + 0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0, + 0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0, + 0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,X,X,X,X,0,0,0, }; -static byte StdOrMask[MOUSE_IMG_SIZE*MOUSE_IMG_SIZE] = { - B,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, - B,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0, - B,I,I,I,I,I,B,B,B,B,0,0,0,0,0,0, - B,I,I,B,I,I,B,0,0,0,0,0,0,0,0,0, - B,I,B,0,B,I,I,B,0,0,0,0,0,0,0,0, - B,B,0,0,B,I,I,B,0,0,0,0,0,0,0,0, - 0,0,0,0,0,B,I,I,B,0,0,0,0,0,0,0, - 0,0,0,0,0,B,I,I,B,0,0,0,0,0,0,0, - 0,0,0,0,0,0,B,B,0,0,0,0,0,0,0,0, +static byte LargeOrMask[] = { + B,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B,0, + B,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,I,B, + B,I,I,I,I,I,I,I,I,I,I,B,B,B,B,B,B,B,B, + B,I,I,I,I,I,I,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,I,B,I,I,I,I,B,0,0,0,0,0,0,0, + B,I,I,I,I,B,0,B,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,I,B,0,0,B,I,I,I,I,B,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,B,I,I,I,I,B,0,0,0,0,0, + B,I,B,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0,0, + B,B,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0, + 0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0, + 0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0, + 0,0,0,0,0,0,0,0,0,0,0,B,I,I,I,I,B,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,B,B,B,B,0,0,0, }; +static byte SmallAndMask[] = { + X,X,0,0,0,0,0,0,0,0, + X,X,X,0,0,0,0,0,0,0, + X,X,X,X,0,0,0,0,0,0, + X,X,X,X,X,0,0,0,0,0, + X,X,X,X,X,X,0,0,0,0, + X,X,X,X,X,X,X,0,0,0, + X,X,X,X,X,X,X,X,0,0, + X,X,X,X,X,X,X,X,X,0, + X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,X,X,X, + X,X,X,X,X,X,X,0,0,0, + X,X,X,0,X,X,X,X,0,0, + X,X,0,0,X,X,X,X,0,0, + 0,0,0,0,0,X,X,X,X,0, + 0,0,0,0,0,X,X,X,X,0, + 0,0,0,0,0,0,X,X,0,0, +}; +static byte SmallOrMask[] = { + B,B,0,0,0,0,0,0,0,0, + B,I,B,0,0,0,0,0,0,0, + B,I,I,B,0,0,0,0,0,0, + B,I,I,I,B,0,0,0,0,0, + B,I,I,I,I,B,0,0,0,0, + B,I,I,I,I,I,B,0,0,0, + B,I,I,I,I,I,I,B,0,0, + B,I,I,I,I,I,I,I,B,0, + B,I,I,I,I,I,I,I,I,B, + B,I,I,I,I,I,B,B,B,B, + B,I,I,B,I,I,B,0,0,0, + B,I,B,0,B,I,I,B,0,0, + B,B,0,0,B,I,I,B,0,0, + 0,0,0,0,0,B,I,I,B,0, + 0,0,0,0,0,B,I,I,B,0, + 0,0,0,0,0,0,B,B,0,0, +}; #undef X #undef B #undef I -static VGLBitmap VGLMouseStdAndMask = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdAndMask); -static VGLBitmap VGLMouseStdOrMask = - VGLBITMAP_INITIALIZER(MEMBUF, MOUSE_IMG_SIZE, MOUSE_IMG_SIZE, StdOrMask); +static VGLBitmap VGLMouseLargeAndMask = + VGLBITMAP_INITIALIZER(MEMBUF, LARGE_MOUSE_IMG_XSIZE, LARGE_MOUSE_IMG_YSIZE, + LargeAndMask); +static VGLBitmap VGLMouseLargeOrMask = + VGLBITMAP_INITIALIZER(MEMBUF, LARGE_MOUSE_IMG_XSIZE, LARGE_MOUSE_IMG_YSIZE, + LargeOrMask); +static VGLBitmap VGLMouseSmallAndMask = + VGLBITMAP_INITIALIZER(MEMBUF, SMALL_MOUSE_IMG_XSIZE, SMALL_MOUSE_IMG_YSIZE, + SmallAndMask); +static VGLBitmap VGLMouseSmallOrMask = + VGLBITMAP_INITIALIZER(MEMBUF, SMALL_MOUSE_IMG_XSIZE, SMALL_MOUSE_IMG_YSIZE, + SmallOrMask); static VGLBitmap *VGLMouseAndMask, *VGLMouseOrMask; static int VGLMouseShown = VGL_MOUSEHIDE; static int VGLMouseXpos = 0; @@ -113,17 +193,17 @@ __VGLMouseMode(int mode) if (mode == VGL_MOUSESHOW) { if (VGLMouseShown == VGL_MOUSEHIDE) { VGLMouseShown = VGL_MOUSESHOW; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, - MOUSE_IMG_SIZE, -MOUSE_IMG_SIZE); + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, + VGLDisplay, VGLMouseXpos, VGLMouseYpos, + VGLMouseAndMask->VXsize, -VGLMouseAndMask->VYsize); } } else { if (VGLMouseShown == VGL_MOUSESHOW) { VGLMouseShown = VGL_MOUSEHIDE; - __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, VGLDisplay, - VGLMouseXpos, VGLMouseYpos, - MOUSE_IMG_SIZE, MOUSE_IMG_SIZE); + __VGLBitmapCopy(&VGLVDisplay, VGLMouseXpos, VGLMouseYpos, + VGLDisplay, VGLMouseXpos, VGLMouseYpos, + VGLMouseAndMask->VXsize, VGLMouseAndMask->VYsize); } } INTON(); @@ -193,13 +273,17 @@ VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask void VGLMouseSetStdImage() { - VGLMouseSetImage(&VGLMouseStdAndMask, &VGLMouseStdOrMask); + if (VGLDisplay->VXsize > 800) + VGLMouseSetImage(&VGLMouseLargeAndMask, &VGLMouseLargeOrMask); + else + VGLMouseSetImage(&VGLMouseSmallAndMask, &VGLMouseSmallOrMask); } int VGLMouseInit(int mode) { struct mouse_info mouseinfo; + VGLBitmap *ormask; int andmask, border, error, i, interior; switch (VGLModeInfo.vi_mem_model) { @@ -226,9 +310,14 @@ VGLMouseInit(int mode) border = strtoul(getenv("VGLMOUSEBORDERCOLOR"), NULL, 0); if (getenv("VGLMOUSEINTERIORCOLOR") != NULL) interior = strtoul(getenv("VGLMOUSEINTERIORCOLOR"), NULL, 0); - for (i = 0; i < MOUSE_IMG_SIZE*MOUSE_IMG_SIZE; i++) - VGLMouseStdOrMask.Bitmap[i] = VGLMouseStdOrMask.Bitmap[i] == BORDER ? - border : VGLMouseStdOrMask.Bitmap[i] == INTERIOR ? interior : 0; + ormask = &VGLMouseLargeOrMask; + for (i = 0; i < ormask->VXsize * ormask->VYsize; i++) + ormask->Bitmap[i] = ormask->Bitmap[i] == BORDER ? border : + ormask->Bitmap[i] == INTERIOR ? interior : 0; + ormask = &VGLMouseSmallOrMask; + for (i = 0; i < ormask->VXsize * ormask->VYsize; i++) + ormask->Bitmap[i] = ormask->Bitmap[i] == BORDER ? border : + ormask->Bitmap[i] == INTERIOR ? interior : 0; VGLMouseSetStdImage(); mouseinfo.operation = MOUSE_MODE; mouseinfo.u.mode.signal = SIGUSR2; @@ -283,9 +372,10 @@ VGLMouseFreezeXY(int x, int y) INTOFF(); if (VGLMouseShown != VGL_MOUSESHOW) return 0; - if (x >= VGLMouseXpos && x < VGLMouseXpos + MOUSE_IMG_SIZE && - y >= VGLMouseYpos && y < VGLMouseYpos + MOUSE_IMG_SIZE && - VGLMouseAndMask->Bitmap[(y-VGLMouseYpos)*MOUSE_IMG_SIZE+(x-VGLMouseXpos)]) + if (x >= VGLMouseXpos && x < VGLMouseXpos + VGLMouseAndMask->VXsize && + y >= VGLMouseYpos && y < VGLMouseYpos + VGLMouseAndMask->VYsize && + VGLMouseAndMask->Bitmap[(y-VGLMouseYpos)*VGLMouseAndMask->VXsize+ + (x-VGLMouseXpos)]) return 1; return 0; } @@ -298,13 +388,13 @@ VGLMouseOverlap(int x, int y, int width, int hight) if (VGLMouseShown != VGL_MOUSESHOW) return 0; if (x > VGLMouseXpos) - overlap = (VGLMouseXpos + MOUSE_IMG_SIZE) - x; + overlap = (VGLMouseXpos + VGLMouseAndMask->VXsize) - x; else overlap = (x + width) - VGLMouseXpos; if (overlap <= 0) return 0; if (y > VGLMouseYpos) - overlap = (VGLMouseYpos + MOUSE_IMG_SIZE) - y; + overlap = (VGLMouseYpos + VGLMouseAndMask->VYsize) - y; else overlap = (y + hight) - VGLMouseYpos; return overlap > 0; @@ -319,10 +409,10 @@ VGLMouseMerge(int x, int y, int width, byte *line) if (xstart < VGLMouseXpos) xstart = VGLMouseXpos; xend = x + width; - if (xend > VGLMouseXpos + MOUSE_IMG_SIZE) - xend = VGLMouseXpos + MOUSE_IMG_SIZE; + if (xend > VGLMouseXpos + VGLMouseAndMask->VXsize) + xend = VGLMouseXpos + VGLMouseAndMask->VXsize; for (x1 = xstart; x1 < xend; x1++) { - pos = (y - VGLMouseYpos) * MOUSE_IMG_SIZE + x1 - VGLMouseXpos; + pos = (y - VGLMouseYpos) * VGLMouseAndMask->VXsize + x1 - VGLMouseXpos; if (VGLMouseAndMask->Bitmap[pos]) bcopy(&VGLMouseOrMask->Bitmap[pos * VGLDisplay->PixelBytes], &line[(x1 - x) * VGLDisplay->PixelBytes], VGLDisplay->PixelBytes); From owner-svn-src-head@freebsd.org Mon Apr 29 16:27:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A9CC1595CB8; Mon, 29 Apr 2019 16:27:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 307E78B694; Mon, 29 Apr 2019 16:27:17 +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 01D052485E; Mon, 29 Apr 2019 16:27:17 +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 x3TGRGT3076548; Mon, 29 Apr 2019 16:27:16 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGRGJp076543; Mon, 29 Apr 2019 16:27:16 GMT (envelope-from br@FreeBSD.org) Message-Id: <201904291627.x3TGRGJp076543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 29 Apr 2019 16:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346896 - in head/sys/dev: altera/atse altera/softdma xdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys/dev: altera/atse altera/softdma xdma X-SVN-Commit-Revision: 346896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 307E78B694 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:27:17 -0000 Author: br Date: Mon Apr 29 16:27:15 2019 New Revision: 346896 URL: https://svnweb.freebsd.org/changeset/base/346896 Log: o Rewrite softdma_process_tx() of Altera SoftDMA engine driver so it does not require a bounce buffer. The only need for this was to align the buffer address. Implement unaligned access and we don't need to copy data twice. o Remove contigmalloc-based bounce buffer from xDMA code since it is not suitable for arbitrary memory provided by platform, which is sometimes a dedicated piece of memory that is not managed by OS at all. Sponsored by: DARPA, AFRL Modified: head/sys/dev/altera/atse/if_atse.c head/sys/dev/altera/softdma/softdma.c head/sys/dev/xdma/xdma.h head/sys/dev/xdma/xdma_mbuf.c head/sys/dev/xdma/xdma_sg.c Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/altera/atse/if_atse.c Mon Apr 29 16:27:15 2019 (r346896) @@ -1290,7 +1290,7 @@ atse_attach(device_t dev) * Chapter 15. On-Chip FIFO Memory Core. * Embedded Peripherals IP User Guide. */ - caps = XCHAN_CAP_BUSDMA_NOSEG; + caps = XCHAN_CAP_NOSEG; /* Alloc xDMA virtual channel. */ sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, caps); @@ -1456,6 +1456,11 @@ atse_detach(device_t dev) } mtx_destroy(&sc->atse_mtx); + + xdma_channel_free(sc->xchan_tx); + xdma_channel_free(sc->xchan_rx); + xdma_put(sc->xdma_tx); + xdma_put(sc->xdma_rx); return (0); } Modified: head/sys/dev/altera/softdma/softdma.c ============================================================================== --- head/sys/dev/altera/softdma/softdma.c Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/altera/softdma/softdma.c Mon Apr 29 16:27:15 2019 (r346896) @@ -190,6 +190,18 @@ softdma_fill_level(struct softdma_softc *sc) return (val); } +static uint32_t +fifo_fill_level_wait(struct softdma_softc *sc) +{ + uint32_t val; + + do + val = softdma_fill_level(sc); + while (val == AVALON_FIFO_TX_BASIC_OPTS_DEPTH); + + return (val); +} + static void softdma_intr(void *arg) { @@ -287,86 +299,96 @@ static int softdma_process_tx(struct softdma_channel *chan, struct softdma_desc *desc) { struct softdma_softc *sc; - uint32_t src_offs, dst_offs; + uint64_t addr; + uint64_t buf; + uint32_t word; + uint32_t missing; uint32_t reg; - uint32_t fill_level; - uint32_t leftm; - uint32_t tmp; - uint32_t val; - uint32_t c; + int got_bits; + int len; sc = chan->sc; - fill_level = softdma_fill_level(sc); - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) - fill_level = softdma_fill_level(sc); + fifo_fill_level_wait(sc); /* Set start of packet. */ - if (desc->control & CONTROL_GEN_SOP) { - reg = 0; - reg |= A_ONCHIP_FIFO_MEM_CORE_SOP; - softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); - } + if (desc->control & CONTROL_GEN_SOP) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_SOP); - src_offs = dst_offs = 0; - c = 0; - while ((desc->len - c) >= 4) { - val = *(uint32_t *)(desc->src_addr + src_offs); - bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, val); - if (desc->src_incr) - src_offs += 4; - if (desc->dst_incr) - dst_offs += 4; - fill_level += 1; + got_bits = 0; + buf = 0; - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) { - fill_level = softdma_fill_level(sc); - } - c += 4; + addr = desc->src_addr; + len = desc->len; + + if (addr & 1) { + buf = (buf << 8) | *(uint8_t *)addr; + got_bits += 8; + addr += 1; + len -= 1; } - val = 0; - leftm = (desc->len - c); + if (len >= 2 && addr & 2) { + buf = (buf << 16) | *(uint16_t *)addr; + got_bits += 16; + addr += 2; + len -= 2; + } - switch (leftm) { - case 1: - val = *(uint8_t *)(desc->src_addr + src_offs); - val <<= 24; - src_offs += 1; - break; - case 2: - case 3: - val = *(uint16_t *)(desc->src_addr + src_offs); - val <<= 16; - src_offs += 2; + while (len >= 4) { + buf = (buf << 32) | (uint64_t)*(uint32_t *)addr; + addr += 4; + len -= 4; + word = (uint32_t)((buf >> got_bits) & 0xffffffff); - if (leftm == 3) { - tmp = *(uint8_t *)(desc->src_addr + src_offs); - val |= (tmp << 8); - src_offs += 1; - } - break; - case 0: - default: - break; + fifo_fill_level_wait(sc); + if (len == 0 && got_bits == 0 && + (desc->control & CONTROL_GEN_EOP) != 0) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_EOP); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); } - /* Set end of packet. */ - reg = 0; - if (desc->control & CONTROL_GEN_EOP) - reg |= A_ONCHIP_FIFO_MEM_CORE_EOP; - reg |= ((4 - leftm) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); - softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); + if (len & 2) { + buf = (buf << 16) | *(uint16_t *)addr; + got_bits += 16; + addr += 2; + len -= 2; + } - /* Ensure there is a FIFO entry available. */ - fill_level = softdma_fill_level(sc); - while (fill_level == AVALON_FIFO_TX_BASIC_OPTS_DEPTH) - fill_level = softdma_fill_level(sc); + if (len & 1) { + buf = (buf << 8) | *(uint8_t *)addr; + got_bits += 8; + addr += 1; + len -= 1; + } - /* Final write */ - bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, val); + if (got_bits >= 32) { + got_bits -= 32; + word = (uint32_t)((buf >> got_bits) & 0xffffffff); - return (dst_offs); + fifo_fill_level_wait(sc); + if (len == 0 && got_bits == 0 && + (desc->control & CONTROL_GEN_EOP) != 0) + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, + A_ONCHIP_FIFO_MEM_CORE_EOP); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); + } + + if (got_bits) { + missing = 32 - got_bits; + got_bits /= 8; + + fifo_fill_level_wait(sc); + reg = A_ONCHIP_FIFO_MEM_CORE_EOP | + ((4 - got_bits) << A_ONCHIP_FIFO_MEM_CORE_EMPTY_SHIFT); + softdma_mem_write(sc, A_ONCHIP_FIFO_MEM_CORE_METADATA, reg); + word = (uint32_t)((buf << missing) & 0xffffffff); + bus_write_4(sc->res[0], A_ONCHIP_FIFO_MEM_CORE_DATA, word); + } + + return (desc->len); } static int @@ -594,6 +616,8 @@ softdma_channel_alloc(device_t dev, struct xdma_channe if (chan->used == 0) { chan->xchan = xchan; xchan->chan = (void *)chan; + xchan->caps |= XCHAN_CAP_NOBUFS; + xchan->caps |= XCHAN_CAP_NOSEG; chan->index = i; chan->idx_head = 0; chan->idx_tail = 0; Modified: head/sys/dev/xdma/xdma.h ============================================================================== --- head/sys/dev/xdma/xdma.h Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/xdma/xdma.h Mon Apr 29 16:27:15 2019 (r346896) @@ -84,7 +84,6 @@ struct xchan_buf { bus_dmamap_t map; uint32_t nsegs; uint32_t nsegs_left; - void *cbuf; }; struct xdma_request { @@ -130,7 +129,8 @@ struct xdma_channel { uint32_t caps; #define XCHAN_CAP_BUSDMA (1 << 0) -#define XCHAN_CAP_BUSDMA_NOSEG (1 << 1) +#define XCHAN_CAP_NOSEG (1 << 1) +#define XCHAN_CAP_NOBUFS (1 << 2) /* A real hardware driver channel. */ void *chan; Modified: head/sys/dev/xdma/xdma_mbuf.c ============================================================================== --- head/sys/dev/xdma/xdma_mbuf.c Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/xdma/xdma_mbuf.c Mon Apr 29 16:27:15 2019 (r346896) @@ -136,19 +136,15 @@ xdma_mbuf_defrag(xdma_channel_t *xchan, struct xdma_re if (c == 1) return (c); /* Nothing to do. */ - if (xchan->caps & XCHAN_CAP_BUSDMA) { - if ((xchan->caps & XCHAN_CAP_BUSDMA_NOSEG) || \ - (c > xchan->maxnsegs)) { - if ((m = m_defrag(xr->m, M_NOWAIT)) == NULL) { - device_printf(xdma->dma_dev, - "%s: Can't defrag mbuf\n", - __func__); - return (c); - } - xr->m = m; - c = 1; - } + if ((m = m_defrag(xr->m, M_NOWAIT)) == NULL) { + device_printf(xdma->dma_dev, + "%s: Can't defrag mbuf\n", + __func__); + return (c); } + + xr->m = m; + c = 1; return (c); } Modified: head/sys/dev/xdma/xdma_sg.c ============================================================================== --- head/sys/dev/xdma/xdma_sg.c Mon Apr 29 16:26:29 2019 (r346895) +++ head/sys/dev/xdma/xdma_sg.c Mon Apr 29 16:27:15 2019 (r346896) @@ -69,14 +69,7 @@ _xchan_bufs_alloc(xdma_channel_t *xchan) for (i = 0; i < xchan->xr_num; i++) { xr = &xchan->xr_mem[i]; - xr->buf.cbuf = contigmalloc(xchan->maxsegsize, - M_XDMA, 0, 0, ~0, PAGE_SIZE, 0); - if (xr->buf.cbuf == NULL) { - device_printf(xdma->dev, - "%s: Can't allocate contiguous kernel" - " physical memory\n", __func__); - return (-1); - } + /* TODO: bounce buffer */ } return (0); @@ -179,7 +172,7 @@ xchan_bufs_free(xdma_channel_t *xchan) } else { for (i = 0; i < xchan->xr_num; i++) { xr = &xchan->xr_mem[i]; - contigfree(xr->buf.cbuf, xchan->maxsegsize, M_XDMA); + /* TODO: bounce buffer */ } } @@ -245,17 +238,19 @@ xdma_prep_sg(xdma_channel_t *xchan, uint32_t xr_num, return (-1); } - /* Allocate bufs. */ - ret = xchan_bufs_alloc(xchan); - if (ret != 0) { - device_printf(xdma->dev, - "%s: Can't allocate bufs.\n", __func__); + /* Allocate buffers if required. */ + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0) { + ret = xchan_bufs_alloc(xchan); + if (ret != 0) { + device_printf(xdma->dev, + "%s: Can't allocate bufs.\n", __func__); - /* Cleanup */ - xchan_sglist_free(xchan); - xchan_bank_free(xchan); + /* Cleanup */ + xchan_sglist_free(xchan); + xchan_bank_free(xchan); - return (-1); + return (-1); + } } xchan->flags |= (XCHAN_CONFIGURED | XCHAN_TYPE_SG); @@ -442,14 +437,8 @@ _xdma_load_data(xdma_channel_t *xchan, struct xdma_req switch (xr->req_type) { case XR_TYPE_MBUF: - if (xr->direction == XDMA_MEM_TO_DEV) { - m_copydata(m, 0, m->m_pkthdr.len, xr->buf.cbuf); - seg[0].ds_addr = (bus_addr_t)xr->buf.cbuf; - seg[0].ds_len = m->m_pkthdr.len; - } else { - seg[0].ds_addr = mtod(m, bus_addr_t); - seg[0].ds_len = m->m_pkthdr.len; - } + seg[0].ds_addr = mtod(m, bus_addr_t); + seg[0].ds_len = m->m_pkthdr.len; break; case XR_TYPE_BIO: case XR_TYPE_VIRT: @@ -516,7 +505,9 @@ xdma_process(xdma_channel_t *xchan, TAILQ_FOREACH_SAFE(xr, &xchan->queue_in, xr_next, xr_tmp) { switch (xr->req_type) { case XR_TYPE_MBUF: - c = xdma_mbuf_defrag(xchan, xr); + if ((xchan->caps & XCHAN_CAP_NOSEG) || + (c > xchan->maxnsegs)) + c = xdma_mbuf_defrag(xchan, xr); break; case XR_TYPE_BIO: case XR_TYPE_VIRT: @@ -571,7 +562,8 @@ xdma_queue_submit_sg(xdma_channel_t *xchan) sg = xchan->sg; - if ((xchan->flags & XCHAN_BUFS_ALLOCATED) == 0) { + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0 && + (xchan->flags & XCHAN_BUFS_ALLOCATED) == 0) { device_printf(xdma->dev, "%s: Can't submit a transfer: no bufs\n", __func__); From owner-svn-src-head@freebsd.org Mon Apr 29 16:50:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9847E159633A; Mon, 29 Apr 2019 16:50:34 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3EDE58C014; Mon, 29 Apr 2019 16:50:34 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BDDE24BE4; Mon, 29 Apr 2019 16:50:34 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TGoXl9086938; Mon, 29 Apr 2019 16:50:33 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TGoXxB086936; Mon, 29 Apr 2019 16:50:33 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201904291650.x3TGoXxB086936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 29 Apr 2019 16:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346897 - in head/sys: conf powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: in head/sys: conf powerpc/conf X-SVN-Commit-Revision: 346897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3EDE58C014 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 16:50:34 -0000 Author: luporl Date: Mon Apr 29 16:50:33 2019 New Revision: 346897 URL: https://svnweb.freebsd.org/changeset/base/346897 Log: [PPC64] Turn opal_flash.c into a device This change makes it easier to enable/disable the inclusion of OPAL flash in the kernel. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20098 Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/GENERIC64 Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon Apr 29 16:27:15 2019 (r346896) +++ head/sys/conf/files.powerpc Mon Apr 29 16:50:33 2019 (r346897) @@ -191,7 +191,7 @@ powerpc/powernv/opal.c optional powernv powerpc/powernv/opal_async.c optional powernv powerpc/powernv/opal_console.c optional powernv powerpc/powernv/opal_dev.c optional powernv -powerpc/powernv/opal_flash.c optional powernv +powerpc/powernv/opal_flash.c optional powernv opalflash powerpc/powernv/opal_hmi.c optional powernv powerpc/powernv/opal_i2c.c optional iicbus fdt powernv powerpc/powernv/opal_i2cm.c optional iicbus fdt powernv Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Mon Apr 29 16:27:15 2019 (r346896) +++ head/sys/powerpc/conf/GENERIC64 Mon Apr 29 16:50:33 2019 (r346897) @@ -236,6 +236,7 @@ device powermac_nvram # Open Firmware configuration N device smu # Apple System Management Unit device atibl # ATI-based backlight driver for PowerBooks/iBooks device nvbl # nVidia-based backlight driver for PowerBooks/iBooks +device opalflash # PowerNV embedded flash memory # ADB support device adb From owner-svn-src-head@freebsd.org Mon Apr 29 18:09:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32EE1597C5C; Mon, 29 Apr 2019 18:09:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 756E48E93D; Mon, 29 Apr 2019 18:09:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4821525A27; Mon, 29 Apr 2019 18:09:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TI9utx028539; Mon, 29 Apr 2019 18:09:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TI9uVc028538; Mon, 29 Apr 2019 18:09:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904291809.x3TI9uVc028538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 29 Apr 2019 18:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346898 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 346898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 756E48E93D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:09:57 -0000 Author: mav Date: Mon Apr 29 18:09:55 2019 New Revision: 346898 URL: https://svnweb.freebsd.org/changeset/base/346898 Log: ip multicast debug: fix strings vs defines Turning on multicast debug made multicast failure worse because the strings and #define values no longer matched up. Fix them, and make sure they stay matched-up. Submitted by: torek MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Mon Apr 29 16:50:33 2019 (r346897) +++ head/sys/netinet/in_mcast.c Mon Apr 29 18:09:55 2019 (r346898) @@ -3067,7 +3067,14 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_ARGS) #if defined(KTR) && (KTR_COMPILE & KTR_IGMPV3) -static const char *inm_modestrs[] = { "un", "in", "ex" }; +static const char *inm_modestrs[] = { + [MCAST_UNDEFINED] = "un", + [MCAST_INCLUDE] = "in", + [MCAST_EXCLUDE] = "ex", +}; +_Static_assert(MCAST_UNDEFINED == 0 && + MCAST_EXCLUDE + 1 == nitems(inm_modestrs), + "inm_modestrs: no longer matches #defines"); static const char * inm_mode_str(const int mode) @@ -3079,16 +3086,20 @@ inm_mode_str(const int mode) } static const char *inm_statestrs[] = { - "not-member", - "silent", - "idle", - "lazy", - "sleeping", - "awakening", - "query-pending", - "sg-query-pending", - "leaving" + [IGMP_NOT_MEMBER] = "not-member", + [IGMP_SILENT_MEMBER] = "silent", + [IGMP_REPORTING_MEMBER] = "reporting", + [IGMP_IDLE_MEMBER] = "idle", + [IGMP_LAZY_MEMBER] = "lazy", + [IGMP_SLEEPING_MEMBER] = "sleeping", + [IGMP_AWAKENING_MEMBER] = "awakening", + [IGMP_G_QUERY_PENDING_MEMBER] = "query-pending", + [IGMP_SG_QUERY_PENDING_MEMBER] = "sg-query-pending", + [IGMP_LEAVING_MEMBER] = "leaving", }; +_Static_assert(IGMP_NOT_MEMBER == 0 && + IGMP_LEAVING_MEMBER + 1 == nitems(inm_statestrs), + "inm_statetrs: no longer matches #defines"); static const char * inm_state_str(const int state) From owner-svn-src-head@freebsd.org Mon Apr 29 18:20:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C332E1598643; Mon, 29 Apr 2019 18:20:52 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 652188F995; Mon, 29 Apr 2019 18:20:52 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EB0125BEE; Mon, 29 Apr 2019 18:20:52 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TIKqjx035235; Mon, 29 Apr 2019 18:20:52 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TIKqsx035234; Mon, 29 Apr 2019 18:20:52 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201904291820.x3TIKqsx035234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Mon, 29 Apr 2019 18:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346899 - head X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 346899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 652188F995 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:20:52 -0000 Author: zeising (doc,ports committer) Date: Mon Apr 29 18:20:51 2019 New Revision: 346899 URL: https://svnweb.freebsd.org/changeset/base/346899 Log: Add a note to MAINTAINERS for lkpi for graphics Add a note to MAINTAINERS requesting pre-commit review from the graphics team, using phabricator, for changes to the lkpi subsystem. This is done in order to give us a chance to test the graphics drivers (drm drivers) for regressions, and to try to avoid breakage, errors and issues with the graphics drivers. The review is done via the #x11 group on phabricator. Please note that hselasky also want to review changes. Discussed with: hselasky, imp Approved by: imp Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Apr 29 18:09:55 2019 (r346898) +++ head/MAINTAINERS Mon Apr 29 18:20:51 2019 (r346899) @@ -90,6 +90,10 @@ share/mk/*.test.mk freebsd-testing,ngie (same list as stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested sys/compat/linuxkpi hselasky If in doubt, ask. + zeising, johalun pre-commit review requested via + #x11 phabricator group. + (to avoid drm graphics drivers + inpact) sys/contrib/ipfilter cy Pre-commit review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. From owner-svn-src-head@freebsd.org Mon Apr 29 18:48:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 120C315991C2; Mon, 29 Apr 2019 18:48:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA76D6A4ED; Mon, 29 Apr 2019 18:48:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83849260FA; Mon, 29 Apr 2019 18:48:43 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TImhua050924; Mon, 29 Apr 2019 18:48:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TImhRl050923; Mon, 29 Apr 2019 18:48:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201904291848.x3TImhRl050923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Mon, 29 Apr 2019 18:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346904 - head X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 346904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA76D6A4ED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:48:44 -0000 Author: ngie Date: Mon Apr 29 18:48:43 2019 New Revision: 346904 URL: https://svnweb.freebsd.org/changeset/base/346904 Log: Update/reformat maintainer entries that I am a part of * Replace all instances of freebsd-testing with `#test`. `#test` is the Phabricator group that focuses on test-related reviews. * Replace `atf` with contrib/atf, as that's the actual location for the test framework. * Remove jmmv@ from the maintainers list for atf. He is the upstream project owner, but was moved to alumni status after r345787. * Fix a typo accidentally introduced in r346899 (inpact -> impact). Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Apr 29 18:37:39 2019 (r346903) +++ head/MAINTAINERS Mon Apr 29 18:48:43 2019 (r346904) @@ -35,17 +35,19 @@ makes a commit to the specified subtree. subsystem login notes ----------------------------- -atf freebsd-testing,jmmv,ngie Pre-commit review requested. ath(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +contrib/atf ngie,#test Pre-commit review requested. +contrib/capsicum-test ngie,#capsicum,#test Pre-commit review requested. contrib/compiler-rt dim Pre-commit review preferred. +contrib/googletest ngie,#test Pre-commit review requested. contrib/ipfilter cy Pre-commit review requested. contrib/libc++ dim Pre-commit review preferred. contrib/libcxxrt dim Pre-commit review preferred. contrib/libunwind dim,emaste,jhb Pre-commit review preferred. contrib/llvm dim Pre-commit review preferred. contrib/llvm/tools/lldb dim,emaste Pre-commit review preferred. -contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. -contrib/pjdfstest freebsd-testing,asomers,ngie,pjd Pre-commit review requested. +contrib/netbsd-tests ngie,#test Pre-commit review requested. +contrib/pjdfstest asomers,ngie,pjd,#test Pre-commit review requested. *env(3) secteam Due to the problematic security history of this code, please have patches reviewed by secteam. etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. @@ -86,14 +88,15 @@ sh(1) jilles Pre-commit review requested. This also to kill(1), printf(1) and test(1) which are compiled in as builtins. share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. -share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. +share/mk/*.test.mk imp,bapt,bdrewery, Pre-commit review requested. + emaste,ngie,sjg,#test stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested -sys/compat/linuxkpi hselasky If in doubt, ask. +sys/compat/linuxkpi hselasky If in doubt, ask. zeising, johalun pre-commit review requested via #x11 phabricator group. (to avoid drm graphics drivers - inpact) + impact) sys/contrib/ipfilter cy Pre-commit review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. @@ -105,7 +108,7 @@ sys/netinet/ip_carp.c glebius Pre-commit review recomm sys/netpfil/pf kp,glebius Pre-commit review recommended. sys/x86/xen royger Pre-commit review recommended. sys/xen royger Pre-commit review recommended. -tests freebsd-testing,ngie Pre-commit review requested. +tests ngie,#test Pre-commit review requested. tools/build imp Pre-commit review requested, especially to fix bootstrap issues. top(1) eadler Pre-commit review requested. usr.sbin/bsdconfig dteske Pre-commit phabricator review requested. From owner-svn-src-head@freebsd.org Mon Apr 29 18:50:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E12515992DF; Mon, 29 Apr 2019 18:50:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89C416A703; Mon, 29 Apr 2019 18:50:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pl1-x632.google.com with SMTP id o5so5485197pls.12; Mon, 29 Apr 2019 11:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8T0ZIYzPcMUnYOs78qYwoFdRajm6401qH8h6cT1PMfw=; b=mj/W4I8cgnBnzA6D00xybiT7bJUODCKxQydZ+on56BaqGsVu848boSpGDNcqlAStz6 lfI8djbLumM6XxaJOg0PtU0iLENBEAFECL6gzG3bjgLzNCJEmbmBC6rV8Fpwcu/c0H3N IeI3nVFaCGfqxeKvDGcSW/UqGnodl8ghZjE2Zbi4b2o3YVoe94ist6LNPpiZsn8TS0Aw 31moKjDb0NW6wnsIWN4kS8Gzzh5etJkd8NojVJo2xfTKjzfsw90XjRG/aHONN16wmhBQ sFCAy54jhGkHIZpQ9SKOtZYMwvFCdK6GEAfHEz9RJHo6C/4lO2kGEebfRWVMpi1+hzSM VbgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8T0ZIYzPcMUnYOs78qYwoFdRajm6401qH8h6cT1PMfw=; b=g3ua1wfWgE3Fqgu8FSkn8h4olJgmUeOLaY8XQ/ya7+gMF+TfkS+b9OFnmggBhiZIw5 SunXLDId3uYxgbzjem7bh0fINgTwQnuWHcX0fVF/gRMT5Phb3eXZZTy6xv0hrvf8vCQZ Vxr0RLqmsSTQmQqJHkltGGLVQVk1pOeHF6SRcTkg1GZjhrbdp9/W0yHuhGvsOl14T9kX SGfG0cHRtxme1zLHS17vJTJmtuEI0UQFbUl1buvvGL3yF0RNFKU9QaFbT6UqHCk3WRv5 egfmqPHa400US/ny/ha55iDRXEhQeO2nEb95+U/xbh8bEwcHCMCkW5Lww2AwsGATMLiD jPPQ== X-Gm-Message-State: APjAAAV1bdkLD0Xl4dntwanGVSiQxpwG6yoAyB0WsluX7bO03fA1YZ1C e39E053k2BQV/deQfUUhLM+zP1K9AVI= X-Google-Smtp-Source: APXvYqyvW27z7ceK5XuM2TDZybTrmMKr5XcklNfkpAHxx98t0F5oHo3utur6uA/m/bUKdg4xwDRgyg== X-Received: by 2002:a17:902:bd92:: with SMTP id q18mr64517473pls.136.1556563836114; Mon, 29 Apr 2019 11:50:36 -0700 (PDT) Received: from [192.168.20.7] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i15sm46232564pfd.162.2019.04.29.11.50.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 11:50:35 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346904 - head From: Enji Cooper In-Reply-To: <201904291848.x3TImhRl050923@repo.freebsd.org> Date: Mon, 29 Apr 2019 11:50:34 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <0844616A-920B-4E53-A71D-8FFAE6455B3E@gmail.com> References: <201904291848.x3TImhRl050923@repo.freebsd.org> To: Enji Cooper X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: 89C416A703 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 18:50:38 -0000 > On Apr 29, 2019, at 11:48 AM, Enji Cooper wrote: >=20 > Author: ngie > Date: Mon Apr 29 18:48:43 2019 > New Revision: 346904 > URL: https://svnweb.freebsd.org/changeset/base/346904 >=20 > Log: > Update/reformat maintainer entries that I am a part of >=20 > * Replace all instances of freebsd-testing with `#test`. `#test` is = the > Phabricator group that focuses on test-related reviews. > * Replace `atf` with contrib/atf, as that's the actual location for = the test > framework. > * Remove jmmv@ from the maintainers list for atf. He is the upstream = project > owner, but was moved to alumni status after r345787. > * Fix a typo accidentally introduced in r346899 (inpact -> impact). I failed to mention: * Add pre-commit maintainer entries for contrib/capsicum-test and = contrib/googletest . Cheers, -Enji= From owner-svn-src-head@freebsd.org Mon Apr 29 21:14:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4802B159E443; Mon, 29 Apr 2019 21:14:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2C5275978; Mon, 29 Apr 2019 21:14:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E82B411244; Mon, 29 Apr 2019 21:14:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: slavash@FreeBSD.org, Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> Date: Mon, 29 Apr 2019 14:14:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E2C5275978 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.92)[-0.918,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 21:14:23 -0000 On 4/25/19 12:10 AM, Slava Shwartsman wrote: > > > On 17-Apr-19 00:28, John Baldwin wrote: >> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>> Author: slavash >>>>> Date: Wed Dec 5 14:25:03 2018 >>>>> New Revision: 341586 >>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>> >>>>> Log: >>>>> mlx5en: Implement backpressure indication. >>>>> >>>>> The backpressure indication is implemented using an unlimited rate type of >>>>> mbuf send tag. When the upper layers typically the socket layer has obtained such >>>>> a tag, it can then query the destination driver queue for the current >>>>> amount of space available in the send queue. >>>>> >>>>> A single mbuf send tag may be referenced multiple times and a refcount has been added >>>>> to the mlx5e_priv structure to track its usage. Because the send tag resides >>>>> in the mlx5e_channel structure, there is no need to wait for refcounts to reach >>>>> zero until the mlx4en(4) driver is detached. The channels structure is persistant >>>>> during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed >>>>> without any need of synchronization. >>>>> >>>>> The mlx5e_snd_tag structure was extended to contain a type field, because there are now >>>>> two different tag types which end up in the driver which need to be distinguished. >>>>> >>>>> Submitted by: hselasky@ >>>>> Approved by: hselasky (mentor) >>>>> MFC after: 1 week >>>>> Sponsored by: Mellanox Technologies >>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >>>>> struct mlx5e_sq *sq; >>>>> int ret; >>>>> >>>>> - sq = mlx5e_select_queue(ifp, mb); >>>>> - if (unlikely(sq == NULL)) { >>>>> -#ifdef RATELIMIT >>>>> - /* Check for route change */ >>>>> - if (mb->m_pkthdr.snd_tag != NULL && >>>>> - mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>> + if (mb->m_pkthdr.snd_tag != NULL) { >>>>> + sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>> + if (unlikely(sq == NULL)) { >>>>> + /* Check for route change */ >>>>> + if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>> + /* Free mbuf */ >>>>> + m_freem(mb); >>>>> + >>>>> + /* >>>>> + * Tell upper layers about route >>>>> + * change and to re-transmit this >>>>> + * packet: >>>>> + */ >>>>> + return (EAGAIN); >>>>> + } >>>> >>>> Hi, >>>> >>>> I just discovered something strange and found that this commit is the >>>> cause. >>>> The test system has mlx5en 100G interface. It has two vlans: vlan500 and >>>> vlan100. >>>> Via vlan500 it receives some packets flows. Then it routes these packets >>>> into vlan100. >>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>> >>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>> CPU ID FUNCTION:NAME >>>> 23 54338 ip6_output:return 35 >>>> 16 54338 ip6_output:return 35 >>>> 21 54338 ip6_output:return 35 >>>> 22 54338 ip6_output:return 35 >>>> 24 54338 ip6_output:return 35 >>>> 23 54338 ip6_output:return 35 >>>> 14 54338 ip6_output:return 35 >>>> ^C >>>> >>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>> CPU ID FUNCTION:NAME >>>> 16 69030 mlx5e_xmit:return 35 >>>> 23 69030 mlx5e_xmit:return 35 >>>> 26 69030 mlx5e_xmit:return 35 >>>> 25 69030 mlx5e_xmit:return 35 >>>> 24 69030 mlx5e_xmit:return 35 >>>> 21 69030 mlx5e_xmit:return 35 >>>> 26 69030 mlx5e_xmit:return 35 >>>> ^C >>>> >>>> The kernel config is GENERIC. >>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>> >>> >>> Hi, >>> >>> This might be a case where rcvif in the mbuf's pktheader is not cleared >>> before the packet is fed back on the wire. >>> >>> John Baldwin is working on the send tags implementation, to eliminate >>> the EAGAIN handling in the network drivers. >> >> I will try to push this branch sooner then since it affects more than just >> TLS. Part of the change includes a new flag we can use to assert that we > Thanks John! >> aren't just getting a stale rcvif (though there are also now assertions in >> ip_output that should catch this case I think). >> > > > > Hi Andrey, > > Yes, we were able to reproduce this issue in house. If you don't mind, I > prefer to wait for John's update - where he eliminates the EAGAIN > handling in the network drivers. I have rebased the branch for this, but for now it will just panic sooner I believe by tripping an assertion. Can you grab the diff (or just the branch) from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce under a kernel with INVARIANTS? I think we will have to explicitly clear the 'rcvif' pointer somewhere, but I want to see what the stack trace looks like so I can think about the "right" place to clear it. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Apr 29 22:00:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD8A2159F100; Mon, 29 Apr 2019 22:00:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 817257741A; Mon, 29 Apr 2019 22:00:46 +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 4E9EF25B; Mon, 29 Apr 2019 22:00:46 +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 x3TM0kTN054462; Mon, 29 Apr 2019 22:00:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TM0k6f054461; Mon, 29 Apr 2019 22:00:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904292200.x3TM0k6f054461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Apr 2019 22:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346931 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 817257741A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:00:47 -0000 Author: jhb Date: Mon Apr 29 22:00:45 2019 New Revision: 346931 URL: https://svnweb.freebsd.org/changeset/base/346931 Log: Note that ccr(4) now supports AES-CCM. Modified: head/share/man/man4/ccr.4 Modified: head/share/man/man4/ccr.4 ============================================================================== --- head/share/man/man4/ccr.4 Mon Apr 29 21:55:39 2019 (r346930) +++ head/share/man/man4/ccr.4 Mon Apr 29 22:00:45 2019 (r346931) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2019 +.Dd April 29, 2019 .Dt CCR 4 .Os .Sh NAME @@ -34,7 +34,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: -.Bd -ragged -offset indeunt +.Bd -ragged -offset indent .Cd "device ccr" .Ed .Pp @@ -49,7 +49,7 @@ The .Nm driver provides support for the crypto accelerator engine included on PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6). -The driver accelerates AES-CBC, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, +The driver accelerates AES-CBC, AES-CCM, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, SHA2-256, SHA2-384, SHA2-512, SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for .Xr crypto 4 From owner-svn-src-head@freebsd.org Mon Apr 29 22:04:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26902159F2FF; Mon, 29 Apr 2019 22:04:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6483777E1; Mon, 29 Apr 2019 22:04:55 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf1-x435.google.com with SMTP id 188so5999860pfd.8; Mon, 29 Apr 2019 15:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sYPi+o9H/z0dwCOGvXwgCQloLsCgDU1ABb0IXTLTego=; b=ODRiZ4S+sZTCZ38VYXKANUoQmUUv1gXXtmjMYyPOtFBl6m8ywbvqBXKl1VT826lQVN 2iMCs9uHCYzyTH0LE95GSFDmh+owzNprF8v0He6kIJp4UmalLE+iNc5nXxg6liZVGRXG 9zljoulITDQUHg9YfYGXHptdppj34dYl5Y/A576hM9DI466TtzhH7eWBybww6jQYwPdp w4VBVLKm1a6bl9QyG1/4WmHOOOFWKwF/Rxf6XPTR4DzzMMxfgU203ZweUyPb3D2nxpAI qR0okp9ejVbavDUk1QXmbfFu6Ix9uxaohUrI06Bd2atqZQxDVnPBWoLPZSNb+LlvV6m/ 1UCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sYPi+o9H/z0dwCOGvXwgCQloLsCgDU1ABb0IXTLTego=; b=tG/5wZlC7m2Q3pNmvgTdQqXoraIfMwDzU0arpUlcG41YmkdoayhUx5P3wakoro5+J0 I8+7OzfDyFi+UWFt+531zzykl1QlyzTQDJcSVoPP0+PVlb3YOeD9jN+yEjqWrfL3lVof xG94kNAjB0N8ByHLCMoYHmzN/e3/6hxL3P8cLyZGLppI+8QJAE7a29NbiMQVp3VqmYhc AOp/DdybxHi0P4IRzkZcDy9HvO6OxsbZuPT5odikRsRg2+sGOQvXxddj/Fd7BjipIuFO ohmudsP0gIudrIHh9BQIPKl1O7F46Df/kAgRm4Qjgd9asGuox64RDRZZDARFnB/b/45/ ZBdw== X-Gm-Message-State: APjAAAUKe6rWvyowkqO/6bLMggmqOH+aCJjlXS8Vav7pL49K7KjC8fZY Ur6ar9Cf5hs//weWx37hz73MsHOO X-Google-Smtp-Source: APXvYqxbrZjdFyiXde1YLHsCaKtcges6G1QJ2/SufetJ5+kDbjjLSheheDSUOQ9BeiplOD1Q18aY1g== X-Received: by 2002:a65:64d3:: with SMTP id t19mr27046719pgv.57.1556575494013; Mon, 29 Apr 2019 15:04:54 -0700 (PDT) Received: from ?IPv6:2607:fb90:f2b:4107:b84d:cfff:19c5:bfd1? ([2607:fb90:f2b:4107:b84d:cfff:19c5:bfd1]) by smtp.gmail.com with ESMTPSA id 71sm91560146pfs.36.2019.04.29.15.04.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 15:04:53 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r346931 - head/share/man/man4 From: Enji Cooper X-Mailer: iPhone Mail (16E227) In-Reply-To: <201904292200.x3TM0k6f054461@repo.freebsd.org> Date: Mon, 29 Apr 2019 15:04:52 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <101FAB41-1F64-479C-81F7-6F5A1D1A0811@gmail.com> References: <201904292200.x3TM0k6f054461@repo.freebsd.org> To: John Baldwin X-Rspamd-Queue-Id: A6483777E1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.962,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:04:56 -0000 > On Apr 29, 2019, at 15:00, John Baldwin wrote: >=20 > Author: jhb > Date: Mon Apr 29 22:00:45 2019 > New Revision: 346931 > URL: https://svnweb.freebsd.org/changeset/base/346931 >=20 > Log: > Note that ccr(4) now supports AES-CCM. Hi John, Should this change be MFCed (including, just maybe the typo you fixed in= the mdoc)? Thank you :)! -Enji= From owner-svn-src-head@freebsd.org Mon Apr 29 22:05:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE2F0159F355; Mon, 29 Apr 2019 22:05:27 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D02B77921; Mon, 29 Apr 2019 22:05:27 +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 45F013F7; Mon, 29 Apr 2019 22:05:27 +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 x3TM5Rhq058463; Mon, 29 Apr 2019 22:05:27 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TM5Q7Z058461; Mon, 29 Apr 2019 22:05:26 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 29 Apr 2019 22:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346932 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 346932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D02B77921 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:05:28 -0000 Author: markj Date: Mon Apr 29 22:05:26 2019 New Revision: 346932 URL: https://svnweb.freebsd.org/changeset/base/346932 Log: Optimize lseek(SEEK_DATA) on UFS. This version fixes the problems identified in r345244. Reviewed by: kib MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19598 Modified: head/sys/ufs/ufs/ufs_bmap.c head/sys/ufs/ufs/ufs_extern.h head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_bmap.c ============================================================================== --- head/sys/ufs/ufs/ufs_bmap.c Mon Apr 29 22:00:45 2019 (r346931) +++ head/sys/ufs/ufs/ufs_bmap.c Mon Apr 29 22:05:26 2019 (r346932) @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include +static ufs_lbn_t lbn_count(struct ufsmount *, int); +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **); + /* * Bmap converts the logical block number of a file to its physical block * number on the disk. The conversion is done by using the logical block @@ -90,6 +93,51 @@ ufs_bmap(ap) return (error); } +static int +readindir(vp, lbn, daddr, bpp) + struct vnode *vp; + ufs_lbn_t lbn; + ufs2_daddr_t daddr; + struct buf **bpp; +{ + struct buf *bp; + struct mount *mp; + struct ufsmount *ump; + int error; + + mp = vp->v_mount; + ump = VFSTOUFS(mp); + + bp = getblk(vp, lbn, mp->mnt_stat.f_iosize, 0, 0, 0); + if ((bp->b_flags & B_CACHE) == 0) { + KASSERT(daddr != 0, + ("readindir: indirect block not in cache")); + + bp->b_blkno = blkptrtodb(ump, daddr); + bp->b_iocmd = BIO_READ; + bp->b_flags &= ~B_INVAL; + bp->b_ioflags &= ~BIO_ERROR; + vfs_busy_pages(bp, 0); + bp->b_iooffset = dbtob(bp->b_blkno); + bstrategy(bp); +#ifdef RACCT + if (racct_enable) { + PROC_LOCK(curproc); + racct_add_buf(curproc, bp, 0); + PROC_UNLOCK(curproc); + } +#endif + curthread->td_ru.ru_inblock++; + error = bufwait(bp); + if (error != 0) { + brelse(bp); + return (error); + } + } + *bpp = bp; + return (0); +} + /* * Indirect blocks are now on the vnode for the file. They are given negative * logical block numbers. Indirect blocks are addressed by the negative @@ -212,35 +260,10 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) */ if (bp) bqrelse(bp); + error = readindir(vp, metalbn, daddr, &bp); + if (error != 0) + return (error); - bp = getblk(vp, metalbn, mp->mnt_stat.f_iosize, 0, 0, 0); - if ((bp->b_flags & B_CACHE) == 0) { -#ifdef INVARIANTS - if (!daddr) - panic("ufs_bmaparray: indirect block not in cache"); -#endif - bp->b_blkno = blkptrtodb(ump, daddr); - bp->b_iocmd = BIO_READ; - bp->b_flags &= ~B_INVAL; - bp->b_ioflags &= ~BIO_ERROR; - vfs_busy_pages(bp, 0); - bp->b_iooffset = dbtob(bp->b_blkno); - bstrategy(bp); -#ifdef RACCT - if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, bp, 0); - PROC_UNLOCK(curproc); - } -#endif /* RACCT */ - curthread->td_ru.ru_inblock++; - error = bufwait(bp); - if (error) { - brelse(bp); - return (error); - } - } - if (I_IS_UFS1(ip)) { daddr = ((ufs1_daddr_t *)bp->b_data)[ap->in_off]; if (num == 1 && daddr && runp) { @@ -301,6 +324,111 @@ ufs_bmaparray(vp, bn, bnp, nbp, runp, runb) *bnp = -1; } return (0); +} + +static ufs_lbn_t +lbn_count(ump, level) + struct ufsmount *ump; + int level; +{ + ufs_lbn_t blockcnt; + + for (blockcnt = 1; level > 0; level--) + blockcnt *= MNINDIR(ump); + return (blockcnt); +} + +int +ufs_bmap_seekdata(vp, offp) + struct vnode *vp; + off_t *offp; +{ + struct buf *bp; + struct indir a[UFS_NIADDR + 1], *ap; + struct inode *ip; + struct mount *mp; + struct ufsmount *ump; + ufs2_daddr_t bn, daddr, nextbn; + uint64_t bsize; + off_t numblks; + int error, num, num1, off; + + bp = NULL; + ip = VTOI(vp); + mp = vp->v_mount; + ump = VFSTOUFS(mp); + + if (vp->v_type != VREG || (ip->i_flags & SF_SNAPSHOT) != 0) + return (EINVAL); + if (*offp < 0 || *offp >= ip->i_size) + return (ENXIO); + + bsize = mp->mnt_stat.f_iosize; + for (bn = *offp / bsize, numblks = howmany(ip->i_size, bsize); + bn < numblks; bn = nextbn) { + if (bn < UFS_NDADDR) { + daddr = DIP(ip, i_db[bn]); + if (daddr != 0) + break; + nextbn = bn + 1; + continue; + } + + ap = a; + error = ufs_getlbns(vp, bn, ap, &num); + if (error != 0) + break; + MPASS(num >= 2); + daddr = DIP(ip, i_ib[ap->in_off]); + ap++, num--; + for (nextbn = UFS_NDADDR, num1 = num - 1; num1 > 0; num1--) + nextbn += lbn_count(ump, num1); + if (daddr == 0) { + nextbn += lbn_count(ump, num); + continue; + } + + for (; daddr != 0 && num > 0; ap++, num--) { + if (bp != NULL) + bqrelse(bp); + error = readindir(vp, ap->in_lbn, daddr, &bp); + if (error != 0) + return (error); + + /* + * Scan the indirect block until we find a non-zero + * pointer. + */ + off = ap->in_off; + do { + daddr = I_IS_UFS1(ip) ? + ((ufs1_daddr_t *)bp->b_data)[off] : + ((ufs2_daddr_t *)bp->b_data)[off]; + } while (daddr == 0 && ++off < MNINDIR(ump)); + nextbn += off * lbn_count(ump, num - 1); + + /* + * We need to recompute the LBNs of indirect + * blocks, so restart with the updated block offset. + */ + if (off != ap->in_off) + break; + } + if (num == 0) { + /* + * We found a data block. + */ + bn = nextbn; + break; + } + } + if (bp != NULL) + bqrelse(bp); + if (bn >= numblks) + error = ENXIO; + if (error == 0 && *offp < bn * bsize) + *offp = bn * bsize; + return (error); } /* Modified: head/sys/ufs/ufs/ufs_extern.h ============================================================================== --- head/sys/ufs/ufs/ufs_extern.h Mon Apr 29 22:00:45 2019 (r346931) +++ head/sys/ufs/ufs/ufs_extern.h Mon Apr 29 22:05:26 2019 (r346932) @@ -58,6 +58,7 @@ extern struct vop_vector ufs_vnodeops; int ufs_bmap(struct vop_bmap_args *); int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *, struct buf *, int *, int *); +int ufs_bmap_seekdata(struct vnode *, off_t *); int ufs_fhtovp(struct mount *, struct ufid *, int, struct vnode **); int ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *); void ufs_dirbad(struct inode *, doff_t, char *); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Apr 29 22:00:45 2019 (r346931) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Apr 29 22:05:26 2019 (r346932) @@ -2701,12 +2701,15 @@ bad: static int ufs_ioctl(struct vop_ioctl_args *ap) { + struct vnode *vp; + vp = ap->a_vp; switch (ap->a_command) { case FIOSEEKDATA: + return (ufs_bmap_seekdata(vp, (off_t *)ap->a_data)); case FIOSEEKHOLE: - return (vn_bmap_seekhole(ap->a_vp, ap->a_command, - (off_t *)ap->a_data, ap->a_cred)); + return (vn_bmap_seekhole(vp, ap->a_command, (off_t *)ap->a_data, + ap->a_cred)); default: return (ENOTTY); } From owner-svn-src-head@freebsd.org Mon Apr 29 22:14:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A06159F736; Mon, 29 Apr 2019 22:14:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC0C80077; Mon, 29 Apr 2019 22:14:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4C392118F0; Mon, 29 Apr 2019 22:14:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r346931 - head/share/man/man4 To: Enji Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904292200.x3TM0k6f054461@repo.freebsd.org> <101FAB41-1F64-479C-81F7-6F5A1D1A0811@gmail.com> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 29 Apr 2019 15:14:28 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <101FAB41-1F64-479C-81F7-6F5A1D1A0811@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0EC0C80077 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:14:32 -0000 On 4/29/19 3:04 PM, Enji Cooper wrote: > >> On Apr 29, 2019, at 15:00, John Baldwin wrote: >> >> Author: jhb >> Date: Mon Apr 29 22:00:45 2019 >> New Revision: 346931 >> URL: https://svnweb.freebsd.org/changeset/base/346931 >> >> Log: >> Note that ccr(4) now supports AES-CCM. > > Hi John, > Should this change be MFCed (including, just maybe the typo you fixed in the mdoc)? > Thank you :)! Only when AES-CCM support is merged. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Apr 29 22:15:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2EB8159F7BC; Mon, 29 Apr 2019 22:15:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88EC1801D7; Mon, 29 Apr 2019 22:15:52 +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 6C3B85A4; Mon, 29 Apr 2019 22:15:52 +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 x3TMFqpO064157; Mon, 29 Apr 2019 22:15:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TMFqaF064156; Mon, 29 Apr 2019 22:15:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201904292215.x3TMFqaF064156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 29 Apr 2019 22:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346933 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 346933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88EC1801D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:15:53 -0000 Author: jhb Date: Mon Apr 29 22:15:51 2019 New Revision: 346933 URL: https://svnweb.freebsd.org/changeset/base/346933 Log: Rewrap some long lines. Whitespace only change. Modified: head/share/man/man4/ccr.4 Modified: head/share/man/man4/ccr.4 ============================================================================== --- head/share/man/man4/ccr.4 Mon Apr 29 22:05:26 2019 (r346932) +++ head/share/man/man4/ccr.4 Mon Apr 29 22:15:51 2019 (r346933) @@ -49,9 +49,10 @@ The .Nm driver provides support for the crypto accelerator engine included on PCI Express Ethernet adapters based on the Chelsio Terminator 6 ASIC (T6). -The driver accelerates AES-CBC, AES-CCM, AES-CTR, AES-GCM, AES-XTS, SHA1, SHA2-224, -SHA2-256, SHA2-384, SHA2-512, SHA1-HMAC, SHA2-224-HMAC, -SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC operations for +The driver accelerates AES-CBC, AES-CCM, AES-CTR, AES-GCM, AES-XTS, +SHA1, SHA2-224, SHA2-256, SHA2-384, SHA2-512, +SHA1-HMAC, SHA2-224-HMAC, SHA2-256-HMAC, SHA2-384-HMAC, and SHA2-512-HMAC +operations for .Xr crypto 4 and .Xr ipsec 4 . From owner-svn-src-head@freebsd.org Mon Apr 29 22:37:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 886AE159FD29; Mon, 29 Apr 2019 22:37:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D92880C7C; Mon, 29 Apr 2019 22:37:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05BE4902; Mon, 29 Apr 2019 22:37:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3TMbZfO074615; Mon, 29 Apr 2019 22:37:35 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3TMbZAW074614; Mon, 29 Apr 2019 22:37:35 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904292237.x3TMbZAW074614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 29 Apr 2019 22:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346935 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 346935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D92880C7C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Apr 2019 22:37:36 -0000 Author: jhibbits Date: Mon Apr 29 22:37:35 2019 New Revision: 346935 URL: https://svnweb.freebsd.org/changeset/base/346935 Log: powerpc64: Fix switch panic from cpu_throw() r18 is used to hold the old PCB flags, but cpu_throw doesn't populate r18 with PCB flags, since the old thread is gone. This can lead to panics on cores that don't have the registers guarded by these flags. Modified: head/sys/powerpc/powerpc/swtch64.S Modified: head/sys/powerpc/powerpc/swtch64.S ============================================================================== --- head/sys/powerpc/powerpc/swtch64.S Mon Apr 29 22:16:33 2019 (r346934) +++ head/sys/powerpc/powerpc/swtch64.S Mon Apr 29 22:37:35 2019 (r346935) @@ -78,6 +78,7 @@ TOC_ENTRY(blocked_lock) ENTRY(cpu_throw) mr %r13, %r4 li %r14,0 /* Tell cpu_switchin not to release a thread */ + li %r18,0 /* No old pcb flags. The old thread is extinguished. */ b cpu_switchin From owner-svn-src-head@freebsd.org Tue Apr 30 03:45:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8EA11581919; Tue, 30 Apr 2019 03:45:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 501358A437; Tue, 30 Apr 2019 03:45:47 +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 DD3DE4081; Tue, 30 Apr 2019 03:45:46 +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 x3U3jkSm037564; Tue, 30 Apr 2019 03:45:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U3jkFC037560; Tue, 30 Apr 2019 03:45:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201904300345.x3U3jkFC037560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 30 Apr 2019 03:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346941 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 346941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 501358A437 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 03:45:48 -0000 Author: jhibbits Date: Tue Apr 30 03:45:46 2019 New Revision: 346941 URL: https://svnweb.freebsd.org/changeset/base/346941 Log: powerpc: Stop pretending we run on e500v1 cores Unconditional writing to MAS7, which doesn't exist on the e500v1 core, in a TLB miss handler has been in the code for several years now. Since this has gone unnoticed for so long, it's easily concluded that e500v1 is not in use with FreeBSD. Simplify the code path a bit, by unconditionally zeroing MAS7 instead of calling a subroutine to do it. Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/trap_subr.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Tue Apr 30 01:25:02 2019 (r346940) +++ head/sys/powerpc/booke/locore.S Tue Apr 30 03:45:46 2019 (r346941) @@ -250,7 +250,8 @@ __start: ori %r4, %r4, (MAS3_SX | MAS3_SW | MAS3_SR)@l mtspr SPR_MAS3, %r4 /* Set RPN and protection */ isync - bl zero_mas7 + li %r4, 0 + mtspr SPR_MAS7, %r4 bl zero_mas8 isync tlbwe @@ -505,7 +506,8 @@ bp_kernload: ori %r3, %r3, (MAS3_SX | MAS3_SW | MAS3_SR)@l mtspr SPR_MAS3, %r3 isync - bl zero_mas7 + li %r4, 0 + mtspr SPR_MAS7, %r4 bl zero_mas8 isync tlbwe @@ -696,7 +698,8 @@ tlb1_temp_mapping_as1: mtspr SPR_MAS1, %r5 isync mflr %r3 - bl zero_mas7 + li %r4, 0 + mtspr SPR_MAS7, %r4 bl zero_mas8 mtlr %r3 isync @@ -736,20 +739,8 @@ tlb1_inval_all_but_current: blr /* - * MAS7 and MAS8 conditional zeroing. + * MAS8 conditional zeroing. */ -.globl zero_mas7 -zero_mas7: - mfpvr %r20 - rlwinm %r20, %r20, 16, 16, 31 - cmpli 0, 0, %r20, FSL_E500v1 - beq 1f - - li %r20, 0 - mtspr SPR_MAS7, %r20 -1: - blr - .globl zero_mas8 zero_mas8: mfpvr %r20 Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Tue Apr 30 01:25:02 2019 (r346940) +++ head/sys/powerpc/booke/trap_subr.S Tue Apr 30 03:45:46 2019 (r346941) @@ -765,7 +765,8 @@ search_failed: mtspr SPR_MAS2, %r27 mtspr SPR_MAS3, %r23 - bl zero_mas7 + li %r23, 0 + mtspr SPR_MAS7, %r23 bl zero_mas8 isync From owner-svn-src-head@freebsd.org Tue Apr 30 06:08:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D9731584AD6; Tue, 30 Apr 2019 06:08:50 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 107928DF2F; Tue, 30 Apr 2019 06:08:50 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id F38CA119B3; Tue, 30 Apr 2019 06:08:49 +0000 (UTC) Date: Tue, 30 Apr 2019 06:08:49 +0000 From: Alexey Dokuchaev To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346932 - head/sys/ufs/ufs Message-ID: <20190430060849.GB97846@FreeBSD.org> References: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 107928DF2F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.916,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 06:08:50 -0000 On Mon, Apr 29, 2019 at 10:05:26PM +0000, Mark Johnston wrote: > New Revision: 346932 > URL: https://svnweb.freebsd.org/changeset/base/346932 > > Log: > Optimize lseek(SEEK_DATA) on UFS. > > This version fixes the problems identified in r345244. > > Reviewed by: kib > @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +static ufs_lbn_t lbn_count(struct ufsmount *, int); > +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **); Is the prototype for static readindir() really needed here? > +static int > +readindir(vp, lbn, daddr, bpp) > + struct vnode *vp; > + ufs_lbn_t lbn; > + ufs2_daddr_t daddr; > + struct buf **bpp; Don't we prefer ASNI declarations over K&R these days? > +static ufs_lbn_t > +lbn_count(ump, level) > + struct ufsmount *ump; > + int level; Ditto. > +int > +ufs_bmap_seekdata(vp, offp) > + struct vnode *vp; > + off_t *offp; ./danfe From owner-svn-src-head@freebsd.org Tue Apr 30 06:54:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4DD7158565F; Tue, 30 Apr 2019 06:54:19 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:101]) (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 5FF758F59A; Tue, 30 Apr 2019 06:54:19 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 9FB4C32812E6; Tue, 30 Apr 2019 09:54:15 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nCXHvL0oZh-sFLCNRJ3; Tue, 30 Apr 2019 09:54:15 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1556607255; bh=+KkWyt3ffbZ0W5MkeKMAEMmvAGxVeimHPcRCm+NUnFg=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=h4hW0fGknIg45aAvYqyhH1DDSCPnwnulLGULsapcAtPqKkWOcJ73Z0c/xHpWul0p9 O2pd6AB7KjIUMHal7F7ydnTvVhNmKUkhOXjQ4cL/4zFhrPxMKZe73IdQjXa1k4Y43F lb2zO/a7axn8ZYw+HcbqoTxZykWlJaV64/SpKrP4= Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id m6AihFwrNM-sBR4VCCh; Tue, 30 Apr 2019 09:54:14 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: John Baldwin , slavash@FreeBSD.org, Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: <17b96a6c-ece6-86e9-426d-84e04248818b@yandex.ru> Date: Tue, 30 Apr 2019 09:52:50 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 5FF758F59A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 06:54:20 -0000 On 30.04.2019 00:14, John Baldwin wrote: >> Yes, we were able to reproduce this issue in house. If you don't mind, I >> prefer to wait for John's update - where he eliminates the EAGAIN >> handling in the network drivers. > > I have rebased the branch for this, but for now it will just panic sooner > I believe by tripping an assertion. Can you grab the diff (or just the branch) > from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce under a > kernel with INVARIANTS? I think we will have to explicitly clear the 'rcvif' > pointer somewhere, but I want to see what the stack trace looks like so I can > think about the "right" place to clear it. Hi, please note, that rcvif is used by firewall to track inbound interface and clearing it can be unexpected in some cases, and can break firewall rules. -- WBR, Andrey V. Elsukov From owner-svn-src-head@freebsd.org Tue Apr 30 09:26:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5ECA158A53C; Tue, 30 Apr 2019 09:26:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DA5D9598F; Tue, 30 Apr 2019 09:26:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09C8179D0; Tue, 30 Apr 2019 09:26:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3U9QB9E016772; Tue, 30 Apr 2019 09:26:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U9QBfM016770; Tue, 30 Apr 2019 09:26:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904300926.x3U9QBfM016770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Apr 2019 09:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346956 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 346956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DA5D9598F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 09:26:13 -0000 Author: hselasky Date: Tue Apr 30 09:26:11 2019 New Revision: 346956 URL: https://svnweb.freebsd.org/changeset/base/346956 Log: Store a pointer to the device instead of the PCI device in the DMA pool implementation in the LinuxKPI. This avoids use of container_of(). No functional change. Discussed with: kib @ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 09:10:45 2019 (r346955) +++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 09:26:11 2019 (r346956) @@ -46,7 +46,7 @@ void linux_dma_pool_free(struct dma_pool *pool, void * dma_addr_t dma_addr); struct dma_pool { - struct pci_dev *pool_pdev; + struct device *pool_device; uma_zone_t pool_zone; struct mtx pool_dma_lock; bus_dma_tag_t pool_dmat; Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:10:45 2019 (r346955) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:26:11 2019 (r346956) @@ -701,7 +701,7 @@ dma_pool_obj_import(void *arg, void **store, int count struct linux_dma_obj *obj; int error, i; - priv = pool->pool_pdev->dev.dma_priv; + priv = pool->pool_device->dma_priv; for (i = 0; i < count; i++) { obj = uma_zalloc(linux_dma_obj_zone, flags); if (obj == NULL) @@ -728,7 +728,7 @@ dma_pool_obj_release(void *arg, void **store, int coun struct linux_dma_obj *obj; int i; - priv = pool->pool_pdev->dev.dma_priv; + priv = pool->pool_device->dma_priv; for (i = 0; i < count; i++) { obj = store[i]; bus_dmamem_free(pool->pool_dmat, obj->vaddr, obj->dmamap); @@ -746,7 +746,7 @@ linux_dma_pool_create(char *name, struct device *dev, priv = dev->dma_priv; pool = kzalloc(sizeof(*pool), GFP_KERNEL); - pool->pool_pdev = to_pci_dev(dev); + pool->pool_device = dev; pool->pool_entry_size = size; if (bus_dma_tag_create(bus_get_dma_tag(dev->bsddev), From owner-svn-src-head@freebsd.org Tue Apr 30 09:38:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD9C5158A921; Tue, 30 Apr 2019 09:38:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54D0D9627A; Tue, 30 Apr 2019 09:38:23 +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 3045B7BBA; Tue, 30 Apr 2019 09:38: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 x3U9cNcv022162; Tue, 30 Apr 2019 09:38:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3U9cMcI022160; Tue, 30 Apr 2019 09:38:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904300938.x3U9cMcI022160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Apr 2019 09:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346957 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 346957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54D0D9627A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 09:38:23 -0000 Author: hselasky Date: Tue Apr 30 09:38:22 2019 New Revision: 346957 URL: https://svnweb.freebsd.org/changeset/base/346957 Log: Make the dma_pool structure private to the LinuxKPI similar to Linux. No functional change. Discussed with: kib @ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 09:26:11 2019 (r346956) +++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Tue Apr 30 09:38:22 2019 (r346957) @@ -37,6 +37,7 @@ #include #include +struct dma_pool; struct dma_pool *linux_dma_pool_create(char *name, struct device *dev, size_t size, size_t align, size_t boundary); void linux_dma_pool_destroy(struct dma_pool *pool); @@ -44,16 +45,6 @@ void *linux_dma_pool_alloc(struct dma_pool *pool, gfp_ dma_addr_t *handle); void linux_dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma_addr); - -struct dma_pool { - struct device *pool_device; - uma_zone_t pool_zone; - struct mtx pool_dma_lock; - bus_dma_tag_t pool_dmat; - size_t pool_entry_size; - struct mtx pool_ptree_lock; - struct pctrie pool_ptree; -}; static inline struct dma_pool * dma_pool_create(char *name, struct device *dev, size_t size, Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:26:11 2019 (r346956) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:38:22 2019 (r346957) @@ -658,6 +658,16 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc uma_zfree(linux_dma_obj_zone, obj); } +struct dma_pool { + struct device *pool_device; + uma_zone_t pool_zone; + struct mtx pool_dma_lock; + bus_dma_tag_t pool_dmat; + size_t pool_entry_size; + struct mtx pool_ptree_lock; + struct pctrie pool_ptree; +}; + static inline int dma_pool_obj_ctor(void *mem, int size, void *arg, int flags) { From owner-svn-src-head@freebsd.org Tue Apr 30 10:41:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E97B8158C69E; Tue, 30 Apr 2019 10:41:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DAF469A68; Tue, 30 Apr 2019 10:41:21 +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 68D2A8604; Tue, 30 Apr 2019 10:41:21 +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 x3UAfLZq054369; Tue, 30 Apr 2019 10:41:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UAfLvj054368; Tue, 30 Apr 2019 10:41:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201904301041.x3UAfLvj054368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 30 Apr 2019 10:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346958 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 346958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DAF469A68 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 10:41:22 -0000 Author: hselasky Date: Tue Apr 30 10:41:20 2019 New Revision: 346958 URL: https://svnweb.freebsd.org/changeset/base/346958 Log: Reduce the number of mutexes after r346645 in the LinuxKPI. Make function macro wrappers for locking and unlocking to ease readability. No functional change. Discussed with: kib@, tychon@ and zeising@ Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 09:38:22 2019 (r346957) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue Apr 30 10:41:20 2019 (r346958) @@ -78,11 +78,12 @@ static device_method_t pci_methods[] = { struct linux_dma_priv { uint64_t dma_mask; - struct mtx dma_lock; + struct mtx lock; bus_dma_tag_t dmat; - struct mtx ptree_lock; struct pctrie ptree; }; +#define DMA_PRIV_LOCK(priv) mtx_lock(&(priv)->lock) +#define DMA_PRIV_UNLOCK(priv) mtx_unlock(&(priv)->lock) static int linux_pdev_dma_init(struct pci_dev *pdev) @@ -92,9 +93,8 @@ linux_pdev_dma_init(struct pci_dev *pdev) priv = malloc(sizeof(*priv), M_DEVBUF, M_WAITOK | M_ZERO); pdev->dev.dma_priv = priv; - mtx_init(&priv->dma_lock, "linux_dma", NULL, MTX_DEF); + mtx_init(&priv->lock, "lkpi-priv-dma", NULL, MTX_DEF); - mtx_init(&priv->ptree_lock, "linux_dma_ptree", NULL, MTX_DEF); pctrie_init(&priv->ptree); return (0); @@ -108,8 +108,7 @@ linux_pdev_dma_uninit(struct pci_dev *pdev) priv = pdev->dev.dma_priv; if (priv->dmat) bus_dma_tag_destroy(priv->dmat); - mtx_destroy(&priv->dma_lock); - mtx_destroy(&priv->ptree_lock); + mtx_destroy(&priv->lock); free(priv, M_DEVBUF); pdev->dev.dma_priv = NULL; return (0); @@ -500,37 +499,34 @@ linux_dma_map_phys(struct device *dev, vm_paddr_t phys obj = uma_zalloc(linux_dma_obj_zone, 0); + DMA_PRIV_LOCK(priv); if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } nseg = -1; - mtx_lock(&priv->dma_lock); if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, phys, len, BUS_DMA_NOWAIT, &seg, &nseg) != 0) { bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } - mtx_unlock(&priv->dma_lock); KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); obj->dma_addr = seg.ds_addr; - mtx_lock(&priv->ptree_lock); error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); - mtx_unlock(&priv->ptree_lock); if (error != 0) { - mtx_lock(&priv->dma_lock); bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } - + DMA_PRIV_UNLOCK(priv); return (obj->dma_addr); } @@ -542,19 +538,16 @@ linux_dma_unmap(struct device *dev, dma_addr_t dma_add priv = dev->dma_priv; - mtx_lock(&priv->ptree_lock); + DMA_PRIV_LOCK(priv); obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, dma_addr); if (obj == NULL) { - mtx_unlock(&priv->ptree_lock); + DMA_PRIV_UNLOCK(priv); return; } LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, dma_addr); - mtx_unlock(&priv->ptree_lock); - - mtx_lock(&priv->dma_lock); bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); } @@ -575,7 +568,9 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat obj = uma_zalloc(linux_dma_obj_zone, 0); + DMA_PRIV_LOCK(priv); if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } @@ -583,6 +578,7 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat sg = sgl; dma_sg = sg; dma_nents = 0; + while (nents > 0) { seg_phys = sg_phys(sg); seg_len = sg->length; @@ -595,17 +591,15 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat } nseg = -1; - mtx_lock(&priv->dma_lock); if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, seg_phys, seg_len, BUS_DMA_NOWAIT, &seg, &nseg) != 0) { bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } - mtx_unlock(&priv->dma_lock); KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); sg_dma_address(dma_sg) = seg.ds_addr; @@ -617,18 +611,15 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat obj->dma_addr = sg_dma_address(sgl); - mtx_lock(&priv->ptree_lock); error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); - mtx_unlock(&priv->ptree_lock); if (error != 0) { - mtx_lock(&priv->dma_lock); bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); return (0); } - + DMA_PRIV_UNLOCK(priv); return (dma_nents); } @@ -641,19 +632,16 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc priv = dev->dma_priv; - mtx_lock(&priv->ptree_lock); + DMA_PRIV_LOCK(priv); obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, sg_dma_address(sgl)); if (obj == NULL) { - mtx_unlock(&priv->ptree_lock); + DMA_PRIV_UNLOCK(priv); return; } LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, sg_dma_address(sgl)); - mtx_unlock(&priv->ptree_lock); - - mtx_lock(&priv->dma_lock); bus_dmamap_unload(priv->dmat, obj->dmamap); bus_dmamap_destroy(priv->dmat, obj->dmamap); - mtx_unlock(&priv->dma_lock); + DMA_PRIV_UNLOCK(priv); uma_zfree(linux_dma_obj_zone, obj); } @@ -661,13 +649,15 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc struct dma_pool { struct device *pool_device; uma_zone_t pool_zone; - struct mtx pool_dma_lock; + struct mtx pool_lock; bus_dma_tag_t pool_dmat; size_t pool_entry_size; - struct mtx pool_ptree_lock; struct pctrie pool_ptree; }; +#define DMA_POOL_LOCK(pool) mtx_lock(&(pool)->pool_lock) +#define DMA_POOL_UNLOCK(pool) mtx_unlock(&(pool)->pool_lock) + static inline int dma_pool_obj_ctor(void *mem, int size, void *arg, int flags) { @@ -677,11 +667,11 @@ dma_pool_obj_ctor(void *mem, int size, void *arg, int bus_dma_segment_t seg; nseg = -1; - mtx_lock(&pool->pool_dma_lock); + DMA_POOL_LOCK(pool); error = _bus_dmamap_load_phys(pool->pool_dmat, obj->dmamap, vtophys(obj->vaddr), pool->pool_entry_size, BUS_DMA_NOWAIT, &seg, &nseg); - mtx_unlock(&pool->pool_dma_lock); + DMA_POOL_UNLOCK(pool); if (error != 0) { return (error); } @@ -697,9 +687,9 @@ dma_pool_obj_dtor(void *mem, int size, void *arg) struct linux_dma_obj *obj = mem; struct dma_pool *pool = arg; - mtx_lock(&pool->pool_dma_lock); + DMA_POOL_LOCK(pool); bus_dmamap_unload(pool->pool_dmat, obj->dmamap); - mtx_unlock(&pool->pool_dma_lock); + DMA_POOL_UNLOCK(pool); } static int @@ -778,10 +768,7 @@ linux_dma_pool_create(char *name, struct device *dev, dma_pool_obj_dtor, NULL, NULL, dma_pool_obj_import, dma_pool_obj_release, pool, 0); - mtx_init(&pool->pool_dma_lock, "linux_dma_pool", NULL, MTX_DEF); - - mtx_init(&pool->pool_ptree_lock, "linux_dma_pool_ptree", NULL, - MTX_DEF); + mtx_init(&pool->pool_lock, "lkpi-dma-pool", NULL, MTX_DEF); pctrie_init(&pool->pool_ptree); return (pool); @@ -793,8 +780,7 @@ linux_dma_pool_destroy(struct dma_pool *pool) uma_zdestroy(pool->pool_zone); bus_dma_tag_destroy(pool->pool_dmat); - mtx_destroy(&pool->pool_ptree_lock); - mtx_destroy(&pool->pool_dma_lock); + mtx_destroy(&pool->pool_lock); kfree(pool); } @@ -808,13 +794,13 @@ linux_dma_pool_alloc(struct dma_pool *pool, gfp_t mem_ if (obj == NULL) return (NULL); - mtx_lock(&pool->pool_ptree_lock); + DMA_POOL_LOCK(pool); if (LINUX_DMA_PCTRIE_INSERT(&pool->pool_ptree, obj) != 0) { - mtx_unlock(&pool->pool_ptree_lock); + DMA_POOL_UNLOCK(pool); uma_zfree_arg(pool->pool_zone, obj, pool); return (NULL); } - mtx_unlock(&pool->pool_ptree_lock); + DMA_POOL_UNLOCK(pool); *handle = obj->dma_addr; return (obj->vaddr); @@ -825,14 +811,14 @@ linux_dma_pool_free(struct dma_pool *pool, void *vaddr { struct linux_dma_obj *obj; - mtx_lock(&pool->pool_ptree_lock); + DMA_POOL_LOCK(pool); obj = LINUX_DMA_PCTRIE_LOOKUP(&pool->pool_ptree, dma_addr); if (obj == NULL) { - mtx_unlock(&pool->pool_ptree_lock); + DMA_POOL_UNLOCK(pool); return; } LINUX_DMA_PCTRIE_REMOVE(&pool->pool_ptree, dma_addr); - mtx_unlock(&pool->pool_ptree_lock); + DMA_POOL_UNLOCK(pool); uma_zfree_arg(pool->pool_zone, obj, pool); } From owner-svn-src-head@freebsd.org Tue Apr 30 13:10:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30B3615909A4; Tue, 30 Apr 2019 13:10:12 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (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 C199F6F937; Tue, 30 Apr 2019 13:10:11 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 44thhf1CXZzDjs5; Tue, 30 Apr 2019 13:10:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id zjJolTN-WpJO; Tue, 30 Apr 2019 13:10:09 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-79-116.mobileonline.telia.com [95.192.79.116]) by mail.daemonic.se (Postfix) with ESMTPSA id 44thhd33m2zDjp8; Tue, 30 Apr 2019 13:10:09 +0000 (UTC) Subject: Re: svn commit: r346958 - head/sys/compat/linuxkpi/common/src To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904301041.x3UAfLvj054368@repo.freebsd.org> From: Niclas Zeising Message-ID: <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> Date: Tue, 30 Apr 2019 15:10:08 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201904301041.x3UAfLvj054368@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C199F6F937 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 13:10:12 -0000 On 2019-04-30 12:41, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Apr 30 10:41:20 2019 > New Revision: 346958 > URL: https://svnweb.freebsd.org/changeset/base/346958 > > Log: > Reduce the number of mutexes after r346645 in the LinuxKPI. > Make function macro wrappers for locking and unlocking to ease readability. > > No functional change. > > Discussed with: kib@, tychon@ and zeising@ I was not part of any discussion regarding this. If this is related to https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to hold of for a bit, while we try to figure out why we are seeing regressions in graphics with the latest dmar changes. Can you please revert this since it colludes the dmar graphics issue, and it makes the suggested patch not apply cleanly, which makes it harder to get people to help test. Thank you! Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Tue Apr 30 14:26:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51DCA15933BC; Tue, 30 Apr 2019 14:26:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it1-x136.google.com (mail-it1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E043B73C66; Tue, 30 Apr 2019 14:26:48 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it1-x136.google.com with SMTP id q14so4981561itk.0; Tue, 30 Apr 2019 07:26:48 -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=AWfwmAgJHxypDflhfBcVHSclA2QkjF7Sfhx13+hiZ4Y=; b=YgVJWdgjT2LR+RzCQXNYuSER6Q5ea+1bSRm3P5gi+bO8qSTW7LUV/XOpBjE3yJpZWx MEL/HtIGbgCu1spw29tqkKLt8UQS63A9OjA2wAsMElAS5a3krEqlw+YYar3zVKbv1ACo J2LKdnhfg4RzWMsSxu6lIMNOTrYl9+mH85GO5Q1mxUuEaOcZfTNmJQgyyKO48e5TF6C3 HGBnWk2H3u8DczyNCYQ0n4+6iq0xp8EJz/+xTjnLTpzc69hbph/djxAmDD3zis+vdE4U MGgdUQfiiFGKVHON4Kf372lEXaRNDBaHKwTaoXCc9wGEpRVjSNHOWkgu0niRWEt2vu1D NNng== 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=AWfwmAgJHxypDflhfBcVHSclA2QkjF7Sfhx13+hiZ4Y=; b=A6nQjwVEuEqW1nnguprIya/NuiJM+ckbSgjXFHwWHj0zX50gv6JPZnGOlPh2RtlbLU 5neDqeDgBO9pyl2Xt8IKUWiJG8I9yy3kfxu6EY4FA5BPHC0+dw1NHFyft//mEEPcgWHP WTguoUngPNvkxS8UxAGTIicrZcBq3564uzNVmtEEJt4vKfNSEiA6vuJO/it+UJU1wxlU v3BT16AmsuNnsnPeSY+DzZkVnQZCcjHcnTqwLYYpx21YpQsl2cLHOkaUu0CV7q34quHr o+kE7s3g4pHHXdJ+stsXnpAp9k9mwm43wpYSLssWJr+8ypz+jDxOZgonXodhzhTIXFTL /Rqg== X-Gm-Message-State: APjAAAVCG69Ap4JP8+SK1VZ5r4CgFce4C67SaxwLiG2aVoGwnwvIbUdt h0VmWYyGj6Re5IFs05yGpHFKR5IDfU8= X-Google-Smtp-Source: APXvYqyEiKq3UPiVWtkEZFNkI+MV5WhuxaPGXC2BcrMlIw8cYIK85cfaQ44RczfmAaz9x8GB9g65vg== X-Received: by 2002:a02:cc8d:: with SMTP id s13mr1947927jap.115.1556634407790; Tue, 30 Apr 2019 07:26:47 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-36-31.dsl.bell.ca. [69.159.36.31]) by smtp.gmail.com with ESMTPSA id s15sm2733951iob.70.2019.04.30.07.26.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Apr 2019 07:26:46 -0700 (PDT) Sender: Mark Johnston Date: Tue, 30 Apr 2019 10:26:41 -0400 From: Mark Johnston To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346932 - head/sys/ufs/ufs Message-ID: <20190430142641.GA34567@raichu> References: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> <20190430060849.GB97846@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190430060849.GB97846@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: E043B73C66 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 14:26:49 -0000 On Tue, Apr 30, 2019 at 06:08:49AM +0000, Alexey Dokuchaev wrote: > On Mon, Apr 29, 2019 at 10:05:26PM +0000, Mark Johnston wrote: > > New Revision: 346932 > > URL: https://svnweb.freebsd.org/changeset/base/346932 > > > > Log: > > Optimize lseek(SEEK_DATA) on UFS. > > > > This version fixes the problems identified in r345244. > > > > Reviewed by: kib > > @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > > > +static ufs_lbn_t lbn_count(struct ufsmount *, int); > > +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct buf **); > > Is the prototype for static readindir() really needed here? Yes, when using a K&R definition. > > +static int > > +readindir(vp, lbn, daddr, bpp) > > + struct vnode *vp; > > + ufs_lbn_t lbn; > > + ufs2_daddr_t daddr; > > + struct buf **bpp; > > Don't we prefer ASNI declarations over K&R these days? Yes, I was just staying consistent with the rest of the file. > > +static ufs_lbn_t > > +lbn_count(ump, level) > > + struct ufsmount *ump; > > + int level; > > Ditto. > > > +int > > +ufs_bmap_seekdata(vp, offp) > > + struct vnode *vp; > > + off_t *offp; > > ./danfe From owner-svn-src-head@freebsd.org Tue Apr 30 14:29:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 773071593564; Tue, 30 Apr 2019 14:29:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CC6274317; Tue, 30 Apr 2019 14:29:10 +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 EE569AD72; Tue, 30 Apr 2019 14:29:09 +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 x3UET9ch077744; Tue, 30 Apr 2019 14:29:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UET9ia077742; Tue, 30 Apr 2019 14:29:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201904301429.x3UET9ia077742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 30 Apr 2019 14:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346959 - in head/release: . tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in head/release: . tools X-SVN-Commit-Revision: 346959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CC6274317 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 14:29:10 -0000 Author: gjb Date: Tue Apr 30 14:29:09 2019 New Revision: 346959 URL: https://svnweb.freebsd.org/changeset/base/346959 Log: Reduce the default image size for virtual machine disk images from 30GB to 3GB. The raw images can be resized using truncate(1), and other formats can be resized with tools included with other tools included with other hypervisors. Enable the growfs(8) rc(8) at firstboot if the disk was resized prior to booting the virtual machine for the first time. Discussed with: several PR: 232313 (requested in other context) MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile.vm head/release/tools/gce.conf head/release/tools/vmimage.subr Modified: head/release/Makefile.vm ============================================================================== --- head/release/Makefile.vm Tue Apr 30 10:41:20 2019 (r346958) +++ head/release/Makefile.vm Tue Apr 30 14:29:09 2019 (r346959) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 30G +VMSIZE?= 3072M SWAPSIZE?= 1G VMBASE?= vm Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Tue Apr 30 10:41:20 2019 (r346958) +++ head/release/tools/gce.conf Tue Apr 30 14:29:09 2019 (r346959) @@ -3,9 +3,6 @@ # $FreeBSD$ # -# Reduce VMSIZE to be below the free quota limit. -export VMSIZE=27G - # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Tue Apr 30 10:41:20 2019 (r346958) +++ head/release/tools/vmimage.subr Tue Apr 30 14:29:09 2019 (r346959) @@ -182,6 +182,9 @@ vm_extra_enable_services() { if [ -z "${VMCONFIG}" -o -c "${VMCONFIG}" ]; then echo 'ifconfig_DEFAULT="DHCP inet6 accept_rtadv"' >> \ ${DESTDIR}/etc/rc.conf + # Expand the filesystem to fill the disk. + echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf + touch ${DESTDIR}/firstboot fi return 0 From owner-svn-src-head@freebsd.org Tue Apr 30 14:44:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91F411593FBE; Tue, 30 Apr 2019 14:44:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3991A751DA; Tue, 30 Apr 2019 14:44:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29F48B0EF; Tue, 30 Apr 2019 14:44:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UEieB5088108; Tue, 30 Apr 2019 14:44:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UEieAU088107; Tue, 30 Apr 2019 14:44:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201904301444.x3UEieAU088107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 30 Apr 2019 14:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346960 - head/usr.sbin/rtadvd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/rtadvd X-SVN-Commit-Revision: 346960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3991A751DA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 14:44:40 -0000 Author: markj Date: Tue Apr 30 14:44:39 2019 New Revision: 346960 URL: https://svnweb.freebsd.org/changeset/base/346960 Log: Retry upon NET_RT_IFLIST sysctl failure. Port the logic used by getifaddrs(3) to handle the case where NET_RT_IFLIST returns ENOMEM, which can occur if the list size changes between the buffer allocation and sysctl read. PR: 195191 Submitted by: Guy Yur (original version) MFC after: 1 week Modified: head/usr.sbin/rtadvd/if.c Modified: head/usr.sbin/rtadvd/if.c ============================================================================== --- head/usr.sbin/rtadvd/if.c Tue Apr 30 14:29:09 2019 (r346959) +++ head/usr.sbin/rtadvd/if.c Tue Apr 30 14:44:39 2019 (r346960) @@ -408,6 +408,8 @@ update_ifinfo_nd_flags(struct ifinfo *ifi) return (0); } +#define MAX_SYSCTL_TRY 5 + struct ifinfo * update_ifinfo(struct ifilist_head_t *ifi_head, int ifindex) { @@ -419,26 +421,43 @@ update_ifinfo(struct ifilist_head_t *ifi_head, int ifi size_t len; char *lim; int mib[] = { CTL_NET, PF_ROUTE, 0, AF_INET6, NET_RT_IFLIST, 0 }; - int error; + int error, ntry; syslog(LOG_DEBUG, "<%s> enter", __func__); - if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), NULL, &len, NULL, 0) < - 0) { - syslog(LOG_ERR, - "<%s> sysctl: NET_RT_IFLIST size get failed", __func__); - exit(1); - } - if ((msg = malloc(len)) == NULL) { - syslog(LOG_ERR, "<%s> malloc failed", __func__); - exit(1); - } - if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), msg, &len, NULL, 0) < - 0) { - syslog(LOG_ERR, - "<%s> sysctl: NET_RT_IFLIST get failed", __func__); - exit(1); - } + ntry = 0; + do { + /* + * We'll try to get addresses several times in case that + * the number of addresses is unexpectedly increased during + * the two sysctl calls. This should rarely happen. + * Portability note: since FreeBSD does not add margin of + * memory at the first sysctl, the possibility of failure on + * the second sysctl call is a bit higher. + */ + + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) { + syslog(LOG_ERR, + "<%s> sysctl: NET_RT_IFLIST size get failed", + __func__); + exit(1); + } + if ((msg = malloc(len)) == NULL) { + syslog(LOG_ERR, "<%s> malloc failed", __func__); + exit(1); + } + if (sysctl(mib, nitems(mib), msg, &len, NULL, 0) < 0) { + if (errno != ENOMEM || ++ntry >= MAX_SYSCTL_TRY) { + free(msg); + syslog(LOG_ERR, + "<%s> sysctl: NET_RT_IFLIST get failed", + __func__); + exit(1); + } + free(msg); + msg = NULL; + } + } while (msg == NULL); lim = msg + len; for (ifm = (struct if_msghdr *)msg; From owner-svn-src-head@freebsd.org Tue Apr 30 14:46:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 682471594105 for ; Tue, 30 Apr 2019 14:46:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B2017545B for ; Tue, 30 Apr 2019 14:46:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72e.google.com with SMTP id w73so8244967qkb.13 for ; Tue, 30 Apr 2019 07:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uOXalQIAh8UZo3dnH20BOfxLQJOx9pKBtjX6uDphisA=; b=F7W7MJ4tkTp70vmIFw91w7ZgT845c7vL279+neDTGjB4jGd+PgXmpL1CBesXn7tmpj yrirl4dbhWbvPJXUH1pw9v9QdPxXsESkYeON6khILjChCNayjpZE+mZqjw0MEaHS0XCl xE5dhK5ejb+5G99OmOCs7I5FqjcWZwYMZOCV8xCPxMczssaaaM7fGFTznyV0a9Virfp+ GLEfHZ681G7P1El+qTwmrZu79IEjHvcqm5LNCtjiP+qBTBncctPVnvIKG0bf4O8DjoK2 cim46Q9eTAypFH15m61Mi8j5my+Re99npJ3drQogufn5zYO1rDdRI8ERU1wE26GsGquw ruOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uOXalQIAh8UZo3dnH20BOfxLQJOx9pKBtjX6uDphisA=; b=NuQqm75lH1ZXN4oUZiC8Mo9eSQvBmSk/ThVRpNrj6rowtVJwnV++wnMvZ9TAAvjkNc 8fJ6CJsdf+EXbagiKY6Dj2uvtDdbC2hDSsQj+ibbImdFGu7zuGzdrNgLQpnipTbVlhuz zCGqECxFZxf1S+MWRpUdoWu0v1amHFsGMhrlOGH2tj0EzsAz96BOCCY1V5CBmkMLKend hfJfB1JwnRkRpGuMonCF005dSmpdLj8wa/cj0er0c3qJp4zz+aOAuWJNrZLlCx4cVXc8 1YpQfkcTpoNNwCS/aM6Tv/fXsRBVP3fy2ivrdU7DXkzeAyK4Y/cIl8o3aOXfTCLa+Frh cEGQ== X-Gm-Message-State: APjAAAUQUQVsGuN8r3OSTffXRqnzgSn1T5mS+JrLi5dE973H1lmQIk6d q9jHtJPp+/U1MeaptHLpRJ521oUU95AUjTO+fhgWVQ== X-Google-Smtp-Source: APXvYqw95v1HJNjFq6NxXANx2HJSYKFAedxbUN0WCX2cuyCFXTfg1tbtGGA16U2DXAE83wwuKEXXZ3z9oML/lvNewuM= X-Received: by 2002:a05:620a:1014:: with SMTP id z20mr21135229qkj.258.1556635577124; Tue, 30 Apr 2019 07:46:17 -0700 (PDT) MIME-Version: 1.0 References: <201904292205.x3TM5Q7Z058461@repo.freebsd.org> <20190430060849.GB97846@FreeBSD.org> <20190430142641.GA34567@raichu> In-Reply-To: <20190430142641.GA34567@raichu> From: Warner Losh Date: Tue, 30 Apr 2019 08:46:05 -0600 Message-ID: Subject: Re: svn commit: r346932 - head/sys/ufs/ufs To: Mark Johnston Cc: Alexey Dokuchaev , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 0B2017545B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 14:46:18 -0000 On Tue, Apr 30, 2019 at 8:27 AM Mark Johnston wrote: > On Tue, Apr 30, 2019 at 06:08:49AM +0000, Alexey Dokuchaev wrote: > > On Mon, Apr 29, 2019 at 10:05:26PM +0000, Mark Johnston wrote: > > > New Revision: 346932 > > > URL: https://svnweb.freebsd.org/changeset/base/346932 > > > > > > Log: > > > Optimize lseek(SEEK_DATA) on UFS. > > > > > > This version fixes the problems identified in r345244. > > > > > > Reviewed by: kib > > > @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > > > > +static ufs_lbn_t lbn_count(struct ufsmount *, int); > > > +static int readindir(struct vnode *, ufs_lbn_t, ufs2_daddr_t, struct > buf **); > > > > Is the prototype for static readindir() really needed here? > > Yes, when using a K&R definition. > > > > +static int > > > +readindir(vp, lbn, daddr, bpp) > > > + struct vnode *vp; > > > + ufs_lbn_t lbn; > > > + ufs2_daddr_t daddr; > > > + struct buf **bpp; > > > > Don't we prefer ASNI declarations over K&R these days? > > Yes, I was just staying consistent with the rest of the file. For new code, we do prefer ANSI prototypes and function definitions. But for ufs and friends, we're still using K&R for a variety of reasons. Warner From owner-svn-src-head@freebsd.org Tue Apr 30 15:17:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C4B1595299; Tue, 30 Apr 2019 15:17:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 9551076AFE; Tue, 30 Apr 2019 15:17:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E983326026E; Tue, 30 Apr 2019 17:17:02 +0200 (CEST) Subject: Re: svn commit: r346958 - head/sys/compat/linuxkpi/common/src To: Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904301041.x3UAfLvj054368@repo.freebsd.org> <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> From: Hans Petter Selasky Message-ID: <2f77d9f2-833d-f614-e193-a369086c01cf@selasky.org> Date: Tue, 30 Apr 2019 17:16:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9551076AFE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.966,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 15:17:05 -0000 On 4/30/19 3:10 PM, Niclas Zeising wrote: > On 2019-04-30 12:41, Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Apr 30 10:41:20 2019 >> New Revision: 346958 >> URL: https://svnweb.freebsd.org/changeset/base/346958 >> >> Log: >>    Reduce the number of mutexes after r346645 in the LinuxKPI. >>    Make function macro wrappers for locking and unlocking to ease >> readability. >>    No functional change. >>    Discussed with:        kib@, tychon@ and zeising@ > > I was not part of any discussion regarding this.  If this is related to > https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to > hold of for a bit, while we try to figure out why we are seeing > regressions in graphics with the latest dmar changes. > > Can you please revert this since it colludes the dmar graphics issue, > and it makes the suggested patch not apply cleanly, which makes it > harder to get people to help test. > Thank you! > Regards In response to your request I've collected fixes for all the known LinuxKPI+DMA issues at: https://reviews.freebsd.org/D20097 It is based on top of the latest -current. --HPS From owner-svn-src-head@freebsd.org Tue Apr 30 15:24:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83FAE1595658 for ; Tue, 30 Apr 2019 15:24:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 219A9771BA for ; Tue, 30 Apr 2019 15:24:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x82b.google.com with SMTP id e2so15849632qtb.4 for ; Tue, 30 Apr 2019 08:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yl2EMt15elu4oxf2JGGS6wqU0GrIaki3oQhxCPfnaow=; b=MtPKNmISxOGeOcuDPlil+B6yJsGxfVkO8FPRorYRJdzbPpyg3Xp/fTmlO4mhotBvr4 NCQeVBB/gLXghn4ocxuiaIR1WUm2MdV1ClEAmfGJcZT5w4E6L4NtG1Qk4cF/8PxE/MM5 sF0Vdkw1Kr65wD3XrUeRjr2Zwq99z4zbyVZ20f5GlPyWOeRyTDvbIISZjzRYxTvquXDn NmaC0KajhMnUiQdLNaa3NmQtdO1VhrlXC/m+XtXjGoSfYMnS4qMk+vmuX7grIxUoHbws KyqM9jd18XHBSbr9IiZTy6GLB2AZBEVL31W1jWrt38JgDsWZ/SIh4OtC19Gqi/crDeKN YNKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yl2EMt15elu4oxf2JGGS6wqU0GrIaki3oQhxCPfnaow=; b=txJTG6u4OUDhv2oWH45Ps7At3jF+NDGAWx3Jc07/co0g24JJDA8q8L+sZcxtDCCnML vuGJD9Lw67IbYFjhLPsoV8sHi4s6DPYzXj08fhmeWuSCjlyHu7dYYy/ZVWyyyajdNKt/ DYa4gA9gUoSAqbDIxHBu5mLJ8CPWBODi6Fh+S0ucvquo7jMJdSFnykrixlOfUp0Xq4ZY lHNAszWQAAmdGtSvw5AFm0j0VvfVPCyoLkINYTqDd+6iKUhkZ6WHi1PK8GbY1sZE0Coi XSezrVtcMVDTrtXrgnu1Fe5fo0nuPW4NhHxzhQ+YLSQGYgHuprgoRunDS/FpjB/cL/uM HXyg== X-Gm-Message-State: APjAAAUXkajxDMghC+RQ99d07olJdnOFr5qpcH9DavEWD/WKuvqFZBmQ xENSO1H2YKvIQFQLHNmOF7BP7+GCeWg1bFqTSufyZ2Bi X-Google-Smtp-Source: APXvYqwJvBMy+IdPrcmd61rB/pbSY8DYqM1V/8kxT8czKKEens8rgG93UxxQnkxzputbAzJCYukco++7lceOyVWEXVg= X-Received: by 2002:ac8:28d0:: with SMTP id j16mr56190135qtj.15.1556637877357; Tue, 30 Apr 2019 08:24:37 -0700 (PDT) MIME-Version: 1.0 References: <201904301041.x3UAfLvj054368@repo.freebsd.org> <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> <2f77d9f2-833d-f614-e193-a369086c01cf@selasky.org> In-Reply-To: <2f77d9f2-833d-f614-e193-a369086c01cf@selasky.org> From: Warner Losh Date: Tue, 30 Apr 2019 09:24:25 -0600 Message-ID: Subject: Re: svn commit: r346958 - head/sys/compat/linuxkpi/common/src To: Hans Petter Selasky Cc: Niclas Zeising , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 219A9771BA X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 15:24:38 -0000 On Tue, Apr 30, 2019 at 9:17 AM Hans Petter Selasky wrote: > On 4/30/19 3:10 PM, Niclas Zeising wrote: > > On 2019-04-30 12:41, Hans Petter Selasky wrote: > >> Author: hselasky > >> Date: Tue Apr 30 10:41:20 2019 > >> New Revision: 346958 > >> URL: https://svnweb.freebsd.org/changeset/base/346958 > >> > >> Log: > >> Reduce the number of mutexes after r346645 in the LinuxKPI. > >> Make function macro wrappers for locking and unlocking to ease > >> readability. > >> No functional change. > >> Discussed with: kib@, tychon@ and zeising@ > > > > I was not part of any discussion regarding this. If this is related to > > https://reviews.freebsd.org/D20097 I explicitly asked you on gitter to > > hold of for a bit, while we try to figure out why we are seeing > > regressions in graphics with the latest dmar changes. > > > > Can you please revert this since it colludes the dmar graphics issue, > > and it makes the suggested patch not apply cleanly, which makes it > > harder to get people to help test. > > Thank you! > > Regards > > In response to your request I've collected fixes for all the known > LinuxKPI+DMA issues at: > https://reviews.freebsd.org/D20097 > > It is based on top of the latest -current. > Hopefully this will solve the problem. Do you have any idea of when we might see resolution of this issue? I'd like to see it fixed by Friday either with fixes or a revert. Do you think that's a reasonable time frame? If not, what do you think a reasonable time frame will be? I know we have a number of unknowns to factor in, so my queries are based on our best guesses. Warner From owner-svn-src-head@freebsd.org Tue Apr 30 15:28:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7813F1595721; Tue, 30 Apr 2019 15:28: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B173777E4; Tue, 30 Apr 2019 15:28:53 +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 E52E2B83E; Tue, 30 Apr 2019 15:28: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 x3UFSqpd009425; Tue, 30 Apr 2019 15:28:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UFSqX0009424; Tue, 30 Apr 2019 15:28:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201904301528.x3UFSqX0009424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 30 Apr 2019 15:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346961 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 346961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B173777E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 15:28:53 -0000 Author: emaste Date: Tue Apr 30 15:28:52 2019 New Revision: 346961 URL: https://svnweb.freebsd.org/changeset/base/346961 Log: revert QEMU q35 platform use from r346748 It seems to be incompatible with the OVMF.fd (of unknown provenance) in use by the Cirrus-CI config. We will soon have a known OVMF build via a port/package (see review D19869) and we can switch back to q35 once packages are available. Discussed with: bcran Modified: head/tools/boot/ci-qemu-test.sh Modified: head/tools/boot/ci-qemu-test.sh ============================================================================== --- head/tools/boot/ci-qemu-test.sh Tue Apr 30 14:44:39 2019 (r346960) +++ head/tools/boot/ci-qemu-test.sh Tue Apr 30 15:28:52 2019 (r346961) @@ -97,7 +97,7 @@ trap tempdir_cleanup EXIT SIGINT SIGHUP SIGTERM SIGQUI # And, boot in QEMU. : ${BOOTLOG:=${TMPDIR:-/tmp}/ci-qemu-test-boot.log} timeout 300 \ - qemu-system-x86_64 -M q35 -m 256M -nodefaults \ + qemu-system-x86_64 -m 256M -nodefaults \ -drive if=pflash,format=raw,readonly,file=${OVMF} \ -serial stdio -vga none -nographic -monitor none \ -snapshot -hda fat:${ROOTDIR} 2>&1 | tee ${BOOTLOG} From owner-svn-src-head@freebsd.org Tue Apr 30 15:53:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFB811595FD6; Tue, 30 Apr 2019 15:53:54 +0000 (UTC) (envelope-from tycho@pobox.com) Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53]) (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 4758E8079C; Tue, 30 Apr 2019 15:53:54 +0000 (UTC) (envelope-from tycho@pobox.com) Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 5EA1D20A78; Tue, 30 Apr 2019 11:53:47 -0400 (EDT) (envelope-from tycho@pobox.com) 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=ZDMjYYOjZyfXiakzrJlI0UxG/X4=; b=fA yzI12zwU0J8+pQFBuD3kW3F0HczQWrIpqBJN6cRvgu3R1duqPOpT5jza+7AGUOu/ OTiaanCka0KCdD2nnlijoUjVLpme20mVkGa/8nLQHc0wcUPUgpwzAZyPw/VZS0Pp oxuUNtJoLM458rs9qiApbWyZNHLWcJYySuBvdcikw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:message-id :content-type:mime-version:subject:date:in-reply-to:cc:to :references; q=dns; s=sasl; b=K082JJ7me3AAw8YqCGR0aQIKXf2ITSQok+ YmvpMyFboGi9BIBADaEUFdVEbT9UN3csIea3kaeoyj5Q5RtjiZQpqKmMkD2mNIWF yKUJrglTzHJ1DV8793MJWG1DUk4Hy5jsYQAVm3YumG69YQVYl8FlkM2GdzPHwiG2 RpRS4c5IE= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 567BB20A77; Tue, 30 Apr 2019 11:53:47 -0400 (EDT) (envelope-from tycho@pobox.com) Received: from [10.0.1.195] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 1566520A76; Tue, 30 Apr 2019 11:53:44 -0400 (EDT) (envelope-from tycho@pobox.com) From: Tycho Nightingale Message-Id: <7927F561-6922-4960-90EC-BD36E0190A6F@pobox.com> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r346958 - head/sys/compat/linuxkpi/common/src Date: Tue, 30 Apr 2019 11:53:42 -0400 In-Reply-To: Cc: Hans Petter Selasky , Niclas Zeising , src-committers , svn-src-all , svn-src-head To: Warner Losh References: <201904301041.x3UAfLvj054368@repo.freebsd.org> <8f360678-2df1-fe7b-cb83-f47923534826@freebsd.org> <2f77d9f2-833d-f614-e193-a369086c01cf@selasky.org> X-Mailer: Apple Mail (2.3445.9.1) X-Pobox-Relay-ID: 222F23C0-6B60-11E9-A01B-EE24A11ADF13-09779102!pb-smtp21.pobox.com X-Rspamd-Queue-Id: 4758E8079C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.952,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 15:53:55 -0000 > On Apr 30, 2019, at 11:24 AM, Warner Losh wrote: >=20 >=20 > On Tue, Apr 30, 2019 at 9:17 AM Hans Petter Selasky > wrote: > On 4/30/19 3:10 PM, Niclas Zeising wrote: > > On 2019-04-30 12:41, Hans Petter Selasky wrote: > >> Author: hselasky > >> Date: Tue Apr 30 10:41:20 2019 > >> New Revision: 346958 > >> URL: https://svnweb.freebsd.org/changeset/base/346958 = > >> > >> Log: > >> Reduce the number of mutexes after r346645 in the LinuxKPI. > >> Make function macro wrappers for locking and unlocking to ease=20= > >> readability. > >> No functional change. > >> Discussed with: kib@, tychon@ and zeising@ > >=20 > > I was not part of any discussion regarding this. If this is related = to=20 > > https://reviews.freebsd.org/D20097 = I explicitly asked you on gitter to=20= > > hold of for a bit, while we try to figure out why we are seeing=20 > > regressions in graphics with the latest dmar changes. > >=20 > > Can you please revert this since it colludes the dmar graphics = issue,=20 > > and it makes the suggested patch not apply cleanly, which makes it=20= > > harder to get people to help test. > > Thank you! > > Regards >=20 > In response to your request I've collected fixes for all the known=20 > LinuxKPI+DMA issues at: > https://reviews.freebsd.org/D20097 = >=20 > It is based on top of the latest -current. >=20 > Hopefully this will solve the problem. Do you have any idea of when we = might see resolution of this issue? I'd like to see it fixed by Friday = either with fixes or a revert. Do you think that's a reasonable time = frame? If not, what do you think a reasonable time frame will be? I know = we have a number of unknowns to factor in, so my queries are based on = our best guesses. Friday seems reasonable. The issues that have been exposed are that several callers of the Linux = API are not compliant with the documented API. For example according to = the documentation, dma_map_sg() may coalesce entries and our current = implementation does that. This broke some graphics drivers. To support = these drivers, going back to the non-coalesced version is the only path = forward as the callee bugs redefine this API de facto; this is included = in D20097. Also included in D20097 is a fix to ensure sg_dma_len() is equal to = sg->length =E2=80=94 again to address assumptions in drivers. Finally, apparently some drivers load the same DMA address multiple = times without any prior unload. Those drivers need to work too; D20097 = contains a fix. Thanks hps@ for helping out! Tycho= From owner-svn-src-head@freebsd.org Tue Apr 30 17:18:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 560A71598412; Tue, 30 Apr 2019 17:18:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F061C84152; Tue, 30 Apr 2019 17:18:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9836CD59; Tue, 30 Apr 2019 17:18:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UHI67O068403; Tue, 30 Apr 2019 17:18:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHI60P068400; Tue, 30 Apr 2019 17:18:06 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201904301718.x3UHI60P068400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 30 Apr 2019 17:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346965 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 346965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F061C84152 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:18:07 -0000 Author: dchagin Date: Tue Apr 30 17:18:05 2019 New Revision: 346965 URL: https://svnweb.freebsd.org/changeset/base/346965 Log: Follow the FreeBSD and implement PDEATH_SIG prctl ops in the Linuxulator. It was first introduced in r163734 and missied by me in r283383. MFC after: 1 week Modified: head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_emul.h head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_emul.c Tue Apr 30 17:18:05 2019 (r346965) @@ -127,7 +127,6 @@ linux_proc_init(struct thread *td, struct thread *newt em->em_tid = p->p_pid; em->flags = 0; - em->pdeath_signal = 0; em->robust_futexes = NULL; em->child_clear_tid = NULL; em->child_set_tid = NULL; Modified: head/sys/compat/linux/linux_emul.h ============================================================================== --- head/sys/compat/linux/linux_emul.h Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_emul.h Tue Apr 30 17:18:05 2019 (r346965) @@ -40,7 +40,6 @@ struct linux_emuldata { int *child_set_tid; /* in clone(): Child's TID to set on clone */ int *child_clear_tid;/* in clone(): Child's TID to clear on exit */ - int pdeath_signal; /* parent death signal */ int flags; /* thread emuldata flags */ int em_tid; /* thread id */ Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Tue Apr 30 16:52:50 2019 (r346964) +++ head/sys/compat/linux/linux_misc.c Tue Apr 30 17:18:05 2019 (r346965) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1993,7 +1994,6 @@ linux_prctl(struct thread *td, struct linux_prctl_args int error = 0, max_size; struct proc *p = td->td_proc; char comm[LINUX_MAX_COMM_LEN]; - struct linux_emuldata *em; int pdeath_signal; #ifdef DEBUG @@ -2007,17 +2007,18 @@ linux_prctl(struct thread *td, struct linux_prctl_args case LINUX_PR_SET_PDEATHSIG: if (!LINUX_SIG_VALID(args->arg2)) return (EINVAL); - em = em_find(td); - KASSERT(em != NULL, ("prctl: emuldata not found.\n")); - em->pdeath_signal = args->arg2; - break; + pdeath_signal = linux_to_bsd_signal(args->arg2); + return (kern_procctl(td, P_PID, 0, PROC_PDEATHSIG_CTL, + &pdeath_signal)); case LINUX_PR_GET_PDEATHSIG: - em = em_find(td); - KASSERT(em != NULL, ("prctl: emuldata not found.\n")); - pdeath_signal = em->pdeath_signal; - error = copyout(&pdeath_signal, + error = kern_procctl(td, P_PID, 0, PROC_PDEATHSIG_STATUS, + &pdeath_signal); + if (error != 0) + return (error); + pdeath_signal = bsd_to_linux_signal(pdeath_signal); + return (copyout(&pdeath_signal, (void *)(register_t)args->arg2, - sizeof(pdeath_signal)); + sizeof(pdeath_signal))); break; case LINUX_PR_GET_KEEPCAPS: /* From owner-svn-src-head@freebsd.org Tue Apr 30 17:42:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFBCC1598F71; Tue, 30 Apr 2019 17:42:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB2C852DF; Tue, 30 Apr 2019 17:42:06 +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 4B104D246; Tue, 30 Apr 2019 17:42:06 +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 x3UHg6pR083917; Tue, 30 Apr 2019 17:42:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHg62b083916; Tue, 30 Apr 2019 17:42:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904301742.x3UHg62b083916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 17:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346968 - head/sbin/reboot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sbin/reboot X-SVN-Commit-Revision: 346968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FB2C852DF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:42:07 -0000 Author: ian Date: Tue Apr 30 17:42:05 2019 New Revision: 346968 URL: https://svnweb.freebsd.org/changeset/base/346968 Log: Update the manpage text to show the output generated by the first-stage bootloader these days (x86 instead of i386). Modified: head/sbin/reboot/boot_i386.8 Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Tue Apr 30 17:30:37 2019 (r346967) +++ head/sbin/reboot/boot_i386.8 Tue Apr 30 17:42:05 2019 (r346968) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 15, 2018 +.Dd April 30, 2019 .Dt BOOT 8 i386 .Os .Sh NAME @@ -95,7 +95,7 @@ program is documented separately. After the boot blocks have been loaded, you should see a prompt similar to the following: .Bd -literal ->> FreeBSD/i386 BOOT +>> FreeBSD/x86 BOOT Default: 0:ad(0,a)/boot/loader boot: .Ed From owner-svn-src-head@freebsd.org Tue Apr 30 17:44:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E54C15990BC; Tue, 30 Apr 2019 17:44:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f172.google.com (mail-it1-f172.google.com [209.85.166.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D05A85552; Tue, 30 Apr 2019 17:44:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f172.google.com with SMTP id v143so6145211itc.1; Tue, 30 Apr 2019 10:44:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=yoJmsV10x1BRW8nTQUkTBeFHXZa3vBRnpTyYgBZmLrk=; b=BlNk+BednTjPvUJGoj1XKOG38XD93snByL+sx3lXN4vx/IKZopsaAJPIRwOXdBf/qB iJXc1e5H6jln1mqQE8c4J5lbbg2HppdHmDjw+SW01OV3GWUo3ECMPOgSoPap0Dr8bEvH /VBHIohW3myvjq2sHxPjQRE3v98WlfdOJtpsVB01/HhRwZ7Eta2+VnHyq4DZyaYYeCJh TQXXZF2RtJf6NmRk0tO6XAD1J6MBcy4dKL9/+jRuxn3XCV9Xu/EzS60sKl/+ND88Yq6d cb+THhx+x18Zi9yqSKXIPfdSylbpF0zwkpR0yWi1++mRrAJAajYya19mcT1sqkijbr/T Jh9Q== X-Gm-Message-State: APjAAAXNf3bgYj3VWqtsbxp+0MJlo8PE1tPR70Tt7B61iuWg1B3qcbMh I05ZoC4+0dnANs/vvyl5hpytvoLO X-Google-Smtp-Source: APXvYqwNKeeI31N4wCEZbVOnlQDslikl6p574cmgnF2ggqk6Uh1BjN84j4IfK9XfBFSOStiPzsDoNg== X-Received: by 2002:a24:6a8b:: with SMTP id l133mr4626161itc.92.1556646275643; Tue, 30 Apr 2019 10:44:35 -0700 (PDT) Received: from mail-it1-f179.google.com (mail-it1-f179.google.com. [209.85.166.179]) by smtp.gmail.com with ESMTPSA id 1sm1875154ity.9.2019.04.30.10.44.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 10:44:35 -0700 (PDT) Received: by mail-it1-f179.google.com with SMTP id q14so6113470itk.0; Tue, 30 Apr 2019 10:44:35 -0700 (PDT) X-Received: by 2002:a05:660c:130f:: with SMTP id f15mr1223669itb.166.1556646275090; Tue, 30 Apr 2019 10:44:35 -0700 (PDT) MIME-Version: 1.0 References: <201904301429.x3UET9ia077742@repo.freebsd.org> In-Reply-To: <201904301429.x3UET9ia077742@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 30 Apr 2019 10:44:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346959 - in head/release: . tools To: Glen Barber Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 9D05A85552 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:44:43 -0000 Thanks, Glen! On Tue, Apr 30, 2019 at 7:29 AM Glen Barber wrote: > > Author: gjb > Date: Tue Apr 30 14:29:09 2019 > New Revision: 346959 > URL: https://svnweb.freebsd.org/changeset/base/346959 > > Log: > Reduce the default image size for virtual machine disk images from > 30GB to 3GB. The raw images can be resized using truncate(1), and > other formats can be resized with tools included with other tools > included with other hypervisors. > > Enable the growfs(8) rc(8) at firstboot if the disk was resized > prior to booting the virtual machine for the first time. > > Discussed with: several > PR: 232313 (requested in other context) > MFC after: 3 days > Sponsored by: The FreeBSD Foundation From owner-svn-src-head@freebsd.org Tue Apr 30 17:45:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D87B715990FD; Tue, 30 Apr 2019 17:45:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 80BB985666; Tue, 30 Apr 2019 17:45:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CA97D27A; Tue, 30 Apr 2019 17:45:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3UHjNPS084123; Tue, 30 Apr 2019 17:45:23 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UHjNJR084122; Tue, 30 Apr 2019 17:45:23 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201904301745.x3UHjNJR084122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 30 Apr 2019 17:45:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346969 - head/stand/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/zfsboot X-SVN-Commit-Revision: 346969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 80BB985666 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 17:45:24 -0000 Author: tsoome Date: Tue Apr 30 17:45:22 2019 New Revision: 346969 URL: https://svnweb.freebsd.org/changeset/base/346969 Log: zfsboot: to detect disk size, use GPT information first If we do have GPT on disk, read the disk size from it and do not call int13. Since int13 does report bogus informatiopn too often, rather trust the partition table. We are using the same strategy with loader. MFC after: 1 month Modified: head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Tue Apr 30 17:42:05 2019 (r346968) +++ head/stand/i386/zfsboot/zfsboot.c Tue Apr 30 17:45:22 2019 (r346969) @@ -460,6 +460,33 @@ copy_dsk(struct zfsdsk *zdsk) } /* + * Get disk size from GPT. + */ +static uint64_t +drvsize_gpt(struct dsk *dskp) +{ +#ifdef GPT + struct gpt_hdr hdr; + char *sec; + + sec = dmadat->secbuf; + if (drvread(dskp, sec, 1, 1)) + return (0); + + memcpy(&hdr, sec, sizeof(hdr)); + if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || + hdr.hdr_lba_self != 1 || hdr.hdr_revision < 0x00010000 || + hdr.hdr_entsz < sizeof(struct gpt_ent) || + DEV_BSIZE % hdr.hdr_entsz != 0) { + return (0); + } + return (hdr.hdr_lba_alt + 1); +#else + return (0); +#endif +} + +/* * Get disk size from eax=0x800 and 0x4800. We need to probe both * because 0x4800 may not be available and we would like to get more * or less correct disk size - if it is possible at all. @@ -474,6 +501,11 @@ drvsize_ext(struct zfsdsk *zdsk) int cyl, hds, sec; dskp = &zdsk->dsk; + + /* Try to read disk size from GPT */ + size = drvsize_gpt(dskp); + if (size != 0) + return (size); v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-head@freebsd.org Tue Apr 30 18:48:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B38D159AB3F; Tue, 30 Apr 2019 18:48:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 329748823E; Tue, 30 Apr 2019 18:48:21 +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 0CB5BDE9B; Tue, 30 Apr 2019 18:48:21 +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 x3UImKrp017407; Tue, 30 Apr 2019 18:48:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3UImKTS017406; Tue, 30 Apr 2019 18:48:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201904301848.x3UImKTS017406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 30 Apr 2019 18:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346973 - head/stand/i386/gptboot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/stand/i386/gptboot X-SVN-Commit-Revision: 346973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 329748823E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 18:48:21 -0000 Author: ian Date: Tue Apr 30 18:48:20 2019 New Revision: 346973 URL: https://svnweb.freebsd.org/changeset/base/346973 Log: Add a paragraph that mentions gptboot having an interactive mode, and direct the user to the boot(8) manpage, which provides the details on that. Modified: head/stand/i386/gptboot/gptboot.8 Modified: head/stand/i386/gptboot/gptboot.8 ============================================================================== --- head/stand/i386/gptboot/gptboot.8 Tue Apr 30 18:42:42 2019 (r346972) +++ head/stand/i386/gptboot/gptboot.8 Tue Apr 30 18:48:20 2019 (r346973) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2014 +.Dd April 30, 2019 .Dt GPTBOOT 8 .Os .Sh NAME @@ -39,6 +39,20 @@ is installed in a .Cm freebsd-boot partition with .Xr gpart 8 . +.Pp +When it starts, +.Nm +first reads the GPT and determines which drive and partition to +boot from, as described under +.Sx BOOTING , +below. +If it does not find an eligible partition, or if the user hits a +key within three seconds, +.Nm +switches from auto-boot to interactive mode. +Interactive mode allows manual selection of the disk, partition, +filename, and boot option flags, as described in +.Xr boot 8 . .Sh IMPLEMENTATION NOTES The GPT standard allows a variable number of partitions, but .Nm From owner-svn-src-head@freebsd.org Tue Apr 30 21:38:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6A86159F294; Tue, 30 Apr 2019 21:38:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CADF8FDE4; Tue, 30 Apr 2019 21:38:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DABBFC23; Tue, 30 Apr 2019 21:38:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3ULcdfY011998; Tue, 30 Apr 2019 21:38:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3ULcdQR011997; Tue, 30 Apr 2019 21:38:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201904302138.x3ULcdQR011997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 30 Apr 2019 21:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346976 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 346976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CADF8FDE4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Apr 2019 21:38:40 -0000 Author: mav Date: Tue Apr 30 21:38:38 2019 New Revision: 346976 URL: https://svnweb.freebsd.org/changeset/base/346976 Log: Respect quotes and escapes when splitting exports fields. Without this r293305 was still unable to handle names with spaces. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Tue Apr 30 21:27:32 2019 (r346975) +++ head/usr.sbin/mountd/mountd.c Tue Apr 30 21:38:38 2019 (r346976) @@ -2824,18 +2824,27 @@ static void nextfield(char **cp, char **endcp) { char *p; + char quot = 0; p = *cp; while (*p == ' ' || *p == '\t') p++; - if (*p == '\n' || *p == '\0') - *cp = *endcp = p; - else { - *cp = p++; - while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0') - p++; - *endcp = p; - } + *cp = p; + while (*p != '\0') { + if (quot) { + if (*p == quot) + quot = 0; + } else { + if (*p == '\\' && *(p + 1) != '\0') + p++; + else if (*p == '\'' || *p == '"') + quot = *p; + else if (*p == ' ' || *p == '\t') + break; + } + p++; + }; + *endcp = p; } /* @@ -2907,8 +2916,8 @@ parsecred(char *namelist, struct xucred *cr) /* * Get the user's password table entry. */ - names = strsep_quote(&namelist, " \t\n"); - name = strsep(&names, ":"); + names = namelist; + name = strsep_quote(&names, ":"); /* Bug? name could be NULL here */ if (isdigit(*name) || *name == '-') pw = getpwuid(atoi(name)); @@ -2952,7 +2961,7 @@ parsecred(char *namelist, struct xucred *cr) } cr->cr_ngroups = 0; while (names != NULL && *names != '\0' && cr->cr_ngroups < XU_NGROUPS) { - name = strsep(&names, ":"); + name = strsep_quote(&names, ":"); if (isdigit(*name) || *name == '-') { cr->cr_groups[cr->cr_ngroups++] = atoi(name); } else { From owner-svn-src-head@freebsd.org Wed May 1 00:06:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B06AB15A22DB; Wed, 1 May 2019 00:06:30 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail03.asahi-net.or.jp (mail03.asahi-net.or.jp [202.224.55.15]) by mx1.freebsd.org (Postfix) with ESMTP id 8DDDD6DCFB; Wed, 1 May 2019 00:06:24 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from rv515.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail03.asahi-net.or.jp (Postfix) with ESMTPSA id A23824017F; Wed, 1 May 2019 09:06:11 +0900 (JST) Date: Tue, 30 Apr 2019 20:05:34 -0400 From: Yoshihiro Ota To: Yoshihiro Ota Cc: Ed Maste , svn-src-head , svn-src-all , src-committers Subject: Re: svn commit: r346315 - head/lib/libcasper/services/cap_fileargs Message-Id: <20190430200534.f7eb9da6d4ba113d77ed61d9@j.email.ne.jp> In-Reply-To: <20190424002434.06aad79f1135a3f2e7248da6@j.email.ne.jp> References: <201904171602.x3HG2wQq054372@repo.freebsd.org> <20190423000625.d051ac725a82186d1736858b@j.email.ne.jp> <20190424002434.06aad79f1135a3f2e7248da6@j.email.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 8DDDD6DCFB X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ota@j.email.ne.jp designates 202.224.55.15 as permitted sender) smtp.mailfrom=ota@j.email.ne.jp X-Spamd-Result: default: False [-1.19 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:202.224.55.0/24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[email.ne.jp]; NEURAL_HAM_LONG(-0.60)[-0.596,0]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[sbmx.asahi-net.or.jp]; NEURAL_SPAM_SHORT(0.04)[0.041,0]; NEURAL_HAM_MEDIUM(-0.94)[-0.944,0]; IP_SCORE(0.11)[asn: 4685(0.63), country: JP(-0.06)]; RCVD_NO_TLS_LAST(0.10)[]; RCVD_IN_DNSWL_LOW(-0.10)[15.55.224.202.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4685, ipnet:202.224.32.0/19, country:JP]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[135.119.76.72.zen.spamhaus.org : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 00:06:30 -0000 I looked into this more. I started wondering if "xdev" has been obsolete after /usr/obj/. dir chaneg. Both of these commands worked okay: % make kernel-toolchain kernel TARGET_ARCH=mips KERNCONF=PB92 -C /usr/src % make buildworld TARGET_ARCH=arm -C /usr/src While I kept getting compile errors by: % make xdev-build TARGET_ARCH=mips TARGET=mips -C /usr/src In other words, if I don't run explict xdev command, buildworld and buildkernel compile okay. Hiro On Wed, 24 Apr 2019 00:24:34 -0400 Yoshihiro Ota wrote: > Hi Ed and thank you for taking a look. > > my svn info says 346593 which is after few other fixes were commited. > > I'm on i386 arch. > I haven't done installworld yet after picking up libcasper changes. > 'make buildworld' works fine. > 'make xdev-build' fails and I tried with both "arm" and "mips" for TARGET and TARGET_ARCH. > Both fail same way. > Please check your /usr/include/casper/ca_fileargs.h and I suspect that's where you pick up > FA_OPEN. > > I attached a log file this time. > > Regards, > Hiro > > On Tue, 23 Apr 2019 09:49:00 -0400 > Ed Maste wrote: > > > On Tue, 23 Apr 2019 at 00:07, Yoshihiro Ota wrote: > > > > > > It looks this change is causing 'make xdev TARGET=mips TARGET_ARCH=mips' to fail as the > > > following with HEAD checked out under "/usr/obj/freebsd": > > > > Hello Hiro-san, sorry about that. > > > > I tried `make xdev TARGET=mips TARGET_ARCH=mips` on HEAD just now (but > > it failed on the install as DESTDIR wasn't set and I ran as non-root). > > Just `make xdev-build` was successful though. > > > > What version were you trying to build? There were (several) followup > > commits to address issues with the initial commit of cap_fileargs > > lstat support. From owner-svn-src-head@freebsd.org Wed May 1 05:42:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169421582DE0; Wed, 1 May 2019 05:42:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71D4984BCC; Wed, 1 May 2019 05:42:14 +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 1492C1D06A; Wed, 1 May 2019 05:42:14 +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 x415gDTd065802; Wed, 1 May 2019 05:42:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x415gDJx065801; Wed, 1 May 2019 05:42:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905010542.x415gDJx065801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 1 May 2019 05:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346984 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 346984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71D4984BCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.81 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.81)[-0.809,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 05:42:15 -0000 Author: imp Date: Wed May 1 05:42:13 2019 New Revision: 346984 URL: https://svnweb.freebsd.org/changeset/base/346984 Log: Use D_PARTISGPT rather than bare 255 These three cases dovetail with other places in the code where we use or set D_PARTISGPT when we mean that the partitioning scheme is GPT. Use this #define to make the code easier to undertand. Reviewed by: tsoome@ Differential Revision: https://reviews.freebsd.org/D20122 Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Wed May 1 01:53:19 2019 (r346983) +++ head/stand/common/disk.c Wed May 1 05:42:13 2019 (r346984) @@ -286,9 +286,9 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize od->entrysize = part.end - part.start + 1; slice = part.index; if (ptable_gettype(od->table) == PTABLE_GPT) { - partition = 255; + partition = D_PARTISGPT; goto out; /* Nothing more to do */ - } else if (partition == 255) { + } else if (partition == D_PARTISGPT) { /* * When we try to open GPT partition, but partition * table isn't GPT, reset d_partition value to -1 @@ -419,7 +419,7 @@ disk_parsedev(struct disk_devdesc *dev, const char *de /* we don't support nested partitions on GPT */ if (*cp != '\0' && *cp != ':') return (EINVAL); - partition = 255; + partition = D_PARTISGPT; } else #endif #ifdef LOADER_MBR_SUPPORT From owner-svn-src-head@freebsd.org Wed May 1 07:28:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E810515928E8; Wed, 1 May 2019 07:28:10 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74D5A8FDA7; Wed, 1 May 2019 07:28:09 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wm1-f66.google.com with SMTP id o25so6307627wmf.5; Wed, 01 May 2019 00:28:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:from:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KsIG70QEzPib2ajR8JxPLUGaPyK7qQCfqzwojcXhN6o=; b=HmZUo4SsA7Ms4PGT8zii5DeI/M98Ej/K3i13kNOBwa7H23lTkiIE2w2lBpWO7abXbK Uf1vtdSwvcGjRx1jreFY1wNdAZSmLgFyOOHitMUWgFffzFvj9KBRc1IVS6xB69pQSCSN D5Et/udvGq4NH9ucsiop5xCeRJTEyQofK3DlJIGNuh8MyaQEKoHhcV+AlCirPHdpmcwl zq7L+SXAQP6pRMjSJtphTAzYTaoimcHXvmiVYzxhNYm8Pr16lxQGojTq/vY4icgDUbLT hSYbmcsdi1jL8MDj6jpEHXornnvA41y7abDQGS6ms7GlbkWYSWXuZSMXgr1b1a0pnLny yi4Q== X-Gm-Message-State: APjAAAXMwkfmiDILlJBCMlv8NLSeJryi6Z2OzNS92myvl1SrTF0LobP4 ZUv/NDEaPRTmbMeO5A2u0sH2jqCI X-Google-Smtp-Source: APXvYqxFGsQZFI5R8VOOUG1x7dvH1aZ3iQuuq2LxA8UizZLMWe2jXvGf0X+zxS8cpZOIQHFsO27lsw== X-Received: by 2002:a05:600c:2506:: with SMTP id d6mr3251685wma.106.1556695687584; Wed, 01 May 2019 00:28:07 -0700 (PDT) Received: from [10.223.3.125] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id d3sm6720116wmf.46.2019.05.01.00.28.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 00:28:07 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en From: Slava Shwartsman To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> Message-ID: <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> Date: Wed, 1 May 2019 10:28:05 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 74D5A8FDA7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of slavashwartsman@gmail.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=slavashwartsman@gmail.com X-Spamd-Result: default: False [-2.47 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[slavash@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FORGED_SENDER(0.30)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; IP_SCORE(-1.23)[ipnet: 209.85.128.0/17(-3.85), asn: 15169(-2.24), country: US(-0.06)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.77)[0.771,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.128.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 07:28:11 -0000 On 01-May-19 10:09, Slava Shwartsman wrote: > > > On 30-Apr-19 00:14, John Baldwin wrote: >> On 4/25/19 12:10 AM, Slava Shwartsman wrote: >>> >>> >>> On 17-Apr-19 00:28, John Baldwin wrote: >>>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>>> Author: slavash >>>>>>> Date: Wed Dec  5 14:25:03 2018 >>>>>>> New Revision: 341586 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>>> >>>>>>> Log: >>>>>>>      mlx5en: Implement backpressure indication. >>>>>>>      The backpressure indication is implemented using an >>>>>>> unlimited rate type of >>>>>>>      mbuf send tag. When the upper layers typically the socket >>>>>>> layer has obtained such >>>>>>>      a tag, it can then query the destination driver queue for >>>>>>> the current >>>>>>>      amount of space available in the send queue. >>>>>>>      A single mbuf send tag may be referenced multiple times and >>>>>>> a refcount has been added >>>>>>>      to the mlx5e_priv structure to track its usage. Because the >>>>>>> send tag resides >>>>>>>      in the mlx5e_channel structure, there is no need to wait for >>>>>>> refcounts to reach >>>>>>>      zero until the mlx4en(4) driver is detached. The channels >>>>>>> structure is persistant >>>>>>>      during the lifetime of the mlx5en(4) driver it belongs to >>>>>>> and can so be accessed >>>>>>>      without any need of synchronization. >>>>>>>      The mlx5e_snd_tag structure was extended to contain a type >>>>>>> field, because there are now >>>>>>>      two different tag types which end up in the driver which >>>>>>> need to be distinguished. >>>>>>>      Submitted by:   hselasky@ >>>>>>>      Approved by:    hselasky (mentor) >>>>>>>      MFC after:      1 week >>>>>>>      Sponsored by:   Mellanox Technologies >>>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >>>>>>>         struct mlx5e_sq *sq; >>>>>>>         int ret; >>>>>>> -    sq = mlx5e_select_queue(ifp, mb); >>>>>>> -    if (unlikely(sq == NULL)) { >>>>>>> -#ifdef RATELIMIT >>>>>>> -        /* Check for route change */ >>>>>>> -        if (mb->m_pkthdr.snd_tag != NULL && >>>>>>> -            mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>> +    if (mb->m_pkthdr.snd_tag != NULL) { >>>>>>> +        sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>>> +        if (unlikely(sq == NULL)) { >>>>>>> +            /* Check for route change */ >>>>>>> +            if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>> +                /* Free mbuf */ >>>>>>> +                m_freem(mb); >>>>>>> + >>>>>>> +                /* >>>>>>> +                 * Tell upper layers about route >>>>>>> +                 * change and to re-transmit this >>>>>>> +                 * packet: >>>>>>> +                 */ >>>>>>> +                return (EAGAIN); >>>>>>> +            } >>>>>> >>>>>> Hi, >>>>>> >>>>>> I just discovered something strange and found that this commit is the >>>>>> cause. >>>>>> The test system has mlx5en 100G interface. It has two vlans: >>>>>> vlan500 and >>>>>> vlan100. >>>>>> Via vlan500 it receives some packets flows. Then it routes these >>>>>> packets >>>>>> into vlan100. >>>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>>> >>>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>>> CPU     ID                    FUNCTION:NAME >>>>>>     23  54338                ip6_output:return 35 >>>>>>     16  54338                ip6_output:return 35 >>>>>>     21  54338                ip6_output:return 35 >>>>>>     22  54338                ip6_output:return 35 >>>>>>     24  54338                ip6_output:return 35 >>>>>>     23  54338                ip6_output:return 35 >>>>>>     14  54338                ip6_output:return 35 >>>>>> ^C >>>>>> >>>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>>> CPU     ID                    FUNCTION:NAME >>>>>>     16  69030                mlx5e_xmit:return 35 >>>>>>     23  69030                mlx5e_xmit:return 35 >>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>     25  69030                mlx5e_xmit:return 35 >>>>>>     24  69030                mlx5e_xmit:return 35 >>>>>>     21  69030                mlx5e_xmit:return 35 >>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>> ^C >>>>>> >>>>>> The kernel config is GENERIC. >>>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>>> >>>>> >>>>> Hi, >>>>> >>>>> This might be a case where rcvif in the mbuf's pktheader is not >>>>> cleared >>>>> before the packet is fed back on the wire. >>>>> >>>>> John Baldwin is working on the send tags implementation, to eliminate >>>>> the EAGAIN handling in the network drivers. >>>> >>>> I will try to push this branch sooner then since it affects more >>>> than just >>>> TLS.  Part of the change includes a new flag we can use to assert >>>> that we >>> Thanks John! >>>> aren't just getting a stale rcvif (though there are also now >>>> assertions in >>>> ip_output that should catch this case I think). >>>> >>> >>> >>> >>> Hi Andrey, >>> >>> Yes, we were able to reproduce this issue in house. If you don't mind, I >>> prefer to wait for John's update - where he eliminates the EAGAIN >>> handling in the network drivers. >> >> I have rebased the branch for this, but for now it will just panic sooner >> I believe by tripping an assertion.  Can you grab the diff (or just >> the branch) >> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce >> under a >> kernel with INVARIANTS?  I think we will have to explicitly clear the >> 'rcvif' >> pointer somewhere, but I want to see what the stack trace looks like >> so I can >> think about the "right" place to clear it. >> > > Hi John, > > I grabbed your branch (which doesn't build BTW due to libbe(3): Fix > mis-application of patch (SHLIBDIR) so I just reverted it). > > The kernel doesn't panic in this scenario - it just that the packets are > being dropped. So I added a kdb_backtrace right before the return > (EAGAIN) in mlx5e_xmit: > > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe0000547d90 > mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 > vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 > ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 > ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 > ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 > ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 > ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005485d0 > ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 > ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005486d0 > ether_input() at ether_input+0x73/frame 0xfffffe0000548700 > vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 > ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 > ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe0000548850 > ether_input() at ether_input+0x73/frame 0xfffffe0000548880 > mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 > mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 > mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 > ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 > fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > > > Please ping me if you want me to try anything else. > > > Slava My bad - tested with master. Re-testing now. Slava From owner-svn-src-head@freebsd.org Wed May 1 07:09:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 202FA158F057; Wed, 1 May 2019 07:09:30 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17EBC8F041; Wed, 1 May 2019 07:09:29 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wm1-f66.google.com with SMTP id q15so621827wmf.3; Wed, 01 May 2019 00:09:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Nwv+MxoTi8a47eJZHr4gBkqerIhJC+GpQf5VSIO6an0=; b=Y+0432sBRocFuU7dmmJK4mfmjHjZx8dsa66qUnyCtjUPNZ9v5fdql6YTABc7OUQ3Ju jTdUDe+Vts7Rj2Y9KuPi5zUVrysMDka4CgSQGh2waEiZEJ0iL2vm2d2Mw45vzXUIYrKL znuyGFMJ/oQ5/NeN4UUXiJdckX81O5s8J5EEAr6Ol4Ch3aIt8zF0mi/D6vk5cNisCTxV l1Nd/uylHasPwA977uYw5eSzf0iV7USQbGA3KpEGFkYkWsI4i6VbJvrmuDE2aTaAwvl/ pzEdYKPEiWIxJWIVqsNK5CfbyVOdpMbrIiFTi/HQG954cVQE5WVtPKrPXtGrhVxTTgp2 zlsg== X-Gm-Message-State: APjAAAViLqxxegp1hK3mY24kbwvVy5wRlON+uuTYz8qPgmtUjqVXiY/b 7PiIcInozMlSaXUVaVcE862GXjc3 X-Google-Smtp-Source: APXvYqyeJEv83uUZ+7ofMs6kRZF62No0mhG3cSR0nXLoi1QnRMXtpUvu4daBvzW721GKLkkxRiBLew== X-Received: by 2002:a1c:6783:: with SMTP id b125mr5548050wmc.79.1556694562025; Wed, 01 May 2019 00:09:22 -0700 (PDT) Received: from [10.223.3.125] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id a4sm6016742wmf.45.2019.05.01.00.09.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 00:09:20 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> From: Slava Shwartsman Message-ID: <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> Date: Wed, 1 May 2019 10:09:19 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 17EBC8F041 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of slavashwartsman@gmail.com designates 209.85.128.66 as permitted sender) smtp.mailfrom=slavashwartsman@gmail.com X-Spamd-Result: default: False [-2.37 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[slavash@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; FORGED_SENDER(0.30)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; IP_SCORE(-1.23)[ipnet: 209.85.128.0/17(-3.85), asn: 15169(-2.24), country: US(-0.06)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.87)[0.871,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.128.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 07:09:30 -0000 On 30-Apr-19 00:14, John Baldwin wrote: > On 4/25/19 12:10 AM, Slava Shwartsman wrote: >> >> >> On 17-Apr-19 00:28, John Baldwin wrote: >>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>> Author: slavash >>>>>> Date: Wed Dec 5 14:25:03 2018 >>>>>> New Revision: 341586 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>> >>>>>> Log: >>>>>> mlx5en: Implement backpressure indication. >>>>>> >>>>>> The backpressure indication is implemented using an unlimited rate type of >>>>>> mbuf send tag. When the upper layers typically the socket layer has obtained such >>>>>> a tag, it can then query the destination driver queue for the current >>>>>> amount of space available in the send queue. >>>>>> >>>>>> A single mbuf send tag may be referenced multiple times and a refcount has been added >>>>>> to the mlx5e_priv structure to track its usage. Because the send tag resides >>>>>> in the mlx5e_channel structure, there is no need to wait for refcounts to reach >>>>>> zero until the mlx4en(4) driver is detached. The channels structure is persistant >>>>>> during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed >>>>>> without any need of synchronization. >>>>>> >>>>>> The mlx5e_snd_tag structure was extended to contain a type field, because there are now >>>>>> two different tag types which end up in the driver which need to be distinguished. >>>>>> >>>>>> Submitted by: hselasky@ >>>>>> Approved by: hselasky (mentor) >>>>>> MFC after: 1 week >>>>>> Sponsored by: Mellanox Technologies >>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) >>>>>> struct mlx5e_sq *sq; >>>>>> int ret; >>>>>> >>>>>> - sq = mlx5e_select_queue(ifp, mb); >>>>>> - if (unlikely(sq == NULL)) { >>>>>> -#ifdef RATELIMIT >>>>>> - /* Check for route change */ >>>>>> - if (mb->m_pkthdr.snd_tag != NULL && >>>>>> - mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>> + if (mb->m_pkthdr.snd_tag != NULL) { >>>>>> + sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>> + if (unlikely(sq == NULL)) { >>>>>> + /* Check for route change */ >>>>>> + if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>> + /* Free mbuf */ >>>>>> + m_freem(mb); >>>>>> + >>>>>> + /* >>>>>> + * Tell upper layers about route >>>>>> + * change and to re-transmit this >>>>>> + * packet: >>>>>> + */ >>>>>> + return (EAGAIN); >>>>>> + } >>>>> >>>>> Hi, >>>>> >>>>> I just discovered something strange and found that this commit is the >>>>> cause. >>>>> The test system has mlx5en 100G interface. It has two vlans: vlan500 and >>>>> vlan100. >>>>> Via vlan500 it receives some packets flows. Then it routes these packets >>>>> into vlan100. >>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>> >>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>> CPU ID FUNCTION:NAME >>>>> 23 54338 ip6_output:return 35 >>>>> 16 54338 ip6_output:return 35 >>>>> 21 54338 ip6_output:return 35 >>>>> 22 54338 ip6_output:return 35 >>>>> 24 54338 ip6_output:return 35 >>>>> 23 54338 ip6_output:return 35 >>>>> 14 54338 ip6_output:return 35 >>>>> ^C >>>>> >>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>> CPU ID FUNCTION:NAME >>>>> 16 69030 mlx5e_xmit:return 35 >>>>> 23 69030 mlx5e_xmit:return 35 >>>>> 26 69030 mlx5e_xmit:return 35 >>>>> 25 69030 mlx5e_xmit:return 35 >>>>> 24 69030 mlx5e_xmit:return 35 >>>>> 21 69030 mlx5e_xmit:return 35 >>>>> 26 69030 mlx5e_xmit:return 35 >>>>> ^C >>>>> >>>>> The kernel config is GENERIC. >>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>> >>>> >>>> Hi, >>>> >>>> This might be a case where rcvif in the mbuf's pktheader is not cleared >>>> before the packet is fed back on the wire. >>>> >>>> John Baldwin is working on the send tags implementation, to eliminate >>>> the EAGAIN handling in the network drivers. >>> >>> I will try to push this branch sooner then since it affects more than just >>> TLS. Part of the change includes a new flag we can use to assert that we >> Thanks John! >>> aren't just getting a stale rcvif (though there are also now assertions in >>> ip_output that should catch this case I think). >>> >> >> >> >> Hi Andrey, >> >> Yes, we were able to reproduce this issue in house. If you don't mind, I >> prefer to wait for John's update - where he eliminates the EAGAIN >> handling in the network drivers. > > I have rebased the branch for this, but for now it will just panic sooner > I believe by tripping an assertion. Can you grab the diff (or just the branch) > from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce under a > kernel with INVARIANTS? I think we will have to explicitly clear the 'rcvif' > pointer somewhere, but I want to see what the stack trace looks like so I can > think about the "right" place to clear it. > Hi John, I grabbed your branch (which doesn't build BTW due to libbe(3): Fix mis-application of patch (SHLIBDIR) so I just reverted it). The kernel doesn't panic in this scenario - it just that the packets are being dropped. So I added a kdb_backtrace right before the return (EAGAIN) in mlx5e_xmit: KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0000547d90 mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005485d0 ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005486d0 ether_input() at ether_input+0x73/frame 0xfffffe0000548700 vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe0000548850 ether_input() at ether_input+0x73/frame 0xfffffe0000548880 mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Please ping me if you want me to try anything else. Slava From owner-svn-src-head@freebsd.org Wed May 1 08:40:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD7F1580D18; Wed, 1 May 2019 08:40:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 164676B9DF; Wed, 1 May 2019 08:40:40 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 34A052601EC; Wed, 1 May 2019 10:40:37 +0200 (CEST) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: slavash@FreeBSD.org, John Baldwin , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> From: Hans Petter Selasky Message-ID: <83cdfc8f-7223-590c-0e6e-6cd55fe9b355@selasky.org> Date: Wed, 1 May 2019 10:40:09 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 164676B9DF X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.67 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: mail.turbocat.net]; NEURAL_HAM_SHORT(-0.84)[-0.836,0]; IP_SCORE(-2.53)[ip: (-8.90), ipnet: 2a01:4f8::/29(-2.05), asn: 24940(-1.68), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 08:40:42 -0000 Hi, Try this first: https://reviews.freebsd.org/D20117 --HPS From owner-svn-src-head@freebsd.org Wed May 1 08:06:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75C371598AA5; Wed, 1 May 2019 08:06:07 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 025D96A889; Wed, 1 May 2019 08:06:05 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wr1-f65.google.com with SMTP id o4so11852778wra.3; Wed, 01 May 2019 01:06:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:from:to:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pYpzvyvmGs4c9zK5kbcxmuwABTB2cM9SVj3k4V1GTEc=; b=mB6LNcFZ6+nCNuqycex25hZzWz4EsK4S1/PWDK55o8uirR6R86Ox2vY4w6TDZl5Kx/ FfltUENRwuKfsZIcaQEWBFpO4HoIiiFu3oG1hEqRUJWo3UBBrya2guzubP8Xg1BuMZuj BDScFOOuhdP0cbUjyrJvEp9iOR95Rs12eo6HAtiMEIbZ8zjtwr3sAhSrT6AqWRDIe8hU EVn32wUNM4TFYyF6zzsKcKOq2yFZdymEJWhBjiHYv1RYEBN+kC9DpUPYjPsFwa11zdZu X+Z5b/2ejz7ZRsPJjE4J6Ia0wbPUlwFQQaQ+otAi7WxuXhLFMHexgTOOMBuCv2r0DLOj JkMA== X-Gm-Message-State: APjAAAXzShPTgy51s+yFEW2potKTcqIOI1iSJ+RT5EmBKniPIZVQtwkX 25UHdWevDcjo5L764Fa8AyppVgcP X-Google-Smtp-Source: APXvYqzt/8cvyaWEl4Fks1gLuC9gMca7xILJKY6V7KQhYykjC5Rpl2iQT58726REevZYtd7kM+GiXw== X-Received: by 2002:adf:dcc7:: with SMTP id x7mr12370052wrm.197.1556697958472; Wed, 01 May 2019 01:05:58 -0700 (PDT) Received: from [10.223.3.125] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id i30sm7305802wrc.8.2019.05.01.01.05.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 01:05:57 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en From: Slava Shwartsman To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> Message-ID: <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> Date: Wed, 1 May 2019 11:05:56 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 025D96A889 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of slavashwartsman@gmail.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=slavashwartsman@gmail.com X-Spamd-Result: default: False [-4.07 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[slavash@FreeBSD.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.82)[-0.825,0]; FORGED_SENDER(0.30)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; IP_SCORE(-1.23)[ipnet: 209.85.128.0/17(-3.85), asn: 15169(-2.24), country: US(-0.06)]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[slavash@FreeBSD.org,slavashwartsman@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[65.221.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 08:06:07 -0000 On 01-May-19 10:28, Slava Shwartsman wrote: > > > On 01-May-19 10:09, Slava Shwartsman wrote: >> >> >> On 30-Apr-19 00:14, John Baldwin wrote: >>> On 4/25/19 12:10 AM, Slava Shwartsman wrote: >>>> >>>> >>>> On 17-Apr-19 00:28, John Baldwin wrote: >>>>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>>>> Author: slavash >>>>>>>> Date: Wed Dec  5 14:25:03 2018 >>>>>>>> New Revision: 341586 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>>>> >>>>>>>> Log: >>>>>>>>      mlx5en: Implement backpressure indication. >>>>>>>>      The backpressure indication is implemented using an >>>>>>>> unlimited rate type of >>>>>>>>      mbuf send tag. When the upper layers typically the socket >>>>>>>> layer has obtained such >>>>>>>>      a tag, it can then query the destination driver queue for >>>>>>>> the current >>>>>>>>      amount of space available in the send queue. >>>>>>>>      A single mbuf send tag may be referenced multiple times and >>>>>>>> a refcount has been added >>>>>>>>      to the mlx5e_priv structure to track its usage. Because the >>>>>>>> send tag resides >>>>>>>>      in the mlx5e_channel structure, there is no need to wait >>>>>>>> for refcounts to reach >>>>>>>>      zero until the mlx4en(4) driver is detached. The channels >>>>>>>> structure is persistant >>>>>>>>      during the lifetime of the mlx5en(4) driver it belongs to >>>>>>>> and can so be accessed >>>>>>>>      without any need of synchronization. >>>>>>>>      The mlx5e_snd_tag structure was extended to contain a type >>>>>>>> field, because there are now >>>>>>>>      two different tag types which end up in the driver which >>>>>>>> need to be distinguished. >>>>>>>>      Submitted by:   hselasky@ >>>>>>>>      Approved by:    hselasky (mentor) >>>>>>>>      MFC after:      1 week >>>>>>>>      Sponsored by:   Mellanox Technologies >>>>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf >>>>>>>> *mb) >>>>>>>>         struct mlx5e_sq *sq; >>>>>>>>         int ret; >>>>>>>> -    sq = mlx5e_select_queue(ifp, mb); >>>>>>>> -    if (unlikely(sq == NULL)) { >>>>>>>> -#ifdef RATELIMIT >>>>>>>> -        /* Check for route change */ >>>>>>>> -        if (mb->m_pkthdr.snd_tag != NULL && >>>>>>>> -            mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>> +    if (mb->m_pkthdr.snd_tag != NULL) { >>>>>>>> +        sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>>>> +        if (unlikely(sq == NULL)) { >>>>>>>> +            /* Check for route change */ >>>>>>>> +            if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>> +                /* Free mbuf */ >>>>>>>> +                m_freem(mb); >>>>>>>> + >>>>>>>> +                /* >>>>>>>> +                 * Tell upper layers about route >>>>>>>> +                 * change and to re-transmit this >>>>>>>> +                 * packet: >>>>>>>> +                 */ >>>>>>>> +                return (EAGAIN); >>>>>>>> +            } >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I just discovered something strange and found that this commit is >>>>>>> the >>>>>>> cause. >>>>>>> The test system has mlx5en 100G interface. It has two vlans: >>>>>>> vlan500 and >>>>>>> vlan100. >>>>>>> Via vlan500 it receives some packets flows. Then it routes these >>>>>>> packets >>>>>>> into vlan100. >>>>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>>>> >>>>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>     23  54338                ip6_output:return 35 >>>>>>>     16  54338                ip6_output:return 35 >>>>>>>     21  54338                ip6_output:return 35 >>>>>>>     22  54338                ip6_output:return 35 >>>>>>>     24  54338                ip6_output:return 35 >>>>>>>     23  54338                ip6_output:return 35 >>>>>>>     14  54338                ip6_output:return 35 >>>>>>> ^C >>>>>>> >>>>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>     16  69030                mlx5e_xmit:return 35 >>>>>>>     23  69030                mlx5e_xmit:return 35 >>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>     25  69030                mlx5e_xmit:return 35 >>>>>>>     24  69030                mlx5e_xmit:return 35 >>>>>>>     21  69030                mlx5e_xmit:return 35 >>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>> ^C >>>>>>> >>>>>>> The kernel config is GENERIC. >>>>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>>>> >>>>>> >>>>>> Hi, >>>>>> >>>>>> This might be a case where rcvif in the mbuf's pktheader is not >>>>>> cleared >>>>>> before the packet is fed back on the wire. >>>>>> >>>>>> John Baldwin is working on the send tags implementation, to eliminate >>>>>> the EAGAIN handling in the network drivers. >>>>> >>>>> I will try to push this branch sooner then since it affects more >>>>> than just >>>>> TLS.  Part of the change includes a new flag we can use to assert >>>>> that we >>>> Thanks John! >>>>> aren't just getting a stale rcvif (though there are also now >>>>> assertions in >>>>> ip_output that should catch this case I think). >>>>> >>>> >>>> >>>> >>>> Hi Andrey, >>>> >>>> Yes, we were able to reproduce this issue in house. If you don't >>>> mind, I >>>> prefer to wait for John's update - where he eliminates the EAGAIN >>>> handling in the network drivers. >>> >>> I have rebased the branch for this, but for now it will just panic >>> sooner >>> I believe by tripping an assertion.  Can you grab the diff (or just >>> the branch) >>> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce >>> under a >>> kernel with INVARIANTS?  I think we will have to explicitly clear the >>> 'rcvif' >>> pointer somewhere, but I want to see what the stack trace looks like >>> so I can >>> think about the "right" place to clear it. >>> >> >> Hi John, >> >> I grabbed your branch (which doesn't build BTW due to libbe(3): Fix >> mis-application of patch (SHLIBDIR) so I just reverted it). >> >> The kernel doesn't panic in this scenario - it just that the packets >> are being dropped. So I added a kdb_backtrace right before the return >> (EAGAIN) in mlx5e_xmit: >> >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> 0xfffffe0000547d90 >> mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 >> vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 >> ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 >> ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 >> ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 >> ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 >> ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >> 0xfffffe00005485d0 >> ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 >> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >> 0xfffffe00005486d0 >> ether_input() at ether_input+0x73/frame 0xfffffe0000548700 >> vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 >> ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 >> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >> 0xfffffe0000548850 >> ether_input() at ether_input+0x73/frame 0xfffffe0000548880 >> mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 >> mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 >> mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 >> ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 >> fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 >> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 >> --- trap 0, rip = 0, rsp = 0, rbp = 0 --- >> >> >> Please ping me if you want me to try anything else. >> >> >> Slava > > My bad - tested with master. Re-testing now. > > > Slava Got it now: panic: Assertion m->m_pkthdr.snd_tag == NULL failed at /usr/src/sys/netinet/ip_output.c:213 cpuid = 0 time = 1556697834 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00005ac1f0 vpanic() at vpanic+0x19d/frame 0xfffffe00005ac240 panic() at panic+0x43/frame 0xfffffe00005ac2a0 ip_output() at ip_output+0x159f/frame 0xfffffe00005ac3f0 ip_forward() at ip_forward+0x38c/frame 0xfffffe00005ac4b0 ip_input() at ip_input+0x7f5/frame 0xfffffe00005ac560 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac5d0 ether_demux() at ether_demux+0x147/frame 0xfffffe00005ac600 ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac660 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac6d0 ether_input() at ether_input+0x7d/frame 0xfffffe00005ac700 vlan_input() at vlan_input+0x1e7/frame 0xfffffe00005ac750 ether_demux() at ether_demux+0x12d/frame 0xfffffe00005ac780 ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac7e0 netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac850 ether_input() at ether_input+0x7d/frame 0xfffffe00005ac880 mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005ac9a0 mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005ac9d0 mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe00005aca10 ithread_loop() at ithread_loop+0x187/frame 0xfffffe00005aca70 fork_exit() at fork_exit+0x84/frame 0xfffffe00005acab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00005acab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- KDB: enter: panic [ thread pid 12 tid 100113 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why I can keep the machine in this state for a while now if you want to take a look at anything specific. Slava From owner-svn-src-head@freebsd.org Wed May 1 13:00:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 574F815967EB; Wed, 1 May 2019 13:00: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F02A175161; Wed, 1 May 2019 13:00:33 +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 C901721986; Wed, 1 May 2019 13:00:33 +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 x41D0X1C091792; Wed, 1 May 2019 13:00:33 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41D0XeF091791; Wed, 1 May 2019 13:00:33 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905011300.x41D0XeF091791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 May 2019 13:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346989 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 346989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F02A175161 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 13:00:34 -0000 Author: trasz Date: Wed May 1 13:00:33 2019 New Revision: 346989 URL: https://svnweb.freebsd.org/changeset/base/346989 Log: Remove trailing slashes from URLs; current mandoc(1) seems to render them just fine. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Wed May 1 09:05:48 2019 (r346988) +++ head/share/man/man7/development.7 Wed May 1 13:00:33 2019 (r346989) @@ -93,7 +93,7 @@ For coding conventions, see To ask questions regarding development, use the mailing lists, such as freebsd-arch@ and freebsd-hackers@: .Pp -.Lk https://lists.FreeBSD.org/ +.Lk https://lists.FreeBSD.org .Pp To get your patches integrated into the main .Fx @@ -102,7 +102,7 @@ it is a code review tool that allows other developers suggest improvements, and, eventually, allows them to pick up the change and commit it: .Pp -.Lk https://reviews.FreeBSD.org/ +.Lk https://reviews.FreeBSD.org .Sh EXAMPLES Check out the CURRENT branch, build it, and install, overwriting the current system: From owner-svn-src-head@freebsd.org Wed May 1 13:15:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CE9D1596CA4; Wed, 1 May 2019 13:15:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4725759B2; Wed, 1 May 2019 13:15:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EC8E21D28; Wed, 1 May 2019 13:15:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41DF757002485; Wed, 1 May 2019 13:15:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41DF7UT002484; Wed, 1 May 2019 13:15:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905011315.x41DF7UT002484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 1 May 2019 13:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346990 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 346990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4725759B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 13:15:08 -0000 Author: kib Date: Wed May 1 13:15:06 2019 New Revision: 346990 URL: https://svnweb.freebsd.org/changeset/base/346990 Log: Fix another race between vm_map_protect() and vm_map_wire(). vm_map_wire() increments entry->wire_count, after that it drops the map lock both for faulting in the entry' pages, and for marking next entry in the requested region as IN_TRANSITION. Only after all entries are faulted in, MAP_ENTRY_USER_WIRE flag is set. This makes it possible for vm_map_protect() to run while other entry' MAP_ENTRY_IN_TRANSITION flag is handled, and vm_map_busy() lock does not prevent it. In particular, if the call to vm_map_protect() adds VM_PROT_WRITE to CoW entry, it would fail to call vm_fault_copy_entry(). There are at least two consequences of the race: the top object in the shadow chain is not populated with writeable pages, and second, the entry eventually get contradictory flags MAP_ENTRY_NEEDS_COPY | MAP_ENTRY_USER_WIRED with VM_PROT_WRITE set. Handle it by waiting for all MAP_ENTRY_IN_TRANSITION flags to go away in vm_map_protect(), which does not drop map lock afterwards. Note that vm_map_busy_wait() is left as is. Reported and tested by: pho (previous version) Reviewed by: Doug Moore , markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20091 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed May 1 13:00:33 2019 (r346989) +++ head/sys/vm/vm_map.c Wed May 1 13:15:06 2019 (r346990) @@ -2347,7 +2347,7 @@ int vm_map_protect(vm_map_t map, vm_offset_t start, vm_offset_t end, vm_prot_t new_prot, boolean_t set_max) { - vm_map_entry_t current, entry; + vm_map_entry_t current, entry, in_tran; vm_object_t obj; struct ucred *cred; vm_prot_t old_prot; @@ -2355,6 +2355,8 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off if (start == end) return (KERN_SUCCESS); +again: + in_tran = NULL; vm_map_lock(map); /* @@ -2387,6 +2389,22 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } + if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0) + in_tran = entry; + } + + /* + * Postpone the operation until all in transition map entries + * are stabilized. In-transition entry might already have its + * pages wired and wired_count incremented, but + * MAP_ENTRY_USER_WIRED flag not yet set, and visible to other + * threads because the map lock is dropped. In this case we + * would miss our call to vm_fault_copy_entry(). + */ + if (in_tran != NULL) { + in_tran->eflags |= MAP_ENTRY_NEEDS_WAKEUP; + vm_map_unlock_and_wait(map, 0); + goto again; } /* From owner-svn-src-head@freebsd.org Wed May 1 14:20:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8BCA1598158; Wed, 1 May 2019 14:20:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B8EB77CD8; Wed, 1 May 2019 14:20:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10EF022765; Wed, 1 May 2019 14:20:32 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41EKVQ4034437; Wed, 1 May 2019 14:20:31 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41EKVZu034436; Wed, 1 May 2019 14:20:31 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201905011420.x41EKVZu034436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 1 May 2019 14:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346993 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 346993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B8EB77CD8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 14:20:32 -0000 Author: ganbold Date: Wed May 1 14:20:31 2019 New Revision: 346993 URL: https://svnweb.freebsd.org/changeset/base/346993 Log: Add a hw.model sysctl oid for arm64 which reports the CPU model similar to armv6/7. Reviewed by: andrew, manu Differential Revision: https://reviews.freebsd.org/D20123 Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Wed May 1 13:43:49 2019 (r346992) +++ head/sys/arm64/arm64/identcpu.c Wed May 1 14:20:31 2019 (r346993) @@ -72,6 +72,10 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); +static char cpu_model[64]; +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, + cpu_model, sizeof(cpu_model), "Machine model"); + /* * Per-CPU affinity as provided in MPIDR_EL1 * Indexed by CPU number in logical order selected by the system. @@ -1312,6 +1316,10 @@ identify_cpu(void) cpu_desc[cpu].cpu_revision = CPU_REV(midr); cpu_desc[cpu].cpu_variant = CPU_VAR(midr); + + snprintf(cpu_model, sizeof(cpu_model), "%s %s r%dp%d", + cpu_desc[cpu].cpu_impl_name, cpu_desc[cpu].cpu_part_name, + cpu_desc[cpu].cpu_variant, cpu_desc[cpu].cpu_revision); /* Save affinity for current CPU */ cpu_desc[cpu].mpidr = get_mpidr(); From owner-svn-src-head@freebsd.org Wed May 1 15:03:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB2F15991F6; Wed, 1 May 2019 15:03:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 124F3815AE; Wed, 1 May 2019 15:03:13 +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 D997222FDE; Wed, 1 May 2019 15:03:12 +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 x41F3Cv5060457; Wed, 1 May 2019 15:03:12 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41F3Cjv060456; Wed, 1 May 2019 15:03:12 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905011503.x41F3Cjv060456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 1 May 2019 15:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346994 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 346994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 124F3815AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 15:03:13 -0000 Author: br Date: Wed May 1 15:03:12 2019 New Revision: 346994 URL: https://svnweb.freebsd.org/changeset/base/346994 Log: Deactivate IRQ resource by calling to intr_deactivate_irq(). This is the part of INTRNG support that was missed. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/nexus.c Modified: head/sys/riscv/riscv/nexus.c ============================================================================== --- head/sys/riscv/riscv/nexus.c Wed May 1 14:20:31 2019 (r346993) +++ head/sys/riscv/riscv/nexus.c Wed May 1 15:03:12 2019 (r346994) @@ -357,13 +357,17 @@ nexus_deactivate_resource(device_t bus, device_t child bus_size_t psize; bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + psize = (bus_size_t)rman_get_size(r); + vaddr = rman_get_bushandle(r); - if (vaddr != 0) { - bus_space_unmap(&memmap_bus, vaddr, psize); - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); + if (vaddr != 0) { + bus_space_unmap(&memmap_bus, vaddr, psize); + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); + } + } else if (type == SYS_RES_IRQ) { + intr_deactivate_irq(child, r); } return (rman_deactivate_resource(r)); From owner-svn-src-head@freebsd.org Wed May 1 15:28:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 740621599AFD; Wed, 1 May 2019 15:28:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDD7D8239A; Wed, 1 May 2019 15:28:23 +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 B454423363; Wed, 1 May 2019 15:28:23 +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 x41FSN6h071283; Wed, 1 May 2019 15:28:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41FSNls071281; Wed, 1 May 2019 15:28:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905011528.x41FSNls071281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 1 May 2019 15:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346995 - head/tests/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/vm X-SVN-Commit-Revision: 346995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DDD7D8239A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 15:28:24 -0000 Author: markj Date: Wed May 1 15:28:23 2019 New Revision: 346995 URL: https://svnweb.freebsd.org/changeset/base/346995 Log: Add a few regression tests for mlock(2). These are intended to exercise some rarely executed code paths. MFC after: 2 weeks Added: head/tests/sys/vm/mlock_test.c (contents, props changed) Modified: head/tests/sys/vm/Makefile Modified: head/tests/sys/vm/Makefile ============================================================================== --- head/tests/sys/vm/Makefile Wed May 1 15:03:12 2019 (r346994) +++ head/tests/sys/vm/Makefile Wed May 1 15:28:23 2019 (r346995) @@ -4,6 +4,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/vm -ATF_TESTS_C+= mmap_test +ATF_TESTS_C+= mlock_test \ + mmap_test .include Added: head/tests/sys/vm/mlock_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/vm/mlock_test.c Wed May 1 15:28:23 2019 (r346995) @@ -0,0 +1,174 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Mark Johnston + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +static void +test_wired_copy_on_write(void *addr, size_t len) +{ + int status, val; + pid_t pid; + + pid = fork(); + if (pid == -1) + atf_tc_fail("fork() failed: %s", strerror(errno)); + if (pid == 0) { + if (mlock(addr, len) != 0) + _exit(1); + if (ptrace(PT_TRACE_ME, 0, NULL, 0) != 0) + _exit(2); + if (raise(SIGSTOP) != 0) + _exit(3); + if (munlock(addr, len) != 0) + _exit(4); + _exit(0); + } + + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE_MSG(!WIFEXITED(status), + "child exited with status %d", WEXITSTATUS(status)); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + errno = 0; + val = ptrace(PT_READ_D, pid, addr, 0); + ATF_REQUIRE(errno == 0); + ATF_REQUIRE(ptrace(PT_WRITE_D, pid, addr, val) == 0); + ATF_REQUIRE(ptrace(PT_CONTINUE, pid, (caddr_t)1, 0) == 0); + ATF_REQUIRE(waitpid(pid, &status, 0) == pid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE_MSG(WEXITSTATUS(status) == 0, + "child exited with status %d", WSTOPSIG(status)); +} + +/* + * Use ptrace(2) to trigger a copy-on-write fault of anonymous memory. + */ +ATF_TC_WITHOUT_HEAD(mlock__copy_on_write_anon); +ATF_TC_BODY(mlock__copy_on_write_anon, tc) +{ + char *addr; + int len; + + len = getpagesize(); + addr = mmap(NULL, len, PROT_READ, MAP_ANON, -1, 0); + ATF_REQUIRE(addr != MAP_FAILED); + + test_wired_copy_on_write(addr, len); +} + +/* + * Use ptrace(2) to trigger a copy-on-write fault of a read-only text page. + */ +ATF_TC_WITHOUT_HEAD(mlock__copy_on_write_vnode); +ATF_TC_BODY(mlock__copy_on_write_vnode, tc) +{ + void *addr; + int len; + + len = getpagesize(); + addr = (void *)((uintptr_t)test_wired_copy_on_write & ~(len - 1)); + + test_wired_copy_on_write(addr, len); +} + +/* + * Try truncating and then resizing an mlock()ed mapping. + */ +ATF_TC_WITHOUT_HEAD(mlock__truncate_and_resize); +ATF_TC_BODY(mlock__truncate_and_resize, tc) +{ + char filename[16]; + char *addr; + int fd, i, len; + + snprintf(filename, sizeof(filename), "tmp.XXXXXX"); + fd = mkstemp(filename); + ATF_REQUIRE(fd >= 0); + ATF_REQUIRE(unlink(filename) == 0); + + len = getpagesize(); + ATF_REQUIRE(ftruncate(fd, len) == 0); + + addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(addr != MAP_FAILED); + ATF_REQUIRE(mlock(addr, len) == 0); + memset(addr, 1, len); + ATF_REQUIRE(ftruncate(fd, 0) == 0); + ATF_REQUIRE(ftruncate(fd, len) == 0); + for (i = 0; i < len; i++) + ATF_REQUIRE(addr[i] == 0); + ATF_REQUIRE(munlock(addr, len) == 0); +} + +/* + * Make sure that we can munlock() a truncated mapping. + */ +ATF_TC_WITHOUT_HEAD(mlock__truncate_and_unlock); +ATF_TC_BODY(mlock__truncate_and_unlock, tc) +{ + char filename[16]; + void *addr; + int fd, len; + + snprintf(filename, sizeof(filename), "tmp.XXXXXX"); + fd = mkstemp(filename); + ATF_REQUIRE(fd >= 0); + ATF_REQUIRE(unlink(filename) == 0); + + len = getpagesize(); + ATF_REQUIRE(ftruncate(fd, len) == 0); + + addr = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + ATF_REQUIRE(addr != MAP_FAILED); + ATF_REQUIRE(mlock(addr, len) == 0); + ATF_REQUIRE(ftruncate(fd, 0) == 0); + ATF_REQUIRE(munlock(addr, len) == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, mlock__copy_on_write_anon); + ATF_TP_ADD_TC(tp, mlock__copy_on_write_vnode); + ATF_TP_ADD_TC(tp, mlock__truncate_and_resize); + ATF_TP_ADD_TC(tp, mlock__truncate_and_unlock); + + return (atf_no_error()); +} From owner-svn-src-head@freebsd.org Wed May 1 16:45:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF081159B4FD; Wed, 1 May 2019 16:45:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7045E84BAC; Wed, 1 May 2019 16:45:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 723EA354D; Wed, 1 May 2019 16:45:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: slavash@FreeBSD.org, Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <054b81ee-0bdc-184a-9928-8679b53d52cc@FreeBSD.org> Date: Wed, 1 May 2019 09:45:54 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7045E84BAC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 16:45:58 -0000 On 5/1/19 1:05 AM, Slava Shwartsman wrote: > > > On 01-May-19 10:28, Slava Shwartsman wrote: >> >> >> On 01-May-19 10:09, Slava Shwartsman wrote: >>> >>> >>> On 30-Apr-19 00:14, John Baldwin wrote: >>>> On 4/25/19 12:10 AM, Slava Shwartsman wrote: >>>>> >>>>> >>>>> On 17-Apr-19 00:28, John Baldwin wrote: >>>>>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>>>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>>>>> Author: slavash >>>>>>>>> Date: Wed Dec  5 14:25:03 2018 >>>>>>>>> New Revision: 341586 >>>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>>>>> >>>>>>>>> Log: >>>>>>>>>      mlx5en: Implement backpressure indication. >>>>>>>>>      The backpressure indication is implemented using an >>>>>>>>> unlimited rate type of >>>>>>>>>      mbuf send tag. When the upper layers typically the socket >>>>>>>>> layer has obtained such >>>>>>>>>      a tag, it can then query the destination driver queue for >>>>>>>>> the current >>>>>>>>>      amount of space available in the send queue. >>>>>>>>>      A single mbuf send tag may be referenced multiple times and >>>>>>>>> a refcount has been added >>>>>>>>>      to the mlx5e_priv structure to track its usage. Because the >>>>>>>>> send tag resides >>>>>>>>>      in the mlx5e_channel structure, there is no need to wait >>>>>>>>> for refcounts to reach >>>>>>>>>      zero until the mlx4en(4) driver is detached. The channels >>>>>>>>> structure is persistant >>>>>>>>>      during the lifetime of the mlx5en(4) driver it belongs to >>>>>>>>> and can so be accessed >>>>>>>>>      without any need of synchronization. >>>>>>>>>      The mlx5e_snd_tag structure was extended to contain a type >>>>>>>>> field, because there are now >>>>>>>>>      two different tag types which end up in the driver which >>>>>>>>> need to be distinguished. >>>>>>>>>      Submitted by:   hselasky@ >>>>>>>>>      Approved by:    hselasky (mentor) >>>>>>>>>      MFC after:      1 week >>>>>>>>>      Sponsored by:   Mellanox Technologies >>>>>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf >>>>>>>>> *mb) >>>>>>>>>         struct mlx5e_sq *sq; >>>>>>>>>         int ret; >>>>>>>>> -    sq = mlx5e_select_queue(ifp, mb); >>>>>>>>> -    if (unlikely(sq == NULL)) { >>>>>>>>> -#ifdef RATELIMIT >>>>>>>>> -        /* Check for route change */ >>>>>>>>> -        if (mb->m_pkthdr.snd_tag != NULL && >>>>>>>>> -            mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>>> +    if (mb->m_pkthdr.snd_tag != NULL) { >>>>>>>>> +        sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>>>>> +        if (unlikely(sq == NULL)) { >>>>>>>>> +            /* Check for route change */ >>>>>>>>> +            if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>>> +                /* Free mbuf */ >>>>>>>>> +                m_freem(mb); >>>>>>>>> + >>>>>>>>> +                /* >>>>>>>>> +                 * Tell upper layers about route >>>>>>>>> +                 * change and to re-transmit this >>>>>>>>> +                 * packet: >>>>>>>>> +                 */ >>>>>>>>> +                return (EAGAIN); >>>>>>>>> +            } >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> I just discovered something strange and found that this commit is >>>>>>>> the >>>>>>>> cause. >>>>>>>> The test system has mlx5en 100G interface. It has two vlans: >>>>>>>> vlan500 and >>>>>>>> vlan100. >>>>>>>> Via vlan500 it receives some packets flows. Then it routes these >>>>>>>> packets >>>>>>>> into vlan100. >>>>>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>>>>> >>>>>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>>     23  54338                ip6_output:return 35 >>>>>>>>     16  54338                ip6_output:return 35 >>>>>>>>     21  54338                ip6_output:return 35 >>>>>>>>     22  54338                ip6_output:return 35 >>>>>>>>     24  54338                ip6_output:return 35 >>>>>>>>     23  54338                ip6_output:return 35 >>>>>>>>     14  54338                ip6_output:return 35 >>>>>>>> ^C >>>>>>>> >>>>>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>>     16  69030                mlx5e_xmit:return 35 >>>>>>>>     23  69030                mlx5e_xmit:return 35 >>>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>>     25  69030                mlx5e_xmit:return 35 >>>>>>>>     24  69030                mlx5e_xmit:return 35 >>>>>>>>     21  69030                mlx5e_xmit:return 35 >>>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>> ^C >>>>>>>> >>>>>>>> The kernel config is GENERIC. >>>>>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>>>>> >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> This might be a case where rcvif in the mbuf's pktheader is not >>>>>>> cleared >>>>>>> before the packet is fed back on the wire. >>>>>>> >>>>>>> John Baldwin is working on the send tags implementation, to eliminate >>>>>>> the EAGAIN handling in the network drivers. >>>>>> >>>>>> I will try to push this branch sooner then since it affects more >>>>>> than just >>>>>> TLS.  Part of the change includes a new flag we can use to assert >>>>>> that we >>>>> Thanks John! >>>>>> aren't just getting a stale rcvif (though there are also now >>>>>> assertions in >>>>>> ip_output that should catch this case I think). >>>>>> >>>>> >>>>> >>>>> >>>>> Hi Andrey, >>>>> >>>>> Yes, we were able to reproduce this issue in house. If you don't >>>>> mind, I >>>>> prefer to wait for John's update - where he eliminates the EAGAIN >>>>> handling in the network drivers. >>>> >>>> I have rebased the branch for this, but for now it will just panic >>>> sooner >>>> I believe by tripping an assertion.  Can you grab the diff (or just >>>> the branch) >>>> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce >>>> under a >>>> kernel with INVARIANTS?  I think we will have to explicitly clear the >>>> 'rcvif' >>>> pointer somewhere, but I want to see what the stack trace looks like >>>> so I can >>>> think about the "right" place to clear it. >>>> >>> >>> Hi John, >>> >>> I grabbed your branch (which doesn't build BTW due to libbe(3): Fix >>> mis-application of patch (SHLIBDIR) so I just reverted it). >>> >>> The kernel doesn't panic in this scenario - it just that the packets >>> are being dropped. So I added a kdb_backtrace right before the return >>> (EAGAIN) in mlx5e_xmit: >>> >>> KDB: stack backtrace: >>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>> 0xfffffe0000547d90 >>> mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 >>> vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 >>> ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 >>> ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 >>> ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 >>> ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 >>> ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 >>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>> 0xfffffe00005485d0 >>> ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 >>> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 >>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>> 0xfffffe00005486d0 >>> ether_input() at ether_input+0x73/frame 0xfffffe0000548700 >>> vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 >>> ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 >>> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 >>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>> 0xfffffe0000548850 >>> ether_input() at ether_input+0x73/frame 0xfffffe0000548880 >>> mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 >>> mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 >>> mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 >>> ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 >>> fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 >>> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 >>> --- trap 0, rip = 0, rsp = 0, rbp = 0 --- >>> >>> >>> Please ping me if you want me to try anything else. >>> >>> >>> Slava >> >> My bad - tested with master. Re-testing now. >> >> >> Slava > > Got it now: > > panic: Assertion m->m_pkthdr.snd_tag == NULL failed at > /usr/src/sys/netinet/ip_output.c:213 > cpuid = 0 > time = 1556697834 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe00005ac1f0 > vpanic() at vpanic+0x19d/frame 0xfffffe00005ac240 > panic() at panic+0x43/frame 0xfffffe00005ac2a0 > ip_output() at ip_output+0x159f/frame 0xfffffe00005ac3f0 > ip_forward() at ip_forward+0x38c/frame 0xfffffe00005ac4b0 > ip_input() at ip_input+0x7f5/frame 0xfffffe00005ac560 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac5d0 > ether_demux() at ether_demux+0x147/frame 0xfffffe00005ac600 > ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac660 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac6d0 > ether_input() at ether_input+0x7d/frame 0xfffffe00005ac700 > vlan_input() at vlan_input+0x1e7/frame 0xfffffe00005ac750 > ether_demux() at ether_demux+0x12d/frame 0xfffffe00005ac780 > ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac7e0 > netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac850 > ether_input() at ether_input+0x7d/frame 0xfffffe00005ac880 > mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005ac9a0 > mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005ac9d0 > mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe00005aca10 > ithread_loop() at ithread_loop+0x187/frame 0xfffffe00005aca70 > fork_exit() at fork_exit+0x84/frame 0xfffffe00005acab0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00005acab0 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > KDB: enter: panic > [ thread pid 12 tid 100113 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > > > I can keep the machine in this state for a while now if you want to take > a look at anything specific. I pushed further changes to this branch (that are now in the review that Hans noted) that I think should fix the panic. You can either pull the branch (I'll try to rebase it today) or from the review. Please let me know if this resolves the panic. Thanks! -- John Baldwin From owner-svn-src-head@freebsd.org Wed May 1 17:12:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF790159BF9A; Wed, 1 May 2019 17:12:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53DA385A36; Wed, 1 May 2019 17:12:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D67A247F3; Wed, 1 May 2019 17:12:50 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x41HCo7I028426; Wed, 1 May 2019 17:12:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41HCoN3028425; Wed, 1 May 2019 17:12:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201905011712.x41HCoN3028425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 1 May 2019 17:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346996 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 346996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53DA385A36 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 17:12:50 -0000 Author: andrew Date: Wed May 1 17:12:49 2019 New Revision: 346996 URL: https://svnweb.freebsd.org/changeset/base/346996 Log: Restore x18 in efi_arch_leave. Some UEFI implementations trash this register and, as we use it as a platform register, the kernel doesn't save it before calling into the UEFI runtime services. As we have a copy in tpidr_el1 restore from there when exiting the EFI environment. PR: 237234, 237055 Reviewed by: manu Tested On: Ampere eMAG MFC after: 2 weeks Sponsored by: DARPA, AFRL Sponsored by: Ampere Computing (hardware) Differential Revision: https://reviews.freebsd.org/D20127 Modified: head/sys/arm64/arm64/efirt_machdep.c Modified: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- head/sys/arm64/arm64/efirt_machdep.c Wed May 1 15:28:23 2019 (r346995) +++ head/sys/arm64/arm64/efirt_machdep.c Wed May 1 17:12:49 2019 (r346996) @@ -259,6 +259,16 @@ efi_arch_leave(void) { struct thread *td; + /* + * Restore the pcpu pointer. Some UEFI implementations trash it and + * we don't store it before calling into them. To fix this we need + * to restore it after returning to the kernel context. As reading + * curthread will access x18 we need to restore it before loading + * the thread pointer. + */ + __asm __volatile( + "mrs x18, tpidr_el1 \n" + ); td = curthread; __asm __volatile( "msr ttbr0_el1, %0 \n" From owner-svn-src-head@freebsd.org Wed May 1 18:54:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F33159E483; Wed, 1 May 2019 18:54:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03BE489381; Wed, 1 May 2019 18:54:28 +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 C3E742591D; Wed, 1 May 2019 18:54:27 +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 x41IsReP081751; Wed, 1 May 2019 18:54:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41IsRgu081750; Wed, 1 May 2019 18:54:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905011854.x41IsRgu081750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 May 2019 18:54:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347001 - head/lib/atf/libatf-c X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/atf/libatf-c X-SVN-Commit-Revision: 347001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03BE489381 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 18:54:28 -0000 Author: trasz Date: Wed May 1 18:54:27 2019 New Revision: 347001 URL: https://svnweb.freebsd.org/changeset/base/347001 Log: Add MLINKS to atf-c.3. Reviewed by: ngie MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D20125 Modified: head/lib/atf/libatf-c/Makefile Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Wed May 1 18:17:42 2019 (r347000) +++ head/lib/atf/libatf-c/Makefile Wed May 1 18:54:27 2019 (r347001) @@ -95,6 +95,65 @@ INCS+= atf-c.h INCSDIR_atf-c.h= ${INCLUDEDIR} MAN= atf-c.3 +MLINKS+= atf-c.3 ATF_CHECK.3 \ + atf-c.3 ATF_CHECK_MSG.3 \ + atf-c.3 ATF_CHECK_EQ.3 \ + atf-c.3 ATF_CHECK_EQ_MSG.3 \ + atf-c.3 ATF_CHECK_MATCH.3 \ + atf-c.3 ATF_CHECK_MATCH_MSG.3 \ + atf-c.3 ATF_CHECK_STREQ.3 \ + atf-c.3 ATF_CHECK_STREQ_MSG.3 \ + atf-c.3 ATF_CHECK_ERRNO.3 \ + atf-c.3 ATF_REQUIRE.3 \ + atf-c.3 ATF_REQUIRE_MSG.3 \ + atf-c.3 ATF_REQUIRE_EQ.3 \ + atf-c.3 ATF_REQUIRE_EQ_MSG.3 \ + atf-c.3 ATF_REQUIRE_MATCH.3 \ + atf-c.3 ATF_REQUIRE_MATCH_MSG.3 \ + atf-c.3 ATF_REQUIRE_STREQ.3 \ + atf-c.3 ATF_REQUIRE_STREQ_MSG.3 \ + atf-c.3 ATF_REQUIRE_ERRNO.3 \ + atf-c.3 ATF_TC.3 \ + atf-c.3 ATF_TC_BODY.3 \ + atf-c.3 ATF_TC_BODY_NAME.3 \ + atf-c.3 ATF_TC_CLEANUP.3 \ + atf-c.3 ATF_TC_CLEANUP_NAME.3 \ + atf-c.3 ATF_TC_HEAD.3 \ + atf-c.3 ATF_TC_HEAD_NAME.3 \ + atf-c.3 ATF_TC_NAME.3 \ + atf-c.3 ATF_TC_WITH_CLEANUP.3 \ + atf-c.3 ATF_TC_WITHOUT_HEAD.3 \ + atf-c.3 ATF_TP_ADD_TC.3 \ + atf-c.3 ATF_TP_ADD_TCS.3 \ + atf-c.3 atf_tc_get_config_var.3 \ + atf-c.3 atf_tc_get_config_var_wd.3 \ + atf-c.3 atf_tc_get_config_var_as_bool.3 \ + atf-c.3 atf_tc_get_config_var_as_bool_wd.3 \ + atf-c.3 atf_tc_get_config_var_as_long.3 \ + atf-c.3 atf_tc_get_config_var_as_long_wd.3 \ + atf-c.3 atf_no_error.3 \ + atf-c.3 atf_tc_expect_death.3 \ + atf-c.3 atf_tc_expect_exit.3 \ + atf-c.3 atf_tc_expect_fail.3 \ + atf-c.3 atf_tc_expect_pass.3 \ + atf-c.3 atf_tc_expect_signal.3 \ + atf-c.3 atf_tc_expect_timeout.3 \ + atf-c.3 atf_tc_fail.3 \ + atf-c.3 atf_tc_fail_nonfatal.3 \ + atf-c.3 atf_tc_pass.3 \ + atf-c.3 atf_tc_skip.3 \ + atf-c.3 atf_utils_cat_file.3 \ + atf-c.3 atf_utils_compare_file.3 \ + atf-c.3 atf_utils_copy_file.3 \ + atf-c.3 atf_utils_create_file.3 \ + atf-c.3 atf_utils_file_exists.3 \ + atf-c.3 atf_utils_fork.3 \ + atf-c.3 atf_utils_free_charpp.3 \ + atf-c.3 atf_utils_grep_file.3 \ + atf-c.3 atf_utils_grep_string.3 \ + atf-c.3 atf_utils_readline.3 \ + atf-c.3 atf_utils_redirect.3 \ + atf-c.3 atf_utils_wait.3 MLINKS+= atf-c.3 atf-c-api.3 # Backwards compatibility. HAS_TESTS= From owner-svn-src-head@freebsd.org Wed May 1 18:56:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12AD0159E538; Wed, 1 May 2019 18:56:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA5EF89507; Wed, 1 May 2019 18:56:22 +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 756F52592E; Wed, 1 May 2019 18:56:22 +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 x41IuMpH081894; Wed, 1 May 2019 18:56:22 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41IuMLE081893; Wed, 1 May 2019 18:56:22 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905011856.x41IuMLE081893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 May 2019 18:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347002 - head/usr.bin/stat X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/stat X-SVN-Commit-Revision: 347002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AA5EF89507 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 18:56:23 -0000 Author: trasz Date: Wed May 1 18:56:22 2019 New Revision: 347002 URL: https://svnweb.freebsd.org/changeset/base/347002 Log: Add 'Birth' to 'stat -x' output. Current Linux stat(1) also includes that. Reviewed by: cem MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20130 Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Wed May 1 18:54:27 2019 (r347001) +++ head/usr.bin/stat/stat.c Wed May 1 18:56:22 2019 (r347002) @@ -112,7 +112,8 @@ __FBSDID("$FreeBSD$"); "Device: %Hd,%Ld Inode: %i Links: %l%n" \ "Access: %Sa%n" \ "Modify: %Sm%n" \ - "Change: %Sc" + "Change: %Sc%n" \ + " Birth: %SB" #define TIME_FORMAT "%b %e %T %Y" From owner-svn-src-head@freebsd.org Wed May 1 19:02:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D489159E64D; Wed, 1 May 2019 19:02:04 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3BF78983E; Wed, 1 May 2019 19:02:03 +0000 (UTC) (envelope-from slava.shwartsman@gmail.com) Received: by mail-wr1-f65.google.com with SMTP id c12so25608740wrt.8; Wed, 01 May 2019 12:02:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7d6NJZcsUO41HBlpC2Tis+rlIzqBoY26+lB/4eoYFPI=; b=YW8L07WIU2YVlhARgai/jPsucLsqsThZfVvhiGaHeDds/drKm86xyo25xMDThxdQHa w8LlmfaVUH5nRzDzIzHy7BG1Jv8BYRYdB3rWHSPEGUJa3mG/5BALPb6+wdpNzorko2Ir DiU4bpkg3ZoxxjJ8jdQhOK7Zwry748PGNwO02IA3pK+CbWzyb4lrnCwJEDok8EHcYMX7 AS+fFnVshp2Wo2Y4ps5SCgjir+HAigfw2z1oWXdlrfv95x9HgGHflluZV5k2iG1K4XYE rGWlEqxd0lhln9eaZ/cP6OYD1TKhHFcgAbKzBu07Pe45oY7DHGS5t4fyWZywQ9FGxMwN xBbQ== X-Gm-Message-State: APjAAAVUX0xgXZxLnkkXaxB39Ay+mttRZlZ1Edn22ckcwl5XQ6kO+lrS IHOO10FVk/3Z8igGXIo3QfpnigbO X-Google-Smtp-Source: APXvYqyrkf78k+OD/2+202XuDPVFH2cIBOVcucJTwAcEwxiIw9Dm83kt/XF4zRHYqL8wT6PXhLsOqw== X-Received: by 2002:adf:c788:: with SMTP id l8mr19233690wrg.143.1556737321469; Wed, 01 May 2019 12:02:01 -0700 (PDT) Received: from [10.0.0.30] (bzq-79-183-97-188.red.bezeqint.net. [79.183.97.188]) by smtp.gmail.com with ESMTPSA id c18sm20171560wrb.16.2019.05.01.12.01.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 12:02:00 -0700 (PDT) Reply-To: slavash@FreeBSD.org Subject: Re: svn commit: r341586 - head/sys/dev/mlx5/mlx5_en To: John Baldwin , Hans Petter Selasky , "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812051425.wB5EP38T004562@repo.freebsd.org> <7cea5305-4136-a0b6-487b-51307b1c6db9@FreeBSD.org> <123654bf-59f7-1db8-55ce-36306bdac43d@FreeBSD.org> <67b638e0-8e6f-f960-b263-62eed8ce28b7@FreeBSD.org> <0e80cb1d-20b9-5b8c-330e-5f64a603ff10@FreeBSD.org> <737bfa62-eb3e-7c48-6356-0e0b76bb0593@FreeBSD.org> <76a05c08-b851-c50a-16fa-ac42c872413c@FreeBSD.org> <054b81ee-0bdc-184a-9928-8679b53d52cc@FreeBSD.org> From: Slava Shwartsman Message-ID: <83f514cb-b481-4a39-d9e7-3a86f1b3760f@FreeBSD.org> Date: Wed, 1 May 2019 22:01:55 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <054b81ee-0bdc-184a-9928-8679b53d52cc@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B3BF78983E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 19:02:04 -0000 On 01-May-19 19:45, John Baldwin wrote: > On 5/1/19 1:05 AM, Slava Shwartsman wrote: >> >> >> On 01-May-19 10:28, Slava Shwartsman wrote: >>> >>> >>> On 01-May-19 10:09, Slava Shwartsman wrote: >>>> >>>> >>>> On 30-Apr-19 00:14, John Baldwin wrote: >>>>> On 4/25/19 12:10 AM, Slava Shwartsman wrote: >>>>>> >>>>>> >>>>>> On 17-Apr-19 00:28, John Baldwin wrote: >>>>>>> On 4/16/19 8:32 AM, Hans Petter Selasky wrote: >>>>>>>> On 4/16/19 4:39 PM, Andrey V. Elsukov wrote: >>>>>>>>> On 05.12.2018 17:25, Slava Shwartsman wrote: >>>>>>>>>> Author: slavash >>>>>>>>>> Date: Wed Dec  5 14:25:03 2018 >>>>>>>>>> New Revision: 341586 >>>>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/341586 >>>>>>>>>> >>>>>>>>>> Log: >>>>>>>>>>      mlx5en: Implement backpressure indication. >>>>>>>>>>      The backpressure indication is implemented using an >>>>>>>>>> unlimited rate type of >>>>>>>>>>      mbuf send tag. When the upper layers typically the socket >>>>>>>>>> layer has obtained such >>>>>>>>>>      a tag, it can then query the destination driver queue for >>>>>>>>>> the current >>>>>>>>>>      amount of space available in the send queue. >>>>>>>>>>      A single mbuf send tag may be referenced multiple times and >>>>>>>>>> a refcount has been added >>>>>>>>>>      to the mlx5e_priv structure to track its usage. Because the >>>>>>>>>> send tag resides >>>>>>>>>>      in the mlx5e_channel structure, there is no need to wait >>>>>>>>>> for refcounts to reach >>>>>>>>>>      zero until the mlx4en(4) driver is detached. The channels >>>>>>>>>> structure is persistant >>>>>>>>>>      during the lifetime of the mlx5en(4) driver it belongs to >>>>>>>>>> and can so be accessed >>>>>>>>>>      without any need of synchronization. >>>>>>>>>>      The mlx5e_snd_tag structure was extended to contain a type >>>>>>>>>> field, because there are now >>>>>>>>>>      two different tag types which end up in the driver which >>>>>>>>>> need to be distinguished. >>>>>>>>>>      Submitted by:   hselasky@ >>>>>>>>>>      Approved by:    hselasky (mentor) >>>>>>>>>>      MFC after:      1 week >>>>>>>>>>      Sponsored by:   Mellanox Technologies >>>>>>>>>> @@ -587,27 +609,33 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf >>>>>>>>>> *mb) >>>>>>>>>>         struct mlx5e_sq *sq; >>>>>>>>>>         int ret; >>>>>>>>>> -    sq = mlx5e_select_queue(ifp, mb); >>>>>>>>>> -    if (unlikely(sq == NULL)) { >>>>>>>>>> -#ifdef RATELIMIT >>>>>>>>>> -        /* Check for route change */ >>>>>>>>>> -        if (mb->m_pkthdr.snd_tag != NULL && >>>>>>>>>> -            mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>>>> +    if (mb->m_pkthdr.snd_tag != NULL) { >>>>>>>>>> +        sq = mlx5e_select_queue_by_send_tag(ifp, mb); >>>>>>>>>> +        if (unlikely(sq == NULL)) { >>>>>>>>>> +            /* Check for route change */ >>>>>>>>>> +            if (mb->m_pkthdr.snd_tag->ifp != ifp) { >>>>>>>>>> +                /* Free mbuf */ >>>>>>>>>> +                m_freem(mb); >>>>>>>>>> + >>>>>>>>>> +                /* >>>>>>>>>> +                 * Tell upper layers about route >>>>>>>>>> +                 * change and to re-transmit this >>>>>>>>>> +                 * packet: >>>>>>>>>> +                 */ >>>>>>>>>> +                return (EAGAIN); >>>>>>>>>> +            } >>>>>>>>> >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I just discovered something strange and found that this commit is >>>>>>>>> the >>>>>>>>> cause. >>>>>>>>> The test system has mlx5en 100G interface. It has two vlans: >>>>>>>>> vlan500 and >>>>>>>>> vlan100. >>>>>>>>> Via vlan500 it receives some packets flows. Then it routes these >>>>>>>>> packets >>>>>>>>> into vlan100. >>>>>>>>> But packets are dropped in mlx5e_xmit() with EAGAIN error code. >>>>>>>>> >>>>>>>>> # dtrace -n 'fbt::ip6_output:return {printf("%d", arg1);}' >>>>>>>>> dtrace: description 'fbt::ip6_output:return ' matched 1 probe >>>>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>>>     23  54338                ip6_output:return 35 >>>>>>>>>     16  54338                ip6_output:return 35 >>>>>>>>>     21  54338                ip6_output:return 35 >>>>>>>>>     22  54338                ip6_output:return 35 >>>>>>>>>     24  54338                ip6_output:return 35 >>>>>>>>>     23  54338                ip6_output:return 35 >>>>>>>>>     14  54338                ip6_output:return 35 >>>>>>>>> ^C >>>>>>>>> >>>>>>>>> # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' >>>>>>>>> dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe >>>>>>>>> CPU     ID                    FUNCTION:NAME >>>>>>>>>     16  69030                mlx5e_xmit:return 35 >>>>>>>>>     23  69030                mlx5e_xmit:return 35 >>>>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>>>     25  69030                mlx5e_xmit:return 35 >>>>>>>>>     24  69030                mlx5e_xmit:return 35 >>>>>>>>>     21  69030                mlx5e_xmit:return 35 >>>>>>>>>     26  69030                mlx5e_xmit:return 35 >>>>>>>>> ^C >>>>>>>>> >>>>>>>>> The kernel config is GENERIC. >>>>>>>>> 13.0-CURRENT #9 r345758+82f3d57(svn_head)-dirty >>>>>>>>> >>>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> This might be a case where rcvif in the mbuf's pktheader is not >>>>>>>> cleared >>>>>>>> before the packet is fed back on the wire. >>>>>>>> >>>>>>>> John Baldwin is working on the send tags implementation, to eliminate >>>>>>>> the EAGAIN handling in the network drivers. >>>>>>> >>>>>>> I will try to push this branch sooner then since it affects more >>>>>>> than just >>>>>>> TLS.  Part of the change includes a new flag we can use to assert >>>>>>> that we >>>>>> Thanks John! >>>>>>> aren't just getting a stale rcvif (though there are also now >>>>>>> assertions in >>>>>>> ip_output that should catch this case I think). >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Hi Andrey, >>>>>> >>>>>> Yes, we were able to reproduce this issue in house. If you don't >>>>>> mind, I >>>>>> prefer to wait for John's update - where he eliminates the EAGAIN >>>>>> handling in the network drivers. >>>>> >>>>> I have rebased the branch for this, but for now it will just panic >>>>> sooner >>>>> I believe by tripping an assertion.  Can you grab the diff (or just >>>>> the branch) >>>>> from the 'send_tags' branch at github/bsdjhb/freebsd and reproduce >>>>> under a >>>>> kernel with INVARIANTS?  I think we will have to explicitly clear the >>>>> 'rcvif' >>>>> pointer somewhere, but I want to see what the stack trace looks like >>>>> so I can >>>>> think about the "right" place to clear it. >>>>> >>>> >>>> Hi John, >>>> >>>> I grabbed your branch (which doesn't build BTW due to libbe(3): Fix >>>> mis-application of patch (SHLIBDIR) so I just reverted it). >>>> >>>> The kernel doesn't panic in this scenario - it just that the packets >>>> are being dropped. So I added a kdb_backtrace right before the return >>>> (EAGAIN) in mlx5e_xmit: >>>> >>>> KDB: stack backtrace: >>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >>>> 0xfffffe0000547d90 >>>> mlx5e_xmit() at mlx5e_xmit+0x3d/frame 0xfffffe0000548160 >>>> vlan_transmit() at vlan_transmit+0xdc/frame 0xfffffe00005481d0 >>>> ether_output_frame() at ether_output_frame+0xa2/frame 0xfffffe0000548200 >>>> ether_output() at ether_output+0x689/frame 0xfffffe00005482a0 >>>> ip_output() at ip_output+0x13a4/frame 0xfffffe00005483f0 >>>> ip_forward() at ip_forward+0x344/frame 0xfffffe00005484b0 >>>> ip_input() at ip_input+0x7f5/frame 0xfffffe0000548560 >>>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>>> 0xfffffe00005485d0 >>>> ether_demux() at ether_demux+0x147/frame 0xfffffe0000548600 >>>> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe0000548660 >>>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>>> 0xfffffe00005486d0 >>>> ether_input() at ether_input+0x73/frame 0xfffffe0000548700 >>>> vlan_input() at vlan_input+0x1e7/frame 0xfffffe0000548750 >>>> ether_demux() at ether_demux+0x12d/frame 0xfffffe0000548780 >>>> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005487e0 >>>> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame >>>> 0xfffffe0000548850 >>>> ether_input() at ether_input+0x73/frame 0xfffffe0000548880 >>>> mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005489a0 >>>> mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005489d0 >>>> mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe0000548a10 >>>> ithread_loop() at ithread_loop+0x187/frame 0xfffffe0000548a70 >>>> fork_exit() at fork_exit+0x84/frame 0xfffffe0000548ab0 >>>> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe0000548ab0 >>>> --- trap 0, rip = 0, rsp = 0, rbp = 0 --- >>>> >>>> >>>> Please ping me if you want me to try anything else. >>>> >>>> >>>> Slava >>> >>> My bad - tested with master. Re-testing now. >>> >>> >>> Slava >> >> Got it now: >> >> panic: Assertion m->m_pkthdr.snd_tag == NULL failed at >> /usr/src/sys/netinet/ip_output.c:213 >> cpuid = 0 >> time = 1556697834 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> 0xfffffe00005ac1f0 >> vpanic() at vpanic+0x19d/frame 0xfffffe00005ac240 >> panic() at panic+0x43/frame 0xfffffe00005ac2a0 >> ip_output() at ip_output+0x159f/frame 0xfffffe00005ac3f0 >> ip_forward() at ip_forward+0x38c/frame 0xfffffe00005ac4b0 >> ip_input() at ip_input+0x7f5/frame 0xfffffe00005ac560 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac5d0 >> ether_demux() at ether_demux+0x147/frame 0xfffffe00005ac600 >> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac660 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac6d0 >> ether_input() at ether_input+0x7d/frame 0xfffffe00005ac700 >> vlan_input() at vlan_input+0x1e7/frame 0xfffffe00005ac750 >> ether_demux() at ether_demux+0x12d/frame 0xfffffe00005ac780 >> ether_nh_input() at ether_nh_input+0x403/frame 0xfffffe00005ac7e0 >> netisr_dispatch_src() at netisr_dispatch_src+0xa2/frame 0xfffffe00005ac850 >> ether_input() at ether_input+0x7d/frame 0xfffffe00005ac880 >> mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x8b4/frame 0xfffffe00005ac9a0 >> mlx5_cq_completion() at mlx5_cq_completion+0x5e/frame 0xfffffe00005ac9d0 >> mlx5_msix_handler() at mlx5_msix_handler+0x1ba/frame 0xfffffe00005aca10 >> ithread_loop() at ithread_loop+0x187/frame 0xfffffe00005aca70 >> fork_exit() at fork_exit+0x84/frame 0xfffffe00005acab0 >> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00005acab0 >> --- trap 0, rip = 0, rsp = 0, rbp = 0 --- >> KDB: enter: panic >> [ thread pid 12 tid 100113 ] >> Stopped at kdb_enter+0x3b: movq $0,kdb_why >> >> >> I can keep the machine in this state for a while now if you want to take >> a look at anything specific. > > I pushed further changes to this branch (that are now in the review that > Hans noted) that I think should fix the panic. You can either pull the > branch (I'll try to rebase it today) or from the review. Please let me > know if this resolves the panic. Thanks! > I puled the branch and it solves the panic (and the issue): # dtrace -n 'fbt::mlx5e_xmit:return {printf("%d", arg1);}' dtrace: description 'fbt::mlx5e_xmit:return ' matched 1 probe CPU ID FUNCTION:NAME 1 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 0 61827 mlx5e_xmit:return 0 Andrey, do you want to test it on your end too? Slava From owner-svn-src-head@freebsd.org Wed May 1 19:35:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7323A159F311; Wed, 1 May 2019 19:35:47 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13AB38AAC7; Wed, 1 May 2019 19:35: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 7AA4C2601E; Wed, 1 May 2019 19:35:46 +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 x41JZkAZ005857; Wed, 1 May 2019 19:35:46 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x41JZkVh005856; Wed, 1 May 2019 19:35:46 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905011935.x41JZkVh005856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 1 May 2019 19:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347003 - head/usr.bin/stat/tests X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/stat/tests X-SVN-Commit-Revision: 347003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13AB38AAC7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2019 19:35:47 -0000 Author: trasz Date: Wed May 1 19:35:45 2019 New Revision: 347003 URL: https://svnweb.freebsd.org/changeset/base/347003 Log: Unbreak the tests after r347002. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/stat/tests/stat_test.sh Modified: head/usr.bin/stat/tests/stat_test.sh ============================================================================== --- head/usr.bin/stat/tests/stat_test.sh Wed May 1 18:56:22 2019 (r347002) +++ head/usr.bin/stat/tests/stat_test.sh Wed May 1 19:35:45 2019 (r347003) @@ -184,6 +184,7 @@ x_output() local path=$1; shift local atime_s=$(x_output_date -f '%Sa' $path) + local btime_s=$(x_output_date -f '%SB' $path) local ctime_s=$(x_output_date -f '%Sc' $path) local devid=$(stat -f '%Hd,%Ld' $path) local file_type_s=$(stat -f '%HT' $path) @@ -206,6 +207,7 @@ Device: $devid Inode: $inode Links: $nlink Access: $atime_s Modify: $mtime_s Change: $ctime_s + Birth: $btime_s EOF } From owner-svn-src-head@freebsd.org Thu May 2 03:39:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B61971587137; Thu, 2 May 2019 03:39:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DDD373058; Thu, 2 May 2019 03:39:04 +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 357CD34BF; Thu, 2 May 2019 03:39:04 +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 x423d4WV060649; Thu, 2 May 2019 03:39:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x423d4JQ060648; Thu, 2 May 2019 03:39:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905020339.x423d4JQ060648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 2 May 2019 03:39:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347013 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 347013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DDD373058 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 03:39:04 -0000 Author: jhibbits Date: Thu May 2 03:39:03 2019 New Revision: 347013 URL: https://svnweb.freebsd.org/changeset/base/347013 Log: powerpc: Drop OPAL_HANDLE_HMI2 for now, to avoid panicking It's possible for a Hypervisor Maintenance Interrupt (HMI) to occur while in the pmap code, holding locks. This can cause WITNESS to panic due to lock errors in calling pmap_kextract(). Since we don't yet handle the flags returned by OPAL_HANDLE_HMI2, just stop using it, so that we don't call into pmap_kextract(). Reported by: pkubaj Modified: head/sys/powerpc/powernv/opal_hmi.c Modified: head/sys/powerpc/powernv/opal_hmi.c ============================================================================== --- head/sys/powerpc/powernv/opal_hmi.c Thu May 2 02:26:42 2019 (r347012) +++ head/sys/powerpc/powernv/opal_hmi.c Thu May 2 03:39:03 2019 (r347013) @@ -39,25 +39,6 @@ __FBSDID("$FreeBSD$"); #include "opal.h" static int -opal_hmi_handler2(struct trapframe *frame) -{ - int64_t flags; - int err; - - err = opal_call(OPAL_HANDLE_HMI2, vtophys(&flags)); - - /* XXX: At some point, handle the flags outvar. */ - if (err == OPAL_SUCCESS) { - mtspr(SPR_HMER, 0); - return (0); - } - - printf("HMI handler failed! OPAL error code: %d\n", err); - - return (-1); -} - -static int opal_hmi_handler(struct trapframe *frame) { int err; @@ -81,9 +62,7 @@ opal_setup_hmi(void *data) if (opal_check() != 0) return; - if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI2) == OPAL_TOKEN_PRESENT) - hmi_handler = opal_hmi_handler2; - else if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) + if (opal_call(OPAL_CHECK_TOKEN, OPAL_HANDLE_HMI) == OPAL_TOKEN_PRESENT) hmi_handler = opal_hmi_handler; else { printf("Warning: No OPAL HMI handler found.\n"); From owner-svn-src-head@freebsd.org Thu May 2 07:44:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39EDB158BFAF for ; Thu, 2 May 2019 07:44:09 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic301-30.consmr.mail.ne1.yahoo.com (sonic301-30.consmr.mail.ne1.yahoo.com [66.163.184.199]) (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 CDF8B81AF6 for ; Thu, 2 May 2019 07:44:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: bmU50vUVM1kcIYaLR2afzisEENQmLym6zfio42utUdhx3X45njsEpJQtGduVUht AY.SSeVblHqcPF8KcpNBRzhnaf7a2kEsZEqd6arvt_8VYnfCVALAdcOYv6BLDlILchmatTZZR9HU yD9dswJxWsYKIPlvLTlX3E8RheeBUpQx2l1_hTopoyA_wiQ2qKlKe_GxNE5S9KLWz37SCVLNtsQp 1yHtOxXJa9Ee8J73VhZMbvpdG0aqT.mU6IYeHSbet3h9YijJ5Q_l7X2UUwaYgICewdVSvqN5AVAA yj7pU4Vf7y06.iJEcaTMSJTrVqgrfVYKe42sT4XAhAMoHvuRRM3CSUv7iNw6jP3K1FOYhtj8YPhp Relpp89Ijv9EYkdV7UUNAmLsYpYzo7geoeO.IPp1flNA6jWKJ7fFspMsPUQ1b92GRCILUiv9sBK_ h6FvCYR7.qQZ_9eI03_7IT5Vm4hu_27.gElMZ89QZlxCFdsKFyv1R5D4.oBgntPLJ0gSIVJrV1ub tuszzzK8jzculO8JmkHJVknf_IabSF.YifrkpNDs5MKyztCQdY28igU8b5O8mLIktOKu5L65aWtH hjKLbo8o1iiyg5_QnKXGyyVNWXS8GgtFElObGnOTKtmW5xGRlFTIXbSmQjouHSCop9X79ov86d_8 qMpd8azI76tzHrnAd6VHp7vbgVKVEMORAHLcVB6HlnATx2xB2GWB3LFVawwoc7.xL2puiNZpdOe_ rsyKkY5MdjD02AA7.uufg9vxNL1J_77uocm8jlhoRV7nA3fUX4DVnIe4JybO2EOjy2iwojvFdX6H UBUIHJFW2SJjNhiDjtQQyPKWWFMPXQ6Nx3_4Ke.gPMNSqKK0_curXdti_QFpi23TvBzqK9I7f_6c Ddmv4_m3152mAaeCAjSulNLp4rK4mkJLTjwSmLx7S37aVQBKH4_fGRX5frCGO3Tmp2kAwZHxRizB Ai9nkAjeXKdAMhCjsv7ifFJFbax._LNU.N1YiUbrnntAw2lWY8.6JDqLIKYTt.2M.RJAruT_j15B I09p97s2JBiKg.OMJb3hxjTwHvsPv2ITTZJqiyT26HKm6V31swAIK1DkJtL_la5v7VkSnqfj.4pB QX7a9EYddlKJAAdD6N7pOy00GpHkuZcWXrn5lMPsUIH9eX_5Ve9aJF5FSgLe_EgyMRQXIrZvosB1 WYw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Thu, 2 May 2019 07:44:01 +0000 Received: from c-76-115-7-162.hsd1.or.comcast.net (EHLO [192.168.1.103]) ([76.115.7.162]) by smtp417.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 9478745ae67bf0eed4034164ea4f65ca; Thu, 02 May 2019 07:43:59 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: svn commit: r346588 - head/lib/libc/powerpc64/string Date: Thu, 2 May 2019 00:43:57 -0700 References: To: svn-src-head@freebsd.org, Justin Hibbits In-Reply-To: Message-Id: <9C27DA97-6C2F-42B0-8309-8C8FBDECB8F4@yahoo.com> X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: CDF8B81AF6 X-Spamd-Bar: + X-Spamd-Result: default: False [1.34 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.94)[0.941,0]; NEURAL_HAM_LONG(-0.46)[-0.455,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.16)[ip: (3.37), ipnet: 66.163.184.0/21(1.38), asn: 36646(1.11), country: US(-0.06)]; NEURAL_SPAM_MEDIUM(0.20)[0.204,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[199.184.163.66.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 07:44:09 -0000 [I did not deal with translating register usage correctly.] > On 2019-Apr-27, at 01:50, Mark Millard wrote: >=20 > Justin Hibbits jhibbits at FreeBSD.org wrote on > Fri Apr 26 16:21:47 UTC 2019 : >=20 >> This actually uses 'cmpb' which is only available on PowerISA 2.05+, = so >> I'll need to pull it out for now, and re-enable it once we have >> ifuncs. As it stands, this commit broke the G5 and POWER4/POWER5. >=20 > As I understand the code like: >=20 > xor %r8,%r8,%r8 /* %r8 <- Zero. */ > xor %r0,%r5,%r6 /* Check if double words are different. = */ > cmpb %r7,%r5,%r8 /* Check if double words contain zero. = */ >=20 > /* > * If double words are different or contain zero, > * find what byte is different or contains zero, > * else load next double words. > */ > or. %r9,%r7,%r0 > bne .Lstrcmp_check_zeros_differences >=20 > (and similarly for the loop. . .): >=20 > A) Each byte of %r5 that is non-zero needs that byte of %r7 to be = zero. > B) Each byte of %r5 that is zero need that byte of %r7 to be non-zero. >=20 > (cmpb assigns 0xff for non-zero as I understand, but even one non-zero > bit is sufficient for the overall code structure.) >=20 > If I've got that much correct, then the following might be an > alternative to cmpb for now. I'll explain the code via commented > c/c++-ish code and then show the assembler notation: >=20 > unsigned long ul_has_zero_byte(unsigned long b) > { > unsigned long constexpr low_7bits_of_bytes{0x7f7f7f7f'7f7f7f7ful}; >=20 > // Illustrating = byte transformations: > unsigned long const x=3D b & low_7bits_of_bytes; // 0x00->0x00, = 0x80->0x00, other->ms-bit-in-byte=3D=3D0 > unsigned long const y=3D x + low_7bits_of_bytes; // ->0x7f, = ->0x7f, ->ms-bit-in-byte=3D=3D1 > unsigned long const z=3D b | y | low_7bits_of_bytes; // ->0x7f, = ->0xff, ->0xff > return ~z; // ->0x80, = ->0x00, ->0x00 > } >=20 > (used in a powerpc64 context, so unsigned long being 64 bits). >=20 > So, not using %r8 as zero but for a different value, > each cmpb can be replaced by: >=20 > # Only once to set up the value in %r8 (Note: 32639=3D0x7f7f): > lis r8,32639 > ori r8,r8,32639 > rldimi r8,r8,32,0 >=20 > # each "cmpb %r7,%r5,%r8" replaced by: > and r7,r5,r8 > add r7,r7,r8 > nor r5,r7,r5 > andc r5,r5,r8 The above 4 lines are an incorrect match to the context's register usage: only r7 of the 3 registers r5, r7, r8 should have been changed. It looks like another temporary register (for the stage) is required to make a match: and %r9,%r5,%r8 add %r9,%r9,%r8 nor %r7,%r9,%r5 andc %r7,%r7,%r8 (%r9 later being replaced via: or. %r9,%r7,%r0) > (The code is from compiler output, but with registers adjusted > to match the context.) >=20 >=20 > The c/c++-ish code came from thinking about material from Hacker's > Delight Second Edition and the specific criteria needed here: it > uses part of Figure 6-2 "Find First 0-Byte, branch-free code", > adjusted for width and for returning something sufficient here. >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar) From owner-svn-src-head@freebsd.org Thu May 2 08:17:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A35C158CD5C; Thu, 2 May 2019 08:17:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE6183168; Thu, 2 May 2019 08:17:30 +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 1950A66E2; Thu, 2 May 2019 08:17:30 +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 x428HTNX009086; Thu, 2 May 2019 08:17:29 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x428HT1v009085; Thu, 2 May 2019 08:17:29 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905020817.x428HT1v009085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 2 May 2019 08:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347015 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 347015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2EE6183168 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 08:17:30 -0000 Author: trasz Date: Thu May 2 08:17:29 2019 New Revision: 347015 URL: https://svnweb.freebsd.org/changeset/base/347015 Log: Add sys/devices/system/cpu/{possible,present} to linsysfs(5). That makes Linux lscpu(1) work. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20131 Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Thu May 2 04:16:46 2019 (r347014) +++ head/sys/compat/linsysfs/linsysfs.c Thu May 2 08:17:29 2019 (r347015) @@ -436,7 +436,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s } /* - * Filler function for sys/devices/system/cpu/online + * Filler function for sys/devices/system/cpu/{online,possible,present} */ static int linsysfs_cpuonline(PFS_FILL_ARGS) @@ -532,6 +532,10 @@ linsysfs_init(PFS_INIT_ARGS) cpu = pfs_create_dir(sys, "cpu", NULL, NULL, NULL, 0); pfs_create_file(cpu, "online", &linsysfs_cpuonline, + NULL, NULL, NULL, PFS_RD); + pfs_create_file(cpu, "possible", &linsysfs_cpuonline, + NULL, NULL, NULL, PFS_RD); + pfs_create_file(cpu, "present", &linsysfs_cpuonline, NULL, NULL, NULL, PFS_RD); linsysfs_listcpus(cpu); From owner-svn-src-head@freebsd.org Thu May 2 09:00:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AE95158DFB3; Thu, 2 May 2019 09:00:37 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D075B846D6; Thu, 2 May 2019 09:00:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8A376DA1; Thu, 2 May 2019 09:00:36 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4290ax1030250; Thu, 2 May 2019 09:00:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4290aSM030249; Thu, 2 May 2019 09:00:36 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905020900.x4290aSM030249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 2 May 2019 09:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347016 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 347016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D075B846D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 09:00:37 -0000 Author: dchagin Date: Thu May 2 09:00:36 2019 New Revision: 347016 URL: https://svnweb.freebsd.org/changeset/base/347016 Log: Remove unneeded includes. MFC after: 2 week Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Thu May 2 08:17:29 2019 (r347015) +++ head/sys/compat/linsysfs/linsysfs.c Thu May 2 09:00:36 2019 (r347016) @@ -31,22 +31,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include #include -#include #include #include -#include -#include -#include #include #include #include -#include #include #include @@ -55,17 +45,6 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include #include #include From owner-svn-src-head@freebsd.org Thu May 2 11:12:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12E3F159184F; Thu, 2 May 2019 11:12:47 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.eu.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71DCC8982E; Thu, 2 May 2019 11:12:35 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.60,421,1549929600"; d="scan'208";a="89564606" Date: Thu, 2 May 2019 13:11:06 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Kyle Evans CC: , , Subject: Re: svn commit: r346670 - head/sys/net Message-ID: <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> References: <201904251244.x3PCi8g0096201@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <201904251244.x3PCi8g0096201@repo.freebsd.org> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-Rspamd-Queue-Id: 71DCC8982E X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of prvs=018794465=roger.pau@citrix.com designates 185.25.65.24 as permitted sender) smtp.mailfrom=prvs=018794465=roger.pau@citrix.com X-Spamd-Result: default: False [-5.14 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; ENVFROM_PRVS(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[citrix.com]; TO_DN_SOME(0.00)[]; FORGED_SENDER_VERP_SRS(0.00)[]; IP_SCORE(-1.97)[ip: (-5.13), ipnet: 185.25.64.0/23(-2.56), asn: 60825(-2.05), country: GB(-0.09)]; RCVD_IN_DNSWL_MED(-0.20)[24.65.25.185.list.dnswl.org : 127.0.9.2]; MX_GOOD(-0.01)[smtp02.citrix.com,smtp.eu.citrix.com,smtp03.citrix.com,smtp.citrix.com]; NEURAL_HAM_SHORT(-0.66)[-0.663,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FORGED_SENDER(0.00)[roger.pau@citrix.com,prvs=018794465=roger.pau@citrix.com]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:60825, ipnet:185.25.64.0/23, country:GB]; FROM_NEQ_ENVFROM(0.00)[roger.pau@citrix.com,prvs=018794465=roger.pau@citrix.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 11:12:47 -0000 On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > Author: kevans > Date: Thu Apr 25 12:44:08 2019 > New Revision: 346670 > URL: https://svnweb.freebsd.org/changeset/base/346670 >=20 > Log: > tun/tap: close race between destroy/ioctl handler > =20 > It seems that there should be a better way to handle this, but this see= ms to > be the more common approach and it should likely get replaced in all of= the > places it happens... Basically, thread 1 is in the process of destroyin= g the > tun/tap while thread 2 is executing one of the ioctls that requires the > tun/tap mutex and the mutex is destroyed before the ioctl handler can > acquire it. > =20 > This is only one of the races described/found in PR 233955. > =20 > PR: 233955 > Reviewed by: ae > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D20027 This has caused a regression when booting. I reliably get the following panic when booting on several different boxes: Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/o= sstest/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 Apr 26 16:23:57.674650 cpuid =3D 2 Apr 26 16:23:57.686653 time =3D 1 Apr 26 16:23:57.686720 KDB: stack backtrace: Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2= b/frame 0xfffffe003abe8710 Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0= xfffffe003abe8810 Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fr= ame 0xfffffe003abe8840 Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003= abe8a00 Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe0= 03abe8a30 Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe0= 03abe8a70 Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8a= b0 Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfff= ffe003abe8ab0 Apr 26 16:23:57.746721 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- Apr 26 16:23:57.758797 KDB: enter: panic Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why Apr 26 16:23:57.770557 db>=20 The full serial log of the host booting: =1B[01;01He820: 0000000095fff000 0`0000000/boot/config: -hn -S115200/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08Consoles: serial port =20 Apr 26 16:23:50.318505 BIOS drive C: is disk0 Apr 26 16:23:50.318505 BIOS drive D: is disk1 Apr 26 16:23:50.330486 |=08/=08BIOS 632kB/2316028kB available memory Apr 26 16:23:50.366512=20 Apr 26 16:23:50.366512 FreeBSD/x86 bootstrap loader, Revision 1.1 Apr 26 16:23:50.366512 -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08Loading /boot/defaults/loader.conf Apr 26 16:23:50.414528 Loading /boot/device.hints Apr 26 16:23:50.426510 /=08-=08\=08|=08/=08-=08Loading /boot/loader.conf Apr 26 16:23:50.426510 \=08|=08/=08-=08Loading /boot/loader.conf.local Apr 26 16:23:50.438526 \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08Loading kernel... Apr 26 16:23:50.450532 |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08/boot/kerne= l/kernel text=3D0x16e4c29 -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08data=3D0x1d65a8= +0x819948 /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08syms=3D[0x8+0x183c48\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08+0x8+0x1a1479-=08\=08|=08] Apr 26 16:23:51.626609 Loading configured modules... Apr 26 16:23:51.638619 /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08can't find '/boot/entropy' Apr 26 16:23:51.638679 /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08/mfsroot |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =088000000 2 \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08= -=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|= =08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08= \=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/= =08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08= |=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-= =08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08/=08-=08\=08|=08= /=08-=08\=08|=08/=08-=08 \=08|=08/=08-=08\=08|=08/=08-=08\= =08|=08/=08-=08size=3D0x171c8000 Apr 26 16:23:53.846620=20 Apr 26 16:23:53.846671=20 Booting [/boot/kernel/kernel]... =20 Apr 26 16:23:53.846719 GDB: no debug ports present Apr 26 16:23:54.530540 KDB: debugger backends: ddb Apr 26 16:23:54.530540 KDB: current backend: ddb Apr 26 16:23:54.530540 ---<>--- Apr 26 16:23:54.530540 Table 'FACP' at 0x95ff7000 Apr 26 16:23:54.542628 Table 'UEFI' at 0x95ffd000 Apr 26 16:23:54.542683 Table 'UEFI' at 0x95ffc000 Apr 26 16:23:54.542726 Table 'ASF!' at 0x95ffb000 Apr 26 16:23:54.554635 Table 'ASPT' at 0x95ffa000 Apr 26 16:23:54.554696 Table 'BOOT' at 0x95ff9000 Apr 26 16:23:54.554743 Table 'DBGP' at 0x95ff8000 Apr 26 16:23:54.554792 Table 'HPET' at 0x95ff6000 Apr 26 16:23:54.566627 Table 'APIC' at 0x95ff5000 Apr 26 16:23:54.566689 APIC: Found table at 0x95ff5000 Apr 26 16:23:54.566738 APIC: Using the MADT enumerator. Apr 26 16:23:54.566787 Copyright (c) 1992-2019 The FreeBSD Project. Apr 26 16:23:54.578639 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 19= 91, 1992, 1993, 1994 Apr 26 16:23:54.578706 The Regents of the University of California. All ri= ghts reserved. Apr 26 16:23:54.590645 FreeBSD is a registered trademark of The FreeBSD Fou= ndation. Apr 26 16:23:54.590710 FreeBSD 13.0-CURRENT 4284b348ee3(HEAD) GENERIC amd64 Apr 26 16:23:54.602637 FreeBSD clang version 8.0.0 (tags/RELEASE_800/final = 356365) (based on LLVM 8.0.0) Apr 26 16:23:54.614600 WARNING: WITNESS option enabled, expect reduced perf= ormance. Apr 26 16:23:54.614665 Table 'FACP' at 0x95ff7000 Apr 26 16:23:54.614715 Table 'UEFI' at 0x95ffd000 Apr 26 16:23:54.614762 Table 'UEFI' at 0x95ffc000 Apr 26 16:23:54.626589 Table 'ASF!' at 0x95ffb000 Apr 26 16:23:54.626643 Table 'ASPT' at 0x95ffa000 Apr 26 16:23:54.626690 Table 'BOOT' at 0x95ff9000 Apr 26 16:23:54.626736 Table 'DBGP' at 0x95ff8000 Apr 26 16:23:54.638647 Table 'HPET' at 0x95ff6000 Apr 26 16:23:54.638729 Table 'APIC' at 0x95ff5000 Apr 26 16:23:54.638779 Table 'MCFG' at 0x95ff4000 Apr 26 16:23:54.638826 Table 'SLIC' at 0x95ff3000 Apr 26 16:23:54.650634 Table 'SSDT' at 0x95fdc000 Apr 26 16:23:54.650695 Table 'SPMI' at 0x95fda000 Apr 26 16:23:54.650743 Table 'SSDT' at 0x95fd9000 Apr 26 16:23:54.650790 Table 'SSDT' at 0x95fd8000 Apr 26 16:23:54.650837 Table 'SSDT' at 0x95fd4000 Apr 26 16:23:54.662635 Table 'SPCR' at 0x95ff2000 Apr 26 16:23:54.662696 Table 'DMAR' at 0x95fd3000 Apr 26 16:23:54.662744 Table 'SSDT' at 0x95fd2000 Apr 26 16:23:54.662791 Table 'FPDT' at 0x95fd1000 Apr 26 16:23:54.674633 Table 'HEST' at 0x95fd0000 Apr 26 16:23:54.674694 Table 'ERST' at 0x95fce000 Apr 26 16:23:54.674742 Table 'BERT' at 0x95fcd000 Apr 26 16:23:54.674789 Table 'EINJ' at 0x95fcc000 Apr 26 16:23:54.674836 ACPI: No SRAT table found Apr 26 16:23:54.686618 PPIM 0: PA=3D0xa0000, VA=3D0xffffffff99a10000, size= =3D0x10000, mode=3D0 Apr 26 16:23:54.722627 pmap: large map 8 PML4 slots (4096 Gb) Apr 26 16:23:54.734614 VT(vga): resolution 640x480 Apr 26 16:23:54.734676 Preloaded elf kernel "/boot/kernel/kernel" at 0xffff= ffff998dd000. Apr 26 16:23:54.746630 Preloaded mfs_root "/mfsroot" at 0xffffffff998e61f0. Apr 26 16:23:54.746696 Table 'FACP' at 0x95ff7000 Apr 26 16:23:54.746745 FACP: Found table at 0x95ff7000 Apr 26 16:23:54.758587 Calibrating TSC clock ... TSC clock: 3092899860 Hz Apr 26 16:23:55.754490 CPU: Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz (3092= =2E90-MHz K8-class CPU) Apr 26 16:23:55.766650 Origin=3D"GenuineIntel" Id=3D0x306c3 Family=3D0x= 6 Model=3D0x3c Stepping=3D3 Apr 26 16:23:55.778636 Features=3D0xbfebfbff Apr 26 16:23:55.790589 Features2=3D0x7ffafbff Apr 26 16:23:55.802661 AMD Features=3D0x2c100800 Apr 26 16:23:55.814629 AMD Features2=3D0x21 Apr 26 16:23:55.814690 Structured Extended Features=3D0x2fbb Apr 26 16:23:55.826639 XSAVE Features=3D0x1 Apr 26 16:23:55.826700 VT-x: Basic Features=3D0xda0400 Apr 26 16:23:55.826753 Pin-Based Controls=3D0x7f Apr 26 16:23:55.838605 Primary Processor Controls=3D0xfff9fffe Apr 26 16:23:55.850662 Secondary Processor Controls=3D0x7cff Apr 26 16:23:55.862645 Exit Controls=3D0xda0400 Apr 26 16:23:55.874646 Entry Controls=3D0xda0400 Apr 26 16:23:55.874708 EPT Features=3D0x6334141 Apr 26 16:23:55.886587 VPID Features=3D0xf01 Apr 26 16:23:55.886598 TSC: P-state invariant, performance statistics Apr 26 16:23:55.898658 Data TLB: 2 MByte or 4 MByte pages, 4-way set associ= ative, 32 entries and a separate array with 1 GByte pages, 4-way set associ= ative, 4 entries Apr 26 16:23:55.910639 Data TLB: 4 KB pages, 4-way set associative, 64 entr= ies Apr 26 16:23:55.910704 Instruction TLB: 2M/4M pages, fully associative, 8 e= ntries Apr 26 16:23:55.922634 Instruction TLB: 4KByte pages, 8-way set associative= , 128 entries Apr 26 16:23:55.922701 64-Byte prefetching Apr 26 16:23:55.922749 Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way as= sociative, 1024 entries Apr 26 16:23:55.934645 L2 cache: 256 kbytes, 8-way associative, 64 bytes/li= ne Apr 26 16:23:55.946629 real memory =3D 8589934592 (8192 MB) Apr 26 16:23:55.946692 Physical memory chunk(s): Apr 26 16:23:55.946742 0x0000000000010000 - 0x000000000009cfff, 577536 byte= s (141 pages) Apr 26 16:23:55.958641 0x0000000000103000 - 0x00000000001fffff, 1036288 byt= es (253 pages) Apr 26 16:23:55.958736 0x0000000019a00000 - 0x000000008d6befff, 1942745088 = bytes (474303 pages) Apr 26 16:23:55.970634 0x0000000095fff000 - 0x0000000095ffffff, 4096 bytes = (1 pages) Apr 26 16:23:55.970700 0x0000000100000000 - 0x0000000250b8efff, 5649264640 = bytes (1379215 pages) Apr 26 16:23:55.982625 avail memory =3D 7548768256 (7199 MB) Apr 26 16:23:55.994570 Table 'FACP' at 0x95ff7000 Apr 26 16:23:56.006636 Table 'UEFI' at 0x95ffd000 Apr 26 16:23:56.006696 Table 'UEFI' at 0x95ffc000 Apr 26 16:23:56.006743 Table 'ASF!' at 0x95ffb000 Apr 26 16:23:56.006790 Table 'ASPT' at 0x95ffa000 Apr 26 16:23:56.018651 Table 'BOOT' at 0x95ff9000 Apr 26 16:23:56.018712 Table 'DBGP' at 0x95ff8000 Apr 26 16:23:56.018760 Table 'HPET' at 0x95ff6000 Apr 26 16:23:56.018807 Table 'APIC' at 0x95ff5000 Apr 26 16:23:56.018854 Table 'MCFG' at 0x95ff4000 Apr 26 16:23:56.030634 Table 'SLIC' at 0x95ff3000 Apr 26 16:23:56.030694 Table 'SSDT' at 0x95fdc000 Apr 26 16:23:56.030741 Table 'SPMI' at 0x95fda000 Apr 26 16:23:56.030788 Table 'SSDT' at 0x95fd9000 Apr 26 16:23:56.042642 Table 'SSDT' at 0x95fd8000 Apr 26 16:23:56.042702 Table 'SSDT' at 0x95fd4000 Apr 26 16:23:56.042750 Table 'SPCR' at 0x95ff2000 Apr 26 16:23:56.042797 Table 'DMAR' at 0x95fd3000 Apr 26 16:23:56.054632 DMAR: Found table at 0x95fd3000 Apr 26 16:23:56.054694 MADT: Found CPU APIC ID 0 ACPI ID 1: enabled Apr 26 16:23:56.054746 SMP: Added CPU 0 (AP) Apr 26 16:23:56.054793 MADT: Found CPU APIC ID 2 ACPI ID 2: enabled Apr 26 16:23:56.066632 SMP: Added CPU 2 (AP) Apr 26 16:23:56.066691 MADT: Found CPU APIC ID 4 ACPI ID 3: enabled Apr 26 16:23:56.066742 SMP: Added CPU 4 (AP) Apr 26 16:23:56.066788 MADT: Found CPU APIC ID 6 ACPI ID 4: enabled Apr 26 16:23:56.078725 SMP: Added CPU 6 (AP) Apr 26 16:23:56.078760 MADT: Found CPU APIC ID 0 ACPI ID 5: disabled Apr 26 16:23:56.078817 MADT: Found CPU APIC ID 0 ACPI ID 6: disabled Apr 26 16:23:56.090547 MADT: Found CPU APIC ID 0 ACPI ID 7: disabled Apr 26 16:23:56.090547 MADT: Found CPU APIC ID 0 ACPI ID 8: disabled Apr 26 16:23:56.102520 Event timer "LAPIC" quality 600 Apr 26 16:23:56.102520 ACPI APIC Table: Apr 26 16:23:56.102520 Package ID shift: 4 Apr 26 16:23:56.102520 L3 cache ID shift: 4 Apr 26 16:23:56.102520 L2 cache ID shift: 1 Apr 26 16:23:56.114479 L1 cache ID shift: 1 Apr 26 16:23:56.114479 Core ID shift: 1 Apr 26 16:23:56.114479 INTR: Adding local APIC 2 as a target Apr 26 16:23:56.150539 INTR: Adding local APIC 4 as a target Apr 26 16:23:56.150539 INTR: Adding local APIC 6 as a target Apr 26 16:23:56.150539 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs Apr 26 16:23:56.162543 FreeBSD/SMP: 1 package(s) x 4 core(s) Apr 26 16:23:56.162543 Package HW ID =3D 0 Apr 26 16:23:56.162543 Core HW ID =3D 0 Apr 26 16:23:56.174555 CPU0 (BSP): APIC ID: 0 Apr 26 16:23:56.174555 Core HW ID =3D 1 Apr 26 16:23:56.174555 CPU1 (AP): APIC ID: 2 Apr 26 16:23:56.174555 Core HW ID =3D 2 Apr 26 16:23:56.174555 CPU2 (AP): APIC ID: 4 Apr 26 16:23:56.174555 Core HW ID =3D 3 Apr 26 16:23:56.186544 CPU3 (AP): APIC ID: 6 Apr 26 16:23:56.186544 APIC: CPU 0 has ACPI ID 1 Apr 26 16:23:56.186544 APIC: CPU 1 has ACPI ID 2 Apr 26 16:23:56.186544 APIC: CPU 2 has ACPI ID 3 Apr 26 16:23:56.186544 APIC: CPU 3 has ACPI ID 4 Apr 26 16:23:56.198550 x86bios: IVT 0x000000-0x0004ff at 0xfffff80000000000 Apr 26 16:23:56.198550 x86bios: SSEG 0x09c000-0x09cfff at 0xfffffe0002eb1000 Apr 26 16:23:56.210547 x86bios: EBDA 0x09f000-0x09ffff at 0xfffff8000009f000 Apr 26 16:23:56.210547 x86bios: ROM 0x0a0000-0x0fefff at 0xfffff800000a0000 Apr 26 16:23:56.210547 lapic0: CMCI unmasked Apr 26 16:23:56.222548 Pentium Pro MTRR support enabled Apr 26 16:23:56.222611 __stack_chk_init: WARNING: Initializing stack protec= tion with non-random cookies! Apr 26 16:23:56.234649 __stack_chk_init: WARNING: This severely limits the = benefit of -fstack-protector! Apr 26 16:23:56.234725 VIMAGE (virtualized network stack) enabled Apr 26 16:23:56.246632 ULE: setup cpu 0 Apr 26 16:23:56.246709 ULE: setup cpu 1 Apr 26 16:23:56.246757 ULE: setup cpu 2 Apr 26 16:23:56.246803 ULE: setup cpu 3 Apr 26 16:23:56.246850 ACPI: RSDP 0x00000000000FE020 000024 (v02 DELL ) Apr 26 16:23:56.258620 ACPI: XSDT 0x0000000095FCF188 0000E4 (v01 DELL PE_= SC3 00000001 01000013) Apr 26 16:23:56.258689 ACPI: FACP 0x0000000095FF7000 00010C (v05 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.270640 ACPI: DSDT 0x0000000095FDF000 012335 (v01 DELL PE_= SC3 00000000 DELL 00040000) Apr 26 16:23:56.282635 ACPI: FACS 0x0000000095FBD000 000040 Apr 26 16:23:56.282698 ACPI: UEFI 0x0000000095FFD000 000236 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.294635 ACPI: UEFI 0x0000000095FFC000 000042 (v01 DELL PE_= SC3 00000000 DELL 00040000) Apr 26 16:23:56.294705 ACPI: ASF! 0x0000000095FFB000 0000A5 (v32 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.306597 ACPI: ASPT 0x0000000095FFA000 000034 (v07 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.318581 ACPI: BOOT 0x0000000095FF9000 000028 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.318581 ACPI: DBGP 0x0000000095FF8000 000034 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.330620 ACPI: HPET 0x0000000095FF6000 000038 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.342636 ACPI: APIC 0x0000000095FF5000 000092 (v03 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.342704 ACPI: MCFG 0x0000000095FF4000 00003C (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.354639 ACPI: SLIC 0x0000000095FF3000 000176 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.366687 ACPI: SSDT 0x0000000095FDC000 002028 (v01 DELL PE_= SC3 00001000 DELL 00040000) Apr 26 16:23:56.366756 ACPI: SPMI 0x0000000095FDA000 000040 (v05 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.378647 ACPI: SSDT 0x0000000095FD9000 000533 (v01 DELL PE_= SC3 00003000 DELL 00040000) Apr 26 16:23:56.390638 ACPI: SSDT 0x0000000095FD8000 000ACE (v01 DELL PE_= SC3 00003000 DELL 00040000) Apr 26 16:23:56.390709 ACPI: SSDT 0x0000000095FD4000 003492 (v01 DELL PE_= SC3 00003000 DELL 00040000) Apr 26 16:23:56.402647 ACPI: SPCR 0x0000000095FF2000 000050 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.414633 ACPI: DMAR 0x0000000095FD3000 000080 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.414701 ACPI: SSDT 0x0000000095FD2000 000514 (v01 DELL PE_= SC3 00001000 DELL 00040000) Apr 26 16:23:56.426646 ACPI: FPDT 0x0000000095FD1000 000044 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.438643 ACPI: HEST 0x0000000095FD0000 0000A8 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.438711 ACPI: ERST 0x0000000095FCE000 000230 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.450651 ACPI: BERT 0x0000000095FCD000 000030 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.462631 ACPI: EINJ 0x0000000095FCC000 000150 (v01 DELL PE_= SC3 00000001 DELL 00040000) Apr 26 16:23:56.462700 MADT: Found IO APIC ID 2, Interrupt 0 at 0xfec00000 Apr 26 16:23:56.474535 ioapic0: ver 0x20 maxredir 0x17 Apr 26 16:23:56.474568 ioapic0: Routing external 8259A's -> intpin 0 Apr 26 16:23:56.474596 MADT: Interrupt override: source 0, irq 2 Apr 26 16:23:56.486634 ioapic0: Routing IRQ 0 -> intpin 2 Apr 26 16:23:56.486696 MADT: Interrupt override: source 9, irq 9 Apr 26 16:23:56.486748 ioapic0: intpin 9 trigger: level Apr 26 16:23:56.498651 lapic: Routing NMI -> LINT1 Apr 26 16:23:56.498713 lapic: LINT1 trigger: edge Apr 26 16:23:56.498761 lapic: LINT1 polarity: high Apr 26 16:23:56.498809 ioapic0 irqs 0-23 on motherboard Apr 26 16:23:56.510592 lapic: Divisor 2, Frequency 49885486 Hz Apr 26 16:23:57.506602 lapic: deadline tsc mode, Frequency 3092899860 Hz Apr 26 16:23:57.518669 cpu0 BSP: Apr 26 16:23:57.518727 ID: 0x00000000 VER: 0x01060015 LDR: 0x0000000= 1 DFR: 0x00000000 x2APIC: 1 Apr 26 16:23:57.530597 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x0000000= 0 SVR: 0x000011ff Apr 26 16:23:57.530611 timer: 0x000100ef therm: 0x00010000 err: 0x000000f= 0 pmc: 0x00010400 Apr 26 16:23:57.542651 cmci: 0x000000f2 Apr 26 16:23:57.542714 lapic4: CMCI unmasked Apr 26 16:23:57.542762 SMP: AP CPU #2 Launched! Apr 26 16:23:57.542809 cpu2 AP: Apr 26 16:23:57.554629 ID: 0x00000004 VER: 0x01060015 LDR: 0x0000001= 0 DFR: 0x00000000 x2APIC: 1 Apr 26 16:23:57.554698 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x0000000= 0 SVR: 0x000011ff Apr 26 16:23:57.566634 timer: 0x000100ef therm: 0x00010000 err: 0x000000f= 0 pmc: 0x00010400 Apr 26 16:23:57.566701 cmci: 0x000000f2 Apr 26 16:23:57.566748 lapic6: CMCI unmasked Apr 26 16:23:57.578636 SMP: AP CPU #3 Launched! Apr 26 16:23:57.578697 cpu3 AP: Apr 26 16:23:57.578741 ID: 0x00000006 VER: 0x01060015 LDR: 0x0000004= 0 DFR: 0x00000000 x2APIC: 1 Apr 26 16:23:57.590638 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x0000000= 0 SVR: 0x000011ff Apr 26 16:23:57.590703 timer: 0x000100ef therm: 0x00010000 err: 0x000000f= 0 pmc: 0x00010400 Apr 26 16:23:57.602644 cmci: 0x000000f2 Apr 26 16:23:57.602702 lapic2: CMCI unmasked Apr 26 16:23:57.602749 SMP: AP CPU #1 Launched! Apr 26 16:23:57.602798 cpu1 AP: Apr 26 16:23:57.614625 ID: 0x00000002 VER: 0x01060015 LDR: 0x0000000= 4 DFR: 0x00000000 x2APIC: 1 Apr 26 16:23:57.614693 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x0000000= 0 SVR: 0x000011ff Apr 26 16:23:57.626628 timer: 0x000100ef therm: 0x00010000 err: 0x000000f= 0 pmc: 0x00010400 Apr 26 16:23:57.626694 cmci: 0x000000f2 Apr 26 16:23:57.638631 SMP: passed TSC synchronization test Apr 26 16:23:57.638694 TSC timecounter discards lower 1 bit(s) Apr 26 16:23:57.638744 Timecounter "TSC-low" frequency 1546449930 Hz qualit= y 1000 Apr 26 16:23:57.650643 snd_md0: Preload)e u=3D0x00ff800f0 [512] d=3D0743070= 07cbyt e[32at c=3D0x00000f3f82 [10248] Apr 26 16:23:57.650713 feeder_register: snd_unit=3D-1 snd_maxautovchans=3D1= 6 latency=3D5 feeder_rate_min=3D1 feeder_rate_max=3D2016000 feeder_rate_rou= nd=3D25 Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/o= sstest/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 Apr 26 16:23:57.674650 cpuid =3D 2 Apr 26 16:23:57.686653 time =3D 1 Apr 26 16:23:57.686720 KDB: stack backtrace: Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2= b/frame 0xfffffe003abe8710 Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0= xfffffe003abe8810 Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fr= ame 0xfffffe003abe8840 Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003= abe8a00 Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe0= 03abe8a30 Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe0= 03abe8a70 Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8a= b0 Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfff= ffe003abe8ab0 Apr 26 16:23:57.746721 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- Apr 26 16:23:57.758797 KDB: enter: panic Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why Apr 26 16:23:57.770557 db>=20 The automatic bisector has pointed as this commit as the culprit, you can see the full bisection at: https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061.html And an example of a failed test at: https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104.html http://logs.test-lab.xenproject.org/osstest/logs/135458/ Thanks, Roger. From owner-svn-src-head@freebsd.org Thu May 2 11:58:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27CD61593233; Thu, 2 May 2019 11:58:55 +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 B84C28B962; Thu, 2 May 2019 11:58:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id MAMKhPrgLldkPMAMLhs0lY; Thu, 02 May 2019 05:58:45 -0600 X-Authority-Analysis: v=2.3 cv=Ko4zJleN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=E5NmQfObTbMA:10 a=baVkBnF-AAAA:8 a=6I5d2MoRAAAA:8 a=cWRNjhkoAAAA:8 a=YxBL1-UpAAAA:8 a=lYlWJ9YPIbE2u9GGOegA:9 a=mw87X0hgnAeoXYiz:21 a=CjuIK1q_8ugA:10 a=U0-lpeXeMuwA:10 a=LLpjHUk9RYsA:10 a=8T6hGYADbIqAPJwOXx51:22 a=IjZwj45LgO3ly-622nXo:22 a=sVa6W5Aao32NNC1mekxh:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id C3E5BC8F; Thu, 2 May 2019 04:58:39 -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 x42BwdAH006868; Thu, 2 May 2019 04:58:39 -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 x42BwduG006865; Thu, 2 May 2019 04:58:39 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201905021158.x42BwduG006865@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: Roger Pau =?utf-8?B?TW9ubsOp?= cc: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r346670 - head/sys/net In-Reply-To: Message from Roger Pau =?utf-8?B?TW9ubsOp?= of "Thu, 02 May 2019 13:11:06 +0200." <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 02 May 2019 04:58:39 -0700 X-CMAE-Envelope: MS4wfDbPJrLPJdF+4zGT3z65C3qSY6eYeSxawPewXN67MYWOx64zU2g0PaotlJqs+H9K5y2/5AW3/+BjHUo7rslZuFOnX3bYg4ne8a98qeKRLiTnXwXCVo7D tXSGh8fw01eil9kVRPnp27BhJp9LokSz+DMYWMXx2hO23FUu3xoQM/B9Rb9uc2mGiXXl0WW86lRs+4S3+q3p+fjtWoHIiojdw1ZbSnnrFwBLPvZ3Eqp/BEhQ PEoBO9BJrJWeviesReYDifCSAPmzv8dQWwNn+UQddSmM1kiGp1yB11HcFkWiE+/2juSbOoQk9VkNld2knsETd1p7pFBQzpF9giJUKdVsE+E= X-Rspamd-Queue-Id: B84C28B962 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.18 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-2.57)[ip: (-7.08), ipnet: 64.59.128.0/20(-3.21), asn: 6327(-2.46), country: CA(-0.09)]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.90)[-0.901,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.134.59.64.list.dnswl.org : 127.0.5.1] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 11:58:55 -0000 In message <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net>, Roger Pa u =?utf-8?B?TW9ubsOp?= writes: > On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > > Author: kevans > > Date: Thu Apr 25 12:44:08 2019 > > New Revision: 346670 > > URL: https://svnweb.freebsd.org/changeset/base/346670 > > > > Log: > > tun/tap: close race between destroy/ioctl handler > > > > It seems that there should be a better way to handle this, but this seems > to > > be the more common approach and it should likely get replaced in all of t > he > > places it happens... Basically, thread 1 is in the process of destroying > the > > tun/tap while thread 2 is executing one of the ioctls that requires the > > tun/tap mutex and the mutex is destroyed before the ioctl handler can > > acquire it. > > > > This is only one of the races described/found in PR 233955. > > > > PR: 233955 > > Reviewed by: ae > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D20027 > > This has caused a regression when booting. I reliably get the > following panic when booting on several different boxes: > > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/oss > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > Apr 26 16:23:57.674650 cpuid = 2 > Apr 26 16:23:57.686653 time = 1 > Apr 26 16:23:57.686720 KDB: stack backtrace: > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/ > frame 0xfffffe003abe8710 > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xf > ffffe003abe8810 > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fram > e 0xfffffe003abe8840 > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003ab > e8a00 > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003 > abe8a30 > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe003 > abe8a70 > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8ab0 > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfffff > e003abe8ab0 > Apr 26 16:23:57.746721 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > Apr 26 16:23:57.758797 KDB: enter: panic > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why > Apr 26 16:23:57.770557 db> > > The full serial log of the host booting: > > e820: 0000000095fff000 0`0000000/boot/config: -hn -S115200/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\Consoles: s > erial port > Apr 26 16:23:50.318505 BIOS drive C: is disk0 > Apr 26 16:23:50.318505 BIOS drive D: is disk1 > Apr 26 16:23:50.330486 |/BIOS 632kB/2316028kB available memory > Apr 26 16:23:50.366512 > Apr 26 16:23:50.366512 FreeBSD/x86 bootstrap loader, Revision 1.1 > Apr 26 16:23:50.366512 -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|Loading /boot/defaults/loader.conf > Apr 26 16:23:50.414528 Loading /boot/device.hints > Apr 26 16:23:50.426510 /-\|/-Loading /boot/loader.conf > Apr 26 16:23:50.426510 \|/-Loading /boot/loader.conf.local > Apr 26 16:23:50.438526 \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\Loading kernel... > Apr 26 16:23:50.450532 |/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|//boot/kernel/kernel text=0x16e4c29 -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|data=0x1d65a8+0x819 > 948 /-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-syms=[0x8+0x183c48\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/+0x8+0x1a1479-\|] > Apr 26 16:23:51.626609 Loading configured modules... > Apr 26 16:23:51.638619 /-\|/-\|/-\|/-\|can't find '/boot/entropy' > Apr 26 16:23:51.638679 /-\|/-\|/-\|/-\/mfsroot |/-\|/-\|/-\|/-8000000 2 \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-! \|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/- \|/-\|/-\|/-size=0x171c80 > 00 > Apr 26 16:23:53.846620 > Apr 26 16:23:53.846671 > Booting [/boot/kernel/kernel]... > Apr 26 16:23:53.846719 GDB: no debug ports present > Apr 26 16:23:54.530540 KDB: debugger backends: ddb > Apr 26 16:23:54.530540 KDB: current backend: ddb > Apr 26 16:23:54.530540 ---<>--- > Apr 26 16:23:54.530540 Table 'FACP' at 0x95ff7000 > Apr 26 16:23:54.542628 Table 'UEFI' at 0x95ffd000 > Apr 26 16:23:54.542683 Table 'UEFI' at 0x95ffc000 > Apr 26 16:23:54.542726 Table 'ASF!' at 0x95ffb000 > Apr 26 16:23:54.554635 Table 'ASPT' at 0x95ffa000 > Apr 26 16:23:54.554696 Table 'BOOT' at 0x95ff9000 > Apr 26 16:23:54.554743 Table 'DBGP' at 0x95ff8000 > Apr 26 16:23:54.554792 Table 'HPET' at 0x95ff6000 > Apr 26 16:23:54.566627 Table 'APIC' at 0x95ff5000 > Apr 26 16:23:54.566689 APIC: Found table at 0x95ff5000 > Apr 26 16:23:54.566738 APIC: Using the MADT enumerator. > Apr 26 16:23:54.566787 Copyright (c) 1992-2019 The FreeBSD Project. > Apr 26 16:23:54.578639 Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991 > , 1992, 1993, 1994 > Apr 26 16:23:54.578706 The Regents of the University of California. Al > l rights reserved. > Apr 26 16:23:54.590645 FreeBSD is a registered trademark of The FreeBSD Found > ation. > Apr 26 16:23:54.590710 FreeBSD 13.0-CURRENT 4284b348ee3(HEAD) GENERIC amd64 > Apr 26 16:23:54.602637 FreeBSD clang version 8.0.0 (tags/RELEASE_800/final 35 > 6365) (based on LLVM 8.0.0) > Apr 26 16:23:54.614600 WARNING: WITNESS option enabled, expect reduced perfor > mance. > Apr 26 16:23:54.614665 Table 'FACP' at 0x95ff7000 > Apr 26 16:23:54.614715 Table 'UEFI' at 0x95ffd000 > Apr 26 16:23:54.614762 Table 'UEFI' at 0x95ffc000 > Apr 26 16:23:54.626589 Table 'ASF!' at 0x95ffb000 > Apr 26 16:23:54.626643 Table 'ASPT' at 0x95ffa000 > Apr 26 16:23:54.626690 Table 'BOOT' at 0x95ff9000 > Apr 26 16:23:54.626736 Table 'DBGP' at 0x95ff8000 > Apr 26 16:23:54.638647 Table 'HPET' at 0x95ff6000 > Apr 26 16:23:54.638729 Table 'APIC' at 0x95ff5000 > Apr 26 16:23:54.638779 Table 'MCFG' at 0x95ff4000 > Apr 26 16:23:54.638826 Table 'SLIC' at 0x95ff3000 > Apr 26 16:23:54.650634 Table 'SSDT' at 0x95fdc000 > Apr 26 16:23:54.650695 Table 'SPMI' at 0x95fda000 > Apr 26 16:23:54.650743 Table 'SSDT' at 0x95fd9000 > Apr 26 16:23:54.650790 Table 'SSDT' at 0x95fd8000 > Apr 26 16:23:54.650837 Table 'SSDT' at 0x95fd4000 > Apr 26 16:23:54.662635 Table 'SPCR' at 0x95ff2000 > Apr 26 16:23:54.662696 Table 'DMAR' at 0x95fd3000 > Apr 26 16:23:54.662744 Table 'SSDT' at 0x95fd2000 > Apr 26 16:23:54.662791 Table 'FPDT' at 0x95fd1000 > Apr 26 16:23:54.674633 Table 'HEST' at 0x95fd0000 > Apr 26 16:23:54.674694 Table 'ERST' at 0x95fce000 > Apr 26 16:23:54.674742 Table 'BERT' at 0x95fcd000 > Apr 26 16:23:54.674789 Table 'EINJ' at 0x95fcc000 > Apr 26 16:23:54.674836 ACPI: No SRAT table found > Apr 26 16:23:54.686618 PPIM 0: PA=0xa0000, VA=0xffffffff99a10000, size=0x1000 > 0, mode=0 > Apr 26 16:23:54.722627 pmap: large map 8 PML4 slots (4096 Gb) > Apr 26 16:23:54.734614 VT(vga): resolution 640x480 > Apr 26 16:23:54.734676 Preloaded elf kernel "/boot/kernel/kernel" at 0xffffff > ff998dd000. > Apr 26 16:23:54.746630 Preloaded mfs_root "/mfsroot" at 0xffffffff998e61f0. > Apr 26 16:23:54.746696 Table 'FACP' at 0x95ff7000 > Apr 26 16:23:54.746745 FACP: Found table at 0x95ff7000 > Apr 26 16:23:54.758587 Calibrating TSC clock ... TSC clock: 3092899860 Hz > Apr 26 16:23:55.754490 CPU: Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz (3092.9 > 0-MHz K8-class CPU) > Apr 26 16:23:55.766650 Origin="GenuineIntel" Id=0x306c3 Family=0x6 Model > =0x3c Stepping=3 > Apr 26 16:23:55.778636 Features=0xbfebfbff X8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS > ,HTT,TM,PBE> > Apr 26 16:23:55.790589 Features2=0x7ffafbff L,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOV > BE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND> > Apr 26 16:23:55.802661 AMD Features=0x2c100800 > > Apr 26 16:23:55.814629 AMD Features2=0x21 > Apr 26 16:23:55.814690 Structured Extended Features=0x2fbb BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,NFPUSG> > Apr 26 16:23:55.826639 XSAVE Features=0x1 > Apr 26 16:23:55.826700 VT-x: Basic Features=0xda0400 > Apr 26 16:23:55.826753 Pin-Based Controls=0x7f > > Apr 26 16:23:55.838605 Primary Processor Controls=0xfff9fffe SCOff,HLT,INVLPG,MWAIT,RDPMC,RDTSC,CR3-LD,CR3-ST,CR8-LD,CR8-ST,TPR,NMIWIN,MOV > -DR,IO,IOmap,MTF,MSRmap,MONITOR,PAUSE> > Apr 26 16:23:55.850662 Secondary Processor Controls=0x7cff T,RDTSCP,x2APIC,VPID,WBINVD,UG,PAUSE-loop,RDRAND,INVPCID,VMFUNC,VMCS> > Apr 26 16:23:55.862645 Exit Controls=0xda0400 > Apr 26 16:23:55.874646 Entry Controls=0xda0400 > Apr 26 16:23:55.874708 EPT Features=0x6334141 PT,AD,single,all> > Apr 26 16:23:55.886587 VPID Features=0xf01 all,single-globals> > Apr 26 16:23:55.886598 TSC: P-state invariant, performance statistics > Apr 26 16:23:55.898658 Data TLB: 2 MByte or 4 MByte pages, 4-way set associat > ive, 32 entries and a separate array with 1 GByte pages, 4-way set associativ > e, 4 entries > Apr 26 16:23:55.910639 Data TLB: 4 KB pages, 4-way set associative, 64 entrie > s > Apr 26 16:23:55.910704 Instruction TLB: 2M/4M pages, fully associative, 8 ent > ries > Apr 26 16:23:55.922634 Instruction TLB: 4KByte pages, 8-way set associative, > 128 entries > Apr 26 16:23:55.922701 64-Byte prefetching > Apr 26 16:23:55.922749 Shared 2nd-Level TLB: 4 KByte/2MByte pages, 8-way asso > ciative, 1024 entries > Apr 26 16:23:55.934645 L2 cache: 256 kbytes, 8-way associative, 64 bytes/line > Apr 26 16:23:55.946629 real memory = 8589934592 (8192 MB) > Apr 26 16:23:55.946692 Physical memory chunk(s): > Apr 26 16:23:55.946742 0x0000000000010000 - 0x000000000009cfff, 577536 bytes > (141 pages) > Apr 26 16:23:55.958641 0x0000000000103000 - 0x00000000001fffff, 1036288 bytes > (253 pages) > Apr 26 16:23:55.958736 0x0000000019a00000 - 0x000000008d6befff, 1942745088 by > tes (474303 pages) > Apr 26 16:23:55.970634 0x0000000095fff000 - 0x0000000095ffffff, 4096 bytes (1 > pages) > Apr 26 16:23:55.970700 0x0000000100000000 - 0x0000000250b8efff, 5649264640 by > tes (1379215 pages) > Apr 26 16:23:55.982625 avail memory = 7548768256 (7199 MB) > Apr 26 16:23:55.994570 Table 'FACP' at 0x95ff7000 > Apr 26 16:23:56.006636 Table 'UEFI' at 0x95ffd000 > Apr 26 16:23:56.006696 Table 'UEFI' at 0x95ffc000 > Apr 26 16:23:56.006743 Table 'ASF!' at 0x95ffb000 > Apr 26 16:23:56.006790 Table 'ASPT' at 0x95ffa000 > Apr 26 16:23:56.018651 Table 'BOOT' at 0x95ff9000 > Apr 26 16:23:56.018712 Table 'DBGP' at 0x95ff8000 > Apr 26 16:23:56.018760 Table 'HPET' at 0x95ff6000 > Apr 26 16:23:56.018807 Table 'APIC' at 0x95ff5000 > Apr 26 16:23:56.018854 Table 'MCFG' at 0x95ff4000 > Apr 26 16:23:56.030634 Table 'SLIC' at 0x95ff3000 > Apr 26 16:23:56.030694 Table 'SSDT' at 0x95fdc000 > Apr 26 16:23:56.030741 Table 'SPMI' at 0x95fda000 > Apr 26 16:23:56.030788 Table 'SSDT' at 0x95fd9000 > Apr 26 16:23:56.042642 Table 'SSDT' at 0x95fd8000 > Apr 26 16:23:56.042702 Table 'SSDT' at 0x95fd4000 > Apr 26 16:23:56.042750 Table 'SPCR' at 0x95ff2000 > Apr 26 16:23:56.042797 Table 'DMAR' at 0x95fd3000 > Apr 26 16:23:56.054632 DMAR: Found table at 0x95fd3000 > Apr 26 16:23:56.054694 MADT: Found CPU APIC ID 0 ACPI ID 1: enabled > Apr 26 16:23:56.054746 SMP: Added CPU 0 (AP) > Apr 26 16:23:56.054793 MADT: Found CPU APIC ID 2 ACPI ID 2: enabled > Apr 26 16:23:56.066632 SMP: Added CPU 2 (AP) > Apr 26 16:23:56.066691 MADT: Found CPU APIC ID 4 ACPI ID 3: enabled > Apr 26 16:23:56.066742 SMP: Added CPU 4 (AP) > Apr 26 16:23:56.066788 MADT: Found CPU APIC ID 6 ACPI ID 4: enabled > Apr 26 16:23:56.078725 SMP: Added CPU 6 (AP) > Apr 26 16:23:56.078760 MADT: Found CPU APIC ID 0 ACPI ID 5: disabled > Apr 26 16:23:56.078817 MADT: Found CPU APIC ID 0 ACPI ID 6: disabled > Apr 26 16:23:56.090547 MADT: Found CPU APIC ID 0 ACPI ID 7: disabled > Apr 26 16:23:56.090547 MADT: Found CPU APIC ID 0 ACPI ID 8: disabled > Apr 26 16:23:56.102520 Event timer "LAPIC" quality 600 > Apr 26 16:23:56.102520 ACPI APIC Table: > Apr 26 16:23:56.102520 Package ID shift: 4 > Apr 26 16:23:56.102520 L3 cache ID shift: 4 > Apr 26 16:23:56.102520 L2 cache ID shift: 1 > Apr 26 16:23:56.114479 L1 cache ID shift: 1 > Apr 26 16:23:56.114479 Core ID shift: 1 > Apr 26 16:23:56.114479 INTR: Adding local APIC 2 as a target > Apr 26 16:23:56.150539 INTR: Adding local APIC 4 as a target > Apr 26 16:23:56.150539 INTR: Adding local APIC 6 as a target > Apr 26 16:23:56.150539 FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > Apr 26 16:23:56.162543 FreeBSD/SMP: 1 package(s) x 4 core(s) > Apr 26 16:23:56.162543 Package HW ID = 0 > Apr 26 16:23:56.162543 Core HW ID = 0 > Apr 26 16:23:56.174555 CPU0 (BSP): APIC ID: 0 > Apr 26 16:23:56.174555 Core HW ID = 1 > Apr 26 16:23:56.174555 CPU1 (AP): APIC ID: 2 > Apr 26 16:23:56.174555 Core HW ID = 2 > Apr 26 16:23:56.174555 CPU2 (AP): APIC ID: 4 > Apr 26 16:23:56.174555 Core HW ID = 3 > Apr 26 16:23:56.186544 CPU3 (AP): APIC ID: 6 > Apr 26 16:23:56.186544 APIC: CPU 0 has ACPI ID 1 > Apr 26 16:23:56.186544 APIC: CPU 1 has ACPI ID 2 > Apr 26 16:23:56.186544 APIC: CPU 2 has ACPI ID 3 > Apr 26 16:23:56.186544 APIC: CPU 3 has ACPI ID 4 > Apr 26 16:23:56.198550 x86bios: IVT 0x000000-0x0004ff at 0xfffff80000000000 > Apr 26 16:23:56.198550 x86bios: SSEG 0x09c000-0x09cfff at 0xfffffe0002eb1000 > Apr 26 16:23:56.210547 x86bios: EBDA 0x09f000-0x09ffff at 0xfffff8000009f000 > Apr 26 16:23:56.210547 x86bios: ROM 0x0a0000-0x0fefff at 0xfffff800000a0000 > Apr 26 16:23:56.210547 lapic0: CMCI unmasked > Apr 26 16:23:56.222548 Pentium Pro MTRR support enabled > Apr 26 16:23:56.222611 __stack_chk_init: WARNING: Initializing stack protecti > on with non-random cookies! > Apr 26 16:23:56.234649 __stack_chk_init: WARNING: This severely limits the be > nefit of -fstack-protector! > Apr 26 16:23:56.234725 VIMAGE (virtualized network stack) enabled > Apr 26 16:23:56.246632 ULE: setup cpu 0 > Apr 26 16:23:56.246709 ULE: setup cpu 1 > Apr 26 16:23:56.246757 ULE: setup cpu 2 > Apr 26 16:23:56.246803 ULE: setup cpu 3 > Apr 26 16:23:56.246850 ACPI: RSDP 0x00000000000FE020 000024 (v02 DELL ) > Apr 26 16:23:56.258620 ACPI: XSDT 0x0000000095FCF188 0000E4 (v01 DELL PE_SC > 3 00000001 01000013) > Apr 26 16:23:56.258689 ACPI: FACP 0x0000000095FF7000 00010C (v05 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.270640 ACPI: DSDT 0x0000000095FDF000 012335 (v01 DELL PE_SC > 3 00000000 DELL 00040000) > Apr 26 16:23:56.282635 ACPI: FACS 0x0000000095FBD000 000040 > Apr 26 16:23:56.282698 ACPI: UEFI 0x0000000095FFD000 000236 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.294635 ACPI: UEFI 0x0000000095FFC000 000042 (v01 DELL PE_SC > 3 00000000 DELL 00040000) > Apr 26 16:23:56.294705 ACPI: ASF! 0x0000000095FFB000 0000A5 (v32 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.306597 ACPI: ASPT 0x0000000095FFA000 000034 (v07 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.318581 ACPI: BOOT 0x0000000095FF9000 000028 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.318581 ACPI: DBGP 0x0000000095FF8000 000034 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.330620 ACPI: HPET 0x0000000095FF6000 000038 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.342636 ACPI: APIC 0x0000000095FF5000 000092 (v03 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.342704 ACPI: MCFG 0x0000000095FF4000 00003C (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.354639 ACPI: SLIC 0x0000000095FF3000 000176 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.366687 ACPI: SSDT 0x0000000095FDC000 002028 (v01 DELL PE_SC > 3 00001000 DELL 00040000) > Apr 26 16:23:56.366756 ACPI: SPMI 0x0000000095FDA000 000040 (v05 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.378647 ACPI: SSDT 0x0000000095FD9000 000533 (v01 DELL PE_SC > 3 00003000 DELL 00040000) > Apr 26 16:23:56.390638 ACPI: SSDT 0x0000000095FD8000 000ACE (v01 DELL PE_SC > 3 00003000 DELL 00040000) > Apr 26 16:23:56.390709 ACPI: SSDT 0x0000000095FD4000 003492 (v01 DELL PE_SC > 3 00003000 DELL 00040000) > Apr 26 16:23:56.402647 ACPI: SPCR 0x0000000095FF2000 000050 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.414633 ACPI: DMAR 0x0000000095FD3000 000080 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.414701 ACPI: SSDT 0x0000000095FD2000 000514 (v01 DELL PE_SC > 3 00001000 DELL 00040000) > Apr 26 16:23:56.426646 ACPI: FPDT 0x0000000095FD1000 000044 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.438643 ACPI: HEST 0x0000000095FD0000 0000A8 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.438711 ACPI: ERST 0x0000000095FCE000 000230 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.450651 ACPI: BERT 0x0000000095FCD000 000030 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.462631 ACPI: EINJ 0x0000000095FCC000 000150 (v01 DELL PE_SC > 3 00000001 DELL 00040000) > Apr 26 16:23:56.462700 MADT: Found IO APIC ID 2, Interrupt 0 at 0xfec00000 > Apr 26 16:23:56.474535 ioapic0: ver 0x20 maxredir 0x17 > Apr 26 16:23:56.474568 ioapic0: Routing external 8259A's -> intpin 0 > Apr 26 16:23:56.474596 MADT: Interrupt override: source 0, irq 2 > Apr 26 16:23:56.486634 ioapic0: Routing IRQ 0 -> intpin 2 > Apr 26 16:23:56.486696 MADT: Interrupt override: source 9, irq 9 > Apr 26 16:23:56.486748 ioapic0: intpin 9 trigger: level > Apr 26 16:23:56.498651 lapic: Routing NMI -> LINT1 > Apr 26 16:23:56.498713 lapic: LINT1 trigger: edge > Apr 26 16:23:56.498761 lapic: LINT1 polarity: high > Apr 26 16:23:56.498809 ioapic0 irqs 0-23 on motherboard > Apr 26 16:23:56.510592 lapic: Divisor 2, Frequency 49885486 Hz > Apr 26 16:23:57.506602 lapic: deadline tsc mode, Frequency 3092899860 Hz > Apr 26 16:23:57.518669 cpu0 BSP: > Apr 26 16:23:57.518727 ID: 0x00000000 VER: 0x01060015 LDR: 0x00000001 > DFR: 0x00000000 x2APIC: 1 > Apr 26 16:23:57.530597 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 > SVR: 0x000011ff > Apr 26 16:23:57.530611 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 > pmc: 0x00010400 > Apr 26 16:23:57.542651 cmci: 0x000000f2 > Apr 26 16:23:57.542714 lapic4: CMCI unmasked > Apr 26 16:23:57.542762 SMP: AP CPU #2 Launched! > Apr 26 16:23:57.542809 cpu2 AP: > Apr 26 16:23:57.554629 ID: 0x00000004 VER: 0x01060015 LDR: 0x00000010 > DFR: 0x00000000 x2APIC: 1 > Apr 26 16:23:57.554698 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 > SVR: 0x000011ff > Apr 26 16:23:57.566634 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 > pmc: 0x00010400 > Apr 26 16:23:57.566701 cmci: 0x000000f2 > Apr 26 16:23:57.566748 lapic6: CMCI unmasked > Apr 26 16:23:57.578636 SMP: AP CPU #3 Launched! > Apr 26 16:23:57.578697 cpu3 AP: > Apr 26 16:23:57.578741 ID: 0x00000006 VER: 0x01060015 LDR: 0x00000040 > DFR: 0x00000000 x2APIC: 1 > Apr 26 16:23:57.590638 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 > SVR: 0x000011ff > Apr 26 16:23:57.590703 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 > pmc: 0x00010400 > Apr 26 16:23:57.602644 cmci: 0x000000f2 > Apr 26 16:23:57.602702 lapic2: CMCI unmasked > Apr 26 16:23:57.602749 SMP: AP CPU #1 Launched! > Apr 26 16:23:57.602798 cpu1 AP: > Apr 26 16:23:57.614625 ID: 0x00000002 VER: 0x01060015 LDR: 0x00000004 > DFR: 0x00000000 x2APIC: 1 > Apr 26 16:23:57.614693 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 > SVR: 0x000011ff > Apr 26 16:23:57.626628 timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 > pmc: 0x00010400 > Apr 26 16:23:57.626694 cmci: 0x000000f2 > Apr 26 16:23:57.638631 SMP: passed TSC synchronization test > Apr 26 16:23:57.638694 TSC timecounter discards lower 1 bit(s) > Apr 26 16:23:57.638744 Timecounter "TSC-low" frequency 1546449930 Hz quality > 1000 > Apr 26 16:23:57.650643 snd_md0: Preload)e u=0x00ff800f0 [512] d=074307007cbyt > e[32at c=0x00000f3f82 [10248] > Apr 26 16:23:57.650713 feeder_register: snd_unit=-1 snd_maxautovchans=16 late > ncy=5 feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25 > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/oss > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > Apr 26 16:23:57.674650 cpuid = 2 > Apr 26 16:23:57.686653 time = 1 > Apr 26 16:23:57.686720 KDB: stack backtrace: > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/ > frame 0xfffffe003abe8710 > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xf > ffffe003abe8810 > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fram > e 0xfffffe003abe8840 > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003ab > e8a00 > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003 > abe8a30 > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe003 > abe8a70 > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8ab0 > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfffff > e003abe8ab0 > Apr 26 16:23:57.746721 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > Apr 26 16:23:57.758797 KDB: enter: panic > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why > Apr 26 16:23:57.770557 db> > > The automatic bisector has pointed as this commit as the culprit, you > can see the full bisection at: > > https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061.html > > And an example of a failed test at: > > https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104.html > http://logs.test-lab.xenproject.org/osstest/logs/135458/ > > Thanks, Roger. > > It made a strange connection to this commit. The panic has geom written all over it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Thu May 2 12:54:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E3AA15952BC; Thu, 2 May 2019 12:54:04 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.eu.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8392A8DB90; Thu, 2 May 2019 12:54:03 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.60,421,1549929600"; d="scan'208";a="89569125" Date: Thu, 2 May 2019 14:53:34 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Cy Schubert CC: Kyle Evans , , , Subject: Re: svn commit: r346670 - head/sys/net Message-ID: <20190502125334.ly3putfkfnxvbhqv@Air-de-Roger.citrite.net> References: <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> <201905021158.x42BwduG006865@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201905021158.x42BwduG006865@slippy.cwsent.com> User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-Rspamd-Queue-Id: 8392A8DB90 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 12:54:04 -0000 On Thu, May 02, 2019 at 04:58:39AM -0700, Cy Schubert wrote: > In message <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net>, > Roger Pa > u =?utf-8?B?TW9ubsOp?= writes: > > On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/oss > > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > > Apr 26 16:23:57.674650 cpuid = 2 > > Apr 26 16:23:57.686653 time = 1 > > Apr 26 16:23:57.686720 KDB: stack backtrace: > > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/ > > frame 0xfffffe003abe8710 > > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 > > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xf > > ffffe003abe8810 > > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fram > > e 0xfffffe003abe8840 > > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003ab > > e8a00 > > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003 > > abe8a30 > > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe003 > > abe8a70 > > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8ab0 > > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfffff > > e003abe8ab0 > > Apr 26 16:23:57.746721 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > > Apr 26 16:23:57.758797 KDB: enter: panic > > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why > > Apr 26 16:23:57.770557 db> > > > > The automatic bisector has pointed as this commit as the culprit, you > > can see the full bisection at: > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061.html > > > > And an example of a failed test at: > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104.html > > http://logs.test-lab.xenproject.org/osstest/logs/135458/ > > > > Thanks, Roger. > > > > > > It made a strange connection to this commit. The panic has geom written > all over it. I agree it's a strange connection, but the results from the bisection are quite clear, the previous commit which is 070cf1ede1850d8c (r346664) works fine and d61e108233bfdb3 (r346670) this commit fails. The bisection looks reliable as there are no skipped revisions or spurious failures. Roger. From owner-svn-src-head@freebsd.org Thu May 2 12:56:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72D7F1595352; Thu, 2 May 2019 12:56:15 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 174778DD1A; Thu, 2 May 2019 12:56:15 +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 E0B779708; Thu, 2 May 2019 12:56:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42CuErv057111; Thu, 2 May 2019 12:56:14 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42CuD9m057105; Thu, 2 May 2019 12:56:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905021256.x42CuD9m057105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 2 May 2019 12:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347017 - in head/sys: arm64/conf conf dts/arm64/overlays modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/conf conf dts/arm64/overlays modules/dtb/allwinner X-SVN-Commit-Revision: 347017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 174778DD1A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 12:56:15 -0000 Author: manu Date: Thu May 2 12:56:13 2019 New Revision: 347017 URL: https://svnweb.freebsd.org/changeset/base/347017 Log: arm64: Add support for NanoPI NEO2 Add overlay files and activate devicetree file for NanoPi NEO2 featuring Allwinner H5 ARM64 core. To enable sound, dma and codec drivers are enabled for build. Submitted by: Manuel Stühn (freebsdnewbie@freenet.de) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D20129 Added: head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso (contents, props changed) head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso (contents, props changed) head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso (contents, props changed) head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu May 2 09:00:36 2019 (r347016) +++ head/sys/arm64/conf/GENERIC Thu May 2 12:56:13 2019 (r347017) @@ -215,11 +215,19 @@ device muge device smcphy device smsc +# Sound support +device sound +device a10_codec + +# DMA controller +device a31_dmac + # GPIO / PINCTRL device aw_gpio # Allwinner GPIO controller device gpio device gpioled device fdt_pinctrl +device gpioregulator device mv_gpio # Marvell GPIO controller device mvebu_pinctrl # Marvell Pinmux Controller device rk_gpio # RockChip GPIO Controller Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu May 2 09:00:36 2019 (r347016) +++ head/sys/conf/files.arm64 Thu May 2 12:56:13 2019 (r347017) @@ -27,6 +27,9 @@ cloudabi64_vdso_blob.o optional compat_cloudabi64 \ # Allwinner common files arm/allwinner/a10_ehci.c optional ehci aw_ehci fdt arm/allwinner/a10_timer.c optional a10_timer fdt +arm/allwinner/a10_codec.c optional sound a10_codec +arm/allwinner/a31_dmac.c optional a31_dmac +arm/allwinner/sunxi_dma_if.m optional a31_dmac arm/allwinner/aw_cir.c optional evdev aw_cir fdt arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt Added: head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-h5-nanopi-neo2-opp.dtso Thu May 2 12:56:13 2019 (r347017) @@ -0,0 +1,32 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/} { + vdd_cpux: gpio-regulator { + compatible = "regulator-gpio"; + pinctrl-names = "default"; + regulator-name = "vdd-cpux"; + regulator-type = "voltage"; + regulator-boot-on; + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1300000>; + regulator-ramp-delay = <50>; /* 4ms */ + gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + gpios-states = <0x1>; + states = <1100000 0x0 + 1300000 0x1>; + }; + +}; + +&{/cpus/cpu@0} { + cpu-supply = <&vdd_cpux>; +}; + Added: head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-h5-opp.dtso Thu May 2 12:56:13 2019 (r347017) @@ -0,0 +1,99 @@ +/dts-v1/; +/plugin/; + +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/} { + cpu_opp_table: opp_table { + compatible = "operating-points-v2"; + opp-shared; + + opp@408000000 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <1000000 1000000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@648000000 { + opp-hz = /bits/ 64 <648000000>; + opp-microvolt = <1040000 1040000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1080000 1080000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@912000000 { + opp-hz = /bits/ 64 <912000000>; + opp-microvolt = <1120000 1120000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@960000000 { + opp-hz = /bits/ 64 <960000000>; + opp-microvolt = <1160000 1160000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1200000 1200000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1056000000 { + opp-hz = /bits/ 64 <1056000000>; + opp-microvolt = <1240000 1240000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1104000000 { + opp-hz = /bits/ 64 <1104000000>; + opp-microvolt = <1260000 1260000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1152000000 { + opp-hz = /bits/ 64 <1152000000>; + opp-microvolt = <1300000 1300000 1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + }; + + reg_cpu_fallback: reg_cpu_fallback { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpux-dummy"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + }; + +}; + +&{/cpus/cpu@0} { + clocks = <&ccu CLK_CPUX>; + clock-names = "cpu"; + clock-latency = <244144>; /* 8 32k periods */ + operating-points-v2 = <&cpu_opp_table>; + cpu-supply = <®_cpu_fallback>; + #cooling-cells = <2>; +}; + +&{/cpus/cpu@1} { + operating-points-v2 = <&cpu_opp_table>; +}; + +&{/cpus/cpu@2} { + operating-points-v2 = <&cpu_opp_table>; +}; + +&{/cpus/cpu@3} { + operating-points-v2 = <&cpu_opp_table>; +}; + Added: head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-h5-sid.dtso Thu May 2 12:56:13 2019 (r347017) @@ -0,0 +1,17 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/soc} { + sid: eeprom@1c14000 { + compatible = "allwinner,sun50i-h5-sid"; + reg = <0x1c14000 0x400>; + + ths_calib: calib@234 { + reg = <0x234 0x4>; + }; + }; +}; Added: head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm64/overlays/sun50i-h5-ths.dtso Thu May 2 12:56:13 2019 (r347017) @@ -0,0 +1,26 @@ +/dts-v1/; +/plugin/; + +#include +#include +#include + +/ { + compatible = "allwinner,sun50i-h5"; +}; + +&{/soc} { + ths: thermal_sensor@1c25000 { + compatible = "allwinner,sun50i-h5-ths"; + reg = <0x01c25000 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; + clock-names = "apb", "ths"; + resets = <&ccu RST_BUS_THS>; + reset-names = "apb"; + #thermal-sensor-cells = <1>; + + nvmem-cells = <&ths_calib>; + nvmem-cell-names = "ths-calib"; + }; +}; Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Thu May 2 09:00:36 2019 (r347016) +++ head/sys/modules/dtb/allwinner/Makefile Thu May 2 12:56:13 2019 (r347017) @@ -44,14 +44,19 @@ DTS= \ allwinner/sun50i-a64-pine64-plus.dts \ allwinner/sun50i-a64-pine64.dts \ allwinner/sun50i-a64-sopine-baseboard.dts \ - allwinner/sun50i-h5-orangepi-pc2.dts + allwinner/sun50i-h5-orangepi-pc2.dts \ + allwinner/sun50i-h5-nanopi-neo2.dts DTSO= sun50i-a64-opp.dtso \ sun50i-a64-pwm.dtso \ sun50i-a64-rpwm.dtso \ sun50i-a64-sid.dtso \ sun50i-a64-ths.dtso \ - sun50i-a64-timer.dtso + sun50i-a64-timer.dtso \ + sun50i-h5-opp.dtso \ + sun50i-h5-sid.dtso \ + sun50i-h5-ths.dtso \ + sun50i-h5-nanopi-neo2-opp.dtso .endif From owner-svn-src-head@freebsd.org Thu May 2 13:14:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08F1415958B4; Thu, 2 May 2019 13:14:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4678E8B9; Thu, 2 May 2019 13:14:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5A270BFCF; Thu, 2 May 2019 13:14:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-ua1-f50.google.com with SMTP id 90so675674uav.10; Thu, 02 May 2019 06:14:42 -0700 (PDT) X-Gm-Message-State: APjAAAWqLK3b4/qudZ4nIA5/wG66yt9K0zBUAy9r+RQ3z2GrDMowI/cd 5QxeAkmjMB8KHSRIpXe3lANlk0EbDxjt3cd/s40= X-Google-Smtp-Source: APXvYqzVsd1mY5MSF6qa3S4O4NhhWNA+oEWoqzdb1jD3wB3MshrD1VqMZ11EcG8btVJudzYI14sK0PL++1g0wg8EhHE= X-Received: by 2002:ab0:413:: with SMTP id 19mr1702257uav.87.1556802881748; Thu, 02 May 2019 06:14:41 -0700 (PDT) MIME-Version: 1.0 References: <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> <201905021158.x42BwduG006865@slippy.cwsent.com> <20190502125334.ly3putfkfnxvbhqv@Air-de-Roger.citrite.net> In-Reply-To: <20190502125334.ly3putfkfnxvbhqv@Air-de-Roger.citrite.net> From: Kyle Evans Date: Thu, 2 May 2019 08:14:08 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r346670 - head/sys/net To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: Cy Schubert , 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-Rspamd-Queue-Id: 9A4678E8B9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 13:14:43 -0000 On Thu, May 2, 2019 at 7:54 AM Roger Pau Monn=C3=A9 = wrote: > > On Thu, May 02, 2019 at 04:58:39AM -0700, Cy Schubert wrote: > > In message <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net>, > > Roger Pa > > u =3D?utf-8?B?TW9ubsOp?=3D writes: > > > On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > > > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/= home/oss > > > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > > > Apr 26 16:23:57.674650 cpuid =3D 2 > > > Apr 26 16:23:57.686653 time =3D 1 > > > Apr 26 16:23:57.686720 KDB: stack backtrace: > > > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapp= er+0x2b/ > > > frame 0xfffffe003abe8710 > > > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8= 760 > > > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > > > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/f= rame 0xf > > > ffffe003abe8810 > > > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0= x6a/fram > > > e 0xfffffe003abe8840 > > > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfff= ffe003ab > > > e8a00 > > > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xf= ffffe003 > > > abe8a30 > > > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xf= ffffe003 > > > abe8a70 > > > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe00= 3abe8ab0 > > > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame= 0xfffff > > > e003abe8ab0 > > > Apr 26 16:23:57.746721 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --= - > > > Apr 26 16:23:57.758797 KDB: enter: panic > > > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > > > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb= _why > > > Apr 26 16:23:57.770557 db> > > > > > > The automatic bisector has pointed as this commit as the culprit, you > > > can see the full bisection at: > > > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061= .html > > > > > > And an example of a failed test at: > > > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104= .html > > > http://logs.test-lab.xenproject.org/osstest/logs/135458/ > > > > > > Thanks, Roger. > > > > > > > > > > It made a strange connection to this commit. The panic has geom written > > all over it. > > I agree it's a strange connection, but the results from the bisection > are quite clear, the previous commit which is 070cf1ede1850d8c > (r346664) works fine and d61e108233bfdb3 (r346670) this commit > fails. > > The bisection looks reliable as there are no skipped revisions or > spurious failures. > This panic seems to make sense, generally if I read things right, but I'm not immediately sure how my commit triggered it. The mutex in question is initialized in devinit, invoked by the root_bus_mod at SI_SUB_DRIVERS + SI_ORDER_FIRST [0]. geom classes are also declared at SI_SUB_DRIVERS + SI_ORDER_FIRST [1], which takes us on a trip through g_modevent -> g_init. g_init creates the g_event thread [2] -> g_event_procbody -> g_run_events -> ... -> (boom). I guess the timing/ordering of these things normally works out so that devinit gets the mutex ready before the g_event thread does any loading/tasting, but not here. [0] https://svnweb.freebsd.org/base/head/sys/kern/subr_bus.c?view=3Dmarkup#= l5127 [1] https://svnweb.freebsd.org/base/head/sys/geom/geom.h?view=3Dmarkup#l414 [2] https://svnweb.freebsd.org/base/head/sys/geom/geom_kern.c?view=3Dmarkup= #l149 From owner-svn-src-head@freebsd.org Thu May 2 14:27:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67F111597340; Thu, 2 May 2019 14:27:23 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.ctxuk.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 857F490FA0; Thu, 2 May 2019 14:27:21 +0000 (UTC) (envelope-from prvs=018794465=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.60,421,1549929600"; d="scan'208";a="89576929" Date: Thu, 2 May 2019 16:22:54 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Kyle Evans CC: Cy Schubert , src-committers , , Subject: Re: svn commit: r346670 - head/sys/net Message-ID: <20190502142254.ywpxblnztanbmu6v@Air-de-Roger.citrite.net> References: <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net> <201905021158.x42BwduG006865@slippy.cwsent.com> <20190502125334.ly3putfkfnxvbhqv@Air-de-Roger.citrite.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) X-Rspamd-Queue-Id: 857F490FA0 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 14:27:23 -0000 On Thu, May 02, 2019 at 08:14:08AM -0500, Kyle Evans wrote: > On Thu, May 2, 2019 at 7:54 AM Roger Pau Monné wrote: > > > > On Thu, May 02, 2019 at 04:58:39AM -0700, Cy Schubert wrote: > > > In message <20190502111106.pfosaq73kgo6g33j@Air-de-Roger.citrite.net>, > > > Roger Pa > > > u =?utf-8?B?TW9ubsOp?= writes: > > > > On Thu, Apr 25, 2019 at 12:44:08PM +0000, Kyle Evans wrote: > > > > Apr 26 16:23:57.662653 panic: mtx_lock() of spin mutex (null) @ /usr/home/oss > > > > test/build.135317.build-amd64-freebsd/freebsd/sys/kern/subr_bus.c:620 > > > > Apr 26 16:23:57.674650 cpuid = 2 > > > > Apr 26 16:23:57.686653 time = 1 > > > > Apr 26 16:23:57.686720 KDB: stack backtrace: > > > > Apr 26 16:23:57.686797 db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/ > > > > frame 0xfffffe003abe8710 > > > > Apr 26 16:23:57.686879 vpanic() at vpanic+0x19d/frame 0xfffffe003abe8760 > > > > Apr 26 16:23:57.698637 panic() at panic+0x43/frame 0xfffffe003abe87c0 > > > > Apr 26 16:23:57.698700 __mtx_lock_flags() at __mtx_lock_flags+0x145/frame 0xf > > > > ffffe003abe8810 > > > > Apr 26 16:23:57.710640 devctl_queue_data_f() at devctl_queue_data_f+0x6a/fram > > > > e 0xfffffe003abe8840 > > > > Apr 26 16:23:57.722625 g_dev_taste() at g_dev_taste+0x463/frame 0xfffffe003ab > > > > e8a00 > > > > Apr 26 16:23:57.722690 g_load_class() at g_load_class+0x1bc/frame 0xfffffe003 > > > > abe8a30 > > > > Apr 26 16:23:57.734638 g_run_events() at g_run_events+0x197/frame 0xfffffe003 > > > > abe8a70 > > > > Apr 26 16:23:57.734704 fork_exit() at fork_exit+0x84/frame 0xfffffe003abe8ab0 > > > > Apr 26 16:23:57.746655 fork_trampoline() at fork_trampoline+0xe/frame 0xfffff > > > > e003abe8ab0 > > > > Apr 26 16:23:57.746721 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > > > > Apr 26 16:23:57.758797 KDB: enter: panic > > > > Apr 26 16:23:57.758913 [ thread pid 13 tid 100029 ] > > > > Apr 26 16:23:57.758943 Stopped at kdb_enter+0x3b: movq $0,kdb_why > > > > Apr 26 16:23:57.770557 db> > > > > > > > > The automatic bisector has pointed as this commit as the culprit, you > > > > can see the full bisection at: > > > > > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-04/msg02061.html > > > > > > > > And an example of a failed test at: > > > > > > > > https://lists.xenproject.org/archives/html/xen-devel/2019-05/msg00104.html > > > > http://logs.test-lab.xenproject.org/osstest/logs/135458/ > > > > > > > > Thanks, Roger. > > > > > > > > > > > > > > It made a strange connection to this commit. The panic has geom written > > > all over it. > > > > I agree it's a strange connection, but the results from the bisection > > are quite clear, the previous commit which is 070cf1ede1850d8c > > (r346664) works fine and d61e108233bfdb3 (r346670) this commit > > fails. > > > > The bisection looks reliable as there are no skipped revisions or > > spurious failures. > > > > This panic seems to make sense, generally if I read things right, but > I'm not immediately sure how my commit triggered it. The mutex in > question is initialized in devinit, invoked by the root_bus_mod at > SI_SUB_DRIVERS + SI_ORDER_FIRST [0]. geom classes are also declared at > SI_SUB_DRIVERS + SI_ORDER_FIRST [1], which takes us on a trip through > g_modevent -> g_init. g_init creates the g_event thread [2] -> > g_event_procbody -> g_run_events -> ... -> (boom). I guess the > timing/ordering of these things normally works out so that devinit > gets the mutex ready before the g_event thread does any > loading/tasting, but not here. My bet is that your usage of SX_SYSINIT somehow changed the order of the geom stuff and now it's exploding. I think I might have a fix for this, but I need to reproduce on the CI test boxes, my test box doesn't trigger the issue. Roger. From owner-svn-src-head@freebsd.org Thu May 2 15:03:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E9F1598031; Thu, 2 May 2019 15:03: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA1B59262B; Thu, 2 May 2019 15:03:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3384AD93; Thu, 2 May 2019 15:03:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42F3G9c025862; Thu, 2 May 2019 15:03:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42F3GSs025861; Thu, 2 May 2019 15:03:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905021503.x42F3GSs025861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 2 May 2019 15:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347019 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 347019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA1B59262B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 15:03:17 -0000 Author: kib Date: Thu May 2 15:03:16 2019 New Revision: 347019 URL: https://svnweb.freebsd.org/changeset/base/347019 Log: Cleanup for rtld_malloc.c. - Remove dead and most likely rotten MALLOC_DEBUG, MSTAT, and RCHECK options. - Remove unused headers. - Remove one case of undefined behavior where left shift could overflow. It is impossible on practice for rtld and libthr consumer. PR: 237577 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld_malloc.c Modified: head/libexec/rtld-elf/rtld_malloc.c ============================================================================== --- head/libexec/rtld-elf/rtld_malloc.c Thu May 2 14:40:21 2019 (r347018) +++ head/libexec/rtld-elf/rtld_malloc.c Thu May 2 15:03:16 2019 (r347019) @@ -45,17 +45,14 @@ static char *rcsid = "$FreeBSD$"; * This is designed for use in a virtual memory environment. */ -#include +#include #include +#include #include #include #include -#include -#include #include #include -#include -#include #include "rtld.h" #include "rtld_printf.h" #include "paths.h" @@ -81,10 +78,6 @@ union overhead { struct { u_char ovu_magic; /* magic number */ u_char ovu_index; /* bucket # */ -#ifdef RCHECK - u_short ovu_rmagic; /* range magic number */ - u_int ovu_size; /* actual block size */ -#endif } ovu; #define ov_magic ovu.ovu_magic #define ov_index ovu.ovu_index @@ -100,12 +93,6 @@ static int findbucket(union overhead *freep, int srchl #define MAGIC 0xef /* magic # on accounting info */ #define RMAGIC 0x5555 /* magic # on range info */ -#ifdef RCHECK -#define RSLOP sizeof (u_short) -#else -#define RSLOP 0 -#endif - /* * nextf[i] is the pointer to the next free block of size 2^(i+3). The * smallest allocatable block is 8 bytes. The overhead information @@ -117,34 +104,7 @@ static union overhead *nextf[NBUCKETS]; static int pagesz; /* page size */ static int pagebucket; /* page size bucket */ -#ifdef MSTATS /* - * nmalloc[i] is the difference between the number of mallocs and frees - * for a given block size. - */ -static u_int nmalloc[NBUCKETS]; -#include -#endif - -#if defined(MALLOC_DEBUG) || defined(RCHECK) -#define ASSERT(p) if (!(p)) botch("p") -#include -static void -botch(s) - char *s; -{ - fprintf(stderr, "\r\nassertion botched: %s\r\n", s); - (void) fflush(stderr); /* just in case user buffered it */ - abort(); -} -#else -#define ASSERT(p) -#endif - -/* Debugging stuff */ -#define TRACE() rtld_printf("TRACE %s:%d\n", __FILE__, __LINE__) - -/* * The array of supported page sizes is provided by the user, i.e., the * program that calls this storage allocator. That program must initialize * the array before making its first call to allocate storage. The array @@ -188,15 +148,10 @@ __crt_malloc(size_t nbytes) * stored in hash buckets which satisfies request. * Account for space used per block for accounting. */ - if (nbytes <= (unsigned long)(n = pagesz - sizeof (*op) - RSLOP)) { -#ifndef RCHECK + if (nbytes <= (unsigned long)(n = pagesz - sizeof(*op))) { amt = 8; /* size of first bucket */ bucket = 0; -#else - amt = 16; /* size of first bucket */ - bucket = 1; -#endif - n = -(sizeof (*op) + RSLOP); + n = -sizeof(*op); } else { amt = pagesz; bucket = pagebucket; @@ -220,18 +175,6 @@ __crt_malloc(size_t nbytes) nextf[bucket] = op->ov_next; op->ov_magic = MAGIC; op->ov_index = bucket; -#ifdef MSTATS - nmalloc[bucket]++; -#endif -#ifdef RCHECK - /* - * Record allocated size of block and - * bound space with magic numbers. - */ - op->ov_size = roundup2(nbytes, RSLOP); - op->ov_rmagic = RMAGIC; - *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif return ((char *)(op + 1)); } @@ -266,13 +209,9 @@ morecore(int bucket) * sbrk_size <= 0 only for big, FLUFFY, requests (about * 2^30 bytes on a VAX, I think) or for a negative arg. */ - sz = 1 << (bucket + 3); -#ifdef MALLOC_DEBUG - ASSERT(sz > 0); -#else - if (sz <= 0) + if ((unsigned)bucket >= NBBY * sizeof(int) - 4) return; -#endif + sz = 1 << (bucket + 3); if (sz < pagesz) { amt = pagesz; nblks = amt / sz; @@ -306,23 +245,11 @@ __crt_free(void *cp) if (cp == NULL) return; op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); -#ifdef MALLOC_DEBUG - ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ -#else if (op->ov_magic != MAGIC) return; /* sanity */ -#endif -#ifdef RCHECK - ASSERT(op->ov_rmagic == RMAGIC); - ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); -#endif size = op->ov_index; - ASSERT(size < NBUCKETS); op->ov_next = nextf[size]; /* also clobbers ov_magic */ nextf[size] = op; -#ifdef MSTATS - nmalloc[size]--; -#endif } /* @@ -374,26 +301,21 @@ __crt_realloc(void *cp, size_t nbytes) } onb = 1 << (i + 3); if (onb < (u_int)pagesz) - onb -= sizeof (*op) + RSLOP; + onb -= sizeof(*op); else - onb += pagesz - sizeof (*op) - RSLOP; + onb += pagesz - sizeof(*op); /* avoid the copy if same size block */ if (was_alloced) { if (i) { i = 1 << (i + 2); if (i < pagesz) - i -= sizeof (*op) + RSLOP; + i -= sizeof(*op); else - i += pagesz - sizeof (*op) - RSLOP; + i += pagesz - sizeof(*op); } - if (nbytes <= onb && nbytes > (size_t)i) { -#ifdef RCHECK - op->ov_size = roundup2(nbytes, RSLOP); - *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; -#endif - return(cp); - } else - __crt_free(cp); + if (nbytes <= onb && nbytes > (size_t)i) + return (cp); + __crt_free(cp); } if ((res = __crt_malloc(nbytes)) == NULL) return (NULL); @@ -423,39 +345,6 @@ findbucket(union overhead *freep, int srchlen) } return (-1); } - -#ifdef MSTATS -/* - * mstats - print out statistics about malloc - * - * Prints two lines of numbers, one showing the length of the free list - * for each size category, the second showing the number of mallocs - - * frees for each size category. - */ -mstats(char * s) -{ - int i, j; - union overhead *p; - int totfree = 0, - totused = 0; - - fprintf(stderr, "Memory allocation statistics %s\nfree:\t", s); - for (i = 0; i < NBUCKETS; i++) { - for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) - ; - fprintf(stderr, " %d", j); - totfree += j * (1 << (i + 3)); - } - fprintf(stderr, "\nused:\t"); - for (i = 0; i < NBUCKETS; i++) { - fprintf(stderr, " %d", nmalloc[i]); - totused += nmalloc[i] * (1 << (i + 3)); - } - fprintf(stderr, "\n\tTotal in use: %d, total free: %d\n", - totused, totfree); -} -#endif - static int morepages(int n) From owner-svn-src-head@freebsd.org Thu May 2 16:28:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86186159A419; Thu, 2 May 2019 16:28:34 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 284A895B93; Thu, 2 May 2019 16:28:34 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18912BD5F; Thu, 2 May 2019 16:28:34 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42GSXUS068742; Thu, 2 May 2019 16:28:33 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42GSXRC068741; Thu, 2 May 2019 16:28:33 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905021628.x42GSXRC068741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Douglas William Moore Date: Thu, 2 May 2019 16:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347020 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 347020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 284A895B93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 16:28:34 -0000 Author: dougm Date: Thu May 2 16:28:33 2019 New Revision: 347020 URL: https://svnweb.freebsd.org/changeset/base/347020 Log: Enroll new committer Doug Moore (dougm@freebsd.org). Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D20136 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu May 2 15:03:16 2019 (r347019) +++ head/share/misc/committers-src.dot Thu May 2 16:28:33 2019 (r347020) @@ -155,6 +155,7 @@ dexuan [label="Dexuan Cui\ndexuan@FreeBSD.org\n2016/10 dfr [label="Doug Rabson\ndfr@FreeBSD.org\n????/??/??"] dg [label="David Greenman\ndg@FreeBSD.org\n1993/06/14"] dim [label="Dimitry Andric\ndim@FreeBSD.org\n2010/08/30"] +dougm [label="Doug Moore\ndougm@FreeBSD.org\n2019/04/30"] dteske [label="Devin Teske\ndteske@FreeBSD.org\n2012/04/10"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2004/11/29"] dwmalone [label="David Malone\ndwmalone@FreeBSD.org\n2000/07/11"] @@ -663,6 +664,7 @@ ken -> will kib -> ae kib -> badger kib -> dchagin +kib -> dougm kib -> gjb kib -> jah kib -> jlh @@ -694,6 +696,7 @@ marcel -> nwhitehorn marcel -> sjg markj -> cem +markj -> dougm markj -> lwhsu markj -> mhorne markj -> rlibby From owner-svn-src-head@freebsd.org Thu May 2 16:56:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D6A1159AFDA; Thu, 2 May 2019 16:56:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E73F096D6B; Thu, 2 May 2019 16:56:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCC55C2F4; Thu, 2 May 2019 16:56:03 +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 x42Gu3w2084046; Thu, 2 May 2019 16:56:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42Gu3hP084045; Thu, 2 May 2019 16:56:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905021656.x42Gu3hP084045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 2 May 2019 16:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347021 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 347021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E73F096D6B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 16:56:04 -0000 Author: kevans Date: Thu May 2 16:56:03 2019 New Revision: 347021 URL: https://svnweb.freebsd.org/changeset/base/347021 Log: fdt: Fix installation of aarch64 dtb r345519 rewrote parts of how we build .dtb, but mistakenly dropped the vendor dir for aarch64. Simply drop the :T for building ${DTB} in the aarch64 case- it'll get applied at install-time as-needed, with :H:T for determining the vendor dir. Reported by: manu Tested by: manu Reviewed by: manu MFC after: 3 days Modified: head/sys/conf/dtb.build.mk Modified: head/sys/conf/dtb.build.mk ============================================================================== --- head/sys/conf/dtb.build.mk Thu May 2 16:28:33 2019 (r347020) +++ head/sys/conf/dtb.build.mk Thu May 2 16:56:03 2019 (r347021) @@ -24,7 +24,16 @@ SYSDIR= ${_dir:tA} .error "can't find kernel source tree" .endif -DTB=${DTS:T:R:S/$/.dtb/} +.for _dts in ${DTS} +# DTB for aarch64 needs to preserve the immediate parent of the .dts, because +# these DTS are vendored and should be installed into their vendored directory. +.if ${MACHINE_ARCH} == "aarch64" +DTB+= ${_dts:R:S/$/.dtb/} +.else +DTB+= ${_dts:T:R:S/$/.dtb/} +.endif +.endfor + DTBO=${DTSO:T:R:S/$/.dtbo/} .SUFFIXES: .dtb .dts .dtbo .dtso From owner-svn-src-head@freebsd.org Thu May 2 17:01:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2979159B2ED; Thu, 2 May 2019 17:01:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5731D97182; Thu, 2 May 2019 17:01:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D36D8C331; Thu, 2 May 2019 17:01:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42H1DIv087802; Thu, 2 May 2019 17:01:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42H1Dg2087801; Thu, 2 May 2019 17:01:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905021701.x42H1Dg2087801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 2 May 2019 17:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347023 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 347023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5731D97182 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:01:14 -0000 Author: kevans Date: Thu May 2 17:01:13 2019 New Revision: 347023 URL: https://svnweb.freebsd.org/changeset/base/347023 Log: stand: correct mis-merge from r346879 Small mis-merge from multiple WIP resulted in block io media handles getting double-initialized. This resulted in some installations oddly landing at the mountroot prompt. Reported by: ler Reviewed by: imp Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu May 2 16:57:39 2019 (r347022) +++ head/stand/efi/loader/main.c Thu May 2 17:01:13 2019 (r347023) @@ -910,20 +910,6 @@ main(int argc, CHAR16 *argv[]) uhowto = parse_uefi_con_out(); /* - * Scan the BLOCK IO MEDIA handles then - * march through the device switch probing for things. - */ - i = efipart_inithandles(); - if (i != 0 && i != ENOENT) { - printf("efipart_inithandles failed with ERRNO %d, expect " - "failures\n", i); - } - - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); - - /* * Read additional environment variables from the boot device's * "LoaderEnv" file. Any boot loader environment variable may be set * there, which are subtly different than loader.conf variables. Only From owner-svn-src-head@freebsd.org Thu May 2 17:04:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DDA159B4E0; Thu, 2 May 2019 17:04: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 656279760E; Thu, 2 May 2019 17:04:02 +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 3EDDFC49D; Thu, 2 May 2019 17:04:02 +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 x42H42K0089417; Thu, 2 May 2019 17:04:02 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42H42jR089416; Thu, 2 May 2019 17:04:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201905021704.x42H42jR089416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 2 May 2019 17:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347024 - head/sys/modules/dtb/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/rockchip X-SVN-Commit-Revision: 347024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 656279760E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:04:03 -0000 Author: manu Date: Thu May 2 17:04:01 2019 New Revision: 347024 URL: https://svnweb.freebsd.org/changeset/base/347024 Log: dtb: Include RK3399 RockPro64 DTS in kernel build The DTS for this board is already present in sys/gnu/dts/arm64/rockchip/ and just needs to be enabled. Submitted by: alex@wied.io Differential Revision: https://reviews.freebsd.org/D19823 Modified: head/sys/modules/dtb/rockchip/Makefile Modified: head/sys/modules/dtb/rockchip/Makefile ============================================================================== --- head/sys/modules/dtb/rockchip/Makefile Thu May 2 17:01:13 2019 (r347023) +++ head/sys/modules/dtb/rockchip/Makefile Thu May 2 17:04:01 2019 (r347024) @@ -1,7 +1,7 @@ # $FreeBSD$ -# For now only for rk3328-rock64 dts file. DTS= \ - rockchip/rk3328-rock64.dts + rockchip/rk3328-rock64.dts \ + rockchip/rk3399-rockpro64.dts .include From owner-svn-src-head@freebsd.org Thu May 2 17:44:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 551D9159CA1D; Thu, 2 May 2019 17:44:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0CFA6A7E6; Thu, 2 May 2019 17:44:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC7CCB8D; Thu, 2 May 2019 17:44:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42HiklJ010557; Thu, 2 May 2019 17:44:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42HikfO010556; Thu, 2 May 2019 17:44:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905021744.x42HikfO010556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 2 May 2019 17:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347027 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 347027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0CFA6A7E6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:44:47 -0000 Author: kevans Date: Thu May 2 17:44:46 2019 New Revision: 347027 URL: https://svnweb.freebsd.org/changeset/base/347027 Log: libbe(3): Properly mount BEs with mountpoint=none Instead of pretending to successfully mount them while not actually mounting anything, we'll now actually mount them *and* claim we mounted them successfully. Reported by: ler MFC after: 3 days Modified: head/lib/libbe/be_access.c Modified: head/lib/libbe/be_access.c ============================================================================== --- head/lib/libbe/be_access.c Thu May 2 17:43:47 2019 (r347026) +++ head/lib/libbe/be_access.c Thu May 2 17:44:46 2019 (r347027) @@ -45,6 +45,7 @@ struct be_mount_info { const char *mountpoint; int mntflags; int deepmount; + int depth; }; static int @@ -79,6 +80,7 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) char *mountpoint; char tmp[BE_MAXPATHLEN], zfs_mnt[BE_MAXPATHLEN]; struct be_mount_info *info; + char opt; info = (struct be_mount_info *)data; @@ -94,37 +96,50 @@ be_mount_iter(zfs_handle_t *zfs_hdl, void *data) NULL, NULL, 0, 1)) return (1); - if (strcmp("none", zfs_mnt) != 0) { - char opt = '\0'; + if (strcmp("none", zfs_mnt) == 0) { + /* + * mountpoint=none; we'll mount it at info->mountpoint assuming + * we're at the root. If we're not at the root... that's less + * than stellar and not entirely sure what to do with that. + * For now, we won't treat it as an error condition -- we just + * won't mount it, and we'll continue on. + */ + if (info->depth > 0) + return (0); + snprintf(tmp, BE_MAXPATHLEN, "%s", info->mountpoint); + } else { mountpoint = be_mountpoint_augmented(info->lbh, zfs_mnt); - snprintf(tmp, BE_MAXPATHLEN, "%s%s", info->mountpoint, mountpoint); + } - if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, - __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { - switch (errno) { - case ENAMETOOLONG: - return (set_error(info->lbh, BE_ERR_PATHLEN)); - case ELOOP: - case ENOENT: - case ENOTDIR: - return (set_error(info->lbh, BE_ERR_BADPATH)); - case EPERM: - return (set_error(info->lbh, BE_ERR_PERMS)); - case EBUSY: - return (set_error(info->lbh, BE_ERR_PATHBUSY)); - default: - return (set_error(info->lbh, BE_ERR_UNKNOWN)); - } + opt = '\0'; + if ((err = zmount(zfs_get_name(zfs_hdl), tmp, info->mntflags, + __DECONST(char *, MNTTYPE_ZFS), NULL, 0, &opt, 1)) != 0) { + switch (errno) { + case ENAMETOOLONG: + return (set_error(info->lbh, BE_ERR_PATHLEN)); + case ELOOP: + case ENOENT: + case ENOTDIR: + return (set_error(info->lbh, BE_ERR_BADPATH)); + case EPERM: + return (set_error(info->lbh, BE_ERR_PERMS)); + case EBUSY: + return (set_error(info->lbh, BE_ERR_PATHBUSY)); + default: + return (set_error(info->lbh, BE_ERR_UNKNOWN)); } } if (!info->deepmount) return (0); - return (zfs_iter_filesystems(zfs_hdl, be_mount_iter, info)); + ++info->depth; + err = zfs_iter_filesystems(zfs_hdl, be_mount_iter, info); + --info->depth; + return (err); } @@ -138,9 +153,11 @@ be_umount_iter(zfs_handle_t *zfs_hdl, void *data) info = (struct be_mount_info *)data; + ++info->depth; if((err = zfs_iter_filesystems(zfs_hdl, be_umount_iter, info)) != 0) { return (err); } + --info->depth; if (!zfs_is_mounted(zfs_hdl, &mountpoint)) { return (0); @@ -248,6 +265,7 @@ be_mount(libbe_handle_t *lbh, char *bootenv, char *mou info.mountpoint = (mountpoint == NULL) ? mnt_temp : mountpoint; info.mntflags = mntflags; info.deepmount = mntdeep; + info.depth = 0; if((err = be_mount_iter(zhdl, &info) != 0)) { zfs_close(zhdl); @@ -283,6 +301,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla info.be = be; info.mountpoint = NULL; info.mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; + info.depth = 0; if ((err = be_umount_iter(root_hdl, &info)) != 0) { zfs_close(root_hdl); From owner-svn-src-head@freebsd.org Thu May 2 17:50:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A04159CCE8; Thu, 2 May 2019 17:50:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2EC6AE17; Thu, 2 May 2019 17:50: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 1760ACBB0; Thu, 2 May 2019 17:50: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 x42HouWA011839; Thu, 2 May 2019 17:50:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42HoutN011838; Thu, 2 May 2019 17:50:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905021750.x42HoutN011838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 2 May 2019 17:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347028 - head/lib/libbe X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libbe X-SVN-Commit-Revision: 347028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D2EC6AE17 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 17:50:57 -0000 Author: kevans Date: Thu May 2 17:50:56 2019 New Revision: 347028 URL: https://svnweb.freebsd.org/changeset/base/347028 Log: libbe: set mountpoint=none in be_import If we're going to set a mountpoint at all, mountpoint=none makes more sense than mountpoint=/. MFC after: 3 days Modified: head/lib/libbe/be.c Modified: head/lib/libbe/be.c ============================================================================== --- head/lib/libbe/be.c Thu May 2 17:44:46 2019 (r347027) +++ head/lib/libbe/be.c Thu May 2 17:50:56 2019 (r347028) @@ -822,7 +822,7 @@ be_import(libbe_handle_t *lbh, const char *bootenv, in nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); - nvlist_add_string(props, "mountpoint", "/"); + nvlist_add_string(props, "mountpoint", "none"); err = zfs_prop_set_list(zfs, props); nvlist_free(props); From owner-svn-src-head@freebsd.org Thu May 2 18:10:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19582159D392; Thu, 2 May 2019 18:10:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B48F36B9AD; Thu, 2 May 2019 18:10:27 +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 8E651CF0B; Thu, 2 May 2019 18:10:27 +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 x42IARGb021789; Thu, 2 May 2019 18:10:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42IAN1J021769; Thu, 2 May 2019 18:10:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905021810.x42IAN1J021769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 2 May 2019 18:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347029 - in head/sys: amd64/conf arm/conf arm64/conf conf i386/conf mips/conf powerpc/conf sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/conf arm/conf arm64/conf conf i386/conf mips/conf powerpc/conf sparc64/conf X-SVN-Commit-Revision: 347029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B48F36B9AD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 18:10:28 -0000 Author: cem Date: Thu May 2 18:10:23 2019 New Revision: 347029 URL: https://svnweb.freebsd.org/changeset/base/347029 Log: Add a COMPAT_FREEBSD12 kernel option. Use it wherever COMPAT_FREEBSD11 is currently specified, like r309749. Reviewed by: imp, jhb, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20120 Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/MINIMAL head/sys/arm/conf/std.arm head/sys/arm/conf/std.armv6 head/sys/arm/conf/std.armv7 head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/i386/conf/MINIMAL head/sys/mips/conf/ERL head/sys/mips/conf/JZ4780 head/sys/mips/conf/X1000 head/sys/mips/conf/std.BERI head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/amd64/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -63,6 +63,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/amd64/conf/MINIMAL ============================================================================== --- head/sys/amd64/conf/MINIMAL Thu May 2 17:50:56 2019 (r347028) +++ head/sys/amd64/conf/MINIMAL Thu May 2 18:10:23 2019 (r347029) @@ -60,6 +60,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/arm/conf/std.arm ============================================================================== --- head/sys/arm/conf/std.arm Thu May 2 17:50:56 2019 (r347028) +++ head/sys/arm/conf/std.arm Thu May 2 18:10:23 2019 (r347029) @@ -4,6 +4,7 @@ options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 # Debugging support. Always need this: makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/arm/conf/std.armv6 Thu May 2 18:10:23 2019 (r347029) @@ -49,6 +49,7 @@ options MAC # Support for Mandatory Access Control options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 # DTrace support options KDTRACE_HOOKS # Kernel DTrace hooks Modified: head/sys/arm/conf/std.armv7 ============================================================================== --- head/sys/arm/conf/std.armv7 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/arm/conf/std.armv7 Thu May 2 18:10:23 2019 (r347029) @@ -49,6 +49,7 @@ options MAC # Support for Mandatory Access Control options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 # DTrace support options KDTRACE_HOOKS # Kernel DTrace hooks Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/arm64/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -54,6 +54,7 @@ options GEOM_RAID # Soft RAID functionality. options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD32 # Compatible with FreeBSD/arm options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu May 2 17:50:56 2019 (r347028) +++ head/sys/conf/NOTES Thu May 2 18:10:23 2019 (r347029) @@ -376,6 +376,9 @@ options COMPAT_FREEBSD10 # Enable FreeBSD11 compatibility syscalls options COMPAT_FREEBSD11 +# Enable FreeBSD12 compatibility syscalls +options COMPAT_FREEBSD12 + # Enable Linux Kernel Programming Interface options COMPAT_LINUXKPI Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu May 2 17:50:56 2019 (r347028) +++ head/sys/conf/options Thu May 2 18:10:23 2019 (r347029) @@ -88,6 +88,7 @@ COMPAT_FREEBSD7 opt_global.h COMPAT_FREEBSD9 opt_global.h COMPAT_FREEBSD10 opt_global.h COMPAT_FREEBSD11 opt_global.h +COMPAT_FREEBSD12 opt_global.h COMPAT_CLOUDABI32 opt_dontuse.h COMPAT_CLOUDABI64 opt_dontuse.h COMPAT_LINUXKPI opt_dontuse.h Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/i386/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -60,6 +60,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/i386/conf/MINIMAL ============================================================================== --- head/sys/i386/conf/MINIMAL Thu May 2 17:50:56 2019 (r347028) +++ head/sys/i386/conf/MINIMAL Thu May 2 18:10:23 2019 (r347029) @@ -60,6 +60,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Thu May 2 17:50:56 2019 (r347028) +++ head/sys/mips/conf/ERL Thu May 2 18:10:23 2019 (r347029) @@ -75,6 +75,7 @@ options GEOM_LABEL # Provides labelization options COMPAT_FREEBSD32 # Compatible with o32 binaries options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/mips/conf/JZ4780 ============================================================================== --- head/sys/mips/conf/JZ4780 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/mips/conf/JZ4780 Thu May 2 18:10:23 2019 (r347029) @@ -31,6 +31,7 @@ options BREAK_TO_DEBUGGER options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking Modified: head/sys/mips/conf/X1000 ============================================================================== --- head/sys/mips/conf/X1000 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/mips/conf/X1000 Thu May 2 18:10:23 2019 (r347029) @@ -29,6 +29,7 @@ options BREAK_TO_DEBUGGER options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options SCHED_4BSD #4BSD scheduler options INET #InterNETworking Modified: head/sys/mips/conf/std.BERI ============================================================================== --- head/sys/mips/conf/std.BERI Thu May 2 17:50:56 2019 (r347028) +++ head/sys/mips/conf/std.BERI Thu May 2 18:10:23 2019 (r347029) @@ -33,6 +33,7 @@ options CAPABILITIES options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options INTRNG options SCHED_ULE Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/powerpc/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -68,6 +68,7 @@ options COMPAT_FREEBSD7 #Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Thu May 2 17:50:56 2019 (r347028) +++ head/sys/powerpc/conf/GENERIC64 Thu May 2 18:10:23 2019 (r347029) @@ -72,6 +72,7 @@ options COMPAT_FREEBSD7 #Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI options KTRACE #ktrace(1) syscall trace support options STACK #stack(9) support Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Thu May 2 17:50:56 2019 (r347028) +++ head/sys/powerpc/conf/MPC85XX Thu May 2 18:10:23 2019 (r347029) @@ -61,6 +61,7 @@ options WITNESS options WITNESS_SKIPSPIN options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options HWPMC_HOOKS options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Thu May 2 17:50:56 2019 (r347028) +++ head/sys/powerpc/conf/MPC85XXSPE Thu May 2 18:10:23 2019 (r347029) @@ -62,6 +62,7 @@ options WITNESS options WITNESS_SKIPSPIN options COMPAT_FREEBSD10 options COMPAT_FREEBSD11 +options COMPAT_FREEBSD12 options HWPMC_HOOKS options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # Kernel ELF linker loads CTF data Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Thu May 2 17:50:56 2019 (r347028) +++ head/sys/sparc64/conf/GENERIC Thu May 2 18:10:23 2019 (r347029) @@ -58,6 +58,7 @@ options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options COMPAT_FREEBSD9 # Compatible with FreeBSD9 options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options COMPAT_FREEBSD11 # Compatible with FreeBSD11 +options COMPAT_FREEBSD12 # Compatible with FreeBSD12 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support From owner-svn-src-head@freebsd.org Thu May 2 19:02:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19363159EC7F; Thu, 2 May 2019 19:02:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0F026E289; Thu, 2 May 2019 19:02:16 +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 879E3D929; Thu, 2 May 2019 19:02:16 +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 x42J2GNw052950; Thu, 2 May 2019 19:02:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42J2GVA052949; Thu, 2 May 2019 19:02:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905021902.x42J2GVA052949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 2 May 2019 19:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347030 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 347030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0F026E289 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 19:02:17 -0000 Author: trasz Date: Thu May 2 19:02:16 2019 New Revision: 347030 URL: https://svnweb.freebsd.org/changeset/base/347030 Log: Fix flags in cpuinfo. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20139 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Thu May 2 18:10:23 2019 (r347029) +++ head/sys/compat/linprocfs/linprocfs.c Thu May 2 19:02:16 2019 (r347030) @@ -215,11 +215,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) static char *flags[] = { "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", "cx8", "apic", - "sep", "sep", "mtrr", "pge", "mca", - "cmov", "pat", "pse36", "pn", "b19", - "b20", "b21", "mmxext", "mmx", "fxsr", - "xmm", "sse2", "b27", "b28", "b29", - "3dnowext", "3dnow" + "", "sep", "mtrr", "pge", "mca", + "cmov", "pat", "pse36", "pn", "clflush", + "", "dts", "acpi", "mmx", "fxsr", + "sse", "sse2", "ss", "ht", "tm", + "ia64", "pbe" }; static char *power_flags[] = { @@ -287,7 +287,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) CPUID_TO_FAMILY(cpu_id), "yes"); sbuf_cat(sb, "flags\t\t:"); for (j = 0; j < nitems(flags); j++) - if (cpu_feature & (1 << j)) + if (cpu_feature & (1 << j) && flags[j][0] != '\0') sbuf_printf(sb, " %s", flags[j]); sbuf_cat(sb, "\n"); sbuf_printf(sb, From owner-svn-src-head@freebsd.org Thu May 2 19:13:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1DB0159EF9A; Thu, 2 May 2019 19:13:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6389D6E8AE; Thu, 2 May 2019 19:13:32 +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 35630DAF0; Thu, 2 May 2019 19:13:32 +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 x42JDVJ0058681; Thu, 2 May 2019 19:13:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42JDVIK058680; Thu, 2 May 2019 19:13:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905021913.x42JDVIK058680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 2 May 2019 19:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347031 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6389D6E8AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 19:13:32 -0000 Author: emaste Date: Thu May 2 19:13:31 2019 New Revision: 347031 URL: https://svnweb.freebsd.org/changeset/base/347031 Log: iflib: remove assertion that isc_capabilities is nonzero It's atypical, but not invalid, for a driver to pass no capabilities. Submitted by: Gerald Aryeetey Reviewed by: shurd MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20142 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu May 2 19:02:16 2019 (r347030) +++ head/sys/net/iflib.c Thu May 2 19:13:31 2019 (r347031) @@ -4584,7 +4584,6 @@ iflib_device_register(device_t dev, void *sc, if_share ctx->ifc_txrx = *scctx->isc_txrx; #ifdef INVARIANTS - MPASS(scctx->isc_capabilities); if (scctx->isc_capabilities & IFCAP_TXCSUM) MPASS(scctx->isc_tx_csum_flags); #endif @@ -4825,7 +4824,6 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc ifmedia_set(&ctx->ifc_media, IFM_ETHER | IFM_AUTO); #ifdef INVARIANTS - MPASS(scctx->isc_capabilities); if (scctx->isc_capabilities & IFCAP_TXCSUM) MPASS(scctx->isc_tx_csum_flags); #endif From owner-svn-src-head@freebsd.org Thu May 2 19:59:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF21D15A0000; Thu, 2 May 2019 19:59:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79FBE6FFCC; Thu, 2 May 2019 19:59:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BB90E228; Thu, 2 May 2019 19:59:38 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x42Jxc8H079630; Thu, 2 May 2019 19:59:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42JxcX6079629; Thu, 2 May 2019 19:59:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905021959.x42JxcX6079629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 2 May 2019 19:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347032 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 347032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 79FBE6FFCC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 19:59:39 -0000 Author: asomers Date: Thu May 2 19:59:37 2019 New Revision: 347032 URL: https://svnweb.freebsd.org/changeset/base/347032 Log: directory.3: add a STANDARDS section Reviewed by: jilles, ngie MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20111 Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Thu May 2 19:13:31 2019 (r347031) +++ head/lib/libc/gen/directory.3 Thu May 2 19:59:37 2019 (r347032) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 22, 2017 +.Dd April 30, 2019 .Dt DIRECTORY 3 .Os .Sh NAME @@ -264,6 +264,30 @@ return (NOT_FOUND); .Xr open 2 , .Xr read 2 , .Xr dir 5 +.Sh STANDARDS +The +.Fn closedir , +.Fn dirfd , +.Fn fdopendir , +.Fn opendir , +.Fn readdir , +.Fn readdir_r , +.Fn rewinddir , +.Fn seekdir +and +.Fn telldir +functions are expected to conform to +.St -p1003.1-2008 . +The +.Fn fdclosedir +function and the +.Fa d_off , +.Fa d_reclen +and +.Fa d_type +fields of +.Vt struct dirent +are non-standard, and should not be used in portable programs. .Sh HISTORY The .Fn opendir , From owner-svn-src-head@freebsd.org Thu May 2 22:46:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A302715A31E0; Thu, 2 May 2019 22:46:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4844774C1D; Thu, 2 May 2019 22:46: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 20E5BFF71; Thu, 2 May 2019 22:46: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 x42MkcTw068258; Thu, 2 May 2019 22:46:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x42MkbFr068255; Thu, 2 May 2019 22:46:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905022246.x42MkbFr068255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 2 May 2019 22:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347033 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 347033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4844774C1D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 22:46:38 -0000 Author: jhb Date: Thu May 2 22:46:37 2019 New Revision: 347033 URL: https://svnweb.freebsd.org/changeset/base/347033 Log: Increase the VirtIO segment count to support modern Windows guests. The Windows virtio driver ignores the advertized seg_max field and assumes the host can accept up to 67 segments in indirect descriptors, triggering an assert in the bhyve process. This brings back r282922 but with a couple of changes: - It raises the block interface segment limit to 128 instead of 67. - Linux's virtio driver assumes that the segment limit is no larger than the ring size. To avoid breaking Linux guests, raise the VirtIO ring size to 128, and cap the VirtIO segment limit at ring size - 2 (effectively 126). Reviewed by: rgrimes, Patrick Mooney Obtained from: Joyent (Linux workaround) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18831 Modified: head/usr.sbin/bhyve/block_if.c head/usr.sbin/bhyve/block_if.h head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/block_if.c ============================================================================== --- head/usr.sbin/bhyve/block_if.c Thu May 2 19:59:37 2019 (r347032) +++ head/usr.sbin/bhyve/block_if.c Thu May 2 22:46:37 2019 (r347033) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #define BLOCKIF_SIG 0xb109b109 #define BLOCKIF_NUMTHR 8 -#define BLOCKIF_MAXREQ (64 + BLOCKIF_NUMTHR) +#define BLOCKIF_MAXREQ (BLOCKIF_RING_MAX + BLOCKIF_NUMTHR) enum blockop { BOP_READ, Modified: head/usr.sbin/bhyve/block_if.h ============================================================================== --- head/usr.sbin/bhyve/block_if.h Thu May 2 19:59:37 2019 (r347032) +++ head/usr.sbin/bhyve/block_if.h Thu May 2 22:46:37 2019 (r347033) @@ -41,7 +41,13 @@ #include #include -#define BLOCKIF_IOV_MAX 33 /* not practical to be IOV_MAX */ +/* + * BLOCKIF_IOV_MAX is the maximum number of scatter/gather entries in + * a single request. BLOCKIF_RING_MAX is the maxmimum number of + * pending requests that can be queued. + */ +#define BLOCKIF_IOV_MAX 128 /* not practical to be IOV_MAX */ +#define BLOCKIF_RING_MAX 128 struct blockif_req { int br_iovcnt; Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Thu May 2 19:59:37 2019 (r347032) +++ head/usr.sbin/bhyve/pci_virtio_block.c Thu May 2 22:46:37 2019 (r347033) @@ -3,6 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. + * Copyright (c) 2019 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,8 +56,10 @@ __FBSDID("$FreeBSD$"); #include "virtio.h" #include "block_if.h" -#define VTBLK_RINGSZ 64 +#define VTBLK_RINGSZ 128 +_Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each ring entry must be able to queue a request"); + #define VTBLK_S_OK 0 #define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 @@ -351,7 +354,15 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ - sc->vbsc_cfg.vbc_seg_max = BLOCKIF_IOV_MAX; + + /* + * If Linux is presented with a seg_max greater than the virtio queue + * size, it can stumble into situations where it violates its own + * invariants and panics. For safety, we keep seg_max clamped, paying + * heed to the two extra descriptors needed for the header and status + * of a request. + */ + sc->vbsc_cfg.vbc_seg_max = MIN(VTBLK_RINGSZ - 2, BLOCKIF_IOV_MAX); sc->vbsc_cfg.vbc_geometry.cylinders = 0; /* no geometry */ sc->vbsc_cfg.vbc_geometry.heads = 0; sc->vbsc_cfg.vbc_geometry.sectors = 0; From owner-svn-src-head@freebsd.org Fri May 3 02:55:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AEB71581F22; Fri, 3 May 2019 02:55:55 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C53E183D98; Fri, 3 May 2019 02:55:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E0711A9AB; Fri, 3 May 2019 02:55:54 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x432tsNL001163; Fri, 3 May 2019 02:55:54 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x432tsKK001162; Fri, 3 May 2019 02:55:54 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905030255.x432tsKK001162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Douglas William Moore Date: Fri, 3 May 2019 02:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347043 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 347043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C53E183D98 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 02:55:55 -0000 Author: dougm Date: Fri May 3 02:55:54 2019 New Revision: 347043 URL: https://svnweb.freebsd.org/changeset/base/347043 Log: fls() should find the most significant bit of an int faster than a linear search can, so use it to avoid a linear search in isqrt. Approved by: kib (mentor), markj (mentor) Differential Revision: https://reviews.freebsd.org/D20102 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri May 3 02:51:33 2019 (r347042) +++ head/sys/vm/vm_pageout.c Fri May 3 02:55:54 2019 (r347043) @@ -928,9 +928,7 @@ isqrt(u_int num) { u_int bit, root, tmp; - bit = 1u << ((NBBY * sizeof(u_int)) - 2); - while (bit > num) - bit >>= 2; + bit = num != 0 ? (1u << ((fls(num) - 1) & ~1)) : 0; root = 0; while (bit != 0) { tmp = root + bit; From owner-svn-src-head@freebsd.org Fri May 3 06:06:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A11D1585B23; Fri, 3 May 2019 06:06:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E38C08959D; Fri, 3 May 2019 06:06:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC4161CA07; Fri, 3 May 2019 06:06:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4366ddI002836; Fri, 3 May 2019 06:06:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4366d9r002835; Fri, 3 May 2019 06:06:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201905030606.x4366d9r002835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 3 May 2019 06:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347050 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 347050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E38C08959D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 06:06:40 -0000 Author: adrian Date: Fri May 3 06:06:39 2019 New Revision: 347050 URL: https://svnweb.freebsd.org/changeset/base/347050 Log: [libfetch] Fix compilation with WITHOUT_CRYPT. Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Fri May 3 03:36:00 2019 (r347049) +++ head/lib/libfetch/common.c Fri May 3 06:06:39 2019 (r347050) @@ -994,6 +994,7 @@ fetch_ssl(conn_t *conn, const struct url *URL, int ver #else (void)conn; (void)verbose; + (void)URL; fprintf(stderr, "SSL support disabled\n"); return (-1); #endif From owner-svn-src-head@freebsd.org Fri May 3 08:27:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82B791588E9C; Fri, 3 May 2019 08:27:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 281A98D70B; Fri, 3 May 2019 08:27:04 +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 F41511E1C0; Fri, 3 May 2019 08:27:03 +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 x438R39o076384; Fri, 3 May 2019 08:27:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x438R3ro076383; Fri, 3 May 2019 08:27:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201905030827.x438R3ro076383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 3 May 2019 08:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347051 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 347051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 281A98D70B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 08:27:04 -0000 Author: trasz Date: Fri May 3 08:27:03 2019 New Revision: 347051 URL: https://svnweb.freebsd.org/changeset/base/347051 Log: Decode more CPU flags in cpuinfo. Reviewed by: dchagin MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20145 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri May 3 06:06:39 2019 (r347050) +++ head/sys/compat/linprocfs/linprocfs.c Fri May 3 08:27:03 2019 (r347051) @@ -212,16 +212,61 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) * We default the flags to include all non-conflicting flags, * and the Intel versions of conflicting flags. */ - static char *flags[] = { - "fpu", "vme", "de", "pse", "tsc", - "msr", "pae", "mce", "cx8", "apic", - "", "sep", "mtrr", "pge", "mca", - "cmov", "pat", "pse36", "pn", "clflush", - "", "dts", "acpi", "mmx", "fxsr", - "sse", "sse2", "ss", "ht", "tm", - "ia64", "pbe" + static char *cpu_feature_names[] = { + /* 0 */ "fpu", "vme", "de", "pse", + /* 4 */ "tsc", "msr", "pae", "mce", + /* 8 */ "cx8", "apic", "", "sep", + /* 12 */ "mtrr", "pge", "mca", "cmov", + /* 16 */ "pat", "pse36", "pn", "clflush", + /* 20 */ "", "dts", "acpi", "mmx", + /* 24 */ "fxsr", "sse", "sse2", "ss", + /* 28 */ "ht", "tm", "ia64", "pbe" }; + static char *amd_feature_names[] = { + /* 0 */ "", "", "", "", + /* 4 */ "", "", "", "", + /* 8 */ "", "", "", "syscall", + /* 12 */ "", "", "", "", + /* 16 */ "", "", "", "mp", + /* 20 */ "nx", "", "mmxext", "", + /* 24 */ "", "fxsr_opt", "pdpe1gb", "rdtscp", + /* 28 */ "", "lm", "3dnowext", "3dnow" + }; + + static char *cpu_feature2_names[] = { + /* 0 */ "pni", "pclmulqdq", "dtes3", "monitor", + /* 4 */ "ds_cpl", "vmx", "smx", "est", + /* 8 */ "tm2", "ssse3", "cid", "sdbg", + /* 12 */ "fma", "cx16", "xptr", "pdcm", + /* 16 */ "", "pcid", "dca", "sse4_1", + /* 20 */ "sse4_2", "x2apic", "movbe", "popcnt", + /* 24 */ "tsc_deadline_timer", "aes", "xsave", "", + /* 28 */ "avx", "f16c", "rdrand", "hypervisor" + }; + + static char *amd_feature2_names[] = { + /* 0 */ "lahf_lm", "cmp_legacy", "svm", "extapic", + /* 4 */ "cr8_legacy", "abm", "sse4a", "misalignsse", + /* 8 */ "3dnowprefetch", "osvw", "ibs", "xop", + /* 12 */ "skinit", "wdt", "", "lwp", + /* 16 */ "fma4", "tce", "", "nodeid_msr", + /* 20 */ "", "tbm", "topoext", "perfctr_core", + /* 24 */ "perfctr_nb", "", "bpext", "ptsc", + /* 28 */ "perfctr_llc", "mwaitx", "", "" + }; + + static char *cpu_stdext_feature_names[] = { + /* 0 */ "fsgsbase", "tsc_adjust", "", "bmi1", + /* 4 */ "hle", "avx2", "", "smep", + /* 8 */ "bmi2", "erms", "invpcid", "rtm", + /* 12 */ "cqm", "", "mpx", "rdt_a", + /* 16 */ "avx512f", "avx512dq", "rdseed", "adx", + /* 20 */ "smap", "avx512ifma", "", "clflushopt", + /* 24 */ "clwb", "intel_pt", "avx512pf", "avx512er", + /* 28 */ "avx512cd", "sha_ni", "avx512bw", "avx512vl" + }; + static char *power_flags[] = { "ts", "fid", "vid", "ttp", "tm", "stc", @@ -240,10 +285,10 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) switch (cpu_vendor_id) { case CPU_VENDOR_AMD: if (cpu_class < CPUCLASS_686) - flags[16] = "fcmov"; + cpu_feature_names[16] = "fcmov"; break; case CPU_VENDOR_CYRIX: - flags[24] = "cxmmx"; + cpu_feature_names[24] = "cxmmx"; break; } #endif @@ -286,9 +331,27 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) (cpu_feature & CPUID_FPU) ? "yes" : "no", "yes", CPUID_TO_FAMILY(cpu_id), "yes"); sbuf_cat(sb, "flags\t\t:"); - for (j = 0; j < nitems(flags); j++) - if (cpu_feature & (1 << j) && flags[j][0] != '\0') - sbuf_printf(sb, " %s", flags[j]); + for (j = 0; j < nitems(cpu_feature_names); j++) + if (cpu_feature & (1 << j) && + cpu_feature_names[j][0] != '\0') + sbuf_printf(sb, " %s", cpu_feature_names[j]); + for (j = 0; j < nitems(amd_feature_names); j++) + if (amd_feature & (1 << j) && + amd_feature_names[j][0] != '\0') + sbuf_printf(sb, " %s", amd_feature_names[j]); + for (j = 0; j < nitems(cpu_feature2_names); j++) + if (cpu_feature2 & (1 << j) && + cpu_feature2_names[j][0] != '\0') + sbuf_printf(sb, " %s", cpu_feature2_names[j]); + for (j = 0; j < nitems(amd_feature2_names); j++) + if (amd_feature2 & (1 << j) && + amd_feature2_names[j][0] != '\0') + sbuf_printf(sb, " %s", amd_feature2_names[j]); + for (j = 0; j < nitems(cpu_stdext_feature_names); j++) + if (cpu_stdext_feature & (1 << j) && + cpu_stdext_feature_names[j][0] != '\0') + sbuf_printf(sb, " %s", + cpu_stdext_feature_names[j]); sbuf_cat(sb, "\n"); sbuf_printf(sb, "bugs\t\t: %s\n" From owner-svn-src-head@freebsd.org Fri May 3 08:42:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D913D158961B; Fri, 3 May 2019 08:42:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AA018E337; Fri, 3 May 2019 08:42:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 256B71E520; Fri, 3 May 2019 08:42:51 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x438gpcW087271; Fri, 3 May 2019 08:42:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x438gnmw087262; Fri, 3 May 2019 08:42:49 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905030842.x438gnmw087262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 3 May 2019 08:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347052 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/linux i386/linux X-SVN-Commit-Revision: 347052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7AA018E337 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 08:42:52 -0000 Author: dchagin Date: Fri May 3 08:42:49 2019 New Revision: 347052 URL: https://svnweb.freebsd.org/changeset/base/347052 Log: In order to reduce duplication between MD parts of the Linuxulator move bits that are MI out into the headers in compat/linux. For that remove bogus _packed attribute from struct l_sockaddr and use MI types for struct members. And continue to move into the linux_common module a code that is intended for both Linuxulator modules (both instruction set - 32 & 64 bit) or for external modules like linsysfs or linprocfs. To avoid header pollution introduce new sys/compat/linux_common.h header. Reviewed by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20137 Added: head/sys/compat/linux/linux_common.h (contents, props changed) Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux32/linux.h head/sys/arm64/linux/linux.h head/sys/compat/linux/linux.c head/sys/compat/linux/linux.h head/sys/compat/linux/linux_ioctl.c head/sys/i386/linux/linux.h Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/amd64/linux/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -377,11 +377,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -390,9 +385,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/amd64/linux32/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -478,11 +478,6 @@ union l_semun { l_uintptr_t __pad; } __packed; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -} __packed; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -491,9 +486,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: head/sys/arm64/linux/linux.h ============================================================================== --- head/sys/arm64/linux/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/arm64/linux/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -264,11 +264,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -277,9 +272,6 @@ struct l_ifmap { u_char dma; u_char port; } __packed; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { Modified: head/sys/compat/linux/linux.c ============================================================================== --- head/sys/compat/linux/linux.c Fri May 3 08:27:03 2019 (r347051) +++ head/sys/compat/linux/linux.c Fri May 3 08:42:49 2019 (r347052) @@ -29,10 +29,21 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include +#include +#include +#include +#include +#include + #include +#include +CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); static int bsd_to_linux_sigtbl[LINUX_SIGTBLSZ] = { LINUX_SIGHUP, /* SIGHUP */ @@ -202,4 +213,98 @@ bsd_to_linux_sigset(sigset_t *bss, l_sigset_t *lss) LINUX_SIGADDSET(*lss, l); } } +} + +/* + * Translate a Linux interface name to a FreeBSD interface name, + * and return the associated ifnet structure + * bsdname and lxname need to be least IFNAMSIZ bytes long, but + * can point to the same buffer. + */ +struct ifnet * +ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) +{ + struct ifnet *ifp; + int len, unit; + char *ep; + int is_eth, is_lo, index; + + for (len = 0; len < LINUX_IFNAMSIZ; ++len) + if (!isalpha(lxname[len]) || lxname[len] == 0) + break; + if (len == 0 || len == LINUX_IFNAMSIZ) + return (NULL); + /* Linux loopback interface name is lo (not lo0) */ + is_lo = (len == 2 && !strncmp(lxname, "lo", len)) ? 1 : 0; + unit = (int)strtoul(lxname + len, &ep, 10); + if ((ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) && + is_lo == 0) + return (NULL); + index = 0; + is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; + + CURVNET_SET(TD_TO_VNET(td)); + IFNET_RLOCK(); + CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { + /* + * Allow Linux programs to use FreeBSD names. Don't presume + * we never have an interface named "eth", so don't make + * the test optional based on is_eth. + */ + if (strncmp(ifp->if_xname, lxname, LINUX_IFNAMSIZ) == 0) + break; + if (is_eth && IFP_IS_ETH(ifp) && unit == index++) + break; + if (is_lo && IFP_IS_LOOP(ifp)) + break; + } + IFNET_RUNLOCK(); + CURVNET_RESTORE(); + if (ifp != NULL && bsdname != NULL) + strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); + return (ifp); +} + +void +linux_ifflags(struct ifnet *ifp, short *flags) +{ + + *flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; + /* these flags have no Linux equivalent */ + *flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| + IFF_LINK0|IFF_LINK1|IFF_LINK2); + /* Linux' multicast flag is in a different bit */ + if (*flags & IFF_MULTICAST) { + *flags &= ~IFF_MULTICAST; + *flags |= 0x1000; + } +} + +int +linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa) +{ + struct ifaddr *ifa; + struct sockaddr_dl *sdl; + + if (IFP_IS_LOOP(ifp)) { + bzero(lsa, sizeof(*lsa)); + lsa->sa_family = LINUX_ARPHRD_LOOPBACK; + return (0); + } + + if (!IFP_IS_ETH(ifp)) + return (ENOENT); + + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + sdl = (struct sockaddr_dl*)ifa->ifa_addr; + if (sdl != NULL && (sdl->sdl_family == AF_LINK) && + (sdl->sdl_type == IFT_ETHER)) { + bzero(lsa, sizeof(*lsa)); + lsa->sa_family = LINUX_ARPHRD_ETHER; + bcopy(LLADDR(sdl), lsa->sa_data, LINUX_IFHWADDRLEN); + return (0); + } + } + + return (ENOENT); } Modified: head/sys/compat/linux/linux.h ============================================================================== --- head/sys/compat/linux/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/compat/linux/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -29,6 +29,23 @@ #ifndef _LINUX_MI_H_ #define _LINUX_MI_H_ +#define LINUX_IFHWADDRLEN 6 +#define LINUX_IFNAMSIZ 16 + +/* + * Criteria for interface name translation + */ +#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) +#define IFP_IS_LOOP(ifp) (ifp->if_type == IFT_LOOP) + +struct l_sockaddr { + unsigned short sa_family; + char sa_data[14]; +}; + +#define LINUX_ARPHRD_ETHER 1 +#define LINUX_ARPHRD_LOOPBACK 772 + /* sigaltstack */ #define LINUX_SS_ONSTACK 1 #define LINUX_SS_DISABLE 2 Added: head/sys/compat/linux/linux_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linux/linux_common.h Fri May 3 08:42:49 2019 (r347052) @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2019 Dmitry Chagin + * + * 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 _LINUX_COMMON_H_ +#define _LINUX_COMMON_H_ + +struct ifnet *ifname_linux_to_bsd(struct thread *td, + const char *lxname, char *bsdname); +void linux_ifflags(struct ifnet *ifp, short *flags); +int linux_ifhwaddr(struct ifnet *ifp, struct l_sockaddr *lsa); + +#endif /* _LINUX_COMMON_H_ */ Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Fri May 3 08:27:03 2019 (r347051) +++ head/sys/compat/linux/linux_ioctl.c Fri May 3 08:42:49 2019 (r347052) @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include #include @@ -2122,56 +2123,6 @@ linux_ioctl_console(struct thread *td, struct linux_io } /* - * Criteria for interface name translation - */ -#define IFP_IS_ETH(ifp) (ifp->if_type == IFT_ETHER) - -/* - * Translate a Linux interface name to a FreeBSD interface name, - * and return the associated ifnet structure - * bsdname and lxname need to be least IFNAMSIZ bytes long, but - * can point to the same buffer. - */ - -static struct ifnet * -ifname_linux_to_bsd(struct thread *td, const char *lxname, char *bsdname) -{ - struct ifnet *ifp; - int len, unit; - char *ep; - int is_eth, index; - - for (len = 0; len < LINUX_IFNAMSIZ; ++len) - if (!isalpha(lxname[len])) - break; - if (len == 0 || len == LINUX_IFNAMSIZ) - return (NULL); - unit = (int)strtoul(lxname + len, &ep, 10); - if (ep == NULL || ep == lxname + len || ep >= lxname + LINUX_IFNAMSIZ) - return (NULL); - index = 0; - is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0; - CURVNET_SET(TD_TO_VNET(td)); - IFNET_RLOCK(); - CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { - /* - * Allow Linux programs to use FreeBSD names. Don't presume - * we never have an interface named "eth", so don't make - * the test optional based on is_eth. - */ - if (strncmp(ifp->if_xname, lxname, LINUX_IFNAMSIZ) == 0) - break; - if (is_eth && IFP_IS_ETH(ifp) && unit == index++) - break; - } - IFNET_RUNLOCK(); - CURVNET_RESTORE(); - if (ifp != NULL) - strlcpy(bsdname, ifp->if_xname, IFNAMSIZ); - return (ifp); -} - -/* * Implement the SIOCGIFNAME ioctl */ @@ -2332,50 +2283,20 @@ linux_gifflags(struct thread *td, struct ifnet *ifp, s { l_short flags; - flags = (ifp->if_flags | ifp->if_drv_flags) & 0xffff; - /* these flags have no Linux equivalent */ - flags &= ~(IFF_DRV_OACTIVE|IFF_SIMPLEX| - IFF_LINK0|IFF_LINK1|IFF_LINK2); - /* Linux' multicast flag is in a different bit */ - if (flags & IFF_MULTICAST) { - flags &= ~IFF_MULTICAST; - flags |= 0x1000; - } + linux_ifflags(ifp, &flags); return (copyout(&flags, &ifr->ifr_flags, sizeof(flags))); } -#define ARPHRD_ETHER 1 -#define ARPHRD_LOOPBACK 772 - static int linux_gifhwaddr(struct ifnet *ifp, struct l_ifreq *ifr) { - struct ifaddr *ifa; - struct sockaddr_dl *sdl; struct l_sockaddr lsa; - if (ifp->if_type == IFT_LOOP) { - bzero(&lsa, sizeof(lsa)); - lsa.sa_family = ARPHRD_LOOPBACK; - return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); - } - - if (ifp->if_type != IFT_ETHER) + if (linux_ifhwaddr(ifp, &lsa) != 0) return (ENOENT); - CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - sdl = (struct sockaddr_dl*)ifa->ifa_addr; - if (sdl != NULL && (sdl->sdl_family == AF_LINK) && - (sdl->sdl_type == IFT_ETHER)) { - bzero(&lsa, sizeof(lsa)); - lsa.sa_family = ARPHRD_ETHER; - bcopy(LLADDR(sdl), lsa.sa_data, LINUX_IFHWADDRLEN); - return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); - } - } - - return (ENOENT); + return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); } Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Fri May 3 08:27:03 2019 (r347051) +++ head/sys/i386/linux/linux.h Fri May 3 08:42:49 2019 (r347052) @@ -454,11 +454,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_sockaddr { - l_ushort sa_family; - char sa_data[14]; -}; - struct l_ifmap { l_ulong mem_start; l_ulong mem_end; @@ -467,9 +462,6 @@ struct l_ifmap { u_char dma; u_char port; }; - -#define LINUX_IFHWADDRLEN 6 -#define LINUX_IFNAMSIZ 16 struct l_ifreq { union { From owner-svn-src-head@freebsd.org Fri May 3 08:57:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0789615898E2; Fri, 3 May 2019 08:57:23 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (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 C37818E9F6; Fri, 3 May 2019 08:57:16 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id x438vDXt078377; Fri, 3 May 2019 10:57:13 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 450F23F6; Fri, 3 May 2019 10:57:13 +0200 (CEST) Subject: Re: svn commit: r346217 - in head/sys: fs/nfs fs/nfsclient kern sys To: Rick Macklem , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201904150127.x3F1RG7X062973@repo.freebsd.org> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: <8a6cb225-8644-9949-09ab-7e1525e24034@omnilan.de> Date: Fri, 3 May 2019 10:57:12 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201904150127.x3F1RG7X062973@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [78.138.80.130]); Fri, 03 May 2019 10:57:13 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: C37818E9F6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of freebsd@omnilan.de designates 2a00:e10:2800::a130 as permitted sender) smtp.mailfrom=freebsd@omnilan.de X-Spamd-Result: default: False [-6.74 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[omnilan.de]; TO_DN_SOME(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-3.51)[ip: (-9.19), ipnet: 2a00:e10:2800::/64(-4.67), asn: 25074(-3.68), country: DE(-0.01)]; MX_GOOD(-0.01)[mx0.gentlemail.de]; NEURAL_HAM_SHORT(-0.92)[-0.923,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:25074, ipnet:2a00:e10:2800::/64, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 08:57:23 -0000 Am 15.04.2019 um 03:27 schrieb Rick Macklem: > Author: rmacklem > Date: Mon Apr 15 01:27:15 2019 > New Revision: 346217 > URL: https://svnweb.freebsd.org/changeset/base/346217 > > Log: > Fix the NFSv4 client to safely find processes. > > r340744 broke the NFSv4 client, because it replaced pfind_locked() with a > call to pfind(), since pfind() acquires the sx lock for the pid hash and > the NFSv4 already holds a mutex when it does the call. > The patch fixes the problem by recreating a pfind_any_locked() and adding the > functions pidhash_slockall() and pidhash_sunlockall to acquire/release > all of the pid hash locks. > These functions are then used by the NFSv4 client instead of acquiring > the allproc_lock and calling pfind(). > > Reviewed by: kib, mjg > MFC after: 2 weeks Hello, I guess as long as r340744 isn't MFCd, this commit isn't needed in /stable/, is it? Any plans to MFC https://svnweb.freebsd.org/base?view=revision&revision=340744 (proc: convert pfind & friends to use pidhash locks and other cleanup) Thanks, -Harry From owner-svn-src-head@freebsd.org Fri May 3 13:06:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0068F1590072; Fri, 3 May 2019 13:06:47 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 986FE70ABE; Fri, 3 May 2019 13:06:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7130D21187; Fri, 3 May 2019 13:06:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43D6kkG026701; Fri, 3 May 2019 13:06:46 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43D6kOp026700; Fri, 3 May 2019 13:06:46 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201905031306.x43D6kOp026700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 3 May 2019 13:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347054 - head/lib/libvgl X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/libvgl X-SVN-Commit-Revision: 347054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 986FE70ABE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 13:06:47 -0000 Author: bde Date: Fri May 3 13:06:46 2019 New Revision: 347054 URL: https://svnweb.freebsd.org/changeset/base/347054 Log: Fix copying planar bitmaps when the horizontal start and end are both not multiples of 8. Then the misaligned pixels at the end were not copied. Clean up variable misuse related to this bug. The width in bytes was first calculated correctly and used to do complicated reblocking correctly, but it was stored in an unrelated scratch variable and later recalculated with an off-by-1-error, so the last byte (times 4 planes) in the intermediate copy was not copied. This doubly-misaligned case is especially slow. Misalignment complicates the reblocking, and each misaligment requires a read before write, and this read is still not done from the shadow buffer. Modified: head/lib/libvgl/bitmap.c Modified: head/lib/libvgl/bitmap.c ============================================================================== --- head/lib/libvgl/bitmap.c Fri May 3 09:38:23 2019 (r347053) +++ head/lib/libvgl/bitmap.c Fri May 3 13:06:46 2019 (r347054) @@ -47,7 +47,7 @@ static int color2bit[16] = {0x00000000, 0x00000001, 0x static void WriteVerticalLine(VGLBitmap *dst, int x, int y, int width, byte *line) { - int i, pos, last, planepos, start_offset, end_offset, offset; + int bwidth, i, pos, last, planepos, start_offset, end_offset, offset; int len; unsigned int word = 0; byte *address; @@ -58,13 +58,13 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi case VIDBUF4S: start_offset = (x & 0x07); end_offset = (x + width) & 0x07; - i = (width + start_offset) / 8; + bwidth = (width + start_offset) / 8; if (end_offset) - i++; + bwidth++; VGLPlane[0] = VGLBuf; - VGLPlane[1] = VGLPlane[0] + i; - VGLPlane[2] = VGLPlane[1] + i; - VGLPlane[3] = VGLPlane[2] + i; + VGLPlane[1] = VGLPlane[0] + bwidth; + VGLPlane[2] = VGLPlane[1] + bwidth; + VGLPlane[3] = VGLPlane[2] + bwidth; pos = 0; planepos = 0; last = 8 - start_offset; @@ -87,9 +87,6 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi VGLPlane[2][planepos] = word>>16; VGLPlane[3][planepos] = word>>24; } - if (start_offset || end_offset) - width+=8; - width /= 8; outb(0x3ce, 0x01); outb(0x3cf, 0x00); /* set/reset enable */ outb(0x3ce, 0x08); outb(0x3cf, 0xff); /* bit mask */ for (i=0; i<4; i++) { @@ -103,7 +100,7 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi VGLPlane[i][planepos] |= dst->Bitmap[pos+planepos] & mask[end_offset]; if (start_offset) VGLPlane[i][0] |= dst->Bitmap[pos] & ~mask[start_offset]; - bcopy(&VGLPlane[i][0], dst->Bitmap + pos, width); + bcopy(&VGLPlane[i][0], dst->Bitmap + pos, bwidth); } else { /* VIDBUF4S */ if (end_offset) { offset = VGLSetSegment(pos + planepos); @@ -112,9 +109,9 @@ WriteVerticalLine(VGLBitmap *dst, int x, int y, int wi offset = VGLSetSegment(pos); if (start_offset) VGLPlane[i][0] |= dst->Bitmap[offset] & ~mask[start_offset]; - for (last = width; ; ) { + for (last = bwidth; ; ) { len = min(VGLAdpInfo.va_window_size - offset, last); - bcopy(&VGLPlane[i][width - last], dst->Bitmap + offset, len); + bcopy(&VGLPlane[i][bwidth - last], dst->Bitmap + offset, len); pos += len; last -= len; if (last <= 0) From owner-svn-src-head@freebsd.org Fri May 3 14:43:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D37431592457; Fri, 3 May 2019 14:43:23 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76C2574646; Fri, 3 May 2019 14:43:23 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62AE8222D2; Fri, 3 May 2019 14:43:23 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43EhNp8080877; Fri, 3 May 2019 14:43:23 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43EhML2080871; Fri, 3 May 2019 14:43:22 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201905031443.x43EhML2080871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 3 May 2019 14:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347055 - in head: sbin/ifconfig sys/net X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net X-SVN-Commit-Revision: 347055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 76C2574646 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 14:43:24 -0000 Author: gallatin Date: Fri May 3 14:43:21 2019 New Revision: 347055 URL: https://svnweb.freebsd.org/changeset/base/347055 Log: Select lacp egress ports based on NUMA domain This change creates an array of port maps indexed by numa domain for lacp port selection. If we have lacp interfaces in more than one domain, then we select the egress port by indexing into the numa port maps and picking a port on the appropriate numa domain. This is behavior is controlled by the new ifconfig use_numa flag and net.link.lagg.use_numa sysctl/tunable (both modeled after the existing use_flowid), which default to enabled. Reviewed by: bz, hselasky, markj (and scottl, earlier version) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D20060 Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/iflagg.c head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri May 3 13:06:46 2019 (r347054) +++ head/sbin/ifconfig/ifconfig.8 Fri May 3 14:43:21 2019 (r347055) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd June 27, 2018 +.Dd May 3, 2019 .Dt IFCONFIG 8 .Os .Sh NAME @@ -2497,6 +2497,22 @@ Use the RSS hash from the network card if available. Set a shift parameter for RSS local hash computation. Hash is calculated by using flowid bits in a packet header mbuf which are shifted by the number of this parameter. +.It Cm use_numa +Enable selection of egress ports based on the native +.Xr NUMA 4 +domain for the packets being transmitted. +This is currently only implemented for lacp mode. +This works only on +.Xr NUMA 4 +hardware, running a kernel compiled with the +.Xr NUMA 4 +option, and when interfaces from multiple +.Xr NUMA 4 +domains are ports of the aggregation interface. +.It Cm -use_numa +Disable selection of egress ports based on the native +.Xr NUMA 4 +domain for the packets being transmitted. .It Cm lacp_fast_timeout Enable lacp fast-timeout on the interface. .It Cm -lacp_fast_timeout Modified: head/sbin/ifconfig/iflagg.c ============================================================================== --- head/sbin/ifconfig/iflagg.c Fri May 3 13:06:46 2019 (r347054) +++ head/sbin/ifconfig/iflagg.c Fri May 3 14:43:21 2019 (r347055) @@ -130,6 +130,8 @@ setlaggsetopt(const char *val, int d, int s, const str switch (ro.ro_opts) { case LAGG_OPT_USE_FLOWID: case -LAGG_OPT_USE_FLOWID: + case LAGG_OPT_USE_NUMA: + case -LAGG_OPT_USE_NUMA: case LAGG_OPT_LACP_STRICT: case -LAGG_OPT_LACP_STRICT: case LAGG_OPT_LACP_TXTEST: @@ -303,6 +305,8 @@ static struct cmd lagg_cmds[] = { DEF_CMD_ARG("lagghash", setlagghash), DEF_CMD("use_flowid", LAGG_OPT_USE_FLOWID, setlaggsetopt), DEF_CMD("-use_flowid", -LAGG_OPT_USE_FLOWID, setlaggsetopt), + DEF_CMD("use_numa", LAGG_OPT_USE_NUMA, setlaggsetopt), + DEF_CMD("-use_numa", -LAGG_OPT_USE_NUMA, setlaggsetopt), DEF_CMD("lacp_strict", LAGG_OPT_LACP_STRICT, setlaggsetopt), DEF_CMD("-lacp_strict", -LAGG_OPT_LACP_STRICT, setlaggsetopt), DEF_CMD("lacp_txtest", LAGG_OPT_LACP_TXTEST, setlaggsetopt), Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Fri May 3 13:06:46 2019 (r347054) +++ head/sys/net/ieee8023ad_lacp.c Fri May 3 14:43:21 2019 (r347055) @@ -835,7 +835,9 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf struct lacp_softc *lsc = LACP_SOFTC(sc); struct lacp_portmap *pm; struct lacp_port *lp; + struct lacp_port **map; uint32_t hash; + int count; if (__predict_false(lsc->lsc_suppress_distributing)) { LACP_DPRINTF((NULL, "%s: waiting transit\n", __func__)); @@ -848,14 +850,32 @@ lacp_select_tx_port(struct lagg_softc *sc, struct mbuf return (NULL); } +#ifdef NUMA + if ((sc->sc_opts & LAGG_OPT_USE_NUMA) && + pm->pm_num_dom > 1 && m->m_pkthdr.numa_domain < MAXMEMDOM) { + count = pm->pm_numa[m->m_pkthdr.numa_domain].count; + if (count > 0) { + map = pm->pm_numa[m->m_pkthdr.numa_domain].map; + } else { + /* No ports on this domain; use global hash. */ + map = pm->pm_map; + count = pm->pm_count; + } + } else +#endif + { + map = pm->pm_map; + count = pm->pm_count; + } if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) hash = m->m_pkthdr.flowid >> sc->flowid_shift; else hash = m_ether_tcpip_hash(sc->sc_flags, m, lsc->lsc_hashkey); - hash %= pm->pm_count; - lp = pm->pm_map[hash]; + hash %= count; + lp = map[hash]; + KASSERT((lp->lp_state & LACP_STATE_DISTRIBUTING) != 0, ("aggregated port is not distributing")); @@ -1044,6 +1064,10 @@ lacp_update_portmap(struct lacp_softc *lsc) uint64_t speed; u_int newmap; int i; +#ifdef NUMA + int count; + uint8_t domain; +#endif newmap = lsc->lsc_activemap == 0 ? 1 : 0; p = &lsc->lsc_pmap[newmap]; @@ -1054,9 +1078,25 @@ lacp_update_portmap(struct lacp_softc *lsc) if (la != NULL && la->la_nports > 0) { p->pm_count = la->la_nports; i = 0; - TAILQ_FOREACH(lp, &la->la_ports, lp_dist_q) + TAILQ_FOREACH(lp, &la->la_ports, lp_dist_q) { p->pm_map[i++] = lp; +#ifdef NUMA + domain = lp->lp_ifp->if_numa_domain; + if (domain >= MAXMEMDOM) + continue; + count = p->pm_numa[domain].count; + p->pm_numa[domain].map[count] = lp; + p->pm_numa[domain].count++; +#endif + } KASSERT(i == p->pm_count, ("Invalid port count")); + +#ifdef NUMA + for (i = 0; i < MAXMEMDOM; i++) { + if (p->pm_numa[i].count != 0) + p->pm_num_dom++; + } +#endif speed = lacp_aggregator_bandwidth(la); } sc->sc_ifp->if_baudrate = speed; Modified: head/sys/net/ieee8023ad_lacp.h ============================================================================== --- head/sys/net/ieee8023ad_lacp.h Fri May 3 13:06:46 2019 (r347054) +++ head/sys/net/ieee8023ad_lacp.h Fri May 3 14:43:21 2019 (r347055) @@ -197,8 +197,15 @@ enum lacp_mux_state { #define LACP_MAX_PORTS 32 +struct lacp_numa { + int count; + struct lacp_port *map[LACP_MAX_PORTS]; +}; + struct lacp_portmap { int pm_count; + int pm_num_dom; + struct lacp_numa pm_numa[MAXMEMDOM]; struct lacp_port *pm_map[LACP_MAX_PORTS]; }; Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri May 3 13:06:46 2019 (r347054) +++ head/sys/net/if_lagg.c Fri May 3 14:43:21 2019 (r347055) @@ -264,6 +264,13 @@ SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowi &VNET_NAME(def_use_flowid), 0, "Default setting for using flow id for load sharing"); +/* Default value for using numa */ +VNET_DEFINE_STATIC(int, def_use_numa) = 1; +#define V_def_use_numa VNET(def_use_numa) +SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_numa, CTLFLAG_RWTUN, + &VNET_NAME(def_use_numa), 0, + "Use numa to steer flows"); + /* Default value for flowid shift */ VNET_DEFINE_STATIC(int, def_flowid_shift) = 16; #define V_def_flowid_shift VNET(def_flowid_shift) @@ -491,6 +498,8 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd LAGG_XLOCK(sc); if (V_def_use_flowid) sc->sc_opts |= LAGG_OPT_USE_FLOWID; + if (V_def_use_numa) + sc->sc_opts |= LAGG_OPT_USE_NUMA; sc->flowid_shift = V_def_flowid_shift; /* Hash all layers by default */ @@ -1247,6 +1256,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data switch (ro->ro_opts) { case LAGG_OPT_USE_FLOWID: case -LAGG_OPT_USE_FLOWID: + case LAGG_OPT_USE_NUMA: + case -LAGG_OPT_USE_NUMA: case LAGG_OPT_FLOWIDSHIFT: valid = 1; lacp = 0; Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Fri May 3 13:06:46 2019 (r347054) +++ head/sys/net/if_lagg.h Fri May 3 14:43:21 2019 (r347055) @@ -143,6 +143,7 @@ struct lagg_reqopts { #define LAGG_OPT_USE_FLOWID 0x01 /* enable use of flowid */ /* Pseudo flags which are used in ro_opts but not stored into sc_opts. */ #define LAGG_OPT_FLOWIDSHIFT 0x02 /* set flowid shift */ +#define LAGG_OPT_USE_NUMA 0x04 /* enable use of numa */ #define LAGG_OPT_FLOWIDSHIFT_MASK 0x1f /* flowid is uint32_t */ #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ @@ -158,8 +159,9 @@ struct lagg_reqopts { #define SIOCGLAGGOPTS _IOWR('i', 152, struct lagg_reqopts) #define SIOCSLAGGOPTS _IOW('i', 153, struct lagg_reqopts) -#define LAGG_OPT_BITS "\020\001USE_FLOWID\005LACP_STRICT" \ - "\006LACP_TXTEST\007LACP_RXTEST" +#define LAGG_OPT_BITS "\020\001USE_FLOWID\003USE_NUMA" \ + "\005LACP_STRICT\006LACP_TXTEST" \ + "\007LACP_RXTEST" #ifdef _KERNEL From owner-svn-src-head@freebsd.org Fri May 3 14:49:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB64A1592526; Fri, 3 May 2019 14:49:53 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670069.outbound.protection.outlook.com [40.107.67.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37DE37483B; Fri, 3 May 2019 14:49:52 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM (52.132.70.13) by YQBPR0101MB1122.CANPRD01.PROD.OUTLOOK.COM (52.132.67.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Fri, 3 May 2019 14:49:51 +0000 Received: from YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM ([fe80::8128:ff77:e6ac:fe1a]) by YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM ([fe80::8128:ff77:e6ac:fe1a%5]) with mapi id 15.20.1856.012; Fri, 3 May 2019 14:49:51 +0000 From: Rick Macklem To: Harry Schmalzbauer , Rick Macklem , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r346217 - in head/sys: fs/nfs fs/nfsclient kern sys Thread-Topic: svn commit: r346217 - in head/sys: fs/nfs fs/nfsclient kern sys Thread-Index: AQHVAY49J3ZQW8SFgUi1xSB/QpvD1aZZehTF Date: Fri, 3 May 2019 14:49:51 +0000 Message-ID: References: <201904150127.x3F1RG7X062973@repo.freebsd.org>, <8a6cb225-8644-9949-09ab-7e1525e24034@omnilan.de> In-Reply-To: <8a6cb225-8644-9949-09ab-7e1525e24034@omnilan.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d76dd1a4-fc1e-4b69-4e00-08d6cfd6990f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:YQBPR0101MB1122; x-ms-traffictypediagnostic: YQBPR0101MB1122: x-ms-exchange-purlcount: 2 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1186; x-forefront-prvs: 0026334A56 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(346002)(366004)(376002)(199004)(189003)(102836004)(486006)(9686003)(6306002)(229853002)(74482002)(71200400001)(33656002)(71190400001)(14444005)(256004)(5660300002)(53936002)(76116006)(6436002)(73956011)(66446008)(64756008)(66556008)(66476007)(66946007)(68736007)(99286004)(305945005)(52536014)(76176011)(6246003)(7696005)(2906002)(6506007)(2201001)(8936002)(55016002)(316002)(86362001)(81166006)(81156014)(786003)(8676002)(2501003)(478600001)(966005)(110136005)(14454004)(446003)(46003)(476003)(74316002)(25786009)(186003)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB1122; H:YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: AlV48M1Cn67xO30/dlm2VnS25z2i7B/+jq2I1a2U6z/CFW7FMXpOobDOdETf6wqu2v+iyd7TdtAx/dQQSvrLrsb2Aox2fIEdHwceebHHyr4orLdH4RCXgEZBBE7RNnQ5rV5+HAe/KgNIAs6n/nShcn+WLxOcDnO8japIbGa6CipGA8f5HKOqbWsXIMU2dvhvDN2DBUdzCj8mHuliNbfQGRgmYCtEU6uxp0VPaw/D4dGjBB8hcxoncq+OkRyWvFvy5aN/3QO0dNkSQrytDLALIMg+gAd8HtqPmIxOiS/0h1IQK4e9fUPeL71FR/Ha+JfHWvqOOZHIK9uIWxoh2QBK1Z+z8wpAVyJ68GpWzY/jQU6uDUPWR4W8L/MHcA6pFCrY2BPyYYA3XtPCpeTabIz2/nNIVqTImvDenOa6AvPOrWA= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: d76dd1a4-fc1e-4b69-4e00-08d6cfd6990f X-MS-Exchange-CrossTenant-originalarrivaltime: 03 May 2019 14:49:51.6211 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB1122 X-Rspamd-Queue-Id: 37DE37483B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.976,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 14:49:54 -0000 Harry Schmalzbauer wrote: >Am 15.04.2019 um 03:27 schrieb Rick Macklem: >> Author: rmacklem >> Date: Mon Apr 15 01:27:15 2019 >> New Revision: 346217 >> URL: https://svnweb.freebsd.org/changeset/base/346217 >> >> Log: >> Fix the NFSv4 client to safely find processes. >> >> r340744 broke the NFSv4 client, because it replaced pfind_locked() wi= th a >> call to pfind(), since pfind() acquires the sx lock for the pid hash = and >> the NFSv4 already holds a mutex when it does the call. >> The patch fixes the problem by recreating a pfind_any_locked() and ad= ding the >> functions pidhash_slockall() and pidhash_sunlockall to acquire/releas= e >> all of the pid hash locks. >> These functions are then used by the NFSv4 client instead of acquirin= g >> the allproc_lock and calling pfind(). >> >> Reviewed by: kib, mjg >> MFC after: 2 weeks > >Hello, I guess as long as r340744 isn't MFCd, this commit isn't needed >in /stable/, is it? That is correct. I hadn't looked to see if r340744 was MFC'd when I did the= commit. >Any plans to MFC >https://svnweb.freebsd.org/base?view=3Drevision&revision=3D340744 >(proc: convert pfind & friends to use pidhash locks and other cleanup) No MFC is listed for the commit, so I am assuming that the author isn't pla= nning on MFC'ng it. rick From owner-svn-src-head@freebsd.org Fri May 3 17:23:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94104159668F; Fri, 3 May 2019 17:23:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A64F81BF7; Fri, 3 May 2019 17:23:09 +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 10C1C23E2B; Fri, 3 May 2019 17:23:09 +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 x43HN8gm065160; Fri, 3 May 2019 17:23:08 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43HN8hs065159; Fri, 3 May 2019 17:23:08 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905031723.x43HN8hs065159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 3 May 2019 17:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347056 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 347056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3A64F81BF7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 17:23:09 -0000 Author: gjb Date: Fri May 3 17:23:08 2019 New Revision: 347056 URL: https://svnweb.freebsd.org/changeset/base/347056 Log: Increase the default size of the GCE disk image from 3GB to 20GB, as 3GB is too small as discovered in this week's snapshot builds. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Fri May 3 14:43:21 2019 (r347055) +++ head/release/tools/gce.conf Fri May 3 17:23:08 2019 (r347056) @@ -3,6 +3,9 @@ # $FreeBSD$ # +# The default of 3GB is too small for GCE, so override the size here. +export VMSIZE=20G + # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ From owner-svn-src-head@freebsd.org Fri May 3 20:05:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86AF91599898; Fri, 3 May 2019 20:05:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A3B0868BA; Fri, 3 May 2019 20:05:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0162525944; Fri, 3 May 2019 20:05:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43K5VxQ050072; Fri, 3 May 2019 20:05:31 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43K5Vdo050070; Fri, 3 May 2019 20:05:31 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201905032005.x43K5Vdo050070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 3 May 2019 20:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347057 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 347057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A3B0868BA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 20:05:32 -0000 Author: mmacy Date: Fri May 3 20:05:31 2019 New Revision: 347057 URL: https://svnweb.freebsd.org/changeset/base/347057 Log: Allow iflib drivers to pass a pointer to their own ifmedia structure. Tested by: emaste@ Differential Revision: https://reviews.freebsd.org/D19946 Modified: head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Fri May 3 17:23:08 2019 (r347056) +++ head/sys/net/iflib.c Fri May 3 20:05:31 2019 (r347057) @@ -182,6 +182,7 @@ struct iflib_ctx { struct grouptask ifc_vflr_task; struct iflib_filter_info ifc_filter_info; struct ifmedia ifc_media; + struct ifmedia *ifc_mediap; struct sysctl_oid *ifc_sysctl_node; uint16_t ifc_sysctl_ntxqs; @@ -238,7 +239,7 @@ struct ifmedia * iflib_get_media(if_ctx_t ctx) { - return (&ctx->ifc_media); + return (ctx->ifc_mediap); } uint32_t @@ -4184,7 +4185,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) /* falls thru */ case SIOCGIFMEDIA: case SIOCGIFXMEDIA: - err = ifmedia_ioctl(ifp, ifr, &ctx->ifc_media, command); + err = ifmedia_ioctl(ifp, ifr, ctx->ifc_mediap, command); break; case SIOCGI2C: { @@ -4583,6 +4584,9 @@ iflib_device_register(device_t dev, void *sc, if_share _iflib_pre_assert(scctx); ctx->ifc_txrx = *scctx->isc_txrx; + if (sctx->isc_flags & IFLIB_DRIVER_MEDIA) + ctx->ifc_mediap = scctx->isc_media; + #ifdef INVARIANTS if (scctx->isc_capabilities & IFCAP_TXCSUM) MPASS(scctx->isc_tx_csum_flags); @@ -4819,9 +4823,9 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc device_printf(dev, "IFDI_CLONEATTACH failed %d\n", err); goto fail_ctx_free; } - ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); - ifmedia_add(&ctx->ifc_media, IFM_ETHER | IFM_AUTO, 0, NULL); - ifmedia_set(&ctx->ifc_media, IFM_ETHER | IFM_AUTO); + ifmedia_add(ctx->ifc_mediap, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); + ifmedia_add(ctx->ifc_mediap, IFM_ETHER | IFM_AUTO, 0, NULL); + ifmedia_set(ctx->ifc_mediap, IFM_ETHER | IFM_AUTO); #ifdef INVARIANTS if (scctx->isc_capabilities & IFCAP_TXCSUM) @@ -5348,9 +5352,11 @@ iflib_register(if_ctx_t ctx) EVENTHANDLER_REGISTER(vlan_unconfig, iflib_vlan_unregister, ctx, EVENTHANDLER_PRI_FIRST); - ifmedia_init(&ctx->ifc_media, IFM_IMASK, - iflib_media_change, iflib_media_status); - + if ((sctx->isc_flags & IFLIB_DRIVER_MEDIA) == 0) { + ctx->ifc_mediap = &ctx->ifc_media; + ifmedia_init(ctx->ifc_mediap, IFM_IMASK, + iflib_media_change, iflib_media_status); + } return (0); } Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Fri May 3 17:23:08 2019 (r347056) +++ head/sys/net/iflib.h Fri May 3 20:05:31 2019 (r347057) @@ -228,8 +228,10 @@ typedef struct if_softc_ctx { pci_vendor_info_t isc_vendor_info; /* set by iflib prior to attach_pre */ int isc_disable_msix; if_txrx_t isc_txrx; + struct ifmedia *isc_media; } *if_softc_ctx_t; + /* * Initialization values for device */ @@ -361,6 +363,10 @@ typedef enum { * Interface needs admin task to ignore interface up/down status */ #define IFLIB_ADMIN_ALWAYS_RUN 0x10000 +/* + * Driver will pass the media + */ +#define IFLIB_DRIVER_MEDIA 0x20000 /* From owner-svn-src-head@freebsd.org Fri May 3 20:38:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 950681599F77; Fri, 3 May 2019 20:38:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38F42874A7; Fri, 3 May 2019 20:38:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2011125E5F; Fri, 3 May 2019 20:38:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43Kch68065942; Fri, 3 May 2019 20:38:43 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43KchLG065940; Fri, 3 May 2019 20:38:43 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201905032038.x43KchLG065940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 3 May 2019 20:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347058 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: rwatson X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 347058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38F42874A7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 20:38:44 -0000 Author: rwatson Date: Fri May 3 20:38:43 2019 New Revision: 347058 URL: https://svnweb.freebsd.org/changeset/base/347058 Log: When MAC is enabled and a policy module is loaded, don't unconditionally lock mac_ifnet_mtx, which protects labels on struct ifnet, unless at least one policy is actively using labels on ifnets. This avoids a global mutex acquire in certain fast paths -- most noticeably ifnet transmit. This was previously invisible by default, as no MAC policies were loaded by default, but recently became visible due to mac_ntpd being enabled by default. gallatin@ reports a reduction in PPS overhead from 300% to 2.2% with this change. We will want to explore further MAC Framework optimisation to reduce overhead further, but this brings things more back into the world of the sane. MFC after: 3 days Modified: head/sys/security/mac/mac_inet.c head/sys/security/mac/mac_internal.h head/sys/security/mac/mac_net.c Modified: head/sys/security/mac/mac_inet.c ============================================================================== --- head/sys/security/mac/mac_inet.c Fri May 3 20:05:31 2019 (r347057) +++ head/sys/security/mac/mac_inet.c Fri May 3 20:38:43 2019 (r347058) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2007, 2009 Robert N. M. Watson + * Copyright (c) 1999-2002, 2007, 2009, 2019 Robert N. M. Watson * Copyright (c) 2001 Ilmar S. Habibulin * Copyright (c) 2001-2004 Networks Associates Technology, Inc. * Copyright (c) 2006 SPARTA, Inc. @@ -266,16 +266,17 @@ void mac_netinet_arp_send(struct ifnet *ifp, struct mbuf *m) { struct label *mlabel; + int locked; if (mac_policy_count == 0) return; mlabel = mac_mbuf_to_label(m); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_PERFORM_NOSLEEP(netinet_arp_send, ifp, ifp->if_label, m, mlabel); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); } void @@ -310,16 +311,17 @@ void mac_netinet_igmp_send(struct ifnet *ifp, struct mbuf *m) { struct label *mlabel; + int locked; if (mac_policy_count == 0) return; mlabel = mac_mbuf_to_label(m); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_PERFORM_NOSLEEP(netinet_igmp_send, ifp, ifp->if_label, m, mlabel); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); } void Modified: head/sys/security/mac/mac_internal.h ============================================================================== --- head/sys/security/mac/mac_internal.h Fri May 3 20:05:31 2019 (r347057) +++ head/sys/security/mac/mac_internal.h Fri May 3 20:38:43 2019 (r347058) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2006, 2009 Robert N. M. Watson + * Copyright (c) 1999-2002, 2006, 2009, 2019 Robert N. M. Watson * Copyright (c) 2001 Ilmar S. Habibulin * Copyright (c) 2001-2004 Networks Associates Technology, Inc. * Copyright (c) 2006 nCircle Network Security, Inc. @@ -216,8 +216,24 @@ void mac_destroy_label(struct label *label); int mac_check_structmac_consistent(struct mac *mac); int mac_allocate_slot(void); -#define MAC_IFNET_LOCK(ifp) mtx_lock(&mac_ifnet_mtx) -#define MAC_IFNET_UNLOCK(ifp) mtx_unlock(&mac_ifnet_mtx) +/* + * Lock ifnets to protect labels only if ifnet labels are in use. + */ +#define MAC_IFNET_LOCK(ifp, locked) do { \ + if (mac_labeled & MPC_OBJECT_IFNET) { \ + mtx_lock(&mac_ifnet_mtx); \ + locked = 1; \ + } else { \ + locked = 0; \ + } \ +} while (0) + +#define MAC_IFNET_UNLOCK(ifp, locked) do { \ + if (locked) { \ + mtx_unlock(&mac_ifnet_mtx); \ + locked = 0; \ + } \ +} while (0) /* * MAC Framework per-object type functions. It's not yet clear how the Modified: head/sys/security/mac/mac_net.c ============================================================================== --- head/sys/security/mac/mac_net.c Fri May 3 20:05:31 2019 (r347057) +++ head/sys/security/mac/mac_net.c Fri May 3 20:38:43 2019 (r347058) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1999-2002, 2009 Robert N. M. Watson + * Copyright (c) 1999-2002, 2009, 2019 Robert N. M. Watson * Copyright (c) 2001 Ilmar S. Habibulin * Copyright (c) 2001-2004 Networks Associates Technology, Inc. * Copyright (c) 2006 SPARTA, Inc. @@ -77,6 +77,11 @@ __FBSDID("$FreeBSD$"); * XXXRW: struct ifnet locking is incomplete in the network code, so we use * our own global mutex for struct ifnet. Non-ideal, but should help in the * SMP environment. + * + * This lock is acquired only if a loaded policy is using ifnet labeling. + * This should not ever change during a MAC policy check, itself, but could + * change during setup/return from a check, so we have to condition unlock on + * previous lock. */ struct mtx mac_ifnet_mtx; MTX_SYSINIT(mac_ifnet_mtx, &mac_ifnet_mtx, "mac_ifnet", MTX_DEF); @@ -297,13 +302,14 @@ mac_ifnet_internalize_label(struct label *label, char void mac_ifnet_create(struct ifnet *ifp) { + int locked; if (mac_policy_count == 0) return; - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_PERFORM_NOSLEEP(ifnet_create, ifp, ifp->if_label); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); } void @@ -334,16 +340,17 @@ void mac_ifnet_create_mbuf(struct ifnet *ifp, struct mbuf *m) { struct label *label; + int locked; if (mac_policy_count == 0) return; label = mac_mbuf_to_label(m); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_PERFORM_NOSLEEP(ifnet_create_mbuf, ifp, ifp->if_label, m, label); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); } MAC_CHECK_PROBE_DEFINE2(bpfdesc_check_receive, "struct bpf_d *", @@ -352,7 +359,7 @@ MAC_CHECK_PROBE_DEFINE2(bpfdesc_check_receive, "struct int mac_bpfdesc_check_receive(struct bpf_d *d, struct ifnet *ifp) { - int error; + int error, locked; /* Assume reader lock is enough. */ BPFD_LOCK_ASSERT(d); @@ -360,11 +367,11 @@ mac_bpfdesc_check_receive(struct bpf_d *d, struct ifne if (mac_policy_count == 0) return (0); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_CHECK_NOSLEEP(bpfdesc_check_receive, d, d->bd_label, ifp, ifp->if_label); MAC_CHECK_PROBE2(bpfdesc_check_receive, error, d, ifp); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); return (error); } @@ -376,7 +383,7 @@ int mac_ifnet_check_transmit(struct ifnet *ifp, struct mbuf *m) { struct label *label; - int error; + int error, locked; M_ASSERTPKTHDR(m); @@ -385,11 +392,11 @@ mac_ifnet_check_transmit(struct ifnet *ifp, struct mbu label = mac_mbuf_to_label(m); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_CHECK_NOSLEEP(ifnet_check_transmit, ifp, ifp->if_label, m, label); MAC_CHECK_PROBE2(ifnet_check_transmit, error, ifp, m); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); return (error); } @@ -401,7 +408,7 @@ mac_ifnet_ioctl_get(struct ucred *cred, struct ifreq * char *elements, *buffer; struct label *intlabel; struct mac mac; - int error; + int error, locked; if (!(mac_labeled & MPC_OBJECT_IFNET)) return (EINVAL); @@ -423,9 +430,9 @@ mac_ifnet_ioctl_get(struct ucred *cred, struct ifreq * buffer = malloc(mac.m_buflen, M_MACTEMP, M_WAITOK | M_ZERO); intlabel = mac_ifnet_label_alloc(); - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); mac_ifnet_copy_label(ifp->if_label, intlabel); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); error = mac_ifnet_externalize_label(intlabel, elements, buffer, mac.m_buflen); mac_ifnet_label_free(intlabel); @@ -444,7 +451,7 @@ mac_ifnet_ioctl_set(struct ucred *cred, struct ifreq * struct label *intlabel; struct mac mac; char *buffer; - int error; + int error, locked; if (!(mac_labeled & MPC_OBJECT_IFNET)) return (EINVAL); @@ -483,18 +490,18 @@ mac_ifnet_ioctl_set(struct ucred *cred, struct ifreq * return (error); } - MAC_IFNET_LOCK(ifp); + MAC_IFNET_LOCK(ifp, locked); MAC_POLICY_CHECK_NOSLEEP(ifnet_check_relabel, cred, ifp, ifp->if_label, intlabel); if (error) { - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); mac_ifnet_label_free(intlabel); return (error); } MAC_POLICY_PERFORM_NOSLEEP(ifnet_relabel, cred, ifp, ifp->if_label, intlabel); - MAC_IFNET_UNLOCK(ifp); + MAC_IFNET_UNLOCK(ifp, locked); mac_ifnet_label_free(intlabel); return (0); From owner-svn-src-head@freebsd.org Fri May 3 21:06:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67352159AA01; Fri, 3 May 2019 21:06:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D32B8847A; Fri, 3 May 2019 21:06:35 +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 D2C272635A; Fri, 3 May 2019 21:06:34 +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 x43L6YPh081255; Fri, 3 May 2019 21:06:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43L6YCe081254; Fri, 3 May 2019 21:06:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905032106.x43L6YCe081254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 May 2019 21:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347059 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D32B8847A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:06:35 -0000 Author: imp Date: Fri May 3 21:06:34 2019 New Revision: 347059 URL: https://svnweb.freebsd.org/changeset/base/347059 Log: Remove stray '*' We're storing an EFI_HANDLE, not an pointer to a handle. Since EFI_HANDLE is a void * anyway, this has little practical effect since the conversion to / from void * and void ** is silent. Modified: head/stand/efi/boot1/boot_module.h Modified: head/stand/efi/boot1/boot_module.h ============================================================================== --- head/stand/efi/boot1/boot_module.h Fri May 3 20:38:43 2019 (r347058) +++ head/stand/efi/boot1/boot_module.h Fri May 3 21:06:34 2019 (r347059) @@ -48,7 +48,7 @@ typedef struct dev_info { EFI_BLOCK_IO *dev; EFI_DEVICE_PATH *devpath; - EFI_HANDLE *devhandle; + EFI_HANDLE devhandle; void *devdata; uint64_t partoff; int preferred; From owner-svn-src-head@freebsd.org Fri May 3 21:09:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0146E159AAE1; Fri, 3 May 2019 21:09:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BDEB886C1; Fri, 3 May 2019 21:09:26 +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 6973E2635C; Fri, 3 May 2019 21:09:26 +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 x43L9QIX081874; Fri, 3 May 2019 21:09:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43L9QPS081873; Fri, 3 May 2019 21:09:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905032109.x43L9QPS081873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 May 2019 21:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347060 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BDEB886C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:09:27 -0000 Author: imp Date: Fri May 3 21:09:25 2019 New Revision: 347060 URL: https://svnweb.freebsd.org/changeset/base/347060 Log: When we can't get memory, trying again right away is going to fail. Rather than print N failure messages, bail on the first one. Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Fri May 3 21:06:34 2019 (r347059) +++ head/stand/efi/boot1/boot1.c Fri May 3 21:09:25 2019 (r347060) @@ -328,7 +328,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B devinfo = malloc(sizeof(*devinfo)); if (devinfo == NULL) { DPRINTF("\nFailed to allocate devinfo\n"); - continue; + break; } devinfo->dev = blkio; devinfo->devpath = devpath; From owner-svn-src-head@freebsd.org Fri May 3 21:13:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4015E159ACF3; Fri, 3 May 2019 21:13:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBE4188AF1; Fri, 3 May 2019 21:13:04 +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 B4CF826507; Fri, 3 May 2019 21:13:04 +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 x43LD4ia087156; Fri, 3 May 2019 21:13:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LD4mg087155; Fri, 3 May 2019 21:13:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905032113.x43LD4mg087155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 May 2019 21:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347061 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DBE4188AF1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:13:05 -0000 Author: imp Date: Fri May 3 21:13:04 2019 New Revision: 347061 URL: https://svnweb.freebsd.org/changeset/base/347061 Log: Substitute boot1 with ${BOOT1} Allow for other names to be built, so parameterize this makefile to avoid hard coding boot1. Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Fri May 3 21:09:25 2019 (r347060) +++ head/stand/efi/boot1/Makefile Fri May 3 21:13:04 2019 (r347061) @@ -2,7 +2,8 @@ .include -PROG= boot1.sym +BOOT1?= boot1 +PROG= ${BOOT1}.sym INTERNALPROG= WARNS?= 6 @@ -51,8 +52,8 @@ CFLAGS+= -DEFI_DEBUG .PATH: ${LDRSRC} CFLAGS+= -I${LDRSRC} -FILES= boot1.efi boot1.efifat -FILESMODE_boot1.efi= ${BINMODE} +FILES= ${BOOT1}.efi ${BOOT1}.efifat +FILESMODE_${BOOT1}.efi= ${BINMODE} LDSCRIPT= ${EFISRC}/loader/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -shared @@ -77,7 +78,7 @@ LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} -boot1.efi: ${PROG} +${BOOT1}.efi: ${PROG} if ${NM} ${.ALLSRC} | grep ' U '; then \ echo "Undefined symbols in ${.ALLSRC}"; \ exit 1; \ @@ -93,7 +94,7 @@ boot1.efi: ${PROG} .include "Makefile.fat" -boot1.efifat: boot1.efi +${BOOT1}.efifat: ${BOOT1}.efi @set -- `ls -l ${.ALLSRC}`; \ x=$$(($$5-${BOOT1_MAXSIZE})); \ if [ $$x -ge 0 ]; then \ @@ -104,6 +105,6 @@ boot1.efifat: boot1.efi xz -d -c ${BOOTSRC}/efi/boot1/fat-${MACHINE}.tmpl.xz > ${.TARGET} ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc -CLEANFILES+= boot1.efi boot1.efifat +CLEANFILES+= ${BOOT1}.efi ${BOOT1}.efifat .include From owner-svn-src-head@freebsd.org Fri May 3 21:13:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AE32159AD21; Fri, 3 May 2019 21:13:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5E8E88B2B; Fri, 3 May 2019 21:13:10 +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 B356326508; Fri, 3 May 2019 21:13:09 +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 x43LD9Uu087210; Fri, 3 May 2019 21:13:09 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LD9SZ087209; Fri, 3 May 2019 21:13:09 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905032113.x43LD9SZ087209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 3 May 2019 21:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347062 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 347062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5E8E88B2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:13:11 -0000 Author: imp Date: Fri May 3 21:13:09 2019 New Revision: 347062 URL: https://svnweb.freebsd.org/changeset/base/347062 Log: Use SRC+= rather than SRC= To allow boot1/Makefile to be included, use SRC+= rathern than SRC= so the including Makefile can add additional sources to the build. Modified: head/stand/efi/boot1/Makefile Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Fri May 3 21:13:04 2019 (r347061) +++ head/stand/efi/boot1/Makefile Fri May 3 21:13:09 2019 (r347062) @@ -25,7 +25,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code -SRCS= boot1.c self_reloc.c start.S ufs_module.c +SRCS+= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_LOADER_ZFS} != "no" SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} From owner-svn-src-head@freebsd.org Fri May 3 21:26:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84BED159B012; Fri, 3 May 2019 21:26:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4348920E; Fri, 3 May 2019 21:26:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1107266BC; Fri, 3 May 2019 21:26:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43LQinO092656; Fri, 3 May 2019 21:26:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LQilu092655; Fri, 3 May 2019 21:26:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905032126.x43LQilu092655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 3 May 2019 21:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347063 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A4348920E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:26:45 -0000 Author: markj Date: Fri May 3 21:26:44 2019 New Revision: 347063 URL: https://svnweb.freebsd.org/changeset/base/347063 Log: Disallow excessively small times of day in clock_settime(2). Reported by: syzkaller Reviewed by: cem, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20151 Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Fri May 3 21:13:09 2019 (r347062) +++ head/sys/kern/kern_time.c Fri May 3 21:26:44 2019 (r347063) @@ -412,7 +412,9 @@ kern_clock_settime(struct thread *td, clockid_t clock_ if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000 || ats->tv_sec < 0) return (EINVAL); - if (!allow_insane_settime && ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60) + if (!allow_insane_settime && + (ats->tv_sec > 8000ULL * 365 * 24 * 60 * 60 || + ats->tv_sec < utc_offset())) return (EINVAL); /* XXX Don't convert nsec->usec and back */ TIMESPEC_TO_TIMEVAL(&atv, ats); From owner-svn-src-head@freebsd.org Fri May 3 21:46:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1ACB159B5A1; Fri, 3 May 2019 21:46:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84D2F89CC0; Fri, 3 May 2019 21:46:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5861F26A2C; Fri, 3 May 2019 21:46:26 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43LkQx2003449; Fri, 3 May 2019 21:46:26 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LkQas003448; Fri, 3 May 2019 21:46:26 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905032146.x43LkQas003448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 3 May 2019 21:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347064 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 347064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84D2F89CC0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:46:27 -0000 Author: mckusick Date: Fri May 3 21:46:25 2019 New Revision: 347064 URL: https://svnweb.freebsd.org/changeset/base/347064 Log: Simplify calculation of DIRECTSIZ. No functional change intended. Suggested by: kib MFC after: 1 week Modified: head/sys/ufs/ufs/dir.h Modified: head/sys/ufs/ufs/dir.h ============================================================================== --- head/sys/ufs/ufs/dir.h Fri May 3 21:26:44 2019 (r347063) +++ head/sys/ufs/ufs/dir.h Fri May 3 21:46:25 2019 (r347064) @@ -108,13 +108,11 @@ struct direct { * The DIRSIZ macro gives the minimum record length which will hold * the directory entry. This requires the amount of space in struct direct * without the d_name field, plus enough space for the name with a terminating - * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. - * - * + * null byte (dp->d_namlen + 1), rounded up to a 4 byte boundary. */ -#define DIRECTSIZ(namlen) \ - ((__offsetof(struct direct, d_name) + \ - ((namlen)+1)*sizeof(((struct direct *)0)->d_name[0]) + 3) & ~3) +#define DIR_ROUNDUP 4 /* Directory name roundup size */ +#define DIRECTSIZ(namlen) \ + (roundup2(__offsetof(struct direct, d_name) + (namlen) + 1, DIR_ROUNDUP)) #if (BYTE_ORDER == LITTLE_ENDIAN) #define DIRSIZ(oldfmt, dp) \ ((oldfmt) ? DIRECTSIZ((dp)->d_type) : DIRECTSIZ((dp)->d_namlen)) From owner-svn-src-head@freebsd.org Fri May 3 21:48:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25743159B640; Fri, 3 May 2019 21:48:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE83B89E35; Fri, 3 May 2019 21:48:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7B1326A2D; Fri, 3 May 2019 21:48:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43Lmg2S003596; Fri, 3 May 2019 21:48:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LmguV003595; Fri, 3 May 2019 21:48:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905032148.x43LmguV003595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 3 May 2019 21:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347065 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 347065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE83B89E35 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:48:43 -0000 Author: jhb Date: Fri May 3 21:48:42 2019 New Revision: 347065 URL: https://svnweb.freebsd.org/changeset/base/347065 Log: Emulate the "ADD reg, r/m" instruction (opcode 03H). OVMF's flash variable storage is using add instructions when indexing the variable store bootrom location. Submitted by: D Scott Phillips Reviewed by: rgrimes MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D19975 Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Fri May 3 21:46:25 2019 (r347064) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Fri May 3 21:48:42 2019 (r347065) @@ -77,6 +77,7 @@ enum { VIE_OP_TYPE_STOS, VIE_OP_TYPE_BITTEST, VIE_OP_TYPE_TWOB_GRP15, + VIE_OP_TYPE_ADD, VIE_OP_TYPE_LAST }; @@ -112,6 +113,10 @@ static const struct vie_op two_byte_opcodes[256] = { }; static const struct vie_op one_byte_opcodes[256] = { + [0x03] = { + .op_byte = 0x03, + .op_type = VIE_OP_TYPE_ADD, + }, [0x0F] = { .op_byte = 0x0F, .op_type = VIE_OP_TYPE_TWO_BYTE @@ -410,6 +415,41 @@ getcc(int opsize, uint64_t x, uint64_t y) return (getcc64(x, y)); } +/* + * Macro creation of functions getaddflags{8,16,32,64} + */ +#define GETADDFLAGS(sz) \ +static u_long \ +getaddflags##sz(uint##sz##_t x, uint##sz##_t y) \ +{ \ + u_long rflags; \ + \ + __asm __volatile("add %2,%1; pushfq; popq %0" : \ + "=r" (rflags), "+r" (x) : "m" (y)); \ + return (rflags); \ +} struct __hack + +GETADDFLAGS(8); +GETADDFLAGS(16); +GETADDFLAGS(32); +GETADDFLAGS(64); + +static u_long +getaddflags(int opsize, uint64_t x, uint64_t y) +{ + KASSERT(opsize == 1 || opsize == 2 || opsize == 4 || opsize == 8, + ("getaddflags: invalid operand size %d", opsize)); + + if (opsize == 1) + return (getaddflags8(x, y)); + else if (opsize == 2) + return (getaddflags16(x, y)); + else if (opsize == 4) + return (getaddflags32(x, y)); + else + return (getaddflags64(x, y)); +} + static int emulate_mov(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -1179,6 +1219,62 @@ emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct } static int +emulate_add(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t nval, rflags, rflags2, val1, val2; + enum vm_reg_name reg; + + size = vie->opsize; + error = EINVAL; + + switch (vie->op.op_byte) { + case 0x03: + /* + * ADD r/m to r and store the result in r + * + * 03/r ADD r16, r/m16 + * 03/r ADD r32, r/m32 + * REX.W + 03/r ADD r64, r/m64 + */ + + /* get the first operand */ + reg = gpr_map[vie->reg]; + error = vie_read_register(vm, vcpuid, reg, &val1); + if (error) + break; + + /* get the second operand */ + error = memread(vm, vcpuid, gpa, &val2, size, arg); + if (error) + break; + + /* perform the operation and write the result */ + nval = val1 + val2; + error = vie_update_register(vm, vcpuid, reg, nval, size); + break; + default: + break; + } + + if (!error) { + rflags2 = getaddflags(size, val1, val2); + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + &rflags); + if (error) + return (error); + + rflags &= ~RFLAGS_STATUS_BITS; + rflags |= rflags2 & RFLAGS_STATUS_BITS; + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, + rflags, 8); + } + + return (error); +} + +static int emulate_sub(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) { @@ -1542,6 +1638,10 @@ vmm_emulate_instruction(void *vm, int vcpuid, uint64_t case VIE_OP_TYPE_TWOB_GRP15: error = emulate_twob_group15(vm, vcpuid, gpa, vie, memread, memwrite, memarg); + break; + case VIE_OP_TYPE_ADD: + error = emulate_add(vm, vcpuid, gpa, vie, memread, + memwrite, memarg); break; default: error = EINVAL; From owner-svn-src-head@freebsd.org Fri May 3 21:54:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09D96159BA4C; Fri, 3 May 2019 21:54:17 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A53648A31E; Fri, 3 May 2019 21:54:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7844E26BE0; Fri, 3 May 2019 21:54:16 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x43LsGdb008766; Fri, 3 May 2019 21:54:16 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x43LsFae008760; Fri, 3 May 2019 21:54:15 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905032154.x43LsFae008760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 3 May 2019 21:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347066 - in head: sbin/fsck_ffs sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/fsck_ffs sys/ufs/ufs X-SVN-Commit-Revision: 347066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A53648A31E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2019 21:54:17 -0000 Author: mckusick Date: Fri May 3 21:54:14 2019 New Revision: 347066 URL: https://svnweb.freebsd.org/changeset/base/347066 Log: This update eliminates a kernel stack disclosure bug in UFS/FFS directory entries that is caused by uninitialized directory entry padding written to the disk. It can be viewed by any user with read access to that directory. Up to 3 bytes of kernel stack are disclosed per file entry, depending on the the amount of padding the kernel needs to pad out the entry to a 32 bit boundry. The offset in the kernel stack that is disclosed is a function of the filename size. Furthermore, if the user can create files in a directory, this 3 byte window can be expanded 3 bytes at a time to a 254 byte window with 75% of the data in that window exposed. The additional exposure is done by removing the entry, creating a new entry with a 4-byte longer name, extracting 3 more bytes by reading the directory, and repeating until a 252 byte name is created. This exploit works in part because the area of the kernel stack that is being disclosed is in an area that typically doesn't change that often (perhaps a few times a second on a lightly loaded system), and these file creates and unlinks themselves don't overwrite the area of kernel stack being disclosed. It appears that this bug originated with the creation of the Fast File System in 4.1b-BSD (Circa 1982, more than 36 years ago!), and is likely present in every Unix or Unix-like system that uses UFS/FFS. Amazingly, nobody noticed until now. This update also adds the -z flag to fsck_ffs to have it scrub the leaked information in the name padding of existing directories. It only needs to be run once on each UFS/FFS filesystem after a patched kernel is installed and running. Submitted by: David G. Lawrence Reviewed by: kib MFC after: 1 week Modified: head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/main.c head/sys/ufs/ufs/ufs_lookup.c Modified: head/sbin/fsck_ffs/dir.c ============================================================================== --- head/sbin/fsck_ffs/dir.c Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/dir.c Fri May 3 21:54:14 2019 (r347066) @@ -147,14 +147,23 @@ fsck_readdir(struct inodesc *idesc) struct direct *dp, *ndp; struct bufarea *bp; long size, blksiz, fix, dploc; + int dc; blksiz = idesc->id_numfrags * sblock.fs_fsize; bp = getdirblk(idesc->id_blkno, blksiz); if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 && idesc->id_loc < blksiz) { dp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (dircheck(idesc, dp)) + if ((dc = dircheck(idesc, dp)) > 0) { + if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ + dirty(bp); + } goto dpok; + } if (idesc->id_fix == IGNORE) return (0); fix = dofix(idesc, "DIRECTORY CORRUPTED"); @@ -181,19 +190,26 @@ dpok: if ((idesc->id_loc % DIRBLKSIZ) == 0) return (dp); ndp = (struct direct *)(bp->b_un.b_buf + idesc->id_loc); - if (idesc->id_loc < blksiz && idesc->id_filesize > 0 && - dircheck(idesc, ndp) == 0) { - size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); - idesc->id_loc += size; - idesc->id_filesize -= size; - if (idesc->id_fix == IGNORE) - return (0); - fix = dofix(idesc, "DIRECTORY CORRUPTED"); - bp = getdirblk(idesc->id_blkno, blksiz); - dp = (struct direct *)(bp->b_un.b_buf + dploc); - dp->d_reclen += size; - if (fix) + if (idesc->id_loc < blksiz && idesc->id_filesize > 0) { + if ((dc = dircheck(idesc, ndp)) == 0) { + size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); + idesc->id_loc += size; + idesc->id_filesize -= size; + if (idesc->id_fix == IGNORE) + return (0); + fix = dofix(idesc, "DIRECTORY CORRUPTED"); + bp = getdirblk(idesc->id_blkno, blksiz); + dp = (struct direct *)(bp->b_un.b_buf + dploc); + dp->d_reclen += size; + if (fix) + dirty(bp); + } else if (dc == 2) { + /* + * dircheck() cleared unused directory space. + * Mark the buffer as dirty to write it out. + */ dirty(bp); + } } return (dp); } @@ -201,6 +217,11 @@ dpok: /* * Verify that a directory entry is valid. * This is a superset of the checks made in the kernel. + * Also optionally clears padding and unused directory space. + * + * Returns 0 if the entry is bad, 1 if the entry is good and no changes + * were made, and 2 if the entry is good but modified to clear out padding + * and unused space and needs to be written back to disk. */ static int dircheck(struct inodesc *idesc, struct direct *dp) @@ -209,15 +230,39 @@ dircheck(struct inodesc *idesc, struct direct *dp) char *cp; u_char type; u_int8_t namlen; - int spaceleft; + int spaceleft, modified, unused; + modified = 0; spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ); if (dp->d_reclen == 0 || dp->d_reclen > spaceleft || - (dp->d_reclen & 0x3) != 0) + (dp->d_reclen & (DIR_ROUNDUP - 1)) != 0) goto bad; - if (dp->d_ino == 0) - return (1); + if (dp->d_ino == 0) { + /* + * Special case of an unused directory entry. Normally + * the kernel would coalesce unused space with the previous + * entry by extending its d_reclen, but there are situations + * (e.g. fsck) where that doesn't occur. + * If we're clearing out directory cruft (-z flag), then make + * sure this entry gets fully cleared as well. + */ + if (zflag && fswritefd >= 0) { + if (dp->d_type != 0) { + dp->d_type = 0; + modified = 1; + } + if (dp->d_namlen != 0) { + dp->d_namlen = 0; + modified = 1; + } + if (dp->d_name[0] != '\0') { + dp->d_name[0] = '\0'; + modified = 1; + } + } + goto good; + } size = DIRSIZ(0, dp); namlen = dp->d_namlen; type = dp->d_type; @@ -231,7 +276,37 @@ dircheck(struct inodesc *idesc, struct direct *dp) goto bad; if (*cp != '\0') goto bad; + +good: + if (zflag && fswritefd >= 0) { + /* + * Clear unused directory entry space, including the d_name + * padding. + */ + /* First figure the number of pad bytes. */ + unused = roundup2(namlen + 1, DIR_ROUNDUP) - (namlen + 1); + + /* Add in the free space to the end of the record. */ + unused += dp->d_reclen - DIRSIZ(0, dp); + + /* + * Now clear out the unused space, keeping track if we actually + * changed anything. + */ + for (cp = &dp->d_name[namlen + 1]; unused > 0; unused--, cp++) { + if (*cp != '\0') { + *cp = '\0'; + modified = 1; + } + } + + if (modified) { + return 2; + } + } + return (1); + bad: if (debug) printf("Bad dir: ino %d reclen %d namlen %d type %d name %s\n", Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/fsck.h Fri May 3 21:54:14 2019 (r347066) @@ -315,6 +315,7 @@ extern off_t bflag; /* location of alternate super b extern int debug; /* output debugging info */ extern int Eflag; /* delete empty data blocks */ extern int Zflag; /* zero empty data blocks */ +extern int zflag; /* zero unused directory space */ extern int inoopt; /* trim out unused inodes */ extern char ckclean; /* only do work if not cleanly unmounted */ extern int cvtlevel; /* convert to newer file system format */ Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/fsck_ffs.8 Fri May 3 21:54:14 2019 (r347066) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd January 13, 2018 +.Dd May 3, 2019 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BCdEFfnpRrSyZ +.Op Fl BCdEFfnpRrSyZz .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -301,6 +301,9 @@ If both and .Fl Z are specified, blocks are first zeroed and then erased. +.It Fl z +Clear unused directory space. +The cleared space includes deleted file names and name padding. .El .Pp Inconsistencies checked are as follows: Modified: head/sbin/fsck_ffs/globs.c ============================================================================== --- head/sbin/fsck_ffs/globs.c Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/globs.c Fri May 3 21:54:14 2019 (r347066) @@ -85,6 +85,7 @@ off_t bflag; /* location of alternate super block */ int debug; /* output debugging info */ int Eflag; /* delete empty data blocks */ int Zflag; /* zero empty data blocks */ +int zflag; /* zero unused directory space */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Fri May 3 21:48:42 2019 (r347065) +++ head/sbin/fsck_ffs/main.c Fri May 3 21:54:14 2019 (r347066) @@ -89,7 +89,7 @@ main(int argc, char *argv[]) sync(); skipclean = 1; inoopt = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZ")) != -1) { + while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npRrSyZz")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -164,6 +164,10 @@ main(int argc, char *argv[]) case 'Z': Zflag++; + break; + + case 'z': + zflag++; break; default: Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Fri May 3 21:48:42 2019 (r347065) +++ head/sys/ufs/ufs/ufs_lookup.c Fri May 3 21:54:14 2019 (r347066) @@ -825,14 +825,21 @@ ufs_makedirentry(ip, cnp, newdirp) struct componentname *cnp; struct direct *newdirp; { + u_int namelen; -#ifdef INVARIANTS - if ((cnp->cn_flags & SAVENAME) == 0) - panic("ufs_makedirentry: missing name"); -#endif + namelen = (unsigned)cnp->cn_namelen; + KASSERT((cnp->cn_flags & SAVENAME) != 0, + ("ufs_makedirentry: missing name")); + KASSERT(namelen <= UFS_MAXNAMLEN, + ("ufs_makedirentry: name too long")); newdirp->d_ino = ip->i_number; - newdirp->d_namlen = cnp->cn_namelen; - bcopy(cnp->cn_nameptr, newdirp->d_name, (unsigned)cnp->cn_namelen + 1); + newdirp->d_namlen = namelen; + + /* Zero out after-name padding */ + *(u_int32_t *)(&newdirp->d_name[namelen & ~(DIR_ROUNDUP - 1)]) = 0; + + bcopy(cnp->cn_nameptr, newdirp->d_name, namelen); + if (ITOV(ip)->v_mount->mnt_maxsymlinklen > 0) newdirp->d_type = IFTODT(ip->i_mode); else { From owner-svn-src-head@freebsd.org Sat May 4 02:09:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 908F615A2028; Sat, 4 May 2019 02:09:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3261C6B8FE; Sat, 4 May 2019 02:09:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B13B178C; Sat, 4 May 2019 02:09:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4429Ux3041288; Sat, 4 May 2019 02:09:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4429UGV041287; Sat, 4 May 2019 02:09:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201905040209.x4429UGV041287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sat, 4 May 2019 02:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347075 - head/usr.sbin/lpr/common_source X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.sbin/lpr/common_source X-SVN-Commit-Revision: 347075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3261C6B8FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 02:09:31 -0000 Author: ngie Date: Sat May 4 02:09:30 2019 New Revision: 347075 URL: https://svnweb.freebsd.org/changeset/base/347075 Log: Fix `clang -Wcast-qual` issues Remove unnecessary `char*` casting for arguments passed to `cget*(3)`, and deconst `_PATH_PRINTCAP` before passing it to `cget*` via the `printcapdb` variable. This unblocks ^/projects/runtime-coverage-v2 from building cleanly on universe13a.freebsd.org. I suspect the issue was introduced through some changes to `bsd.*.mk` inclusion on the branch, which I will continue to investigate/isolate. MFC after: 1 week Tested with: clang 8 (arm64) Modified: head/usr.sbin/lpr/common_source/printcap.c Modified: head/usr.sbin/lpr/common_source/printcap.c ============================================================================== --- head/usr.sbin/lpr/common_source/printcap.c Sat May 4 00:59:11 2019 (r347074) +++ head/usr.sbin/lpr/common_source/printcap.c Sat May 4 02:09:30 2019 (r347075) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); /* * Routines and data used in processing the printcap file. */ -static char *printcapdb[2] = { _PATH_PRINTCAP, 0 }; /* list for cget* */ +static char *printcapdb[] = { __DECONST(char *, _PATH_PRINTCAP), NULL }; static char *capdb_canonical_name(const char *_bp); static int capdb_getaltlog(char *_bp, const char *_shrt, @@ -99,15 +99,9 @@ int getprintcap(const char *printer, struct printer *pp) { int status; - char *XXX; char *bp; - /* - * A bug in the declaration of cgetent(3) means that we have - * to hide the constness of its third argument. - */ - XXX = (char *)printer; - if ((status = cgetent(&bp, printcapdb, XXX)) < 0) + if ((status = cgetent(&bp, printcapdb, printer)) < 0) return status; status = getprintcap_int(bp, pp); free(bp); @@ -380,10 +374,10 @@ capdb_getaltstr(char *bp, const char *shrt, const char { int status; - status = cgetstr(bp, (char *)/*XXX*/lng, result); + status = cgetstr(bp, lng, result); if (status >= 0 || status == PCAPERR_OSERR) return status; - status = cgetstr(bp, (char *)/*XXX*/shrt, result); + status = cgetstr(bp, shrt, result); if (status >= 0 || status == PCAPERR_OSERR) return status; if (dflt) { @@ -404,10 +398,10 @@ capdb_getaltnum(char *bp, const char *shrt, const char { int status; - status = cgetnum(bp, (char *)/*XXX*/lng, result); + status = cgetnum(bp, lng, result); if (status >= 0) return status; - status = cgetnum(bp, (char *)/*XXX*/shrt, result); + status = cgetnum(bp, shrt, result); if (status >= 0) return status; *result = dflt; @@ -421,9 +415,9 @@ capdb_getaltnum(char *bp, const char *shrt, const char static int capdb_getaltlog(char *bp, const char *shrt, const char *lng) { - if (cgetcap(bp, (char *)/*XXX*/lng, ':')) + if (cgetcap(bp, lng, ':')) return 1; - if (cgetcap(bp, (char *)/*XXX*/shrt, ':')) + if (cgetcap(bp, shrt, ':')) return 1; return 0; } From owner-svn-src-head@freebsd.org Sat May 4 02:34:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBC0415A2FD8; Sat, 4 May 2019 02:34:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 929D36C9F8; Sat, 4 May 2019 02:34:29 +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 50DF61CC4; Sat, 4 May 2019 02:34:29 +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 x442YTOE057139; Sat, 4 May 2019 02:34:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x442YTM2057138; Sat, 4 May 2019 02:34:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905040234.x442YTM2057138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 4 May 2019 02:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347078 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 347078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 929D36C9F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 02:34:30 -0000 Author: jhibbits Date: Sat May 4 02:34:28 2019 New Revision: 347078 URL: https://svnweb.freebsd.org/changeset/base/347078 Log: powerpc: Merge all pmap struct definitions Summary: A few ports fail to build due to missing pmap-related definitions, which are specific per-pmap type. This tries to appease those ports, by merging all pmaps together. A future change will move the inline page directory out of the Book-E pmap, to eliminate the last #ifdefs in pmap.h and complete the merge. Reviewed By: luporl Differential Revision: https://reviews.freebsd.org/D20119 Modified: head/sys/powerpc/include/pmap.h head/sys/powerpc/include/pte.h Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Sat May 4 02:11:28 2019 (r347077) +++ head/sys/powerpc/include/pmap.h Sat May 4 02:34:28 2019 (r347078) @@ -79,8 +79,6 @@ struct pmap; typedef struct pmap *pmap_t; -#if defined(AIM) - #if !defined(NPMAPS) #define NPMAPS 32768 #endif /* !defined(NPMAPS) */ @@ -96,7 +94,7 @@ struct pvo_entry { struct { #ifndef __powerpc64__ /* 32-bit fields */ - struct pte pte; + pte_t pte; #endif /* 64-bit fields */ uintptr_t slot; @@ -136,28 +134,80 @@ RB_PROTOTYPE(pvo_tree, pvo_entry, pvo_plink, pvo_vaddr struct pmap { struct pmap_statistics pm_stats; struct mtx pm_mtx; - - #ifdef __powerpc64__ - struct slbtnode *pm_slb_tree_root; - struct slb **pm_slb; - int pm_slb_len; - #else - register_t pm_sr[16]; - #endif cpuset_t pm_active; + union { +#ifdef AIM + struct { + + #ifdef __powerpc64__ + struct slbtnode *pm_slb_tree_root; + struct slb **pm_slb; + int pm_slb_len; + #else + register_t pm_sr[16]; + #endif - struct pmap *pmap_phys; - struct pvo_tree pmap_pvo; + struct pmap *pmap_phys; + struct pvo_tree pmap_pvo; + }; +#endif +#ifdef BOOKE + struct { + /* TID to identify this pmap entries in TLB */ + tlbtid_t pm_tid[MAXCPU]; + +#ifdef __powerpc64__ + /* + * Page table directory, + * array of pointers to page directories. + */ + pte_t **pm_pp2d[PP2D_NENTRIES]; + + /* List of allocated pdir bufs (pdir kva regions). */ + TAILQ_HEAD(, ptbl_buf) pm_pdir_list; +#else + /* + * Page table directory, + * array of pointers to page tables. + */ + pte_t *pm_pdir[PDIR_NENTRIES]; +#endif + + /* List of allocated ptbl bufs (ptbl kva regions). */ + TAILQ_HEAD(, ptbl_buf) pm_ptbl_list; + }; +#endif + }; }; +struct pv_entry { + pmap_t pv_pmap; + vm_offset_t pv_va; + TAILQ_ENTRY(pv_entry) pv_link; +}; +typedef struct pv_entry *pv_entry_t; + struct md_page { - volatile int32_t mdpg_attrs; - vm_memattr_t mdpg_cache_attrs; - struct pvo_head mdpg_pvoh; + union { + struct { + volatile int32_t mdpg_attrs; + vm_memattr_t mdpg_cache_attrs; + struct pvo_head mdpg_pvoh; + }; + struct { + TAILQ_HEAD(, pv_entry) pv_list; + int pv_tracked; + }; + }; }; +#ifdef AIM #define pmap_page_get_memattr(m) ((m)->md.mdpg_cache_attrs) #define pmap_page_is_mapped(m) (!LIST_EMPTY(&(m)->md.mdpg_pvoh)) +#else +#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT +#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) +#endif /* * Return the VSID corresponding to a given virtual address. @@ -181,56 +231,6 @@ struct slbtnode *slb_alloc_tree(void); void slb_free_tree(pmap_t pm); struct slb **slb_alloc_user_cache(void); void slb_free_user_cache(struct slb **); - -#elif defined(BOOKE) - -struct pmap { - struct pmap_statistics pm_stats; /* pmap statistics */ - struct mtx pm_mtx; /* pmap mutex */ - tlbtid_t pm_tid[MAXCPU]; /* TID to identify this pmap entries in TLB */ - cpuset_t pm_active; /* active on cpus */ - -#ifdef __powerpc64__ - /* Page table directory, array of pointers to page directories. */ - pte_t **pm_pp2d[PP2D_NENTRIES]; - - /* List of allocated pdir bufs (pdir kva regions). */ - TAILQ_HEAD(, ptbl_buf) pm_pdir_list; -#else - /* Page table directory, array of pointers to page tables. */ - pte_t *pm_pdir[PDIR_NENTRIES]; -#endif - - /* List of allocated ptbl bufs (ptbl kva regions). */ - TAILQ_HEAD(, ptbl_buf) pm_ptbl_list; -}; - -struct pv_entry { - pmap_t pv_pmap; - vm_offset_t pv_va; - TAILQ_ENTRY(pv_entry) pv_link; -}; -typedef struct pv_entry *pv_entry_t; - -struct md_page { - TAILQ_HEAD(, pv_entry) pv_list; - int pv_tracked; -}; - -#define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT -#define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) - -#else -/* - * Common pmap members between AIM and BOOKE. - * libkvm needs pm_stats at the same location between both, as it doesn't define - * AIM nor BOOKE, and is expected to work across all. - */ -struct pmap { - struct pmap_statistics pm_stats; /* pmap statistics */ - struct mtx pm_mtx; /* pmap mutex */ -}; -#endif /* AIM */ extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) Modified: head/sys/powerpc/include/pte.h ============================================================================== --- head/sys/powerpc/include/pte.h Sat May 4 02:11:28 2019 (r347077) +++ head/sys/powerpc/include/pte.h Sat May 4 02:34:28 2019 (r347078) @@ -70,6 +70,8 @@ struct pate { u_int64_t proctab; }; +typedef struct pte pte_t; +typedef struct lpte lpte_t; #endif /* LOCORE */ /* 32-bit PTE definitions */ @@ -161,12 +163,6 @@ struct pate { #define RPDE_NLB_SHIFT 8 #define RPDE_NLS_MASK 0x000000000000001FULL - -#ifndef LOCORE -typedef struct pte pte_t; -typedef struct lpte lpte_t; -#endif /* LOCORE */ - /* * Extract bits from address */ @@ -201,6 +197,114 @@ typedef struct lpte lpte_t; #include +/* + * Flags for pte_remove() routine. + */ +#define PTBL_HOLD 0x00000001 /* do not unhold ptbl pages */ +#define PTBL_UNHOLD 0x00000002 /* unhold and attempt to free ptbl pages */ + +#define PTBL_HOLD_FLAG(pmap) (((pmap) == kernel_pmap) ? PTBL_HOLD : PTBL_UNHOLD) + +/* + * Page Table Entry definitions and macros. + * + * RPN need only be 32-bit because Book-E has 36-bit addresses, and the smallest + * page size is 4k (12-bit mask), so RPN can really fit into 24 bits. + */ +#ifndef LOCORE +typedef uint64_t pte_t; +#endif + +/* RPN mask, TLB0 4K pages */ +#define PTE_PA_MASK PAGE_MASK + +#if defined(BOOKE_E500) + +/* PTE bits assigned to MAS2, MAS3 flags */ +#define PTE_MAS2_SHIFT 19 +#define PTE_W (MAS2_W << PTE_MAS2_SHIFT) +#define PTE_I (MAS2_I << PTE_MAS2_SHIFT) +#define PTE_M (MAS2_M << PTE_MAS2_SHIFT) +#define PTE_G (MAS2_G << PTE_MAS2_SHIFT) +#define PTE_MAS2_MASK (MAS2_G | MAS2_M | MAS2_I | MAS2_W) + +#define PTE_MAS3_SHIFT 2 +#define PTE_UX (MAS3_UX << PTE_MAS3_SHIFT) +#define PTE_SX (MAS3_SX << PTE_MAS3_SHIFT) +#define PTE_UW (MAS3_UW << PTE_MAS3_SHIFT) +#define PTE_SW (MAS3_SW << PTE_MAS3_SHIFT) +#define PTE_UR (MAS3_UR << PTE_MAS3_SHIFT) +#define PTE_SR (MAS3_SR << PTE_MAS3_SHIFT) +#define PTE_MAS3_MASK ((MAS3_UX | MAS3_SX | MAS3_UW \ + | MAS3_SW | MAS3_UR | MAS3_SR) << PTE_MAS3_SHIFT) + +#define PTE_PS_SHIFT 8 +#define PTE_PS_4KB (2 << PTE_PS_SHIFT) + +#elif defined(BOOKE_PPC4XX) + +#define PTE_WL1 TLB_WL1 +#define PTE_IL2I TLB_IL2I +#define PTE_IL2D TLB_IL2D + +#define PTE_W TLB_W +#define PTE_I TLB_I +#define PTE_M TLB_M +#define PTE_G TLB_G + +#define PTE_UX TLB_UX +#define PTE_SX TLB_SX +#define PTE_UW TLB_UW +#define PTE_SW TLB_SW +#define PTE_UR TLB_UR +#define PTE_SR TLB_SR + +#endif + +/* Other PTE flags */ +#define PTE_VALID 0x00000001 /* Valid */ +#define PTE_MODIFIED 0x00001000 /* Modified */ +#define PTE_WIRED 0x00002000 /* Wired */ +#define PTE_MANAGED 0x00000002 /* Managed */ +#define PTE_REFERENCED 0x00040000 /* Referenced */ + +/* + * Page Table Entry definitions and macros. + * + * We use the hardware page table entry format: + * + * 63 24 23 19 18 17 14 13 12 11 8 7 6 5 4 3 2 1 0 + * --------------------------------------------------------------- + * ARPN(12:51) WIMGE R U0:U3 SW0 C PSIZE UX SX UW SW UR SR SW1 V + * --------------------------------------------------------------- + */ + +/* PTE fields. */ +#define PTE_TSIZE_SHIFT (63-54) +#define PTE_TSIZE_MASK 0x7 +#define PTE_TSIZE_SHIFT_DIRECT (63-55) +#define PTE_TSIZE_MASK_DIRECT 0xf +#define PTE_PS_DIRECT(ps) (ps<> PTE_TSIZE_SHIFT) & PTE_TSIZE_MASK) +#define PTE_TSIZE_DIRECT(pte) (int)((*pte >> PTE_TSIZE_SHIFT_DIRECT) & PTE_TSIZE_MASK_DIRECT) + +/* Macro argument must of pte_t type. */ +#define PTE_ARPN_SHIFT 12 +#define PTE_FLAGS_MASK 0x00ffffff +#define PTE_RPN_FROM_PA(pa) (((pa) & ~PAGE_MASK) << PTE_ARPN_SHIFT) +#define PTE_PA(pte) ((vm_paddr_t)(*pte >> PTE_ARPN_SHIFT) & ~PAGE_MASK) +#define PTE_ISVALID(pte) ((*pte) & PTE_VALID) +#define PTE_ISWIRED(pte) ((*pte) & PTE_WIRED) +#define PTE_ISMANAGED(pte) ((*pte) & PTE_MANAGED) +#define PTE_ISMODIFIED(pte) ((*pte) & PTE_MODIFIED) +#define PTE_ISREFERENCED(pte) ((*pte) & PTE_REFERENCED) + +#endif /* BOOKE */ + +/* Book-E page table format, broken out for the generic pmap.h. */ #ifdef __powerpc64__ #include @@ -221,16 +325,11 @@ typedef struct lpte lpte_t; * pp2d consists of PP2D_NENTRIES entries, each being a pointer to * second level entity, i.e. the page table directory (pdir). */ -#define HARDWARE_WALKER #define PP2D_H_H 61 #define PP2D_H_L 60 #define PP2D_L_H 39 #define PP2D_L_L 30 /* >30 would work with no page table pool */ -#ifndef LOCORE -#define PP2D_SIZE (1UL << PP2D_L_L) /* va range mapped by pp2d */ -#else #define PP2D_SIZE (1 << PP2D_L_L) /* va range mapped by pp2d */ -#endif #define PP2D_L_SHIFT PP2D_L_L #define PP2D_L_NUM (PP2D_L_H-PP2D_L_L+1) #define PP2D_L_MASK ((1<> PTE_TSIZE_SHIFT) & PTE_TSIZE_MASK) -#define PTE_TSIZE_DIRECT(pte) (int)((*pte >> PTE_TSIZE_SHIFT_DIRECT) & PTE_TSIZE_MASK_DIRECT) - -/* Macro argument must of pte_t type. */ -#define PTE_ARPN_SHIFT 12 -#define PTE_FLAGS_MASK 0x00ffffff -#define PTE_RPN_FROM_PA(pa) (((pa) & ~PAGE_MASK) << PTE_ARPN_SHIFT) -#define PTE_PA(pte) ((vm_paddr_t)(*pte >> PTE_ARPN_SHIFT) & ~PAGE_MASK) -#define PTE_ISVALID(pte) ((*pte) & PTE_VALID) -#define PTE_ISWIRED(pte) ((*pte) & PTE_WIRED) -#define PTE_ISMANAGED(pte) ((*pte) & PTE_MANAGED) -#define PTE_ISMODIFIED(pte) ((*pte) & PTE_MODIFIED) -#define PTE_ISREFERENCED(pte) ((*pte) & PTE_REFERENCED) - -#endif /* BOOKE */ #endif /* _MACHINE_PTE_H_ */ From owner-svn-src-head@freebsd.org Sat May 4 02:45:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC7BA15A37DB; Sat, 4 May 2019 02:45:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71DEC6D33B; Sat, 4 May 2019 02:45:25 +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 485D51E9A; Sat, 4 May 2019 02:45:25 +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 x442jP8t062436; Sat, 4 May 2019 02:45:25 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x442jPh5062435; Sat, 4 May 2019 02:45:25 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905040245.x442jPh5062435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 4 May 2019 02:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347079 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 347079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 71DEC6D33B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 02:45:26 -0000 Author: jhibbits Date: Sat May 4 02:45:24 2019 New Revision: 347079 URL: https://svnweb.freebsd.org/changeset/base/347079 Log: powerpc: Optimize padding in bus_dma_tag Avoid 8 bytes of padding (2 noncontiguous ints). Submitted by: Brandon Bergren Differential Revision: https://reviews.freebsd.org/D20121 Modified: head/sys/powerpc/powerpc/busdma_machdep.c Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Sat May 4 02:34:28 2019 (r347078) +++ head/sys/powerpc/powerpc/busdma_machdep.c Sat May 4 02:45:24 2019 (r347079) @@ -73,8 +73,8 @@ struct bus_dma_tag { bus_dma_filter_t *filter; void *filterarg; bus_size_t maxsize; - u_int nsegments; bus_size_t maxsegsz; + u_int nsegments; int flags; int ref_count; int map_count; From owner-svn-src-head@freebsd.org Sat May 4 09:30:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DED01588135; Sat, 4 May 2019 09:30:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C89308144A; Sat, 4 May 2019 09:30:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C54F65FA; Sat, 4 May 2019 09:30:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x449U3b6076866; Sat, 4 May 2019 09:30:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449U39k076865; Sat, 4 May 2019 09:30:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905040930.x449U39k076865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 4 May 2019 09:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347088 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 347088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C89308144A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:30:04 -0000 Author: hselasky Date: Sat May 4 09:30:03 2019 New Revision: 347088 URL: https://svnweb.freebsd.org/changeset/base/347088 Log: Fix regression issue after r346645 in the LinuxKPI. Properly handle error case when mapping DMA address fails. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 4 09:28:11 2019 (r347087) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 4 09:30:03 2019 (r347088) @@ -480,10 +480,15 @@ linux_dma_alloc_coherent(struct device *dev, size_t si align = PAGE_SIZE << get_order(size); mem = (void *)kmem_alloc_contig(size, flag, 0, high, align, 0, VM_MEMATTR_DEFAULT); - if (mem) + if (mem != NULL) { *dma_handle = linux_dma_map_phys(dev, vtophys(mem), size); - else + if (*dma_handle == 0) { + kmem_free((vm_offset_t)mem, size); + mem = NULL; + } + } else { *dma_handle = 0; + } return (mem); } From owner-svn-src-head@freebsd.org Sat May 4 09:47:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 147911588637; Sat, 4 May 2019 09:47:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC7E281DB7; Sat, 4 May 2019 09:47:02 +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 852DE6976; Sat, 4 May 2019 09:47:02 +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 x449l2A8087037; Sat, 4 May 2019 09:47:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x449l1j9087033; Sat, 4 May 2019 09:47:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905040947.x449l1j9087033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 4 May 2019 09:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347089 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 347089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC7E281DB7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 09:47:03 -0000 Author: hselasky Date: Sat May 4 09:47:01 2019 New Revision: 347089 URL: https://svnweb.freebsd.org/changeset/base/347089 Log: Fix regression issue after r346645 in the LinuxKPI. The S/G list must be mapped AS-IS without any optimisations. This also implies that sg_dma_len() must be equal to sg->length. Many Linux drivers assume this and this fixes some DRM issues. Put the BUS DMA map pointer into the scatter-gather list to allow multiple mappings on the same physical memory address. The FreeBSD version has been bumped to force recompilation of external kernel modules. Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h head/sys/compat/linuxkpi/common/src/linux_pci.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Sat May 4 09:30:03 2019 (r347088) +++ head/sys/compat/linuxkpi/common/include/linux/scatterlist.h Sat May 4 09:47:01 2019 (r347089) @@ -36,6 +36,7 @@ #include #include +struct bus_dmamap; struct scatterlist { unsigned long page_link; #define SG_PAGE_LINK_CHAIN 0x1UL @@ -44,7 +45,7 @@ struct scatterlist { unsigned int offset; unsigned int length; dma_addr_t dma_address; - unsigned int dma_length; + struct bus_dmamap *dma_map; /* FreeBSD specific */ }; CTASSERT((sizeof(struct scatterlist) & SG_PAGE_LINK_MASK) == 0); @@ -79,7 +80,7 @@ struct sg_page_iter { ((struct scatterlist *) ((sg)->page_link & ~SG_PAGE_LINK_MASK)) #define sg_dma_address(sg) (sg)->dma_address -#define sg_dma_len(sg) (sg)->dma_length +#define sg_dma_len(sg) (sg)->length #define for_each_sg_page(sgl, iter, nents, pgoffset) \ for (_sg_iter_init(sgl, iter, nents, pgoffset); \ Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 4 09:30:03 2019 (r347088) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 4 09:47:01 2019 (r347089) @@ -562,70 +562,39 @@ linux_dma_map_sg_attrs(struct device *dev, struct scat enum dma_data_direction dir, struct dma_attrs *attrs) { struct linux_dma_priv *priv; - struct linux_dma_obj *obj; - struct scatterlist *dma_sg, *sg; - int dma_nents, error, nseg; - size_t seg_len; - vm_paddr_t seg_phys, prev_phys_end; + struct scatterlist *sg; + int i, nseg; bus_dma_segment_t seg; priv = dev->dma_priv; - obj = uma_zalloc(linux_dma_obj_zone, 0); - DMA_PRIV_LOCK(priv); - if (bus_dmamap_create(priv->dmat, 0, &obj->dmamap) != 0) { + + /* create common DMA map in the first S/G entry */ + if (bus_dmamap_create(priv->dmat, 0, &sgl->dma_map) != 0) { DMA_PRIV_UNLOCK(priv); - uma_zfree(linux_dma_obj_zone, obj); return (0); } - sg = sgl; - dma_sg = sg; - dma_nents = 0; - - while (nents > 0) { - seg_phys = sg_phys(sg); - seg_len = sg->length; - while (--nents > 0) { - prev_phys_end = sg_phys(sg) + sg->length; - sg = sg_next(sg); - if (prev_phys_end != sg_phys(sg)) - break; - seg_len += sg->length; - } - + /* load all S/G list entries */ + for_each_sg(sgl, sg, nents, i) { nseg = -1; - if (_bus_dmamap_load_phys(priv->dmat, obj->dmamap, - seg_phys, seg_len, BUS_DMA_NOWAIT, + if (_bus_dmamap_load_phys(priv->dmat, sgl->dma_map, + sg_phys(sg), sg->length, BUS_DMA_NOWAIT, &seg, &nseg) != 0) { - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_unload(priv->dmat, sgl->dma_map); + bus_dmamap_destroy(priv->dmat, sgl->dma_map); DMA_PRIV_UNLOCK(priv); - uma_zfree(linux_dma_obj_zone, obj); return (0); } - KASSERT(++nseg == 1, ("More than one segment (nseg=%d)", nseg)); + KASSERT(nseg == 0, + ("More than one segment (nseg=%d)", nseg + 1)); - sg_dma_address(dma_sg) = seg.ds_addr; - sg_dma_len(dma_sg) = seg.ds_len; - - dma_sg = sg_next(dma_sg); - dma_nents++; - } - - obj->dma_addr = sg_dma_address(sgl); - - error = LINUX_DMA_PCTRIE_INSERT(&priv->ptree, obj); - if (error != 0) { - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); - DMA_PRIV_UNLOCK(priv); - uma_zfree(linux_dma_obj_zone, obj); - return (0); + sg_dma_address(sg) = seg.ds_addr; } DMA_PRIV_UNLOCK(priv); - return (dma_nents); + + return (nents); } void @@ -633,22 +602,13 @@ linux_dma_unmap_sg_attrs(struct device *dev, struct sc int nents, enum dma_data_direction dir, struct dma_attrs *attrs) { struct linux_dma_priv *priv; - struct linux_dma_obj *obj; priv = dev->dma_priv; DMA_PRIV_LOCK(priv); - obj = LINUX_DMA_PCTRIE_LOOKUP(&priv->ptree, sg_dma_address(sgl)); - if (obj == NULL) { - DMA_PRIV_UNLOCK(priv); - return; - } - LINUX_DMA_PCTRIE_REMOVE(&priv->ptree, sg_dma_address(sgl)); - bus_dmamap_unload(priv->dmat, obj->dmamap); - bus_dmamap_destroy(priv->dmat, obj->dmamap); + bus_dmamap_unload(priv->dmat, sgl->dma_map); + bus_dmamap_destroy(priv->dmat, sgl->dma_map); DMA_PRIV_UNLOCK(priv); - - uma_zfree(linux_dma_obj_zone, obj); } struct dma_pool { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat May 4 09:30:03 2019 (r347088) +++ head/sys/sys/param.h Sat May 4 09:47:01 2019 (r347089) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300021 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300022 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sat May 4 10:48:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB80B1589CAC; Sat, 4 May 2019 10:48:45 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82DA984046; Sat, 4 May 2019 10:48:45 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BA46739B; Sat, 4 May 2019 10:48:45 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44Amjsn019343; Sat, 4 May 2019 10:48:45 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44AmjMd019342; Sat, 4 May 2019 10:48:45 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201905041048.x44AmjMd019342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Sat, 4 May 2019 10:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347097 - head/sys/arm64/rockchip/clk X-SVN-Group: head X-SVN-Commit-Author: ganbold X-SVN-Commit-Paths: head/sys/arm64/rockchip/clk X-SVN-Commit-Revision: 347097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82DA984046 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 10:48:46 -0000 Author: ganbold Date: Sat May 4 10:48:44 2019 New Revision: 347097 URL: https://svnweb.freebsd.org/changeset/base/347097 Log: Add emmc clock definitions for Rockchip RK3399 SoC. Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c ============================================================================== --- head/sys/arm64/rockchip/clk/rk3399_cru.c Sat May 4 10:38:54 2019 (r347096) +++ head/sys/arm64/rockchip/clk/rk3399_cru.c Sat May 4 10:48:44 2019 (r347097) @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); /* GATES */ +#define ACLK_EMMC_CORE 241 +#define ACLK_EMMC_NOC 242 +#define ACLK_EMMC_GRF 243 #define PCLK_GPIO2 336 #define PCLK_GPIO3 337 #define PCLK_GPIO4 338 @@ -80,6 +83,10 @@ static struct rk_cru_gate rk3399_gates[] = { CRU_GATE(0, "cpll_aclk_perihp_src", "cpll", 0x314, 0) CRU_GATE(0, "gpll_aclk_perihp_src", "gpll", 0x314, 1) + /* CRU_CLKGATE_CON6 */ + CRU_GATE(0, "gpll_aclk_emmc_src", "gpll", 0x318, 12) + CRU_GATE(0, "cpll_aclk_emmc_src", "cpll", 0x318, 13) + /* CRU_CLKGATE_CON7 */ CRU_GATE(0, "gpll_aclk_perilp0_src", "gpll", 0x31C, 0) CRU_GATE(0, "cpll_aclk_perilp0_src", "cpll", 0x31C, 1) @@ -101,6 +108,11 @@ static struct rk_cru_gate rk3399_gates[] = { CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_alive", 0x37c, 4) CRU_GATE(PCLK_GPIO4, "pclk_gpio4", "pclk_alive", 0x37c, 5) + /* CRU_CLKGATE_CON32 */ + CRU_GATE(ACLK_EMMC_CORE, "aclk_emmccore", "aclk_emmc", 0x380, 8) + CRU_GATE(ACLK_EMMC_NOC, "aclk_emmc_noc", "aclk_emmc", 0x380, 9) + CRU_GATE(ACLK_EMMC_GRF, "aclk_emmcgrf", "aclk_emmc", 0x380, 10) + /* CRU_CLKGATE_CON33 */ CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_sd", 0x384, 8) }; @@ -1443,6 +1455,60 @@ static struct rk_clk_composite_def sclk_sdmmc = { .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, }; +/* + * emmc + */ + +#define SCLK_EMMC 78 + +static const char *sclk_emmc_parents[] = {"cpll", "gpll", "npll"}; + +static struct rk_clk_composite_def sclk_emmc = { + .clkdef = { + .id = SCLK_EMMC, + .name = "sclk_emmc", + .parent_names = sclk_emmc_parents, + .parent_cnt = nitems(sclk_emmc_parents), + }, + + .muxdiv_offset = 0x158, + .mux_shift = 8, + .mux_width = 3, + + .div_shift = 0, + .div_width = 7, + + .gate_offset = 0x318, + .gate_shift = 14, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX | RK_CLK_COMPOSITE_HAVE_GATE, +}; + +#define ACLK_EMMC 240 + +static const char *aclk_emmc_parents[] = { + "cpll_aclk_emmc_src", + "gpll_aclk_emmc_src" +}; + +static struct rk_clk_composite_def aclk_emmc = { + .clkdef = { + .id = ACLK_EMMC, + .name = "aclk_emmc", + .parent_names = aclk_emmc_parents, + .parent_cnt = nitems(aclk_emmc_parents), + }, + + .muxdiv_offset = 0x154, + .mux_shift = 7, + .mux_width = 1, + + .div_shift = 0, + .div_width = 5, + + .flags = RK_CLK_COMPOSITE_HAVE_MUX, +}; + static struct rk_clk rk3399_clks[] = { { .type = RK3399_CLK_PLL, @@ -1550,6 +1616,15 @@ static struct rk_clk rk3399_clks[] = { { .type = RK_CLK_COMPOSITE, .clk.composite = &sclk_sdmmc, + }, + + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &sclk_emmc, + }, + { + .type = RK_CLK_COMPOSITE, + .clk.composite = &aclk_emmc, }, }; From owner-svn-src-head@freebsd.org Sat May 4 16:24:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A281592EF5; Sat, 4 May 2019 16:24:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 785B98F4D5; Sat, 4 May 2019 16:24:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 466E6ACBE; Sat, 4 May 2019 16:24:44 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44GOitk098968; Sat, 4 May 2019 16:24:44 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44GOhBU098966; Sat, 4 May 2019 16:24:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905041624.x44GOhBU098966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 4 May 2019 16:24:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347127 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 347127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 785B98F4D5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 16:24:45 -0000 Author: jhibbits Date: Sat May 4 16:24:43 2019 New Revision: 347127 URL: https://svnweb.freebsd.org/changeset/base/347127 Log: powerpc/mpc85xx: Attach MPC85xx PCI bus and root complex at the right pass No signifcant change, just matches other PCI attachments, attaching at BUS_PASS_BUS. MFC after: 2 weeks Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sat May 4 13:58:45 2019 (r347126) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx.c Sat May 4 16:24:43 2019 (r347127) @@ -225,7 +225,8 @@ static devclass_t fsl_pcib_devclass; DEFINE_CLASS_1(pcib, fsl_pcib_driver, fsl_pcib_methods, sizeof(struct fsl_pcib_softc), ofw_pci_driver); -DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0); +EARLY_DRIVER_MODULE(pcib, ofwbus, fsl_pcib_driver, fsl_pcib_devclass, 0, 0, + BUS_PASS_BUS); static int fsl_pcib_err_intr(void *v) Modified: head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Sat May 4 13:58:45 2019 (r347126) +++ head/sys/powerpc/mpc85xx/pci_mpc85xx_pcib.c Sat May 4 16:24:43 2019 (r347127) @@ -103,4 +103,5 @@ static device_method_t fsl_pcib_rc_methods[] = { static devclass_t fsl_pcib_rc_devclass; DEFINE_CLASS_1(pcib, fsl_pcib_rc_driver, fsl_pcib_rc_methods, sizeof(struct fsl_pcib_softc), ofw_pcib_pci_driver); -DRIVER_MODULE(rcpcib, pci, fsl_pcib_rc_driver, fsl_pcib_rc_devclass, 0, 0); +EARLY_DRIVER_MODULE(rcpcib, pci, fsl_pcib_rc_driver, fsl_pcib_rc_devclass, 0, 0, + BUS_PASS_BUS); From owner-svn-src-head@freebsd.org Sat May 4 17:35:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE66159429E; Sat, 4 May 2019 17:35:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E12A06A90D; Sat, 4 May 2019 17:35: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 C5A8DB863; Sat, 4 May 2019 17:35: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 x44HZET6035829; Sat, 4 May 2019 17:35:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44HZErV035827; Sat, 4 May 2019 17:35:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905041735.x44HZErV035827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 4 May 2019 17:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347129 - in head/sys: amd64/include i386/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/include i386/include x86/x86 X-SVN-Commit-Revision: 347129 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E12A06A90D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 17:35:15 -0000 Author: cem Date: Sat May 4 17:35:13 2019 New Revision: 347129 URL: https://svnweb.freebsd.org/changeset/base/347129 Log: x86: Define pc_monitorbuf as a logical structure Rather than just accessing it via pointer cast. No functional change intended. Discussed with: kib (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20135 Modified: head/sys/amd64/include/pcpu.h head/sys/i386/include/pcpu.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Sat May 4 16:27:58 2019 (r347128) +++ head/sys/amd64/include/pcpu.h Sat May 4 17:35:13 2019 (r347129) @@ -36,6 +36,13 @@ #endif #define PC_PTI_STACK_SZ 16 + +struct monitorbuf { + int idle_state; /* Used by cpu_idle_mwait. */ + char padding[128 - (1 * sizeof(int))]; +}; +_Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); + /* * The SMP parts are setup in pmap.c and locore.s for the BSP, and * mp_machdep.c sets up the data for the AP's to "see" when they awake. @@ -44,7 +51,7 @@ * other processors" */ #define PCPU_MD_FIELDS \ - char pc_monitorbuf[128] __aligned(128); /* cache line */ \ + struct monitorbuf pc_monitorbuf __aligned(128); /* cache line */\ struct pcpu *pc_prvspace; /* Self-reference */ \ struct pmap *pc_curpmap; \ struct amd64tss *pc_tssp; /* TSS segment active on CPU */ \ Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Sat May 4 16:27:58 2019 (r347128) +++ head/sys/i386/include/pcpu.h Sat May 4 17:35:13 2019 (r347129) @@ -41,6 +41,12 @@ #include #include +struct monitorbuf { + int idle_state; /* Used by cpu_idle_mwait. */ + char padding[128 - (1 * sizeof(int))]; +}; +_Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); + /* * The SMP parts are setup in pmap.c and machdep.c for the BSP, and * pmap.c and mp_machdep.c sets up the data for the AP's to "see" when @@ -50,7 +56,7 @@ */ #define PCPU_MD_FIELDS \ - char pc_monitorbuf[128] __aligned(128); /* cache line */ \ + struct monitorbuf pc_monitorbuf __aligned(128); /* cache line */\ struct pcpu *pc_prvspace; /* Self-reference */ \ struct pmap *pc_curpmap; \ struct segment_descriptor pc_common_tssd; \ Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Sat May 4 16:27:58 2019 (r347128) +++ head/sys/x86/x86/cpu_machdep.c Sat May 4 17:35:13 2019 (r347129) @@ -164,7 +164,7 @@ acpi_cpu_idle_mwait(uint32_t mwait_hint) * but all Intel CPUs provide hardware coordination. */ - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; KASSERT(atomic_load_int(state) == STATE_SLEEPING, ("cpu_mwait_cx: wrong monitorbuf state")); atomic_store_int(state, STATE_MWAIT); @@ -422,7 +422,7 @@ cpu_idle_acpi(sbintime_t sbt) { int *state; - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; atomic_store_int(state, STATE_SLEEPING); /* See comments in cpu_idle_hlt(). */ @@ -441,7 +441,7 @@ cpu_idle_hlt(sbintime_t sbt) { int *state; - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; atomic_store_int(state, STATE_SLEEPING); /* @@ -473,7 +473,7 @@ cpu_idle_mwait(sbintime_t sbt) { int *state; - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; atomic_store_int(state, STATE_MWAIT); /* See comments in cpu_idle_hlt(). */ @@ -498,7 +498,7 @@ cpu_idle_spin(sbintime_t sbt) int *state; int i; - state = (int *)PCPU_PTR(monitorbuf); + state = &PCPU_PTR(monitorbuf)->idle_state; atomic_store_int(state, STATE_RUNNING); /* @@ -598,9 +598,11 @@ SYSCTL_INT(_machdep, OID_AUTO, idle_apl31, CTLFLAG_RW, int cpu_idle_wakeup(int cpu) { + struct monitorbuf *mb; int *state; - state = (int *)pcpu_find(cpu)->pc_monitorbuf; + mb = &pcpu_find(cpu)->pc_monitorbuf; + state = &mb->idle_state; switch (atomic_load_int(state)) { case STATE_SLEEPING: return (0); From owner-svn-src-head@freebsd.org Sat May 4 18:00:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E89F1594825; Sat, 4 May 2019 18:00:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0476B6B415; Sat, 4 May 2019 18:00:58 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D41DFBEBC; Sat, 4 May 2019 18:00:57 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44I0vne046789; Sat, 4 May 2019 18:00:57 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44I0v1B046788; Sat, 4 May 2019 18:00:57 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905041800.x44I0v1B046788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sat, 4 May 2019 18:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347130 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 347130 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0476B6B415 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 18:00:58 -0000 Author: mckusick Date: Sat May 4 18:00:57 2019 New Revision: 347130 URL: https://svnweb.freebsd.org/changeset/base/347130 Log: Zero out the file directory entry metadata to reduce disk scavenging disclosure. Submitted by: David G. Lawrence MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Sat May 4 17:35:13 2019 (r347129) +++ head/sys/ufs/ufs/ufs_lookup.c Sat May 4 18:00:57 2019 (r347130) @@ -1218,16 +1218,21 @@ ufs_dirremove(dvp, ip, flags, isrmdir) if (ip && rep->d_ino != ip->i_number) panic("ufs_dirremove: ip %ju does not match dirent ino %ju\n", (uintmax_t)ip->i_number, (uintmax_t)rep->d_ino); - if (dp->i_count == 0) { + /* + * Zero out the file directory entry metadata to reduce disk + * scavenging disclosure. + */ + bzero(&rep->d_name[0], rep->d_namlen); + rep->d_namlen = 0; + rep->d_type = 0; + rep->d_ino = 0; + + if (dp->i_count != 0) { /* - * First entry in block: set d_ino to zero. - */ - ep->d_ino = 0; - } else { - /* * Collapse new free space into previous entry. */ ep->d_reclen += rep->d_reclen; + rep->d_reclen = 0; } #ifdef UFS_DIRHASH if (dp->i_dirhash != NULL) From owner-svn-src-head@freebsd.org Sat May 4 19:04:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEF7A1595EC6; Sat, 4 May 2019 19:04:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ECC56D7AE; Sat, 4 May 2019 19:04:18 +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 4BCF6C958; Sat, 4 May 2019 19:04:18 +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 x44J4IfY083076; Sat, 4 May 2019 19:04:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44J4IJp083075; Sat, 4 May 2019 19:04:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905041904.x44J4IJp083075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 May 2019 19:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347131 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347131 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5ECC56D7AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 19:04:19 -0000 Author: mjg Date: Sat May 4 19:04:17 2019 New Revision: 347131 URL: https://svnweb.freebsd.org/changeset/base/347131 Log: Annotate nprocs with __exclusive_cache_line Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_fork.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat May 4 18:00:57 2019 (r347130) +++ head/sys/kern/kern_fork.c Sat May 4 19:04:17 2019 (r347131) @@ -185,7 +185,7 @@ sys_rfork(struct thread *td, struct rfork_args *uap) return (error); } -int nprocs = 1; /* process 0 */ +int __exclusive_cache_line nprocs = 1; /* process 0 */ int lastpid = 0; SYSCTL_INT(_kern, OID_AUTO, lastpid, CTLFLAG_RD, &lastpid, 0, "Last used PID"); From owner-svn-src-head@freebsd.org Sat May 4 19:05:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 630351595F4C; Sat, 4 May 2019 19:05:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B9EE6D903; Sat, 4 May 2019 19:05:31 +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 DB37CC95A; Sat, 4 May 2019 19:05:30 +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 x44J5U2k083177; Sat, 4 May 2019 19:05:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44J5ULR083174; Sat, 4 May 2019 19:05:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201905041905.x44J5ULR083174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 4 May 2019 19:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347132 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 347132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B9EE6D903 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 19:05:31 -0000 Author: mjg Date: Sat May 4 19:05:30 2019 New Revision: 347132 URL: https://svnweb.freebsd.org/changeset/base/347132 Log: sysv: get rid of fork/exit hooks if the code is compiled in Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/sysv_ipc.c head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_ipc.c ============================================================================== --- head/sys/kern/sysv_ipc.c Sat May 4 19:04:17 2019 (r347131) +++ head/sys/kern/sysv_ipc.c Sat May 4 19:05:30 2019 (r347132) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef SYSVSHM void (*shmfork_hook)(struct proc *, struct proc *) = NULL; void (*shmexit_hook)(struct vmspace *) = NULL; @@ -73,6 +74,7 @@ shmexit(struct vmspace *vm) shmexit_hook(vm); return; } +#endif /* * Check for IPC permission. Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Sat May 4 19:04:17 2019 (r347131) +++ head/sys/kern/sysv_shm.c Sat May 4 19:05:30 2019 (r347132) @@ -137,8 +137,10 @@ static void shmrealloc(void); static int shminit(void); static int sysvshm_modload(struct module *, int, void *); static int shmunload(void); +#ifndef SYSVSHM static void shmexit_myhook(struct vmspace *vm); static void shmfork_myhook(struct proc *p1, struct proc *p2); +#endif static int sysctl_shmsegs(SYSCTL_HANDLER_ARGS); static void shm_remove(struct shmid_kernel *, int); static struct prison *shm_find_prison(struct ucred *); @@ -810,8 +812,13 @@ sys_shmget(struct thread *td, struct shmget_args *uap) return (error); } +#ifdef SYSVSHM +void +shmfork(struct proc *p1, struct proc *p2) +#else static void shmfork_myhook(struct proc *p1, struct proc *p2) +#endif { struct shmmap_state *shmmap_s; size_t size; @@ -834,8 +841,13 @@ shmfork_myhook(struct proc *p1, struct proc *p2) SYSVSHM_UNLOCK(); } +#ifdef SYSVSHM +void +shmexit(struct vmspace *vm) +#else static void shmexit_myhook(struct vmspace *vm) +#endif { struct shmmap_state *base, *shm; int i; @@ -956,8 +968,10 @@ shminit(void) shm_nused = 0; shm_committed = 0; sx_init(&sysvshmsx, "sysvshmsx"); +#ifndef SYSVSHM shmexit_hook = &shmexit_myhook; shmfork_hook = &shmfork_myhook; +#endif /* Set current prisons according to their allow.sysvipc. */ shm_prison_slot = osd_jail_register(NULL, methods); @@ -1021,8 +1035,10 @@ shmunload(void) vm_object_deallocate(shmsegs[i].object); } free(shmsegs, M_SHM); +#ifndef SYSVSHM shmexit_hook = NULL; shmfork_hook = NULL; +#endif sx_destroy(&sysvshmsx); return (0); } From owner-svn-src-head@freebsd.org Sat May 4 19:40:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F24EA1596F5C; Sat, 4 May 2019 19:40:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 874D96EB3A; Sat, 4 May 2019 19:40:31 +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 75A88CE6A; Sat, 4 May 2019 19:40:31 +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 x44JeV7q099740; Sat, 4 May 2019 19:40:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44JeV8q099723; Sat, 4 May 2019 19:40:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905041940.x44JeV8q099723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 4 May 2019 19:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347133 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 347133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 874D96EB3A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 19:40:32 -0000 Author: kib Date: Sat May 4 19:40:30 2019 New Revision: 347133 URL: https://svnweb.freebsd.org/changeset/base/347133 Log: arm64: Properly restore PAN when done with userspace access in casueword. Approved by: andrew Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/arm64/arm64/support.S Modified: head/sys/arm64/arm64/support.S ============================================================================== --- head/sys/arm64/arm64/support.S Sat May 4 19:05:30 2019 (r347132) +++ head/sys/arm64/arm64/support.S Sat May 4 19:40:30 2019 (r347133) @@ -64,8 +64,8 @@ ENTRY(casueword32) b.ne 2f /* Not equal, exit */ stxr w5, w3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ - EXIT_USER_ACCESS(w6) -2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str w4, [x2] /* Store the read data */ mov x0, #0 /* Success */ ret /* Return */ @@ -86,8 +86,8 @@ ENTRY(casueword) b.ne 2f /* Not equal, exit */ stxr w5, x3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ - EXIT_USER_ACCESS(w6) -2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str x4, [x2] /* Store the read data */ mov x0, #0 /* Success */ ret /* Return */ From owner-svn-src-head@freebsd.org Sat May 4 20:34:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED3E5159816A; Sat, 4 May 2019 20:34:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EDF270726; Sat, 4 May 2019 20:34:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 705FDD846; Sat, 4 May 2019 20:34:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x44KYSJC031544; Sat, 4 May 2019 20:34:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x44KYRUn031538; Sat, 4 May 2019 20:34:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905042034.x44KYRUn031538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 4 May 2019 20:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347134 - in head/sys: amd64/include i386/include kern x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/include i386/include kern x86/include x86/x86 X-SVN-Commit-Revision: 347134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8EDF270726 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 20:34:29 -0000 Author: cem Date: Sat May 4 20:34:26 2019 New Revision: 347134 URL: https://svnweb.freebsd.org/changeset/base/347134 Log: x86: Implement MWAIT support for stopping a CPU IPI_STOP is used after panic or when ddb is entered manually. MONITOR/ MWAIT allows CPUs that support the feature to sleep in a low power way instead of spinning. Something similar is already used at idle. It is perhaps especially useful in oversubscribed VM environments, and is safe to use even if the panic/ddb thread is not the BSP. (Except in the presence of MWAIT errata, which are detected automatically on platforms with known wakeup problems.) It can be tuned/sysctled with "machdep.stop_mwait," which defaults to 0 (off). This commit also introduces the tunable "machdep.mwait_cpustop_broken," which defaults to 0, unless the CPU has known errata, but may be set to "1" in loader.conf to signal that mwait wakeup is broken on CPUs FreeBSD does not yet know about. Unfortunately, Bhyve doesn't yet support MONITOR extensions, so this doesn't help bhyve hypervisors running FreeBSD guests. Submitted by: Anton Rang (earlier version) Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20135 Modified: head/sys/amd64/include/pcpu.h head/sys/i386/include/pcpu.h head/sys/kern/subr_smp.c head/sys/x86/include/x86_smp.h head/sys/x86/x86/cpu_machdep.c head/sys/x86/x86/mp_x86.c Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Sat May 4 19:40:30 2019 (r347133) +++ head/sys/amd64/include/pcpu.h Sat May 4 20:34:26 2019 (r347134) @@ -39,7 +39,8 @@ struct monitorbuf { int idle_state; /* Used by cpu_idle_mwait. */ - char padding[128 - (1 * sizeof(int))]; + int stop_state; /* Used by cpustop_handler. */ + char padding[128 - (2 * sizeof(int))]; }; _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); @@ -89,6 +90,9 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c #define PC_DBREG_CMD_LOAD 1 #ifdef _KERNEL + +#define MONITOR_STOPSTATE_RUNNING 0 +#define MONITOR_STOPSTATE_STOPPED 1 #if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Sat May 4 19:40:30 2019 (r347133) +++ head/sys/i386/include/pcpu.h Sat May 4 20:34:26 2019 (r347134) @@ -43,7 +43,8 @@ struct monitorbuf { int idle_state; /* Used by cpu_idle_mwait. */ - char padding[128 - (1 * sizeof(int))]; + int stop_state; /* Used by cpustop_handler. */ + char padding[128 - (2 * sizeof(int))]; }; _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); @@ -89,6 +90,9 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x c char __pad[3610] #ifdef _KERNEL + +#define MONITOR_STOPSTATE_RUNNING 0 +#define MONITOR_STOPSTATE_STOPPED 1 #if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sat May 4 19:40:30 2019 (r347133) +++ head/sys/kern/subr_smp.c Sat May 4 20:34:26 2019 (r347134) @@ -351,42 +351,68 @@ generic_restart_cpus(cpuset_t map, u_int type) #endif volatile cpuset_t *cpus; - KASSERT(type == IPI_STOP || type == IPI_STOP_HARD #if X86 - || type == IPI_SUSPEND -#endif - , ("%s: invalid stop type", __func__)); + KASSERT(type == IPI_STOP || type == IPI_STOP_HARD + || type == IPI_SUSPEND, ("%s: invalid stop type", __func__)); if (!smp_started) return (0); CTR1(KTR_SMP, "restart_cpus(%s)", cpusetobj_strprint(cpusetbuf, &map)); -#if X86 if (type == IPI_SUSPEND) cpus = &resuming_cpus; else -#endif cpus = &stopped_cpus; /* signal other cpus to restart */ -#if X86 if (type == IPI_SUSPEND) CPU_COPY_STORE_REL(&map, &toresume_cpus); else -#endif CPU_COPY_STORE_REL(&map, &started_cpus); -#if X86 + /* + * Wake up any CPUs stopped with MWAIT. From MI code we can't tell if + * MONITOR/MWAIT is enabled, but the potentially redundant writes are + * relatively inexpensive. + */ + if (type == IPI_STOP) { + struct monitorbuf *mb; + u_int id; + + CPU_FOREACH(id) { + if (!CPU_ISSET(id, &map)) + continue; + + mb = &pcpu_find(id)->pc_monitorbuf; + atomic_store_int(&mb->stop_state, + MONITOR_STOPSTATE_RUNNING); + } + } + if (!nmi_is_broadcast || nmi_kdb_lock == 0) { -#endif + /* wait for each to clear its bit */ + while (CPU_OVERLAP(cpus, &map)) + cpu_spinwait(); + } +#else /* !X86 */ + KASSERT(type == IPI_STOP || type == IPI_STOP_HARD, + ("%s: invalid stop type", __func__)); + + if (!smp_started) + return (0); + + CTR1(KTR_SMP, "restart_cpus(%s)", cpusetobj_strprint(cpusetbuf, &map)); + + cpus = &stopped_cpus; + + /* signal other cpus to restart */ + CPU_COPY_STORE_REL(&map, &started_cpus); + /* wait for each to clear its bit */ while (CPU_OVERLAP(cpus, &map)) cpu_spinwait(); -#if X86 - } #endif - return (1); } Modified: head/sys/x86/include/x86_smp.h ============================================================================== --- head/sys/x86/include/x86_smp.h Sat May 4 19:40:30 2019 (r347133) +++ head/sys/x86/include/x86_smp.h Sat May 4 20:34:26 2019 (r347134) @@ -61,6 +61,11 @@ struct cpu_info { }; extern struct cpu_info *cpu_info; +/* + * Set if MWAIT does not reliably wake when the MONITORed address is written. + */ +extern bool mwait_cpustop_broken; + #ifdef COUNT_IPIS extern u_long *ipi_invltlb_counts[MAXCPU]; extern u_long *ipi_invlrng_counts[MAXCPU]; Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Sat May 4 19:40:30 2019 (r347133) +++ head/sys/x86/x86/cpu_machdep.c Sat May 4 20:34:26 2019 (r347134) @@ -110,6 +110,13 @@ static u_int cpu_reset_proxyid; static volatile u_int cpu_reset_proxy_active; #endif +/* + * Automatically initialized per CPU errata in cpu_idle_tun below. + */ +bool mwait_cpustop_broken = false; +SYSCTL_BOOL(_machdep, OID_AUTO, mwait_cpustop_broken, CTLFLAG_RDTUN, + &mwait_cpustop_broken, 0, + "Can not reliably wake MONITOR/MWAIT cpus without interrupts"); /* * Machine dependent boot() routine @@ -358,6 +365,7 @@ void cpu_reset(void) { #ifdef SMP + struct monitorbuf *mb; cpuset_t map; u_int cnt; @@ -378,6 +386,9 @@ cpu_reset(void) /* Restart CPU #0. */ CPU_SETOF(0, &started_cpus); + mb = &pcpu_find(0)->pc_monitorbuf; + atomic_store_int(&mb->stop_state, + MONITOR_STOPSTATE_RUNNING); wmb(); cnt = 0; @@ -716,6 +727,7 @@ cpu_idle_tun(void *unused __unused) /* Ryzen erratas 1057, 1109. */ cpu_idle_selector("hlt"); idle_mwait = 0; + mwait_cpustop_broken = true; } if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_id == 0x506c9) { @@ -727,6 +739,7 @@ cpu_idle_tun(void *unused __unused) * sleep states. */ cpu_idle_apl31_workaround = 1; + mwait_cpustop_broken = true; } TUNABLE_INT_FETCH("machdep.idle_apl31", &cpu_idle_apl31_workaround); } Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Sat May 4 19:40:30 2019 (r347133) +++ head/sys/x86/x86/mp_x86.c Sat May 4 20:34:26 2019 (r347134) @@ -161,6 +161,10 @@ struct cache_info { unsigned int boot_address; +static bool stop_mwait = false; +SYSCTL_BOOL(_machdep, OID_AUTO, stop_mwait, CTLFLAG_RWTUN, &stop_mwait, 0, + "Use MONITOR/MWAIT when stopping CPU, if available"); + #define MiB(v) (v ## ULL << 20) void @@ -1390,23 +1394,41 @@ nmi_call_kdb_smp(u_int type, struct trapframe *frame) } /* - * Handle an IPI_STOP by saving our current context and spinning until we - * are resumed. + * Handle an IPI_STOP by saving our current context and spinning (or mwaiting, + * if available) until we are resumed. */ void cpustop_handler(void) { + struct monitorbuf *mb; u_int cpu; + bool use_mwait; cpu = PCPU_GET(cpuid); savectx(&stoppcbs[cpu]); + use_mwait = (stop_mwait && (cpu_feature2 & CPUID2_MON) != 0 && + !mwait_cpustop_broken); + if (use_mwait) { + mb = PCPU_PTR(monitorbuf); + atomic_store_int(&mb->stop_state, + MONITOR_STOPSTATE_STOPPED); + } + /* Indicate that we are stopped */ CPU_SET_ATOMIC(cpu, &stopped_cpus); /* Wait for restart */ while (!CPU_ISSET(cpu, &started_cpus)) { + if (use_mwait) { + cpu_monitor(mb, 0, 0); + if (atomic_load_int(&mb->stop_state) == + MONITOR_STOPSTATE_STOPPED) + cpu_mwait(0, MWAIT_C1); + continue; + } + ia32_pause(); /*